libmobi
C library for handling MOBI format ebook documents
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Macros | Functions | Variables
mobitool.c File Reference

mobitool More...

#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
#include <time.h>
#include <errno.h>
#include <mobi.h>
#include "common.h"

Macros

#define PRINT_RUSAGE_ARG   ""
 
#define PRINT_ENC_USG   ""
 
#define PRINT_ENC_ARG   ""
 
#define PRINT_EPUB_ARG   ""
 
#define EPUB_CONTAINER   "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\<container version=\"1.0\" xmlns=\"urn:oasis:names:tc:opendocument:xmlns:container\">\n\ <rootfiles>\n\ <rootfile full-path=\"OEBPS/content.opf\" media-type=\"application/oebps-package+xml\"/>\n\ </rootfiles>\n\</container>"
 
#define EPUB_MIMETYPE   "application/epub+zip"
 

Functions

void print_meta (const MOBIData *m)
 Print all loaded headers meta information. More...
 
void print_records_meta (const MOBIData *m)
 Print meta data of each document record. More...
 
int dump_records (const MOBIData *m, const char *fullpath)
 Dump each document record to a file into created folder. More...
 
int dump_rawml (const MOBIData *m, const char *fullpath)
 Dump all text records, decompressed and concatenated, to a single rawml file. More...
 
int dump_rawml_parts (const MOBIRawml *rawml, const char *fullpath)
 Dump parsed markup files and resources into created folder. More...
 
int dump_embedded_source (const MOBIData *m, const char *fullpath)
 Dump SRCS record. More...
 
int loadfilename (const char *fullpath)
 Main routine that calls optional subroutines. More...
 
void exit_with_usage (const char *progname)
 Print usage info. More...
 
int main (int argc, char *argv[])
 Main.
 

Variables

int dump_rawml_opt = 0
 
int create_epub_opt = 0
 
int print_extended_meta_opt = 0
 
int print_rec_meta_opt = 0
 
int dump_rec_opt = 0
 
int parse_kf7_opt = 0
 
int dump_parts_opt = 0
 
int print_rusage_opt = 0
 
int outdir_opt = 0
 
int extract_source_opt = 0
 
char outdir [FILENAME_MAX]
 

Detailed Description

mobitool

Function Documentation

int dump_embedded_source ( const MOBIData m,
const char *  fullpath 
)

Dump SRCS record.

Parameters
[in]mMOBIData structure
[in]fullpathFull file path
Examples:
mobitool.c.
int dump_rawml ( const MOBIData m,
const char *  fullpath 
)

Dump all text records, decompressed and concatenated, to a single rawml file.

Parameters
[in]mMOBIData structure
[in]fullpathFile path will be parsed to create a new name for saved file
Examples:
mobitool.c.
int dump_rawml_parts ( const MOBIRawml rawml,
const char *  fullpath 
)

Dump parsed markup files and resources into created folder.

Parameters
[in]rawmlMOBIRawml structure holding parsed records
[in]fullpathFile path will be parsed to build basenames of dumped records
Examples:
mobitool.c.
int dump_records ( const MOBIData m,
const char *  fullpath 
)

Dump each document record to a file into created folder.

Parameters
[in]mMOBIData structure
[in]fullpathFile path will be parsed to build basenames of dumped records
Examples:
mobitool.c.
void exit_with_usage ( const char *  progname)

Print usage info.

Parameters
[in]prognameExecuted program name
Examples:
mobitool.c.
int loadfilename ( const char *  fullpath)

Main routine that calls optional subroutines.

Parameters
[in]fullpathFull file path
Examples:
mobitool.c.
void print_meta ( const MOBIData m)

Print all loaded headers meta information.

Parameters
[in]mMOBIData structure
Examples:
mobitool.c.
void print_records_meta ( const MOBIData m)

Print meta data of each document record.

Parameters
[in]mMOBIData structure
Examples:
mobitool.c.