libmobi
C library for handling MOBI format ebook documents
opf.h
Go to the documentation of this file.
1 
11 #ifndef libmobi_opf_h
12 #define libmobi_opf_h
13 
14 #include "config.h"
15 #include "mobi.h"
16 
18 #define OPF_META_MAX_TAGS 256
19 
30 typedef struct {
31  char *value;
32  char *id;
33  char *scheme;
35 
40 typedef struct {
41  char *value;
42  char *file_as;
43  char *role;
44 } OPFcreator;
45 
47 typedef struct {
48  char *value;
49  char *basic_code;
50 } OPFsubject;
51 
56 typedef struct {
57  char *value;
58  char *event;
59 } OPFdate;
60 
62 typedef struct {
68  char **description;
69  char **language;
70  char **publisher;
71  char **rights;
72  char **source;
73  char **title;
74  char **type;
75 } OPFdcmeta;
76 
78 typedef struct {
79  char *value;
80  char *currency;
81 } OPFsrp;
82 
84 typedef struct {
85  OPFsrp **srp;
86  char **adult;
88  char **dict_short_name;
91  char **embedded_cover;
92  char **imprint;
93  char **review;
94 } OPFxmeta;
95 
97 typedef struct {
98  char *name;
99  char *content;
100 } OPFmeta;
101 
103 typedef struct {
107 } OPFmetadata;
108 
110 typedef struct {
111  char *id;
112  char *href;
113  char *media_type;
114 } OPFitem;
115 
117 typedef struct {
119 } OPFmanifest;
120 
122 typedef struct {
123  char *toc;
124  char **itemref;
125 } OPFspine;
126 
128 typedef struct {
129  char *type;
130  char *title;
131  char *href;
132 } OPFreference;
133 
135 typedef struct {
137 } OPFguide;
138 
140 typedef struct {
141  //char *uid; /**< <package unique-identifier="uid"/> */
146 } OPF;
147 
149 typedef struct {
150  size_t id;
151  char *text;
152  char *target;
153  size_t level;
154  size_t parent;
155  size_t first_child;
156  size_t last_child;
157 } NCX;
161 MOBI_RET mobi_build_opf(MOBIRawml *rawml, const MOBIData *m);
162 MOBI_RET mobi_build_ncx(MOBIRawml *rawml, const OPF *opf);
163 
164 #endif
MOBI_RET
Error codes returned by functions.
Definition: mobi.h:59
Libmobi main header file.
MOBI_RET mobi_build_opf(MOBIRawml *rawml, const MOBIData *m)
Recreate OPF structure.
Definition: opf.c:1900
MOBI_RET mobi_build_ncx(MOBIRawml *rawml, const OPF *opf)
Parse ncx index, recreate ncx document and append it to rawml.
Definition: opf.c:553
Main structure holding all metadata and unparsed records data.
Definition: mobi.h:381
Main structure containing reconstructed source parts and indices.
Definition: mobi.h:464
NCX index entry structure.
Definition: opf.h:149
size_t level
Definition: opf.h:153
char * text
Definition: opf.h:151
char * target
Definition: opf.h:152
size_t id
Definition: opf.h:150
size_t parent
Definition: opf.h:154
size_t last_child
Definition: opf.h:156
size_t first_child
Definition: opf.h:155
OPF <package> element structure.
Definition: opf.h:140
OPFspine * spine
Definition: opf.h:144
OPFguide * guide
Definition: opf.h:145
OPFmetadata * metadata
Definition: opf.h:142
OPFmanifest * manifest
Definition: opf.h:143
OPF <dc:creator/> element structure.
Definition: opf.h:40
char * value
Definition: opf.h:41
char * role
Definition: opf.h:43
char * file_as
Definition: opf.h:42
OPF <dc:date/> element structure.
Definition: opf.h:56
char * event
Definition: opf.h:58
char * value
Definition: opf.h:57
OPF <dc-metadata/> element structure.
Definition: opf.h:62
OPFsubject ** subject
Definition: opf.h:66
char ** description
Definition: opf.h:68
char ** source
Definition: opf.h:72
char ** type
Definition: opf.h:74
char ** rights
Definition: opf.h:71
char ** publisher
Definition: opf.h:70
char ** language
Definition: opf.h:69
char ** title
Definition: opf.h:73
OPFcreator ** contributor
Definition: opf.h:63
OPFcreator ** creator
Definition: opf.h:64
OPFidentifier ** identifier
Definition: opf.h:65
OPFdate ** date
Definition: opf.h:67
OPF <guide> element structure.
Definition: opf.h:135
OPFreference ** reference
Definition: opf.h:136
OPF <dc:identifier/> element structure.
Definition: opf.h:30
char * scheme
Definition: opf.h:33
char * id
Definition: opf.h:32
char * value
Definition: opf.h:31
OPF element structure.
Definition: opf.h:110
char * media_type
Definition: opf.h:113
char * id
Definition: opf.h:111
char * href
Definition: opf.h:112
OPF <manifest> element structure.
Definition: opf.h:117
OPFitem ** item
Definition: opf.h:118
OPF <meta> element structure.
Definition: opf.h:97
char * name
Definition: opf.h:98
char * content
Definition: opf.h:99
OPF <metadata> element structure.
Definition: opf.h:103
OPFdcmeta * dc_meta
Definition: opf.h:105
OPFmeta ** meta
Definition: opf.h:104
OPFxmeta * x_meta
Definition: opf.h:106
OPF <reference> tag structure.
Definition: opf.h:128
char * type
Definition: opf.h:129
char * href
Definition: opf.h:131
char * title
Definition: opf.h:130
OPF <spine> element structure.
Definition: opf.h:122
char ** itemref
Definition: opf.h:124
char * toc
Definition: opf.h:123
OPF <srp> element structure.
Definition: opf.h:78
char * value
Definition: opf.h:79
char * currency
Definition: opf.h:80
OPF <dc:subject/> element structure.
Definition: opf.h:47
char * value
Definition: opf.h:48
char * basic_code
Definition: opf.h:49
OPF <x-metadata/> element structure.
Definition: opf.h:84
char ** embedded_cover
Definition: opf.h:91
char ** dictionary_out_lang
Definition: opf.h:90
char ** dict_short_name
Definition: opf.h:88
char ** imprint
Definition: opf.h:92
char ** default_lookup_index
Definition: opf.h:87
char ** adult
Definition: opf.h:86
char ** review
Definition: opf.h:93
OPFsrp ** srp
Definition: opf.h:85
char ** dictionary_in_lang
Definition: opf.h:89