diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2009-10-04 23:02:37 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2009-10-04 23:02:37 +0000 |
commit | 20bea4c689534c59eabc46ae809051ed04aa0bac (patch) | |
tree | 10f95b833480bfa07e851699b80f2be67e30e6cb /navit/log.h | |
parent | 7c7d35da9659b3f81aed66e4f9a21c45bb2d99a4 (diff) | |
download | navit-svn-20bea4c689534c59eabc46ae809051ed04aa0bac.tar.gz |
Add:Core:Added possibility for binfile logging with dp point reduction
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@2627 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/log.h')
-rw-r--r-- | navit/log.h | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/navit/log.h b/navit/log.h index edb4433f..8a9f073f 100644 --- a/navit/log.h +++ b/navit/log.h @@ -19,25 +19,33 @@ #ifndef NAVIT_LOG_H #define NAVIT_LOG_H +#define LOG_BUFFER_SIZE 256 +/** + * printf-style writing to the log file. A buffer of LOG_BUFFER_SIZE + * bytes is preallocated for the complete format message, longer + * messages will be truncated. + */ + +enum log_flags { + log_flag_replace_buffer=1, + log_flag_force_flush=2, + log_flag_keep_pointer=4, + log_flag_keep_buffer=8, + log_flag_truncate=16, +}; /* prototypes */ enum attr_type; +enum log_flags; struct attr; struct attr_iter; struct log; int log_get_attr(struct log *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter); -struct log *log_new(struct attr * parent,struct attr **attrs); +struct log *log_new(struct attr *parent, struct attr **attrs); void log_set_header(struct log *this_, char *data, int len); void log_set_trailer(struct log *this_, char *data, int len); -void log_write(struct log *this_, char *data, int len); -void log_destroy(struct log *this_); - -#define LOG_BUFFER_SIZE 256 -/** - * printf-style writing to the log file. A buffer of LOG_BUFFER_SIZE - * bytes is preallocated for the complete format message, longer - * messages will be truncated. - */ +void log_write(struct log *this_, char *data, int len, enum log_flags flags); +void *log_get_buffer(struct log *this_, int *len); void log_printf(struct log *this_, char *fmt, ...); - +void log_destroy(struct log *this_); /* end of prototypes */ #endif |