File: helper.h

package info (click to toggle)
haskell-libyaml 0.1.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 100 kB
  • sloc: haskell: 673; ansic: 184; makefile: 3
file content (43 lines) | stat: -rw-r--r-- 1,354 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef __HELPER_H__
#define __HELPER_H__

#include <yaml.h>

typedef struct buffer_s {
	unsigned char *buff;
	unsigned int size, used;
} buffer_t;
void buffer_init(buffer_t *buffer);
int buffer_append(void *ext, unsigned char *str, size_t size);
unsigned char * get_buffer_buff(buffer_t *b);
unsigned int get_buffer_used(buffer_t *b);

void my_emitter_set_output(yaml_emitter_t *e, buffer_t *b);

char const * get_parser_error_problem(yaml_parser_t *p);
char const * get_parser_error_context(yaml_parser_t *p);
unsigned int    get_parser_error_offset(yaml_parser_t *p);

char const * get_emitter_error(yaml_emitter_t *e);

int simple_document_start(yaml_event_t *e);

int get_event_type(yaml_event_t *e);

unsigned char * get_scalar_value(yaml_event_t *e);
unsigned long get_scalar_length(yaml_event_t *e);

unsigned char * get_scalar_tag(yaml_event_t *e);
unsigned char * get_sequence_start_tag(yaml_event_t *e);
unsigned char * get_mapping_start_tag(yaml_event_t *e);

int get_scalar_style(yaml_event_t *e);
int get_sequence_start_style(yaml_event_t *e);
int get_mapping_start_style(yaml_event_t *e);

unsigned char * get_scalar_anchor(yaml_event_t *e);
unsigned char * get_sequence_start_anchor(yaml_event_t *e);
unsigned char * get_mapping_start_anchor(yaml_event_t *e);
unsigned char * get_alias_anchor(yaml_event_t *e);

#endif /* __HELPER_H__ */