public
Description: Library to access lastfm via it's 2.0 api
Homepage: https://launchpad.net/liblastfm
Clone URL: git://github.com/LCID-Fire/liblastfm.git
Click here to lend your support to: liblastfm and make a donation at www.pledgie.com !
liblastfm / include.h
100644 73 lines (60 sloc) 1.874 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <glib.h>
 
gboolean file_exists(const char* file);
int isempty(const char* string);
guint countv(void** elements);
 
#define createv(type, pointer) \
type** pointer = g_new(type*, 1);\
*pointer = NULL
 
#define destroyv(type, pointer) \
{\
type** _iterator = pointer;\
while(*_iterator)\
{\
g_free(*_iterator);\
_iterator++;\
}\
g_free(pointer);\
}
 
#define addv(type, elements, element) \
{\
guint _length = countv((void**)(elements));\
(elements) = g_renew(type*, (elements), _length + 2);\
(elements)[_length] = element;\
(elements)[_length + 1] = NULL;\
}
 
void xwax_vprinterr(const char* module_name, const char* format, va_list args);
#define DECLARE_PRINTERR_FUNCTION(name) void name##_printerr(const char* format, ...) G_GNUC_PRINTF (1, 2);
#define IMPLEMENT_PRINTERR_FUNCTION(name, module_name) \
void name##_printerr(const char* format, ...)\
{\
va_list ap;\
va_start(ap, format);\
xwax_vprinterr(module_name, format, ap);\
va_end(ap);\
}
 
void xwax_vprint(const char* module_name, const char* format, va_list args);
 
#define DECLARE_PRINT_FUNCTION(name) void name##_print(const char* format, ...) G_GNUC_PRINTF (1, 2);
#define IMPLEMENT_PRINT_FUNCTION(name, module_name) \
void name##_print(const char* format, ...)\
{\
va_list ap;\
va_start(ap, format);\
xwax_vprint(module_name, format, ap);\
va_end(ap);\
}
 
#define DECLARE_PRINT_FUNCTIONS(name) \
DECLARE_PRINT_FUNCTION(name)\
DECLARE_PRINTERR_FUNCTION(name)
 
#define IMPLEMENT_PRINT_FUNCTIONS(name, module_name) \
IMPLEMENT_PRINT_FUNCTION(name, module_name)\
IMPLEMENT_PRINTERR_FUNCTION(name, module_name)
 
#define EMBED_PRINT_FUNCTIONS(name, module_name) \
DECLARE_PRINT_FUNCTIONS(name)\
IMPLEMENT_PRINT_FUNCTIONS(name, module_name)
 
enum image_size
{
IMAGE_SMALL,
IMAGE_MEDIUM,
IMAGE_LARGE
};
 
gchar* utf8_get_null_terminated(const gchar* string, size_t string_size);