libmobi
C library for handling MOBI format ebook documents
parse_rawml.h
Go to the documentation of this file.
1 
11 #ifndef mobi_parse_rawml_h
12 #define mobi_parse_rawml_h
13 
14 #include "config.h"
15 #include "mobi.h"
16 
17 #define MOBI_ATTRNAME_MAXSIZE 150
18 #define MOBI_ATTRVALUE_MAXSIZE 150
23 typedef struct {
24  unsigned char *start;
25  unsigned char *end;
26  char value[MOBI_ATTRVALUE_MAXSIZE + 1];
27  bool is_url;
28 } MOBIResult;
29 
33 typedef enum {
34  ATTR_ID = 0,
35  ATTR_NAME
37 
38 
39 MOBI_RET mobi_get_id_by_posoff(uint32_t *file_number, char *id, const MOBIRawml *rawml, const size_t pos_fid, const size_t pos_off, MOBIAttrType *pref_attr);
40 MOBI_RET mobi_find_attrvalue(MOBIResult *result, const unsigned char *data_start, const unsigned char *data_end, const MOBIFiletype type, const char *needle);
41 
42 #endif
MOBI_RET
Error codes returned by functions.
Definition: mobi.h:59
MOBIFiletype
Types of files stored in database records.
Definition: mobi.h:176
Libmobi main header file.
MOBI_RET mobi_get_id_by_posoff(uint32_t *file_number, char *id, const MOBIRawml *rawml, const size_t pos_fid, const size_t pos_off, MOBIAttrType *pref_attr)
Convert kindle:pos:fid:x:off:y to html file number and closest "id" attribute following the position.
Definition: parse_rawml.c:548
#define MOBI_ATTRVALUE_MAXSIZE
Definition: parse_rawml.h:18
MOBI_RET mobi_find_attrvalue(MOBIResult *result, const unsigned char *data_start, const unsigned char *data_end, const MOBIFiletype type, const char *needle)
Find first occurence of markup attribute with given value.
Definition: parse_rawml.c:132
MOBIAttrType
HTML attribute type.
Definition: parse_rawml.h:33
@ ATTR_ID
Definition: parse_rawml.h:34
@ ATTR_NAME
Definition: parse_rawml.h:35
Main structure containing reconstructed source parts and indices.
Definition: mobi.h:464
Result data returned by mobi_search_links_kf7() and mobi_search_links_kf8()
Definition: parse_rawml.h:23
unsigned char * start
Definition: parse_rawml.h:24
bool is_url
Definition: parse_rawml.h:27
unsigned char * end
Definition: parse_rawml.h:25