/*******************************************************************
 *                  Light Weight Chord Library 1.0                 *
 *  CopyRight(C) Yoshihide Matsumoto IDEON WorkingGroup 2003,2004  *
 *      matsumoto333@yahoo.co.jp (http://www.matchan.mydns.jp)     *
 *                                                                 *
 * Implementation of chord (Distributed Hash Table)                *
 * This program is distributed under GPL                           *
 * Light Weight Chord Library comes with ABSOLUTELY NO WARRANTY.   *
 * This is free software, and you are welcome to redistribute it   *
 * under certain conditions; read `COPYING' for details.           *
 *******************************************************************/

#ifndef _MISC
#define _MISC


#define ERROR          1
#define WARNING        2
#define INFORMATION    3
#define NOTICE         4
#define NOTIMPLEMENTED 5


void ip_to_str(unsigned int ip, char *a);
unsigned int str_to_ip(char *str);

void print_ip(int ip, int port);

unsigned int get_random();
void init_random();
int mhash(char *data, int size);

void file_delete(char *fname);
void debug(char *data);
void debuf(int data);

void log(int level, char *fmt,...);
#endif
