|
|
Nyctergatis EPUB, a.k.a.
More...
#include "zip.h"
Go to the source code of this file.
Data Structures |
| struct | NE |
| | Main NE structure (shouldn't be accessed directly) More...
|
Defines |
|
#define | NULL 0 |
| | null pointer
|
|
#define | FALSE 0 |
| | false boolean value
|
|
#define | TRUE 1 |
| | true boolean value
|
Typedefs |
|
typedef unsigned char | NEBoolean |
|
typedef struct NE * | NEPtr |
Enumerations |
| enum | NEErr {
kNEErrOk = 0,
kNEErrCannotCreateEPUBFile,
kNEErrZip,
kNEErrMalloc,
kNEErrCannotOpenFile
} |
| enum | NEMetadataKey {
kNEMetaTitle,
kNEMetaCreator,
kNEMetaIdentifier,
kNEMetaLanguage,
kNEMetaSubject,
kNEMetaDescription,
kNEMetaPublisher,
kNEMetaDate,
kNEMetaSource,
kNEMetaRights
} |
| | Kind of metadata. More...
|
Functions |
| NEErr | NEBegin (NEPtr ne, char const *filename) |
| | Begin the creation of an EPUB file.
|
| NEErr | NEAddMetadata (NEPtr ne, NEMetadataKey key, char const *data, int dataLen) |
| | Add metadata.
|
| NEErr | NEAddPart (NEPtr ne, char const *filename, NEBoolean auxiliary) |
| | Add an XHTML part to the book manifest; its contents should also be added with NEAddFile or NENewFile/NEWriteToFile/NECloseFile.
|
| NEErr | NEAddOther (NEPtr ne, char const *filename, int filenameLen, char const *mimetype) |
| | Add non-HTML content to the book (images, css, etc.); its contents should also be added with NEAddFile or NENewFile/NEWriteToFile/NECloseFile.
|
| void | NEEnumOther (NEPtr ne, char const **filename, int *filenameLength) |
| | Enumerate files added by NEAddOther.
|
| NEErr | NEAddTOCEntry (NEPtr ne, char const *title, char const *relativeUrl, int level) |
| | Add an entry to the table of contents.
|
| NEErr | NEAddFile (NEPtr ne, char const *filename, char const *path) |
| | Add the contents of a file.
|
| NEErr | NENewFile (NEPtr ne, char const *filename) |
| | Create a new file in the EPUB.
|
| NEErr | NEWriteToFile (NEPtr ne, char const *data, int len) |
| | Add data to the file created with NENewFile.
|
| NEErr | NECloseFile (NEPtr ne) |
| | Close the file opened by NENewFile.
|
| NEErr | NEAddEndnote (NEPtr ne, char const *endnote, int len, char const *refDoc, int refDocLen, char const **refLink) |
| | Add an endnote.
|
|
NEErr | NEMakeCover (NEPtr ne) |
| NEErr | NESetCoverImage (NEPtr ne, char const *filename, int filenameLen) |
| | Specify an image to be used for the cover.
|
| NEErr | NEEnd (NEPtr ne) |
| | Finish writing the EPUB file and release all resources.
|
| NEErr | NEStringCopy (char **str, char const *src, int srcLen) |
| | Copy a string to a sring allocated by malloc.
|
| NEErr | NEStringCat (char **str, char const *src, int srcLen) |
| | Concatenate a string to a string allocated by malloc.
|
| NEErr | NEStringAdd (char **str, char const *src, int srcLen) |
| | Concatenate a string with a linefeed separator character.
|
| char const * | NEStringNextPart (char const *str) |
| | Find next part after the next linefeed character.
|
| void | NEStringFree (char **str) |
| | Deallocated string.
|
Detailed Description
Nyctergatis EPUB, a.k.a.
NE (creation of EPUB documents). Relies on zlib (by Jean-Loup Gailly and Mark Adler) and minizip (by Gilles Vollant, distributed with zlib) for zip compression.
- Author:
- Yves Piguet.
- Copyright:
- 2010-2013, Yves Piguet.
Definition in file NE.h.
Enumeration Type Documentation
Kind of metadata.
- Enumerator:
| kNEMetaTitle |
title
|
| kNEMetaCreator |
creator (author); may be multiple
|
| kNEMetaIdentifier |
unique identifier (ISBN, reversed domain name, etc.)
|
| kNEMetaLanguage |
language (RFC 3066; en, fr, de, ...)
|
| kNEMetaSubject |
subject; may be multiple
|
| kNEMetaDescription |
description
|
| kNEMetaPublisher |
publisher
|
| kNEMetaDate |
date (YYYY or YYYY-MM or YYYY-MM-DD)
|
| kNEMetaSource |
source
|
| kNEMetaRights |
copyright notice
|
Definition at line 110 of file NE.h.
Function Documentation
| NEErr NEAddEndnote |
( |
NEPtr |
ne, |
|
|
char const * |
endnote, |
|
|
int |
len, |
|
|
char const * |
refDoc, |
|
|
int |
refDocLen, |
|
|
char const ** |
refLink |
|
) |
| |
Add an endnote.
- Parameters:
-
| [in,out] | ne | reference to EPUB main structure |
| [in] | endnote | XHTML code for the endnote (without number) |
| [in] | len | length of endnote in bytes |
| [in] | refDoc | name of the document containing the reference |
| [in] | refDocLen | length of srcDoc in bytes |
| [out] | refLink | XHTML code to use as a link to the endnote (null-terminated) |
- Returns:
- kNEErrOk for success, error code for failure
Definition at line 449 of file NE.c.
| NEErr NEAddFile |
( |
NEPtr |
ne, |
|
|
char const * |
filename, |
|
|
char const * |
path |
|
) |
| |
Add the contents of a file.
- Parameters:
-
| [in,out] | ne | reference to EPUB main structure |
| [in] | filename | file name as seen in the EPUB |
| [in] | path | path of the original file |
- Returns:
- kNEErrOk for success, error code for failure
Definition at line 323 of file NE.c.
Add metadata.
- Parameters:
-
| [in,out] | ne | reference to EPUB main structure |
| [in] | key | kind of metadata |
| [in] | data | metadata value |
| [in] | dataLen | length of data in bytes |
- Returns:
- kNEErrOk for success, error code for failure
Definition at line 205 of file NE.c.
| NEErr NEAddOther |
( |
NEPtr |
ne, |
|
|
char const * |
filename, |
|
|
int |
filenameLen, |
|
|
char const * |
mimetype |
|
) |
| |
Add non-HTML content to the book (images, css, etc.); its contents should also be added with NEAddFile or NENewFile/NEWriteToFile/NECloseFile.
- Parameters:
-
| [in,out] | ne | reference to EPUB main structure |
| [in] | filename | filename |
| [in] | filenameLen | length of filename in bytes |
| [in] | mimetype | MIME type (NULL to use filename's suffix) |
- Returns:
- kNEErrOk for success, error code for failure
Definition at line 297 of file NE.c.
| NEErr NEAddPart |
( |
NEPtr |
ne, |
|
|
char const * |
filename, |
|
|
NEBoolean |
auxiliary |
|
) |
| |
Add an XHTML part to the book manifest; its contents should also be added with NEAddFile or NENewFile/NEWriteToFile/NECloseFile.
- Parameters:
-
| [in,out] | ne | reference to EPUB main structure |
| [in] | filename | filename |
| [in] | auxiliary | TRUE for auxiliary content (referenced via hyperlinks), FALSE for main contents (main line of reading) |
- Returns:
- kNEErrOk for success, error code for failure
Definition at line 253 of file NE.c.
| NEErr NEAddTOCEntry |
( |
NEPtr |
ne, |
|
|
char const * |
title, |
|
|
char const * |
relativeUrl, |
|
|
int |
level |
|
) |
| |
Add an entry to the table of contents.
- Parameters:
-
| [in,out] | ne | reference to EPUB main structure |
| [in] | title | entry text |
| [in] | relativeURL | relative URL to the file with an optional anchor |
| [in] | level | 1 for top-level entries, 2 for subentries, etc. |
- Returns:
- kNEErrOk for success, error code for failure
Definition at line 374 of file NE.c.
| NEErr NEBegin |
( |
NEPtr |
ne, |
|
|
char const * |
filename |
|
) |
| |
Begin the creation of an EPUB file.
- Parameters:
-
| [out] | ne | reference to EPUB main structure |
| [in] | filename | EPUB file name, or NULL for debug (write to stderr) |
- Returns:
- kNEErrOk for success, error code for failure
Definition at line 143 of file NE.c.
| NEErr NECloseFile |
( |
NEPtr |
ne | ) |
|
Close the file opened by NENewFile.
- Returns:
- kNEErrOk for success, error code for failure
Definition at line 442 of file NE.c.
Finish writing the EPUB file and release all resources.
- Returns:
- kNEErrOk for success, error code for failure
Definition at line 858 of file NE.c.
| void NEEnumOther |
( |
NEPtr |
ne, |
|
|
char const ** |
filename, |
|
|
int * |
filenameLength |
|
) |
| |
Enumerate files added by NEAddOther.
- Parameters:
-
| [in] | ne | reference to EPUB main structure |
| [in,out] | filename | previous filename on input (NULL to get the first one), next filename on output (NULL if no more) |
| [out] | filenameLength | length of filename in bytes |
Definition at line 308 of file NE.c.
| NEErr NENewFile |
( |
NEPtr |
ne, |
|
|
char const * |
filename |
|
) |
| |
Create a new file in the EPUB.
- Parameters:
-
| [in,out] | ne | reference to EPUB main structure |
| [in] | filename | filename in document subdirectory, or in EPUB root if it starts with "/" |
- Returns:
- kNEErrOk for success, error code for failure
Definition at line 399 of file NE.c.
| NEErr NESetCoverImage |
( |
NEPtr |
ne, |
|
|
char const * |
filename, |
|
|
int |
filenameLen |
|
) |
| |
Specify an image to be used for the cover.
- Parameters:
-
| [in,out] | ne | reference to EPUB main structure |
| [in] | filename | filename of the cover image (should also be added with NENewFile or NEAddFile) |
| [in] | filenameLen | length of filename in bytes, or -1 if null-terminated |
- Returns:
- kNEErrOk for success, error code for failure
Definition at line 244 of file NE.c.
| NEErr NEStringAdd |
( |
char ** |
str, |
|
|
char const * |
src, |
|
|
int |
srcLen |
|
) |
| |
Concatenate a string with a linefeed separator character.
- Parameters:
-
| [out] | str | null-terminated string allocated by malloc, or NULL |
| [in] | src | source string to be concatenated |
| [in] | srcLen | length of src in bytes, or -1 if null-terminated |
- Returns:
- kNEErrOk for success, error code for failure
Definition at line 77 of file NE.c.
| NEErr NEStringCat |
( |
char ** |
str, |
|
|
char const * |
src, |
|
|
int |
srcLen |
|
) |
| |
Concatenate a string to a string allocated by malloc.
- Parameters:
-
| [out] | str | null-terminated string allocated by malloc, or NULL |
| [in] | src | source string to be concatenated |
| [in] | srcLen | length of src in bytes, or -1 if null-terminated |
- Returns:
- kNEErrOk for success, error code for failure
Definition at line 55 of file NE.c.
| NEErr NEStringCopy |
( |
char ** |
str, |
|
|
char const * |
src, |
|
|
int |
srcLen |
|
) |
| |
Copy a string to a sring allocated by malloc.
- Parameters:
-
| [in,out] | str | null-terminated string allocated by malloc, or NULL |
| [in] | src | source string to be copied |
| [in] | srcLen | length of src in bytes, or -1 if null-terminated |
- Returns:
- kNEErrOk for success, error code for failure
Definition at line 34 of file NE.c.
| void NEStringFree |
( |
char ** |
str | ) |
|
Deallocated string.
- Parameters:
-
| [in,out] | str | string to be deallocated, or NULL |
Definition at line 136 of file NE.c.
| char const* NEStringNextPart |
( |
char const * |
str | ) |
|
Find next part after the next linefeed character.
- Parameters:
-
| [in] | str | input null-terminated string, or NULL |
- Returns:
- address of string following the next (first) line-feed, or NULL if none
Definition at line 100 of file NE.c.
| NEErr NEWriteToFile |
( |
NEPtr |
ne, |
|
|
char const * |
data, |
|
|
int |
len |
|
) |
| |
Add data to the file created with NENewFile.
- Parameters:
-
| [in,out] | ne | reference to EPUB main structure |
| [in] | data | data |
| [in] | len | length of data in bytes |
- Returns:
- kNEErrOk for success, error code for failure
Definition at line 428 of file NE.c.
|
Generated by Doxygen.
Copyright 2007-2013, Yves Piguet.
All rights reserved.
|
|