00001 #ifndef MICROFEEDMISC_H 00002 #define MICROFEEDMISC_H 00003 00004 #include <stdlib.h> 00005 #include <sys/types.h> 00006 #include <dirent.h> 00007 00016 typedef struct _MicrofeedWeakReference MicrofeedWeakReference; 00017 00018 MicrofeedWeakReference* microfeed_weak_reference_new(void* referenced, MicrofeedWeakReference* existing_weak_reference); 00019 void microfeed_weak_reference_free(MicrofeedWeakReference* weak_refeference); 00020 void* microfeed_weak_reference_get_impl(MicrofeedWeakReference* weak_reference); 00021 #define microfeed_weak_reference_get(w, t) ((t*)microfeed_weak_reference_get_impl(w)) 00022 void microfeed_weak_reference_invalidate(MicrofeedWeakReference* weak_reference); 00023 00024 #define microfeed_memory_allocate(t) ((t*)microfeed_memory_allocate_bytes(sizeof(t))) 00025 void* microfeed_memory_allocate_bytes(size_t size); 00026 #define microfeed_memory_allocate_with_strings(t,...) ((t*)microfeed_memory_allocate_with_strings_impl(sizeof(t),__VA_ARGS__)) 00027 /* #define microfeed_memory_free(p) free(p) */ 00028 void microfeed_memory_free(void* p); 00029 00030 char* microfeed_util_string_concatenate(const char* s, ...); 00031 char* microfeed_util_string_unescape_percent_encoding(const char* s); 00032 00035 #endif