1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

move TEXT_BUFFER_META_REC -> LINE_INFO_META_REC

This commit is contained in:
Ailin Nemui 2021-08-12 23:51:18 +02:00
parent 9677b07488
commit 8d314eadf1
5 changed files with 15 additions and 14 deletions

View File

@ -67,6 +67,11 @@ typedef struct _TEXT_DEST_REC {
GHashTable *meta;
} TEXT_DEST_REC;
typedef struct _LINE_INFO_META_REC {
gint64 server_time;
GHashTable *hash;
} LINE_INFO_META_REC;
#define window_get_theme(window) \
(window != NULL && (window)->theme != NULL ? \
(window)->theme : current_theme)

View File

@ -102,7 +102,7 @@ static void format_rec_set_dest(TEXT_BUFFER_FORMAT_REC *rec, const TEXT_DEST_REC
rec->flags = dest->flags & ~PRINT_FLAG_FORMAT;
}
void textbuffer_meta_rec_free(TEXT_BUFFER_META_REC *rec)
void textbuffer_meta_rec_free(LINE_INFO_META_REC *rec)
{
if (rec == NULL)
return;
@ -113,7 +113,7 @@ void textbuffer_meta_rec_free(TEXT_BUFFER_META_REC *rec)
g_free(rec);
}
static void meta_hash_create(struct _TEXT_BUFFER_META_REC *meta)
static void meta_hash_create(struct _LINE_INFO_META_REC *meta)
{
if (meta->hash == NULL) {
meta->hash = g_hash_table_new_full(g_str_hash, (GEqualFunc) g_str_equal,
@ -122,9 +122,9 @@ static void meta_hash_create(struct _TEXT_BUFFER_META_REC *meta)
}
}
static TEXT_BUFFER_META_REC *line_meta_create(GHashTable *meta_hash)
static LINE_INFO_META_REC *line_meta_create(GHashTable *meta_hash)
{
struct _TEXT_BUFFER_META_REC *meta;
struct _LINE_INFO_META_REC *meta;
GHashTableIter iter;
const char *key;
const char *val;
@ -132,7 +132,7 @@ static TEXT_BUFFER_META_REC *line_meta_create(GHashTable *meta_hash)
if (meta_hash == NULL || g_hash_table_size(meta_hash) == 0)
return NULL;
meta = g_new0(struct _TEXT_BUFFER_META_REC, 1);
meta = g_new0(struct _LINE_INFO_META_REC, 1);
g_hash_table_iter_init(&iter, meta_hash);
while (g_hash_table_iter_next(&iter, (gpointer *) &key, (gpointer *) &val)) {
@ -362,7 +362,7 @@ char *textbuffer_line_get_text(TEXT_BUFFER_REC *buffer, LINE_REC *line, gboolean
THEME_REC *theme;
int formatnum;
TEXT_BUFFER_FORMAT_REC *format_rec;
TEXT_BUFFER_META_REC *meta;
LINE_INFO_META_REC *meta;
char *str;
curr = line;

View File

@ -2,11 +2,7 @@
#define IRSSI_FE_TEXT_TEXTBUFFER_FORMATS_H
#include <irssi/src/fe-text/textbuffer.h>
typedef struct _TEXT_BUFFER_META_REC {
gint64 server_time;
GHashTable *hash;
} TEXT_BUFFER_META_REC;
#include <irssi/src/fe-common/core/formats.h>
typedef struct _TEXT_BUFFER_FORMAT_REC {
char *module;
@ -22,7 +18,7 @@ typedef struct _TEXT_BUFFER_FORMAT_REC {
} TEXT_BUFFER_FORMAT_REC;
void textbuffer_format_rec_free(TEXT_BUFFER_FORMAT_REC *rec);
void textbuffer_meta_rec_free(TEXT_BUFFER_META_REC *rec);
void textbuffer_meta_rec_free(LINE_INFO_META_REC *rec);
char *textbuffer_line_get_text(TEXT_BUFFER_REC *buffer, LINE_REC *line, gboolean raw);
void textbuffer_formats_init(void);
void textbuffer_formats_deinit(void);

View File

@ -24,7 +24,7 @@ typedef struct {
int level;
time_t time;
char *text;
struct _TEXT_BUFFER_META_REC *meta;
struct _LINE_INFO_META_REC *meta;
struct _TEXT_BUFFER_FORMAT_REC *format;
} LINE_INFO_REC;

View File

@ -107,7 +107,7 @@ textbuffer_line_get_meta(line)
PREINIT:
HV *hv;
LINE_REC *l;
TEXT_BUFFER_META_REC *m;
LINE_INFO_META_REC *m;
GHashTableIter iter;
char *key;
char *val;