![]() |
Ultibo API
C/C++ API for Ultibo Core
|
#include "ultibo/globaltypes.h"#include "ultibo/globalconst.h"#include "ultibo/devices.h"#include "ultibo/console.h"Go to the source code of this file.
Data Structures | |
| struct | _LOGGING_ENTRY |
| struct | _LOGGING_ENTRY_EX |
| struct | _LOGGING_DEVICE |
Macros | |
| #define | LOGGING_NAME_PREFIX "Logging" |
| Name prefix for Logging Devices. | |
| #define | LOGGING_THREAD_NAME "Logging" |
| Thread name for Logging threads. | |
| #define | LOGGING_THREAD_PRIORITY THREAD_PRIORITY_NORMAL |
| Thread priority for Logging threads. | |
| #define | LOGGING_TYPE_NONE 0 |
| #define | LOGGING_TYPE_CONSOLE 1 |
| #define | LOGGING_TYPE_FILE 2 |
| #define | LOGGING_TYPE_SYSLOG 3 |
| #define | LOGGING_TYPE_SERIAL 4 |
| #define | LOGGING_STATE_DISABLED 0 |
| #define | LOGGING_STATE_ENABLED 1 |
| #define | LOGGING_FLAG_NONE 0x00000000 |
| #define | CONSOLE_LOGGING_DESCRIPTION "Console Logging" |
Typedefs | |
| typedef struct _LOGGING_ENTRY | LOGGING_ENTRY |
| typedef struct _LOGGING_ENTRY_EX | LOGGING_ENTRY_EX |
| typedef struct _LOGGING_DEVICE | LOGGING_DEVICE |
| typedef uint32_t STDCALL(* | logging_enumerate_cb) (LOGGING_DEVICE *logging, void *data) |
| typedef uint32_t STDCALL(* | logging_notification_cb) (DEVICE *device, void *data, uint32_t notification) |
| typedef uint32_t STDCALL(* | logging_device_start_proc) (LOGGING_DEVICE *logging) |
| typedef uint32_t STDCALL(* | logging_device_stop_proc) (LOGGING_DEVICE *logging) |
| typedef uint32_t STDCALL(* | logging_device_output_proc) (LOGGING_DEVICE *logging, const char *data) |
| typedef uint32_t STDCALL(* | logging_device_output_ex_proc) (LOGGING_DEVICE *logging, uint32_t facility, uint32_t severity, const char *tag, const char *content) |
| Syslog compatible output. | |
| typedef char *STDCALL(* | logging_device_get_target_proc) (LOGGING_DEVICE *logging) |
| typedef uint32_t STDCALL(* | logging_device_set_target_proc) (LOGGING_DEVICE *logging, const char *target) |
Functions | |
| uint32_t STDCALL | logging_device_start (LOGGING_DEVICE *logging) |
| uint32_t STDCALL | logging_device_stop (LOGGING_DEVICE *logging) |
| uint32_t STDCALL | logging_device_output (LOGGING_DEVICE *logging, const char *data) |
| uint32_t STDCALL | logging_device_output_ex (LOGGING_DEVICE *logging, uint32_t facility, uint32_t severity, const char *tag, const char *content) |
| uint32_t STDCALL | logging_device_get_target (LOGGING_DEVICE *logging, char *target, uint32_t len) |
| uint32_t STDCALL | logging_device_set_target (LOGGING_DEVICE *logging, const char *target) |
| LOGGING_DEVICE *STDCALL | logging_device_create (BOOL _default) |
| Create a new Logging device entry. | |
| LOGGING_DEVICE *STDCALL | logging_device_create_ex (uint32_t size, BOOL _default) |
| Create a new Logging device entry. | |
| uint32_t STDCALL | logging_device_destroy (LOGGING_DEVICE *logging) |
| Destroy an existing Logging device entry. | |
| uint32_t STDCALL | logging_device_register (LOGGING_DEVICE *logging) |
| Register a new Logging device in the Logging table. | |
| uint32_t STDCALL | logging_device_deregister (LOGGING_DEVICE *logging) |
| Deregister a Logging device from the Logging table. | |
| LOGGING_DEVICE *STDCALL | logging_device_find (uint32_t loggingid) |
| LOGGING_DEVICE *STDCALL | logging_device_find_by_type (uint32_t loggingtype) |
| LOGGING_DEVICE *STDCALL | logging_device_find_by_device (DEVICE *device) |
| LOGGING_DEVICE *STDCALL | logging_device_find_by_name (const char *name) |
| LOGGING_DEVICE *STDCALL | logging_device_find_by_description (const char *description) |
| uint32_t STDCALL | logging_device_enumerate (logging_enumerate_cb callback, void *data) |
| uint32_t STDCALL | logging_device_notification (LOGGING_DEVICE *logging, logging_notification_cb callback, void *data, uint32_t notification, uint32_t flags) |
| int STDCALL | logging_device_outputf (LOGGING_DEVICE *logging, const char *format,...) _ATTRIBUTE((__format__(__printf__ |
| Output formatted text to a Logging device. | |
| int STDCALL uint32_t STDCALL | logging_device_get_count (void) |
| Get the current logging device count. | |
| LOGGING_DEVICE *STDCALL | logging_device_get_default (void) |
| Get the current default logging device. | |
| uint32_t STDCALL | logging_device_set_default (LOGGING_DEVICE *logging) |
| Set the current default logging device. | |
| LOGGING_DEVICE *STDCALL | logging_device_check (LOGGING_DEVICE *logging) |
| Check if the supplied Logging device is in the Logging table. | |
| uint32_t STDCALL | logging_type_to_string (uint32_t loggingtype, char *string, uint32_t len) |
| Convert a Logging type value to a string. | |
| uint32_t STDCALL | logging_state_to_string (uint32_t loggingstate, char *string, uint32_t len) |
| Convert a Logging state value to a string. | |
| BOOL STDCALL | logging_device_redirect_output (LOGGING_DEVICE *logging) |
| Redirect standard output to the logging device specified by Logging. | |
| uint32_t STDCALL | logging_get_messageslot_flags (void) |
| Get the lock flags for the logging messageslot. | |
| uint32_t STDCALL | logging_console_device_add (CONSOLE_DEVICE *console) |
| uint32_t STDCALL | logging_console_device_remove (CONSOLE_DEVICE *console) |
| #define LOGGING_NAME_PREFIX "Logging" |
Name prefix for Logging Devices.
Logging specific constants
| #define LOGGING_THREAD_NAME "Logging" |
Thread name for Logging threads.
| #define LOGGING_THREAD_PRIORITY THREAD_PRIORITY_NORMAL |
Thread priority for Logging threads.
| #define LOGGING_TYPE_NONE 0 |
Logging Device Types
| #define LOGGING_TYPE_CONSOLE 1 |
| #define LOGGING_TYPE_FILE 2 |
| #define LOGGING_TYPE_SYSLOG 3 |
| #define LOGGING_TYPE_SERIAL 4 |
| #define LOGGING_STATE_DISABLED 0 |
Logging Device States
| #define LOGGING_STATE_ENABLED 1 |
| #define LOGGING_FLAG_NONE 0x00000000 |
Logging Device Flags
| #define CONSOLE_LOGGING_DESCRIPTION "Console Logging" |
Console Logging specific constants
| typedef struct _LOGGING_ENTRY LOGGING_ENTRY |
Logging specific types
| typedef struct _LOGGING_ENTRY_EX LOGGING_ENTRY_EX |
| typedef struct _LOGGING_DEVICE LOGGING_DEVICE |
| typedef uint32_t STDCALL(* logging_enumerate_cb) (LOGGING_DEVICE *logging, void *data) |
Logging Enumeration Callback
| typedef uint32_t STDCALL(* logging_notification_cb) (DEVICE *device, void *data, uint32_t notification) |
Logging Notification Callback
| typedef uint32_t STDCALL(* logging_device_start_proc) (LOGGING_DEVICE *logging) |
Logging Device Methods
| typedef uint32_t STDCALL(* logging_device_stop_proc) (LOGGING_DEVICE *logging) |
| typedef uint32_t STDCALL(* logging_device_output_proc) (LOGGING_DEVICE *logging, const char *data) |
| typedef uint32_t STDCALL(* logging_device_output_ex_proc) (LOGGING_DEVICE *logging, uint32_t facility, uint32_t severity, const char *tag, const char *content) |
Syslog compatible output.
| typedef char *STDCALL(* logging_device_get_target_proc) (LOGGING_DEVICE *logging) |
| typedef uint32_t STDCALL(* logging_device_set_target_proc) (LOGGING_DEVICE *logging, const char *target) |
| uint32_t STDCALL logging_device_start | ( | LOGGING_DEVICE * | logging | ) |
Logging Functions
| uint32_t STDCALL logging_device_stop | ( | LOGGING_DEVICE * | logging | ) |
| uint32_t STDCALL logging_device_output | ( | LOGGING_DEVICE * | logging, |
| const char * | data ) |
| uint32_t STDCALL logging_device_output_ex | ( | LOGGING_DEVICE * | logging, |
| uint32_t | facility, | ||
| uint32_t | severity, | ||
| const char * | tag, | ||
| const char * | content ) |
| uint32_t STDCALL logging_device_get_target | ( | LOGGING_DEVICE * | logging, |
| char * | target, | ||
| uint32_t | len ) |
| uint32_t STDCALL logging_device_set_target | ( | LOGGING_DEVICE * | logging, |
| const char * | target ) |
| LOGGING_DEVICE *STDCALL logging_device_create | ( | BOOL | _default | ) |
Create a new Logging device entry.
| Default | If true make the new device the default logging device if there is no current default |
| LOGGING_DEVICE *STDCALL logging_device_create_ex | ( | uint32_t | size, |
| BOOL | _default ) |
Create a new Logging device entry.
| Size | Size in bytes to allocate for new Logging (Including the Logging entry) |
| Default | If true make the new device the default logging device if there is no current default |
| uint32_t STDCALL logging_device_destroy | ( | LOGGING_DEVICE * | logging | ) |
Destroy an existing Logging device entry.
| uint32_t STDCALL logging_device_register | ( | LOGGING_DEVICE * | logging | ) |
Register a new Logging device in the Logging table.
| uint32_t STDCALL logging_device_deregister | ( | LOGGING_DEVICE * | logging | ) |
Deregister a Logging device from the Logging table.
| LOGGING_DEVICE *STDCALL logging_device_find | ( | uint32_t | loggingid | ) |
| LOGGING_DEVICE *STDCALL logging_device_find_by_type | ( | uint32_t | loggingtype | ) |
| LOGGING_DEVICE *STDCALL logging_device_find_by_device | ( | DEVICE * | device | ) |
| LOGGING_DEVICE *STDCALL logging_device_find_by_name | ( | const char * | name | ) |
| LOGGING_DEVICE *STDCALL logging_device_find_by_description | ( | const char * | description | ) |
| uint32_t STDCALL logging_device_enumerate | ( | logging_enumerate_cb | callback, |
| void * | data ) |
| uint32_t STDCALL logging_device_notification | ( | LOGGING_DEVICE * | logging, |
| logging_notification_cb | callback, | ||
| void * | data, | ||
| uint32_t | notification, | ||
| uint32_t | flags ) |
| int STDCALL logging_device_outputf | ( | LOGGING_DEVICE * | logging, |
| const char * | format, | ||
| ... ) |
Output formatted text to a Logging device.
| Logging | The logging device to output text to |
| Format | The formatted text to output (As per printf in standard C library) |
Get the current logging device count.
Logging Helper Functions
| LOGGING_DEVICE *STDCALL logging_device_get_default | ( | void | ) |
Get the current default logging device.
| uint32_t STDCALL logging_device_set_default | ( | LOGGING_DEVICE * | logging | ) |
Set the current default logging device.
| LOGGING_DEVICE *STDCALL logging_device_check | ( | LOGGING_DEVICE * | logging | ) |
Check if the supplied Logging device is in the Logging table.
| uint32_t STDCALL logging_type_to_string | ( | uint32_t | loggingtype, |
| char * | string, | ||
| uint32_t | len ) |
Convert a Logging type value to a string.
| uint32_t STDCALL logging_state_to_string | ( | uint32_t | loggingstate, |
| char * | string, | ||
| uint32_t | len ) |
Convert a Logging state value to a string.
| BOOL STDCALL logging_device_redirect_output | ( | LOGGING_DEVICE * | logging | ) |
Redirect standard output to the logging device specified by Logging.
| Logging | The logging device to redirect output to (or nil to stop redirection) |
| uint32_t STDCALL logging_get_messageslot_flags | ( | void | ) |
Get the lock flags for the logging messageslot.
| uint32_t STDCALL logging_console_device_add | ( | CONSOLE_DEVICE * | console | ) |
| uint32_t STDCALL logging_console_device_remove | ( | CONSOLE_DEVICE * | console | ) |