~ubuntu-branches/ubuntu/saucy/libyaml-libyaml-perl/saucy-security

« back to all changes in this revision

Viewing changes to LibYAML/perl_libyaml.h

  • Committer: Bazaar Package Importer
  • Author(s): Ryan Niebur
  • Date: 2009-06-01 02:17:22 UTC
  • Revision ID: james.westby@ubuntu.com-20090601021722-8qlj45pmu8ffwzau
Tags: upstream-0.32
ImportĀ upstreamĀ versionĀ 0.32

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* These definitions affect -pedantic warnings...
 
2
 
 
3
#define PERL_GCC_BRACE_GROUPS_FORBIDDEN 1
 
4
#define __STRICT_ANSI__ 1
 
5
#define PERL_GCC_PEDANTIC 1
 
6
*/
 
7
 
 
8
#include "EXTERN.h"
 
9
#include "perl.h"
 
10
#include "XSUB.h"
 
11
#define NEED_newRV_noinc
 
12
#define NEED_sv_2pv_nolen
 
13
#define NEED_sv_2pvbyte
 
14
#include "ppport.h"
 
15
#include <yaml.h>
 
16
#include <ppport_sort.h>
 
17
 
 
18
#define TAG_PERL_PREFIX "tag:yaml.org,2002:perl/"
 
19
#define TAG_PERL_REF TAG_PERL_PREFIX "ref"
 
20
#define TAG_PERL_STR TAG_PERL_PREFIX "str"
 
21
#define TAG_PERL_GLOB TAG_PERL_PREFIX "glob"
 
22
#define ERRMSG "YAML::XS Error: "
 
23
#define LOADERRMSG "YAML::XS::Load Error: "
 
24
#define DUMPERRMSG "YAML::XS::Dump Error: "
 
25
 
 
26
typedef struct {
 
27
    yaml_parser_t parser;
 
28
    yaml_event_t event;
 
29
    HV *anchors;
 
30
    int load_code;
 
31
    int document;
 
32
} perl_yaml_loader_t;
 
33
 
 
34
typedef struct {
 
35
    yaml_emitter_t emitter;
 
36
    long anchor;
 
37
    HV *anchors;
 
38
    HV *shadows;
 
39
    int dump_code;
 
40
} perl_yaml_dumper_t;
 
41
 
 
42
static SV *
 
43
call_coderef(SV *, AV *);
 
44
 
 
45
static SV *
 
46
fold_results(I32);
 
47
 
 
48
static SV *
 
49
find_coderef(char *);
 
50
 
 
51
void
 
52
set_dumper_options(perl_yaml_dumper_t *);
 
53
 
 
54
void
 
55
set_loader_options(perl_yaml_dumper_t *);
 
56
 
 
57
void
 
58
Dump(SV *, ...);
 
59
 
 
60
void
 
61
Load(SV *);
 
62
 
 
63
SV *
 
64
load_node(perl_yaml_loader_t *);
 
65
 
 
66
SV *
 
67
load_mapping(perl_yaml_loader_t *, char *);
 
68
 
 
69
SV *
 
70
load_sequence(perl_yaml_loader_t *);
 
71
 
 
72
SV *
 
73
load_scalar(perl_yaml_loader_t *);
 
74
 
 
75
SV *
 
76
load_alias(perl_yaml_loader_t *);
 
77
 
 
78
SV *
 
79
load_scalar_ref(perl_yaml_loader_t *);
 
80
 
 
81
SV *
 
82
load_regexp(perl_yaml_loader_t *);
 
83
 
 
84
SV *
 
85
load_glob(perl_yaml_loader_t *);
 
86
 
 
87
 
 
88
void
 
89
dump_prewalk(perl_yaml_dumper_t *, SV *);
 
90
 
 
91
void
 
92
dump_document(perl_yaml_dumper_t *, SV *);
 
93
 
 
94
void
 
95
dump_node(perl_yaml_dumper_t *, SV *);
 
96
 
 
97
void
 
98
dump_hash(perl_yaml_dumper_t *, SV *, yaml_char_t *, yaml_char_t *);
 
99
 
 
100
void
 
101
dump_array(perl_yaml_dumper_t *, SV *);
 
102
 
 
103
void
 
104
dump_scalar(perl_yaml_dumper_t *, SV *, yaml_char_t *);
 
105
 
 
106
void
 
107
dump_ref(perl_yaml_dumper_t *, SV *);
 
108
 
 
109
void
 
110
dump_code(perl_yaml_dumper_t *, SV *);
 
111
 
 
112
SV*
 
113
dump_glob(perl_yaml_dumper_t *, SV *);
 
114
 
 
115
 
 
116
yaml_char_t *
 
117
get_yaml_anchor(perl_yaml_dumper_t *, SV *);
 
118
 
 
119
yaml_char_t *
 
120
get_yaml_tag(SV *);
 
121
 
 
122
 
 
123
int
 
124
append_output(void *, unsigned char *, unsigned int size);
 
125