smflite

diff src/fake_glib.h @ 0:4264abea8b06

smf-lite initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 26 Jan 2012 11:25:11 +0200
parents
children 8e535ca4bb86
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/fake_glib.h	Thu Jan 26 11:25:11 2012 +0200
     1.3 @@ -0,0 +1,40 @@
     1.4 +#ifndef FAKE_GLIB_H_
     1.5 +#define FAKE_GLIB_H_
     1.6 +
     1.7 +typedef struct FakeGPtrArray {
     1.8 +	void **pdata;
     1.9 +	unsigned int len;
    1.10 +} FakeGPtrArray;
    1.11 +
    1.12 +typedef int (*FakeGCompareFunc)(const void*, const void*);
    1.13 +
    1.14 +#ifndef TRUE
    1.15 +#define TRUE	1
    1.16 +#endif
    1.17 +#ifndef FALSE
    1.18 +#define FALSE	0
    1.19 +#endif
    1.20 +
    1.21 +typedef int gint;
    1.22 +typedef void* gpointer;
    1.23 +typedef const void* gconstpointer;
    1.24 +
    1.25 +#define fg_ptr_array_index(arr, idx) ((arr)->pdata[idx])
    1.26 +
    1.27 +FakeGPtrArray *fg_ptr_array_new(void);
    1.28 +void **fg_ptr_array_free(FakeGPtrArray *arr, int free_seg);
    1.29 +
    1.30 +void fg_ptr_array_add(FakeGPtrArray *arr, void *data);
    1.31 +int fg_ptr_array_remove(FakeGPtrArray *arr, void *data);
    1.32 +void *fg_ptr_array_remove_index(FakeGPtrArray *arr, unsigned int idx);
    1.33 +
    1.34 +void fg_ptr_array_sort(FakeGPtrArray *arr, FakeGCompareFunc cmp);
    1.35 +
    1.36 +/* -- logging -- */
    1.37 +#define fg_message	printf
    1.38 +void fg_warning(const char *fmt, ...);
    1.39 +void fg_critical(const char *fmt, ...);
    1.40 +void fg_error(const char *fmt, ...);
    1.41 +void fg_debug(const char *fmt, ...);
    1.42 +
    1.43 +#endif	/* FAKE_GLIB_H_ */