"Fossies" - the Fresh Open Source Software Archive

Member "libgcgi.a-0.9.5/src/mime.h" (22 Jun 2002, 3219 Bytes) of package /linux/www/old/gcgi-0.9.5.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "mime.h" see the Fossies "Dox" file reference documentation.

    1 /* -*-mode:c; c-style:k&r; c-basic-offset:4; -*- */
    2 /*
    3  * GCGI Library, implementing NCSA'a Common Gateway Interface and RFC2338.
    4  * Copyright (C) 2001-2002 Julian Catchen, julian@catchen.org
    5  *
    6  * This library is free software; you can redistribute it and/or
    7  * modify it under the terms of the GNU Lesser General Public
    8  * License as published by the Free Software Foundation; either
    9  * version 2.1 of the License, or (at your option) any later version.
   10  *
   11  * This library is distributed in the hope that it will be useful,
   12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   14  * Lesser General Public License for more details.
   15  *
   16  * You should have received a copy of the GNU Lesser General Public
   17  * License along with this library; if not, write to the Free Software
   18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   19  */
   20 
   21 #ifndef __MIME_H__
   22 #define __MIME_H__
   23 
   24 #include "common.h"
   25 #include "crlfstringbuf.h"
   26 #include "parse.h"
   27 #include "gcgi_private.h"
   28 
   29 BEGIN_C_DECLS
   30 
   31 
   32 /*------ Structures ------*/
   33 typedef struct mimepart {
   34     char            *version;
   35     MimeType         type;
   36     char            *subtype;
   37     MimeEncoding     encoding;
   38     char            *boundary;
   39     char            *name;
   40     char            *filename;
   41     char            *charset;
   42     MimeDisposition  disposition;
   43     MimeFormat       format;
   44     char            *description;
   45     char            *body;
   46     size_t           bodylen;
   47     size_t           bodysize;
   48     size_t           truncated;
   49     struct mimepart *next;
   50 } MimePart; 
   51 
   52 
   53 /*------ Structure Functions ------*/
   54 void             mimeCreateMimePart(MimePart **part);
   55 void             mimeFreeMimePart(MimePart *part);
   56 
   57 /*------ MIME-Handling Functions ------*/
   58 MimePart        *mimeParseMimeMessage(FILE *mimeIn, size_t mimeLimit, size_t mimePartLimit);
   59 void             mimeFreeMimeMessage(MimePart *mime);
   60 void             mimeParseHeaders(CRLFStringBuf *mimeIn, MimePart *part);
   61 void             mimeParseHeadersFromEnv(MimePart *part);
   62 void             mimeFillMimeStruct(MimePart *part, char *type, char *subtype, char *encoding, 
   63                     char *name, char *boundary, char *filename, char *desc, 
   64                     char *disp, char *dname, char *charset, char *format);
   65 void             mimeParseContentType(char *text, char **type, char **subtype, 
   66                       char **charset, char **name, char **boundary, char **format);
   67 void             mimeParseContentTransferEncoding(char *text, char **encoding);
   68 void             mimeParseContentDisposition(char *text, char **disp, char **filename, char **name);
   69 void             mimeParseContentDescription(char *text, char **desc);
   70 size_t           mimeParseMimeBody(CRLFStringBuf *mimeIn, char *sboundary, char *eboundary, 
   71                    MimePart *part, size_t mimePartLimit, size_t mimeLimit);
   72 MimeHeader       mimeHeaderName(char *text);
   73 
   74 int              mimeReturnHeader(CRLFStringBuf *mimeIn, char **text, int *size);
   75 int              mimeReturnHeaderByName(FILE *mimeIn, char *header, char **text, int *size);
   76 int              mimeRemovePat(char *text, char *pattern, int stringLen);
   77 
   78 END_C_DECLS
   79 
   80 #endif  /* __MIME_H__ */