tildefriends/src/trace.h

23 lines
812 B
C

#pragma once
#include <inttypes.h>
#include <stddef.h>
typedef struct _tf_trace_t tf_trace_t;
typedef struct sqlite3 sqlite3;
tf_trace_t* tf_trace_create();
void tf_trace_destroy(tf_trace_t* trace);
void tf_trace_counter(tf_trace_t* trace, const char* name, int argc, const char** arg_names, const int64_t* arg_values);
void tf_trace_begin(tf_trace_t* trace, const char* name);
void tf_trace_end(tf_trace_t* trace);
char* tf_trace_export(tf_trace_t* trace);
typedef void (tf_trace_write_callback_t)(tf_trace_t* trace, const char* buffer, size_t size, void* user_data);
void tf_trace_set_write_callback(tf_trace_t* trace, tf_trace_write_callback_t* callback, void* user_data);
void tf_trace_raw(tf_trace_t* trace, const char* buffer, size_t size);
void tf_trace_sqlite(tf_trace_t* trace, sqlite3* sqlite);