ze-filter  (ze-filter-0.8.0-develop-180218)
ze-demime.c File Reference
#include <ze-sys.h>
#include "ze-libjc.h"

Go to the source code of this file.

Classes

struct  VALUES
 

Macros

#define LOG_LEVEL   12
 
#define USE_NEW_GET_BOUNDARY   1
 
#define MAX(a, b)   ((a) > (b) ? (a) : (b))
 
#define MIN(a, b)   ((a) < (b) ? (a) : (b))
 
#define MAXLONG   (1 << 30)
 
#define MAX_RECURSIVE_LEVEL   5
 
#define REGCOMP_FLAGS   (REG_ICASE | REG_NEWLINE | REG_EXTENDED)
 
#define REGEXEC_FLAGS   (0)
 
#define FREE_ALLOC()
 
#define LOG_SOB(h, txt)
 
#define BADFILENAMECHARS   " \t\n\r\"\'\\/$&|;,:()[]<>*{}@?"
 
#define CLEANUP_FILENAME(fname)
 
#define GOTO_FIN(r)
 
#define LINESZ   0x800
 

Functions

char * zeStrnDup (const char *s, size_t n)
 
void set_mime_debug (bool v)
 
bool decode_mime_buffer (char *id, char *buf, size_t sz, int level, uint32_t *flags, demime_F func, void *arg)
 
bool decode_mime_file (char *id, char *fname, uint32_t *flags, demime_F func, void *arg)
 
int which_mime_encoding (char *s)
 
char * mime_encode_name (int n)
 
int which_mime_type (char *s)
 
char * mime_type_name (int n)
 

Macro Definition Documentation

◆ BADFILENAMECHARS

#define BADFILENAMECHARS   " \t\n\r\"\'\\/$&|;,:()[]<>*{}@?"

Definition at line 133 of file ze-demime.c.

◆ CLEANUP_FILENAME

#define CLEANUP_FILENAME (   fname)
Value:
if (fname != NULL) \
{ \
char *s = fname; \
while ((s = strpbrk(fname, BADFILENAMECHARS)) != NULL) \
*s = '_'; \
}
#define BADFILENAMECHARS
Definition: ze-demime.c:133

Definition at line 135 of file ze-demime.c.

◆ FREE_ALLOC

#define FREE_ALLOC ( )
Value:
do { \
FREE(bodybuf); \
FREE(name); \
FREE(filename); \
FREE(boundary); \
FREE(charset); \
FREE(mimetype); \
} while (0);

Definition at line 112 of file ze-demime.c.

◆ GOTO_FIN

#define GOTO_FIN (   r)
Value:
{ \
result = (r); \
goto fin; \
}

Definition at line 143 of file ze-demime.c.

◆ LINESZ

#define LINESZ   0x800

Definition at line 149 of file ze-demime.c.

◆ LOG_LEVEL

#define LOG_LEVEL   12

Definition at line 28 of file ze-demime.c.

◆ LOG_SOB

#define LOG_SOB (   h,
  txt 
)
Value:
{ \
char titi[80]; \
strlcpy(titi, txt, sizeof(titi)); \
ZE_MessageInfo(LOG_LEVEL, "*************** %s **************", h); \
ZE_MessageInfo(LOG_LEVEL, "%s",titi); \
ZE_MessageInfo(LOG_LEVEL, "*************"); \
}
#define strlcpy
Definition: zeString.h:32
#define LOG_LEVEL
Definition: ze-demime.c:28

Definition at line 123 of file ze-demime.c.

◆ MAX

#define MAX (   a,
 
)    ((a) > (b) ? (a) : (b))

Definition at line 81 of file ze-demime.c.

◆ MAX_RECURSIVE_LEVEL

#define MAX_RECURSIVE_LEVEL   5

Definition at line 98 of file ze-demime.c.

◆ MAXLONG

#define MAXLONG   (1 << 30)

Definition at line 88 of file ze-demime.c.

◆ MIN

#define MIN (   a,
 
)    ((a) < (b) ? (a) : (b))

Definition at line 84 of file ze-demime.c.

◆ REGCOMP_FLAGS

#define REGCOMP_FLAGS   (REG_ICASE | REG_NEWLINE | REG_EXTENDED)

Definition at line 101 of file ze-demime.c.

◆ REGEXEC_FLAGS

#define REGEXEC_FLAGS   (0)

Definition at line 106 of file ze-demime.c.

◆ USE_NEW_GET_BOUNDARY

#define USE_NEW_GET_BOUNDARY   1

Definition at line 30 of file ze-demime.c.

Function Documentation

◆ zeStrnDup()

char* zeStrnDup ( const char *  s,
size_t  n 
)