00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00029 #ifndef NEMESI_UTILS_H
00030 #define NEMESI_UTILS_H
00031
00032 #ifdef HAVE_CONFIG_H
00033 #include <config.h>
00034 #endif
00035
00036 #include <stdio.h>
00037 #include <stdlib.h>
00038 #include <string.h>
00039 #include <errno.h>
00040 #include <ctype.h>
00041 #include <inttypes.h>
00042 #include <stdint.h>
00043
00044 #include <pthread.h>
00045
00046 #ifndef WIN32
00047 # include <sys/types.h>
00048 # include <sys/time.h>
00049 # define min(x,y) ((x) < (y) ? (x) : (y))
00050 # define max(x,y) ((x) > (y) ? (x) : (y))
00051 #else
00052 # include <winsock2.h>
00053 char * strtok_r(char * str, const char *delim, char **saveptr);
00054 #endif
00055
00056 #include "comm.h"
00057
00058 int urltokenize(char *, char **, char **, char **);
00059
00060 char *strstrcase(char *, const char *);
00061
00062 uint32_t random32(int);
00063
00064 int thread_isvalid(pthread_t p);
00065 void thread_invalidate(pthread_t * p);
00066 int thread_getuid(pthread_t p);
00067
00073 int nms_timeval_subtract(struct timeval *, const struct timeval *,
00074 const struct timeval *);
00075 int nms_timeval_add(struct timeval *, const struct timeval *, const struct timeval *);
00076 void f2time(double, struct timeval *);
00081 #endif