source: errqueue.c @ 7d969f3

release-1.10release-1.8release-1.9
Last change on this file since 7d969f3 was d4927a7, checked in by Anders Kaseorg <andersk@mit.edu>, 14 years ago
Replace owl_strdup with g_strdup. Signed-off-by: Anders Kaseorg <andersk@mit.edu> Reviewed-by: Karl Ramm <kcr@mit.edu>
  • Property mode set to 100644
File size: 536 bytes
Line 
1#include "owl.h"
2
3void owl_errqueue_init(owl_errqueue *eq)
4{
5  owl_list_create(&(eq->errlist));
6}
7
8void owl_errqueue_append_err(owl_errqueue *eq, const char *msg)
9{
10  owl_list_append_element(&(eq->errlist), g_strdup(msg));
11}
12
13/* fmtext should already be initialized */
14void owl_errqueue_to_fmtext(const owl_errqueue *eq, owl_fmtext *fm)
15{
16  int i, j;
17
18  j=owl_list_get_size(&(eq->errlist));
19  for (i=0; i<j; i++) {
20    owl_fmtext_append_normal(fm, owl_list_get_element(&(eq->errlist), i));
21    owl_fmtext_append_normal(fm, "\n");
22  }
23}
Note: See TracBrowser for help on using the repository browser.