view mcabber/src/hbuf.h @ 113:8ac67e951eab

[/trunk] Changeset 127 by mikael * Add a "hooks" layer. Hooks are used when multiples operations should be done when an event araises. For example message in/out, status change... 2 more files; Makefile updated. * Logging is ready. * Add 2 options: - "logging" (bool): enable/disable history logging - "logging_dir" (char): root dir for logging files * Document pinginterval (keepalive) in the sample config file. * Send keepalive only when online.
author mikael
date Sun, 24 Apr 2005 20:24:18 +0000
parents 9a31028e8095
children b5aa2b9c425a
line wrap: on
line source

#ifndef __HBUF_H__
#define __HBUF_H__ 1

#include <glib.h>

// With current implementation a message must fit in a hbuf block,
// so we shouldn't choose a too small size.
#define HBB_BLOCKSIZE   2048    // > 20 please

// Flags:
// - ALLOC: the ptr data has been allocated, it can be freed
// - PERSISTENT: this is a new history line
#define HBB_FLAG_ALLOC      1
#define HBB_FLAG_PERSISTENT 2
// #define HBB_FLAG_FREE       4

void hbuf_add_line(GList **p_hbuf, const char *text, const char *prefix,
        unsigned int width);
void hbuf_free(GList **p_hbuf);
void hbuf_rebuild(GList **p_hbuf, unsigned int width);

char **hbuf_get_lines(GList *hbuf, unsigned int n);

#endif /* __HBUF_H__ */