source: errqueue.c @ 6c144b3

release-1.10release-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
Last change on this file since 6c144b3 was 5b256de, checked in by Anders Kaseorg <andersk@mit.edu>, 15 years ago
Add const qualifiers for owl_errqueue *. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Property mode set to 100644
File size: 538 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), owl_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.