view src/lib/lib.h @ 50:d493b9cc265e HEAD

Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed to be able to handle off_t overflows properly. Also changed a few unsigned int fields into uoff_t so we should now support >2G mails if uoff_t is 64bit. Also fixed several potential integer overflows.
author Timo Sirainen <tss@iki.fi>
date Tue, 27 Aug 2002 22:16:54 +0300
parents 3b1985cbc908
children 62fc6c729962
line wrap: on
line source

#ifndef __LIB_H
#define __LIB_H

/* default system includes - keep these at minimum.. */
#include <string.h> /* strcmp() etc. */
#include <stdarg.h> /* va_list is used everywhere */
#include <errno.h> /* error checking is good */
#include <sys/types.h> /* many other includes want this */

typedef struct _IOLoop *IOLoop;
typedef struct _IO *IO;
typedef struct _Timeout *Timeout;

typedef struct _IPADDR IPADDR;
typedef struct _IOBuffer IOBuffer;
typedef struct _TempString TempString;

/* default lib includes */
#ifdef HAVE_CONFIG_H
#  include "../../config.h"
#endif

#if defined (UOFF_T_INT)
typedef unsigned int uoff_t;
#elif defined (UOFF_T_LONG)
typedef unsigned long uoff_t;
#elif defined (UOFF_T_LONG_LONG)
typedef unsigned long long uoff_t;
#else
#  error uoff_t size not set
#endif

#include "compat.h"
#include "macros.h"
#include "failures.h"

#include "mempool.h"
#include "temp-mempool.h"
#include "imem.h"

#include "strfuncs.h"

unsigned int nearest_power(unsigned int num);

void lib_init(void);
void lib_deinit(void);

#endif