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. */
11 #define DIR_SEP_STR "\\"
13 #define DIR_SEP_STR "/"
16 /************************************************************************
18 ***********************************************************************/
19 uint64_t hb_get_date();
20 void hb_snooze( int delay );
21 int hb_get_cpu_count();
23 char *strtok_r(char *s, const char *delim, char **save_ptr);
28 /* Everything from now is only used internally and hidden to the UI */
30 /************************************************************************
32 ***********************************************************************/
33 int hb_dvd_region(char *device, int *region_mask);
35 /************************************************************************
37 ***********************************************************************/
38 void hb_get_temporary_directory( char path[512] );
39 void hb_get_tempory_filename( hb_handle_t *, char name[1024],
41 void hb_mkdir( char * name );
43 /************************************************************************
45 ***********************************************************************/
46 typedef struct hb_thread_s hb_thread_t;
48 #if defined( SYS_BEOS )
49 # define HB_LOW_PRIORITY 5
50 # define HB_NORMAL_PRIORITY 10
51 #elif defined( SYS_DARWIN )
52 # define HB_LOW_PRIORITY 0
53 # define HB_NORMAL_PRIORITY 31
54 #elif defined( SYS_LINUX ) || defined( SYS_FREEBSD ) || defined ( SYS_SunOS )
55 # define HB_LOW_PRIORITY 0
56 # define HB_NORMAL_PRIORITY 0
57 #elif defined( SYS_CYGWIN )
58 # define HB_LOW_PRIORITY 0
59 # define HB_NORMAL_PRIORITY 1
60 #elif defined( SYS_MINGW )
61 # define HB_LOW_PRIORITY 0
62 # define HB_NORMAL_PRIORITY 0
65 hb_thread_t * hb_thread_init( char * name, void (* function)(void *),
66 void * arg, int priority );
67 void hb_thread_close( hb_thread_t ** );
68 int hb_thread_has_exited( hb_thread_t * );
70 /************************************************************************
72 ***********************************************************************/
74 hb_lock_t * hb_lock_init();
75 void hb_lock_close( hb_lock_t ** );
76 void hb_lock( hb_lock_t * );
77 void hb_unlock( hb_lock_t * );
79 /************************************************************************
81 ***********************************************************************/
82 typedef struct hb_cond_s hb_cond_t;
84 hb_cond_t * hb_cond_init();
85 void hb_cond_wait( hb_cond_t *, hb_lock_t * );
86 void hb_cond_timedwait( hb_cond_t * c, hb_lock_t * lock, int msec );
87 void hb_cond_signal( hb_cond_t * );
88 void hb_cond_broadcast( hb_cond_t * c );
89 void hb_cond_close( hb_cond_t ** );
91 /************************************************************************
93 ***********************************************************************/
94 typedef struct hb_net_s hb_net_t;
96 hb_net_t * hb_net_open( char * address, int port );
97 int hb_net_send( hb_net_t *, char * );
98 int hb_net_recv( hb_net_t *, char *, int );
99 void hb_net_close( hb_net_t ** );
101 #endif /* __LIBHB__ */