context.h File Reference

Application context API. More...

#include <lwmsg/status.h>
#include <lwmsg/type.h>
#include <stdlib.h>

Typedefs

typedef struct LWMsgContext LWMsgContext
 Application context. More...
 
typedef LWMsgStatus(* LWMsgAllocFunction )(size_t size, void **out, void *data)
 Callback to allocate a memory object. More...
 
typedef void(* LWMsgFreeFunction )(void *object, void *data)
 Callback to free a memory object. More...
 
typedef LWMsgStatus(* LWMsgReallocFunction )(void *object, size_t old_size, size_t new_size, void **new_object, void *data)
 Callback to reallocate a memory object. More...
 
typedef LWMsgBool(* LWMsgLogFunction )(LWMsgLogLevel level, const char *message, const char *function, const char *filename, unsigned int line, void *data)
 Logging callback. More...
 

Enumerations

enum  LWMsgLogLevel {
  LWMSG_LOGLEVEL_ALWAYS,
  LWMSG_LOGLEVEL_ERROR,
  LWMSG_LOGLEVEL_WARNING,
  LWMSG_LOGLEVEL_INFO,
  LWMSG_LOGLEVEL_VERBOSE,
  LWMSG_LOGLEVEL_DEBUG,
  LWMSG_LOGLEVEL_TRACE
}
 Log level. More...
 

Functions

LWMsgStatus lwmsg_context_new (const LWMsgContext *parent, LWMsgContext **context)
 Create a new context. More...
 
void lwmsg_context_delete (LWMsgContext *context)
 Delete a context. More...
 
void lwmsg_context_set_memory_functions (LWMsgContext *context, LWMsgAllocFunction alloc, LWMsgFreeFunction free, LWMsgReallocFunction realloc, void *data)
 Set context memory management functions. More...
 
void lwmsg_context_get_memory_functions (const LWMsgContext *context, LWMsgAllocFunction *alloc, LWMsgFreeFunction *free, LWMsgReallocFunction *realloc, void **data)
 Get context memory management functions. More...
 
void lwmsg_context_set_log_function (LWMsgContext *context, LWMsgLogFunction logfn, void *data)
 Set log call function. More...