source:
errqueue.c
@
a0c06dc
Last change on this file since a0c06dc was eb897c6, checked in by David Benjamin <davidben@mit.edu>, 13 years ago | |
---|---|
|
|
File size: 483 bytes |
Rev | Line | |
---|---|---|
[ec6ff52] | 1 | #include "owl.h" |
2 | ||
3 | void owl_errqueue_init(owl_errqueue *eq) | |
4 | { | |
[eb897c6] | 5 | eq->errlist = g_ptr_array_new(); |
[ec6ff52] | 6 | } |
7 | ||
[e19eb97] | 8 | void owl_errqueue_append_err(owl_errqueue *eq, const char *msg) |
[ec6ff52] | 9 | { |
[eb897c6] | 10 | g_ptr_array_add(eq->errlist, g_strdup(msg)); |
[ec6ff52] | 11 | } |
12 | ||
13 | /* fmtext should already be initialized */ | |
[5b256de] | 14 | void owl_errqueue_to_fmtext(const owl_errqueue *eq, owl_fmtext *fm) |
[ec6ff52] | 15 | { |
[eb897c6] | 16 | int i; |
17 | for (i = 0; i < eq->errlist->len; i++) { | |
18 | owl_fmtext_append_normal(fm, eq->errlist->pdata[i]); | |
[ec6ff52] | 19 | owl_fmtext_append_normal(fm, "\n"); |
20 | } | |
21 | } |
Note: See TracBrowser
for help on using the repository browser.