kviewshell
DjVuGlobal.h File Reference
#include <new.h>
Go to the source code of this file.
Defines | |
#define | _djvu_calloc(siz, items) calloc((siz),(items)) |
#define | _djvu_free(ptr) free((ptr)) |
#define | _djvu_malloc(siz) malloc((siz)) |
#define | _djvu_realloc(ptr, siz) realloc((ptr),(siz)) |
#define | EMPTY_LOOP |
#define | ERR_MSG(x) "\003" x |
#define | HAS_CTRL_C_IN_ERR_MSG 1 |
DjVu Progress | |
This section is enabled when compilation symbol NEED_DJVU_PROGRESS# is defined. This macro setups callback function that may be used to implement a progress indicator for the encoding routines. The decoding routines do not need such a facility because it is sufficient to monitor the calls to function {ByteStream::read} in class {ByteStream}. { Code tracing macros} --- Monitoring the progress of such complex algorithms requires significant code support. This is achieved by inserting {code tracing macros} in strategic regions of the code. {description} [DJVU_PROGRESS_TASK(name,task,nsteps)] indicates that the current scope performs a task roughly divided in nsteps# equal steps, with the specified task# string used in the callback. [DJVU_PROGRESS_RUN(name,tostep)] indicates that we are starting an operation which will take us to step tostep#. The operation will be considered finished when DJVU_PROGRESS_RUN# will be called again with an argument greater than tostep#. The execution of this operation of course can be described by one subtask and so on. {description} { Progress callback} --- Before defining the outermost task, you can store a callback function pointer into the static member variable DjVuProgressTask::callback#. This callback function is called periodically with two unsigned long arguments. The first argument is the elapsed time. The second argument is the estimated total execution time. Both times are given in milliseconds.
{ Important Note} --- This monitoring mechanism should not be used by multithreaded programs. | |
#define | DJVU_PROGRESS_RUN(name, step) |
#define | DJVU_PROGRESS_TASK(name, task, nsteps) |
General functions. | |
This section contains functions that replace some of the standard system calls without any other header file dependancies. | |
#define | DJVUEXTERNCAPI(x) extern DJVUAPI x |
const unsigned int | buffer_size |
DJVUEXTERNCAPI (void DjVuWriteError(const char *message)) DJVUEXTERNCAPI(void DjVuWriteMessage(const char *message)) DJVUEXTERNCAPI(void DjVuMessageLookUpUTF8(char *msg_buffer | |
DJVUEXTERNCAPI (void DjVuPrintErrorUTF8(const char *fmt,...)) DJVUEXTERNCAPI(void DjVuPrintErrorNative(const char *fmt |
Define Documentation
#define _djvu_calloc | ( | siz, | |||
items | ) | calloc((siz),(items)) |
Definition at line 212 of file DjVuGlobal.h.
#define _djvu_free | ( | ptr | ) | free((ptr)) |
Definition at line 209 of file DjVuGlobal.h.
#define _djvu_malloc | ( | siz | ) | malloc((siz)) |
Definition at line 210 of file DjVuGlobal.h.
#define _djvu_realloc | ( | ptr, | |||
siz | ) | realloc((ptr),(siz)) |
Definition at line 211 of file DjVuGlobal.h.
#define DJVU_PROGRESS_RUN | ( | name, | |||
step | ) |
Definition at line 285 of file DjVuGlobal.h.
#define DJVU_PROGRESS_TASK | ( | name, | |||
task, | |||||
nsteps | ) |
Definition at line 284 of file DjVuGlobal.h.
#define DJVUEXTERNCAPI | ( | x | ) | extern DJVUAPI x |
Definition at line 301 of file DjVuGlobal.h.
#define EMPTY_LOOP |
#define ERR_MSG | ( | x | ) | "\003" x |
#define HAS_CTRL_C_IN_ERR_MSG 1 |
Function Documentation
DJVUEXTERNCAPI | ( | void | DjVuWriteErrorconst char *message | ) | const |
Prints the translation of message to stderr.
Prints the translation of message to stdout. A C function to perform a message lookup. Arguments are a buffer to received the translated message, a buffer size (bytes), and a message_list. The translated result is returned in msg_buffer encoded in UTF-8. In case of error, msg_buffer is empty (i.e., msg_buffer[0] == '').
DJVUEXTERNCAPI | ( | void | DjVuFormatErrorUTF8const char *fmt,... | ) | const |
This replaces fprintf(stderr,.
This replaces printf(.
..), but with UTF8 encoded strings. This replaces fprintf(stderr,...), but with UTF8 encoded strings.
..), but requires UTF8 encoded strings. This replaces printf(...), but requires UTF8 encoded strings.
The format (fmt) and arguments define a MessageList to be looked up in the external messages and printed to stderr.
Variable Documentation
const unsigned int buffer_size |
Definition at line 337 of file DjVuGlobal.h.