823330dde9
Most of the basic db functionality is in place now. Changing print_col out for a user-supplied callback function might be a cool idea.
26 lines
627 B
C
26 lines
627 B
C
#ifndef THREADS_H
|
|
#define THREADS_H
|
|
|
|
#if defined (_WIN32)
|
|
#include <windows.h>
|
|
#define CREATE_THREAD(id,func,param) (CreateThread(0, 0, func, param, 0, id) == 0)
|
|
#define THREAD_FUNCTION(funcname) static DWORD WINAPI funcname (LPVOID arg)
|
|
#define thread_id_t DWORD
|
|
#define sleep(a) Sleep (a*1000)
|
|
#else
|
|
#include <unistd.h>
|
|
#include <pthread.h>
|
|
#define CREATE_THREAD(id,func,param) (pthread_create (id, 0, func, (void *) param) != 0)
|
|
#define THREAD_FUNCTION(funcname) static void * funcname (void * arg)
|
|
#define thread_id_t pthread_t
|
|
#endif
|
|
|
|
enum {
|
|
RUNNING,
|
|
STOPPED,
|
|
};
|
|
|
|
extern char F_IRC_THREAD;
|
|
|
|
#endif /* THREADS_H */
|