26 #elif defined(_MSC_VER) 64 const int refresh_freq,
67 const unsigned int flags)
70 if (filename || msglevel >= 0 || vout)
85 O_CREAT | O_TRUNC | O_WRONLY,
165 if (so && so->
fd >= 0)
167 lseek(so->
fd, (off_t)0, SEEK_SET);
176 #if defined(HAVE_FTRUNCATE) 178 const off_t off = lseek(so->
fd, (off_t)0, SEEK_CUR);
179 if (ftruncate(so->
fd, off) != 0)
184 #elif defined(HAVE_CHSIZE) 186 const long off = (long) lseek(so->
fd, (off_t)0, SEEK_CUR);
190 #warning both ftruncate and chsize functions appear to be missing from this OS 214 if (close(so->
fd) < 0)
236 #define STATUS_PRINTF_MAXLEN 512 247 va_start(arglist, format);
269 if (
write(so->
fd, buf, len) != len)
static bool buf_write_u8(struct buffer *dest, int data)
unsigned int flags_default
void free_buf(struct buffer *buf)
char * string_alloc(const char *str, struct gc_arena *gc)
#define STATUS_OUTPUT_WRITE
bool status_trigger_tv(struct status_output *so, struct timeval *tv)
struct buffer alloc_buf(size_t size)
static void event_timeout_clear(struct event_timeout *et)
static int buf_read_u8(struct buffer *buf)
const struct virtual_output * vout
void status_printf(struct status_output *so, const char *format,...)
void status_flush(struct status_output *so)
struct status_output * status_open(const char *filename, const int refresh_freq, const int msglevel, const struct virtual_output *vout, const unsigned int flags)
bool status_close(struct status_output *so)
bool event_timeout_trigger(struct event_timeout *et, struct timeval *tv, const int et_const_retry)
void buf_null_terminate(struct buffer *buf)
#define ALLOC_OBJ_CLEAR(dptr, type)
#define STATUS_PRINTF_MAXLEN
static const char * print_status_mode(unsigned int flags)
#define STATUS_OUTPUT_READ
bool status_trigger(struct status_output *so)
void(* func)(void *arg, const unsigned int flags, const char *str)
static bool buf_defined(const struct buffer *buf)
static bool buf_inc_len(struct buffer *buf, int inc)
Wrapper structure for dynamically allocated memory.
#define buf_init(buf, offset)
static void buf_reset(struct buffer *buf)
bool status_read(struct status_output *so, struct buffer *buf)
void status_reset(struct status_output *so)
static void event_timeout_init(struct event_timeout *et, interval_t n, const time_t local_now)