1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
#ifndef COMMON_H
#define COMMON_H
#include <config.h>
#include <sys/types.h>
#include <stdio.h>
#define DEBUG_SOCKET 1
#define DEBUG_FILES 2
#define DEBUG_RCFILE 4
#define DEBUG_HTTP 8
#define DEBUG_FTP 16
#define DEBUG_XML 32
#define DEBUG_GNOME 64
/* This way doesn't rely on DEBUG(a,b...) which confused old compilers
* and decent compilers can optimize out the if(0) paths.
*/
#ifdef DEBUGGING
extern int debug_mask;
#define DEBUG debug
#else
#define DEBUG if(0) debug
#endif
void debug( int ch, char *, ... );
/* A signal hander */
typedef void (*sig_handler)( int );
#define min(a,b) ((a)<(b)?(a):(b))
#ifdef __EMX__
/* siebert: strcasecmp is stricmp */
#define strcasecmp stricmp
#endif
/* boolean */
typedef int bool;
#define true 1
#define false 0
#if !defined( HAVE_STRDUP ) || !defined( strdup )
char *strdup( const char *s );
#endif
#if !HAVE_STRERROR && !defined(strerror)
char *strerror (int errnum);
#endif
/* Text -> MD5 -> Hex converter. */
char *md5_hex( const char *buffer, size_t buflen );
/* Stream -> MD5 -> Hex converter. */
char *md5_hex_stream( FILE *stream );
/* Return current date/time in RFC1123 format */
char *rfc1123_date( const time_t anytime );
/* Returns time from date/time in RFC1123 format */
time_t rfc1123_parse( const char *date );
#endif
|