1 /* $Id: ports.h,v 1.7 2005/10/15 18:05:03 titer Exp $
3 This file is part of the HandBrake source code.
4 Homepage: <http://handbrake.fr/>.
5 It may be used under the terms of the GNU General Public License. */
10 /************************************************************************
12 ***********************************************************************/
13 uint64_t hb_get_date();
14 void hb_snooze( int delay );
15 int hb_get_cpu_count();
19 /* Everything from now is only used internally and hidden to the UI */
21 /************************************************************************
23 ***********************************************************************/
24 void hb_get_tempory_directory( hb_handle_t * h, char path[512] );
25 void hb_get_tempory_filename( hb_handle_t *, char name[1024],
27 void hb_mkdir( char * name );
29 /************************************************************************
31 ***********************************************************************/
32 typedef struct hb_thread_s hb_thread_t;
34 #if defined( SYS_BEOS )
35 # define HB_LOW_PRIORITY 5
36 # define HB_NORMAL_PRIORITY 10
37 #elif defined( SYS_DARWIN )
38 # define HB_LOW_PRIORITY 0
39 # define HB_NORMAL_PRIORITY 31
40 #elif defined( SYS_LINUX ) || defined( SYS_FREEBSD ) || defined ( SYS_SunOS )
41 # define HB_LOW_PRIORITY 0
42 # define HB_NORMAL_PRIORITY 0
43 #elif defined( SYS_CYGWIN )
44 # define HB_LOW_PRIORITY 0
45 # define HB_NORMAL_PRIORITY 1
46 #elif defined( SYS_MINGW )
47 # define HB_LOW_PRIORITY 0
48 # define HB_NORMAL_PRIORITY 0
51 hb_thread_t * hb_thread_init( char * name, void (* function)(void *),
52 void * arg, int priority );
53 void hb_thread_close( hb_thread_t ** );
54 int hb_thread_has_exited( hb_thread_t * );
56 /************************************************************************
58 ***********************************************************************/
60 hb_lock_t * hb_lock_init();
61 void hb_lock_close( hb_lock_t ** );
62 void hb_lock( hb_lock_t * );
63 void hb_unlock( hb_lock_t * );
65 /************************************************************************
67 ***********************************************************************/
68 typedef struct hb_cond_s hb_cond_t;
70 hb_cond_t * hb_cond_init();
71 void hb_cond_wait( hb_cond_t *, hb_lock_t * );
72 void hb_cond_signal( hb_cond_t * );
73 void hb_cond_close( hb_cond_t ** );
75 /************************************************************************
77 ***********************************************************************/
78 typedef struct hb_net_s hb_net_t;
80 hb_net_t * hb_net_open( char * address, int port );
81 int hb_net_send( hb_net_t *, char * );
82 int hb_net_recv( hb_net_t *, char *, int );
83 void hb_net_close( hb_net_t ** );
85 #endif /* __LIBHB__ */