Added smart_records_internals.h (forgotten in initial commit)

This commit is contained in:
2020-07-25 14:10:51 +02:00
parent b5a105ea60
commit 17fae01520

View File

@@ -0,0 +1,17 @@
#ifndef SMART_RECORDS_INTERNALS_H
#define SMART_RECORDS_INTERNALS_H
/*
* Small helper to populate char **error and jump to failed label.
*/
#define set_error_and_fails(x) { if (error) *error = strdup(x); goto failed; }
typedef struct smart_records_ctx_t {
void *CTX;
int (*set_format) (struct smart_records_ctx_t *ctx, char **error, char *fmp);
int (*write_record) (struct smart_records_ctx_t *ctx, char **error, va_list ap);
int (*close_records_base) (struct smart_records_ctx_t *ctx);
} smart_records_ctx_t ;
#endif