smflite

view src/fake_glib.h @ 1:8e535ca4bb86

added smfsh
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 26 Jan 2012 15:35:18 +0200
parents 4264abea8b06
children d9e0d0500a78
line source
1 #ifndef FAKE_GLIB_H_
2 #define FAKE_GLIB_H_
4 typedef struct FakeGPtrArray {
5 void **pdata;
6 unsigned int len;
7 } FakeGPtrArray;
9 typedef int (*FakeGCompareFunc)(const void*, const void*);
11 #ifndef TRUE
12 #define TRUE 1
13 #endif
14 #ifndef FALSE
15 #define FALSE 0
16 #endif
18 typedef char gchar;
19 typedef int gint;
20 typedef void* gpointer;
21 typedef const void* gconstpointer;
23 #define fg_ptr_array_index(arr, idx) ((arr)->pdata[idx])
25 FakeGPtrArray *fg_ptr_array_new(void);
26 void **fg_ptr_array_free(FakeGPtrArray *arr, int free_seg);
28 void fg_ptr_array_add(FakeGPtrArray *arr, void *data);
29 int fg_ptr_array_remove(FakeGPtrArray *arr, void *data);
30 void *fg_ptr_array_remove_index(FakeGPtrArray *arr, unsigned int idx);
32 void fg_ptr_array_sort(FakeGPtrArray *arr, FakeGCompareFunc cmp);
34 /* -- logging -- */
35 void fg_message(const char *fmt, ...);
36 void fg_warning(const char *fmt, ...);
37 void fg_critical(const char *fmt, ...);
38 void fg_error(const char *fmt, ...);
39 void fg_debug(const char *fmt, ...);
41 #endif /* FAKE_GLIB_H_ */