#include "config.h"
#include "mobi.h"
Go to the source code of this file.
Copyright (c) 2014 Bartek Fabiszewski http://www.fabiszewski.net
This file is part of libmobi. Licensed under LGPL, either version 3, or any later. See http://www.gnu.org/licenses/
◆ MOBI_ATTRNAME_MAXSIZE
#define MOBI_ATTRNAME_MAXSIZE 150 |
Maximum length of tag attribute name, like "href"
◆ MOBI_ATTRVALUE_MAXSIZE
#define MOBI_ATTRVALUE_MAXSIZE 150 |
Maximum length of tag attribute value
◆ MOBIAttrType
HTML attribute type.
Enumerator |
---|
ATTR_ID | Attribute 'id'
|
ATTR_NAME | Attribute 'name'
|
◆ mobi_find_attrvalue()
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.
- Parameters
-
[in,out] | result | MOBIResult structure will be filled with found data |
[in] | data_start | Beginning of the memory area to search in |
[in] | data_end | End of the memory area to search in |
[in] | type | Type of data (T_HTML or T_CSS) |
[in] | needle | String to find (len <= MOBI_ATTRNAME_MAXSIZE) |
- Returns
- MOBI_RET status code (on success MOBI_SUCCESS)
◆ mobi_get_id_by_posoff()
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.
- Parameters
-
[in,out] | file_number | Will be set to file number value |
[in,out] | id | String value of "id" attribute |
[in] | rawml | MOBIRawml parsed records structure |
[in] | pos_fid | X value of pos:fid:x |
[in] | pos_off | Y value of off:y |
[in,out] | pref_attr | Attribute to link to |
- Returns
- MOBI_RET status code (on success MOBI_SUCCESS)