-
Notifications
You must be signed in to change notification settings - Fork 1
/
relationships.h
77 lines (56 loc) · 1.85 KB
/
relationships.h
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
* libxlsxwriter
*
* Copyright 2014-2018, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
*
* relationships - A libxlsxwriter library for creating Excel XLSX
* relationships files.
*
*/
#ifndef __LXW_RELATIONSHIPS_H__
#define __LXW_RELATIONSHIPS_H__
#include <stdint.h>
#include "common.h"
/* Define the queue.h STAILQ structs for the generic data structs. */
STAILQ_HEAD(lxw_rel_tuples, lxw_rel_tuple);
typedef struct lxw_rel_tuple {
char *type;
char *target;
char *target_mode;
STAILQ_ENTRY (lxw_rel_tuple) list_pointers;
} lxw_rel_tuple;
/*
* Struct to represent a relationships.
*/
typedef struct lxw_relationships {
FILE *file;
uint32_t rel_id;
struct lxw_rel_tuples *relationships;
} lxw_relationships;
/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */
lxw_relationships *lxw_relationships_new();
void lxw_free_relationships(lxw_relationships *relationships);
void lxw_relationships_assemble_xml_file(lxw_relationships *self);
void lxw_add_document_relationship(lxw_relationships *self, const char *type,
const char *target);
void lxw_add_package_relationship(lxw_relationships *self, const char *type,
const char *target);
void lxw_add_ms_package_relationship(lxw_relationships *self,
const char *type, const char *target);
void lxw_add_worksheet_relationship(lxw_relationships *self, const char *type,
const char *target,
const char *target_mode);
/* Declarations required for unit testing. */
#ifdef TESTING
STATIC void _relationships_xml_declaration(lxw_relationships *self);
#endif /* TESTING */
/* *INDENT-OFF* */
#ifdef __cplusplus
}
#endif
/* *INDENT-ON* */
#endif /* __LXW_RELATIONSHIPS_H__ */