Global Lender
A Pebble app for finding new and interesting loans on kiva.org
misc.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "libs/magpebapp.h"
4 
8 #define HEAP_LOG_0() APP_LOG(APP_LOG_LEVEL_DEBUG, "Free Heap: %zu b, Used Heap: %zu b", heap_bytes_free(), heap_bytes_used())
9 #define HEAP_LOG_1(str) if (str != NULL) { APP_LOG(APP_LOG_LEVEL_DEBUG, "Free Heap: %zu b, Used Heap: %zu b -- %s", heap_bytes_free(), heap_bytes_used(), str); }
10 #define GET_MACRO(_0, _1, NAME, ...) NAME
11 #define HEAP_LOG(...) GET_MACRO(_0, ##__VA_ARGS__, HEAP_LOG_1, HEAP_LOG_0)(__VA_ARGS__)
12 
13 
17 #define strxlen(str) (str==NULL?0:strlen(str))
18 
19 
20 void textLayer_stylize(TextLayer*, const GColor, const GColor, const GTextAlignment, const GFont);
21 
22 
23 bool strxcpy(char* buffer, size_t bufsize, const char* source, const char* readable);
24 MagPebApp_ErrCode strxcpyalloc(char** dest, const char* src);
MagPebApp_ErrCode strxcpyalloc(char **dest, const char *src)
Definition: misc.c:65
MagPebApp_ErrCode
Definition: magpebapp.h:12
void textLayer_stylize(TextLayer *, const GColor, const GColor, const GTextAlignment, const GFont)
Stylizes the text layer to the spec.
Definition: misc.c:8
bool strxcpy(char *buffer, size_t bufsize, const char *source, const char *readable)
Copies a string with error handling and logging.
Definition: misc.c:24