The Multithreaded Portable Runtime (MPR) is a portable runtime library for embedded applications.
The MPR provides management for logging, error handling, events, files, http, memory, ssl, sockets, strings, xml parsing, and date/time functions. It also provides a foundation of safe routines for secure programming, that help to prevent buffer overflows and other security threats. The MPR is a library and a C API that can be used in both C and C++ programs.
The MPR uses a set extended typedefs for common types. These include: bool, cchar, cvoid, uchar, short, ushort, int, uint, long, ulong, int32, uint32, int64, uint64, float, and double. The cchar type is a const char, cvoid is const void. Several types have "u" prefixes to denote unsigned qualifiers.
The MPR includes a memory allocator and generational garbage collector. The allocator is a fast, immediate coalescing allocator that will return memory back to the O/S if not required. It is optimized for frequent allocations of small blocks (< 4K) and uses a scheme of free queues for fast allocation.
Not all of these APIs are thread-safe.
| Mpr | Primary MPR application control structure. |
| MprBuf | Dynamic Buffer Module. |
| MprCache | In-memory caching. |
| MprCmd | Command execution Service. |
| MprEvent | Event object. |
| MprFile | File I/O Module. |
| MprFileSystem | File system service. |
| MprFloat | Floating Point Services. |
| MprHash | Hash table entry structure. |
| MprJson | JSON parser. |
| MprList | List data structure. |
| MprLog | Logging Services. |
| MprMem | Memory Allocation Service. |
| MprMime | Mime Type hash table entry (the URL extension is the key). |
| MprModule | Loadable Module Service. |
| MprModuleSerivce | Loadable module service. |
| MprPath | Path (filename) Information. |
| MprSignal | Signal control structure. |
| MprSocket | Socket Service. |
| MprString | Safe String Module. |
| MprSynch | Multithreaded Synchronization Services. |
| MprTestService | Test service facility. |
| MprThread | Thread Service. |
| MprTime | Date and Time Service. |
| MprWaitHandler | Wait Handler Service. |
| MprWorker | Worker thread structure. |
| MprXml | Per XML session structure. |
| bool | assertTrue(MprTestGroup *gp, cchar *loc, bool success, cchar *msg) |
| Assert test. | |
| char* | itos(int64 value) |
| Convert an integer to a string. | |
| char* | itosbuf(char *buf, ssize size, int64 value, int radix) |
| Convert an integer to a string buffer. | |
| char* | itosradix(int64 value, int radix) |
| Convert an integer to a string. | |
| MprSocket* | mprAcceptSocket(MprSocket *listen) |
| Accept an incoming connection. | |
| MprKey* | mprAddDuplicateKey(MprHash *table, cvoid *key, cvoid *ptr) |
| Add a duplicate symbol value into the hash table. | |
| void | mprAddFileSystem(MprFileSystem *fs) |
| Create and initialize the disk FileSystem. | |
| int | mprAddItem(MprList *list, cvoid *item) |
| Add an item to a list. | |
| MprKey* | mprAddKey(MprHash *table, cvoid *key, cvoid *ptr) |
| Add a symbol value into the hash table. | |
| MprKey* | mprAddKeyFmt(MprHash *table, cvoid *key, cchar *fmt, ...) |
| Add a key with a formatting value into the hash table. | |
| MprMime* | mprAddMime(MprHash *table, cchar *ext, cchar *mimeType) |
| Add a mime type to the mime type table. | |
| int | mprAddNullItem(MprList *list) |
| Add a null item to the list. | |
| void | mprAddNullToBuf(MprBuf *buf) |
| Add a null character to the buffer contents. | |
| void | mprAddNullToWideBuf(MprBuf *buf) |
| Add a wide null character to the buffer contents. | |
| void | mprAddRoot(void *ptr) |
| Add a memory block as a root for garbage collection. | |
| MprSignal* | mprAddSignalHandler(int signo, void *handler, void *arg, MprDispatcher *dispatcher, int flags) |
| Add a signal handler. | |
| MprWaitHandler* | mprAddSocketHandler(MprSocket *sp, int mask, MprDispatcher *dispatcher, void *proc, void *data, int flags) |
| Add a wait handler to a socket. | |
| void | mprAddStandardSignals() |
| Add standard trapping of system signals. | |
| void | mprAddTerminator(MprTerminator terminator) |
| Add a terminator callback. | |
| MprTestGroup* | mprAddTestGroup(MprTestService *ts, MprTestDef *def) |
| Add a test group to the test service. | |
| void | mprAdjustBufEnd(MprBuf *buf, ssize count) |
| Adjust the buffer end position. | |
| void | mprAdjustBufStart(MprBuf *buf, ssize count) |
| Adjust the buffer start position. | |
| void* | mprAlloc(ssize size) |
| Allocate a block of memory. | |
| void* | mprAllocMem(ssize size, int flags) |
| Allocate a block of memory. | |
| void* | mprAllocObj(Type type, MprManager manager) |
| Allocate an object of a given type. | |
| void* | mprAllocZeroed(ssize size) |
| Allocate a zeroed block of memory. | |
| MprList* | mprAppendList(MprList *list, MprList *add) |
| Append a list. | |
| char* | mprAsprintf(cchar *fmt, ...) |
| Format a string into an allocated buffer. | |
| char* | mprAsprintfv(cchar *fmt, va_list arg) |
| Allocate a buffer of sufficient length to hold the formatted string. | |
| void | mprAssertError(cchar *loc, cchar *msg) |
| Output an assertion failed message. | |
| void | mprAtomicAdd(volatile int *target, int value) |
| Atomic Add. | |
| void | mprAtomicAdd64(volatile int64 *target, int value) |
| Atomic 64 bit Add. | |
| void | mprAtomicBarrier() |
| Apply a full (read+write) memory barrier. | |
| int | mprAtomicCas(void *volatile *target, void *expected, cvoid *value) |
| Atomic Compare and Swap. | |
| void* | mprAtomicExchange(void *volatile *target, cvoid *value) |
| Exchange the target and a value. | |
| void | mprAtomicListInsert(void *volatile *head, volatile void **link, void *item) |
| Atomic list insertion. | |
| MprFile* | mprAttachFileFd(int fd, cchar *name, int omode) |
| Attach to an existing file descriptor. | |
| int | mprBackupLog(cchar *path, int count) |
| Backup a log. | |
| MprHash* | mprBlendHash(MprHash *target, MprHash *other) |
| Blend two hash tables. | |
| void | mprBreakpoint() |
| Trigger a breakpoint. | |
| void | mprClearList(MprList *list) |
| Clears the list of all items. | |
| MprBuf* | mprCloneBuf(MprBuf *orig) |
| Clone a buffer. | |
| MprHash* | mprCloneHash(MprHash *table) |
| Copy a hash table. | |
| MprList* | mprCloneList(MprList *src) |
| Clone a list and all elements. | |
| void | mprCloseCmdFd(MprCmd *cmd, int channel) |
| Close the command channel. | |
| int | mprCloseFile(MprFile *file) |
| Close a file. | |
| void | mprCloseSocket(MprSocket *sp, bool graceful) |
| Close a socket. | |
| void | mprCompactBuf(MprBuf *buf) |
| Compact the buffer contents. | |
| int | mprCompareTime(MprTime t1, MprTime t2) |
| Compare two times. | |
| void | mprConfigureSsl(struct MprSsl *ssl) |
| Configure SSL based on the parsed MprSsl configuration. | |
| int | mprConnectSocket(MprSocket *sp, cchar *hostName, int port, int flags) |
| Connect a client socket. | |
| int | mprCopyListContents(MprList *dest, MprList *src) |
| Copy list contents. | |
| int | mprCopyPath(cchar *from, cchar *to, int omode) |
| Copy a file. | |
| Mpr* | mprCreate(int argc, char **argv, int flags) |
| Create an instance of the MPR. | |
| MprBuf* | mprCreateBuf(ssize initialSize, ssize maxSize) |
| Create a new buffer. | |
| MprCache* | mprCreateCache(int options) |
| Create a new cache object. | |
| MprCmd* | mprCreateCmd(MprDispatcher *dispatcher) |
| Create a new Command object. | |
| MprCond* | mprCreateCond() |
| Create a condition lock variable. | |
| MprDispatcher* | mprCreateDispatcher(cchar *name, int enable) |
| Create a new event dispatcher. | |
| MprEvent* | mprCreateEvent(MprDispatcher *dispatcher, cchar *name, MprTime period, void *proc, void *data, int flags) |
| Create a new event. | |
| MprFileSystem* | mprCreateFileSystem(cchar *path) |
| Create and initialize the FileSystem subsystem. | |
| MprHash* | mprCreateHash(int hashSize, int flags) |
| Create a hash table. | |
| MprHash* | mprCreateHashFromWords(cchar *str) |
| Create a hash of words. | |
| MprKeyValue* | mprCreateKeyPair(cchar *key, cchar *value) |
| Create a key / value pair. | |
| MprList* | mprCreateList(int size, int flags) |
| Create a list. | |
| MprMutex* | mprCreateLock() |
| Create a Mutex lock object. | |
| void | mprCreateLogService() |
| Initialize the log service. | |
| struct Mpr* | mprCreateMemService(MprManager manager, int flags) |
| Create and initialize the Memory service. | |
| MprHash* | mprCreateMimeTypes(cchar *path) |
| Create the mime types. | |
| MprModule* | mprCreateModule(cchar *name, cchar *path, cchar *entry, void *data) |
| Create a module. | |
| MprModuleService* | mprCreateModuleService() |
| Create and initialize the module service. | |
| int | mprCreateOsService() |
| Create and initialze the O/S dependent subsystem. | |
| MprRomFileSystem* | mprCreateRomFileSystem(cchar *path) |
| Create and initialize the ROM FileSystem. | |
| MprSocket* | mprCreateSocket(struct MprSsl *ssl) |
| Create a socket. | |
| MprSpin* | mprCreateSpinLock() |
| Create a spin lock lock object. | |
| struct MprSsl* | mprCreateSsl() |
| Create the SSL control structure. | |
| MprTestService* | mprCreateTestService() |
| Create the test service. | |
| MprThread* | mprCreateThread(cchar *name, void *proc, void *data, ssize stackSize) |
| Create a new thread. | |
| int | mprCreateTimeService() |
| Mpr time structure. | |
| MprEvent* | mprCreateTimerEvent(MprDispatcher *dispatcher, cchar *name, MprTime period, void *proc, void *data, int flags) |
| Create a timer event. | |
| MprWaitHandler* | mprCreateWaitHandler(int fd, int mask, MprDispatcher *dispatcher, void *proc, void *data, int flags) |
| Create a wait handler. | |
| char* | mprDecode64(cchar *str) |
| Deocde buffer using base-46 encoding. | |
| void | mprDecodeLocalTime(struct tm *timep, MprTime time) |
| Decode a time value into a tokenized local time value. | |
| void | mprDecodeUniversalTime(struct tm *timep, MprTime time) |
| Decode a time value into a tokenized UTC time structure. | |
| void | mprDedicateWorker(MprWorker *worker) |
| Dedicate a worker thread to a current real thread. | |
| int | mprDeletePath(cchar *path) |
| Delete a file. | |
| MprObj* | mprDeserialize(cchar *str) |
| Deserialize a JSON string into an object tree. | |
| MprObj* | mprDeserializeCustom(cchar *str, MprJsonCallback callback, void *data) |
| Custom deserialization from a JSON string into an object tree. | |
| void | mprDestroy(int how) |
| Destroy the MPR. | |
| void* | mprDestroyCache(MprCache *cache) |
| Destroy a new cache object. | |
| void | mprDestroyCmd(MprCmd *cmd) |
| Destroy the command. | |
| void | mprDestroyDispatcher(MprDispatcher *dispatcher) |
| Destroy a dispatcher. | |
| void | mprDestroyMemService() |
| Destroy the memory service. | |
| void | mprDisableCmdEvents(MprCmd *cmd, int channel) |
| Disable command I/O events. | |
| void | mprDisableFileBuffering(MprFile *file) |
| Disable file buffering. | |
| void | mprDisconnectCmd(MprCmd *cmd) |
| Disconnect a command its underlying I/O channels. | |
| void | mprDisconnectSocket(MprSocket *sp) |
| Disconnect a socket by closing its underlying file descriptor. | |
| char* | mprDtoa(double value, int ndigits, int mode, int flags) |
| Convert a double to ascii. | |
| char* | mprEmptyString() |
| Reference to a permanent preallocated empty string. | |
| void | mprEnableCmdEvents(MprCmd *cmd, int channel) |
| Enable command I/O events. | |
| void | mprEnableContinuousEvent(MprEvent *event, int enable) |
| Enable or disable an event being continous. | |
| void | mprEnableDispatcher(MprDispatcher *dispatcher) |
| Enable a dispatcher to service events. | |
| int | mprEnableFileBuffering(MprFile *file, ssize size, ssize maxSize) |
| Enable file buffering. | |
| bool | mprEnableGC(bool on) |
| Enable or disable the garbage collector. | |
| void | mprEnableSocketEvents(MprSocket *sp, int mask) |
| Enable socket events for a socket callback. | |
| char* | mprEncode64(cchar *str) |
| Encode buffer using base-46 encoding. | |
| void | mprError(cchar *fmt, ...) |
| Log an error message. | |
| char* | mprEscapeCmd(cchar *cmd, int escChar) |
| Encode a string escaping typical command (shell) characters. | |
| char* | mprEscapeHtml(cchar *html) |
| Encode a string by escaping typical HTML characters. | |
| int | mprExpireCache(MprCache *cache, cchar *key, MprTime expires) |
| Set the expiry date for a cache item. | |
| void | mprFatalError(cchar *fmt, ...) |
| Log a fatal error message and exit. | |
| void | mprFinalizeCmd(MprCmd *cmd) |
| Finalize the writing of data to the command process. | |
| void | mprFlushBuf(MprBuf *buf) |
| Flush the buffer contents. | |
| int | mprFlushFile(MprFile *file) |
| Flush any buffered write data. | |
| ssize | mprFlushSocket(MprSocket *sp) |
| Flush a socket. | |
| char* | mprFormatLocalTime(cchar *fmt, MprTime time) |
| Convert a time value to local time and format as a string. | |
| char* | mprFormatTm(cchar *fmt, struct tm *timep) |
| Format a time value as a local time. | |
| char* | mprFormatUniversalTime(cchar *fmt, MprTime time) |
| Convert a time value to universal time and format as a string. | |
| ssize | mprFprintf(struct MprFile *file, cchar *fmt, ...) |
| Print a formatted message to a file descriptor. | |
| char* | mprGetAbsPath(cchar *path) |
| Convert a path to an absolute path. | |
| char* | mprGetAppDir() |
| Get the application directory. | |
| cchar* | mprGetAppName() |
| Get the application name defined via mprSetAppName. | |
| char* | mprGetAppPath() |
| Get the application executable path. | |
| cchar* | mprGetAppTitle() |
| Get the application title string. | |
| cchar* | mprGetAppVersion() |
| Get the application version string. | |
| int | mprGetAvailableWorkers() |
| Get the count of available worker threads Return the count of free threads in the worker thread pool. | |
| ssize | mprGetBlockFromBuf(MprBuf *buf, char *blk, ssize count) |
| Get a block of data from the buffer. | |
| ssize | mprGetBlockSize(cvoid *ptr) |
| Get the allocated size of a memory block. | |
| char* | mprGetBuf(MprBuf *buf) |
| Get the origin of the buffer content storage. | |
| char* | mprGetBufEnd(MprBuf *buf) |
| Get a reference to the end of the buffer contents. | |
| ssize | mprGetBufLength(MprBuf *buf) |
| Get the buffer content length. | |
| MprBufProc | mprGetBufRefillProc(MprBuf *buf) |
| Get the buffer refill procedure. | |
| ssize | mprGetBufSize(MprBuf *buf) |
| Get the current size of the buffer content storage. | |
| ssize | mprGetBufSpace(MprBuf *buf) |
| Get the space available to store content. | |
| char* | mprGetBufStart(MprBuf *buf) |
| Get the start of the buffer contents. | |
| int | mprGetCharFromBuf(MprBuf *buf) |
| Get a character from the buffer. | |
| MprBuf* | mprGetCmdBuf(MprCmd *cmd, int channel) |
| Get the underlying buffer for a channel. | |
| int | mprGetCmdExitStatus(MprCmd *cmd) |
| Get the command exit status. | |
| int | mprGetCmdFd(MprCmd *cmd, int channel) |
| Get the underlying file descriptor for an I/O channel. | |
| bool | mprGetCmdlineLogging() |
| Get if command line logging is being used. | |
| MprOsThread | mprGetCurrentOsThread() |
| Get the O/S thread. | |
| char* | mprGetCurrentPath() |
| Return the current working directory. | |
| MprThread* | mprGetCurrentThread() |
| Get the currently executing thread. | |
| cchar* | mprGetCurrentThreadName() |
| Return the name of the current thread. | |
| char* | mprGetDate(char *fmt) |
| Get a string representation of the current date/time. | |
| bool | mprGetDebugMode() |
| Get the debug mode. | |
| MprDispatcher* | mprGetDispatcher() |
| Get the MPR primary dispatcher. | |
| cchar* | mprGetDomainName() |
| Get the application domain name string. | |
| MprTime | mprGetElapsedTime(MprTime mark) |
| Get the elapsed time since a time mark. | |
| int | mprGetEndian() |
| Return the endian byte ordering for the application. | |
| int | mprGetError() |
| Return the error code for the most recent system or library operation. | |
| int | mprGetFileChar(MprFile *file) |
| Read a character from the file. | |
| int | mprGetFileFd(MprFile *file) |
| Get the file descriptor for a file. | |
| MprOff | mprGetFilePosition(MprFile *file) |
| Return the current file position. | |
| MprOff | mprGetFileSize(MprFile *file) |
| Get the size of the file. | |
| void* | mprGetFirstItem(MprList *list) |
| Get the first item in the list. | |
| MprKey* | mprGetFirstKey(MprHash *table) |
| Return the first symbol in a symbol entry. | |
| cchar* | mprGetFirstPathSeparator(cchar *path) |
| Get the first path separator in a path. | |
| int | mprGetHashLength(MprHash *table) |
| Return the count of symbols in a symbol entry. | |
| cchar* | mprGetHostName() |
| Get the application host name string. | |
| HWND | mprGetHwnd() |
| Get the Windows window handle. | |
| long | mprGetInst() |
| Get the windows application instance. | |
| cchar* | mprGetIpAddr() |
| Get the application IP address string. | |
| void* | mprGetItem(MprList *list, int index) |
| Get an list item. | |
| void* | mprGetLastItem(MprList *list) |
| Get the last item in the list. | |
| int | mprGetListCapacity(MprList *list) |
| Get the current capacity of the list. | |
| int | mprGetListLength(MprList *list) |
| Get the number of items in the list. | |
| struct MprFile* | mprGetLogFile() |
| Get the log file object. | |
| MprLogHandler | mprGetLogHandler() |
| Get the current MPR debug log handler. | |
| int | mprGetLogLevel() |
| Get the current logging level. | |
| char* | mprGetMD5(cchar *s) |
| Get an MD5 checksum. | |
| char* | mprGetMD5WithPrefix(cchar *buf, ssize len, cchar *prefix) |
| Get an MD5 checksum with optional prefix string and buffer length. | |
| int | mprGetMaxWorkers() |
| Get the maximum count of worker pool threads Get the maximum limit of worker pool threads. | |
| ssize | mprGetMem() |
| Return the amount of memory currently used by the application. | |
| MprMemStats* | mprGetMemStats() |
| Return the current allocation memory statistics block. | |
| cchar* | mprGetMimeProgram(MprHash *table, cchar *mimeType) |
| Get the mime type program for a given mimeType. | |
| cchar* | mprGetModuleSearchPath() |
| Get the module search path. | |
| Mpr* | mprGetMpr() |
| Return the MPR control instance. | |
| char* | mprGetNativePath(cchar *path) |
| Get a path formatted according to the native O/S conventions. | |
| void* | mprGetNextItem(MprList *list, int *lastIndex) |
| Get the next item in the list. | |
| MprKey* | mprGetNextKey(MprHash *table, MprKey *last) |
| Return the next symbol in a symbol entry. | |
| int | mprGetOsError() |
| Return the O/S error code. | |
| int | mprGetPageSize() |
| Get the current O/S virtual page size. | |
| char* | mprGetPathBase(cchar *path) |
| Get the base portion of a path. | |
| char* | mprGetPathDir(cchar *path) |
| Get the directory portion of a path. | |
| char* | mprGetPathExt(cchar *path) |
| Get the file extension portion of a path. | |
| MprList* | mprGetPathFiles(cchar *dir, bool enumDirs) |
| Create a directory list of files. | |
| int | mprGetPathInfo(cchar *path, MprPath *info) |
| Return information about a file represented by a path. | |
| char* | mprGetPathLink(cchar *path) |
| Get the target of a symbolic link. | |
| cchar* | mprGetPathNewline(cchar *path) |
| Get the file newline character string for a given path. | |
| char* | mprGetPathParent(cchar *path) |
| Get the parent directory of a path. | |
| cchar* | mprGetPathSeparators(cchar *path) |
| Get the path directory separator. | |
| MprList* | mprGetPathTree(cchar *path, int flags) |
| Find files below a path directory. | |
| char* | mprGetPortablePath(cchar *path) |
| Get a portable path. | |
| void* | mprGetPrevItem(MprList *list, int *lastIndex) |
| Get the previous item in the list. | |
| int | mprGetRandomBytes(char *buf, ssize size, bool block) |
| Get some random data. | |
| char* | mprGetRelPath(cchar *path) |
| Get a relative path. | |
| MprTime | mprGetRemainingTime(MprTime mark, MprTime timeout) |
| Return the time remaining until a timeout has elapsed. | |
| cchar* | mprGetServerName() |
| Get the application server name string. | |
| bool | mprGetSocketBlockingMode(MprSocket *sp) |
| Get the socket blocking mode. | |
| int | mprGetSocketError(MprSocket *sp) |
| Get a socket error code. | |
| int | mprGetSocketFd(MprSocket *sp) |
| Get the socket file descriptor. | |
| int | mprGetSocketInfo(cchar *ip, int port, int *family, int *protocol, struct sockaddr **addr, socklen_t *addrlen) |
| Get the socket for an IP:Port address. | |
| int | mprGetSocketPort(MprSocket *sp) |
| Get the port used by a socket. | |
| MprFile* | mprGetStderr() |
| Return a file object for the Stderr I/O channel. | |
| MprFile* | mprGetStdin() |
| Return a file object for the Stdin I/O channel. | |
| MprFile* | mprGetStdout() |
| Return a file object for the Stdout I/O channel. | |
| char* | mprGetTempPath(cchar *tmpDir) |
| Make a temporary file. | |
| cchar* | mprGetThreadName(MprThread *thread) |
| Get the thread name. | |
| int | mprGetThreadPriority(MprThread *thread) |
| Get the thread priroity. | |
| uint64 | mprGetTicks() |
| Get the CPU tick count. | |
| MprTime | mprGetTime() |
| Get the system time. | |
| int | mprGetTimeZoneOffset(MprTime when) |
| Get the current timezone offset for a given time. | |
| char* | mprGetWinPath(cchar *path) |
| Convert a path to an absolute windows path. | |
| void | mprGetWorkerServiceStats(MprWorkerService *ws, MprWorkerStats *stats) |
| Get the Worker service statistics. | |
| void | mprGlobalLock() |
| Globally lock the application. | |
| void | mprGlobalUnlock() |
| Unlock the global mutex. | |
| int | mprGrowBuf(MprBuf *buf, ssize count) |
| Grow the buffer. | |
| bool | mprHasMemError() |
| Determine if the MPR has encountered memory allocation errors. | |
| bool | mprHasSecureSockets() |
| Determine if SSL is available. | |
| void | mprHold(void *ptr) |
| Hold a memory block. | |
| int64 | mprIncCache(MprCache *cache, cchar *key, int64 amount) |
| Increment a numeric cache item. | |
| void | mprInitList(MprList *list) |
| Initialize a list structure. | |
| MprMutex* | mprInitLock(MprMutex *mutex) |
| Initialize a statically allocated Mutex lock object. | |
| MprSpin* | mprInitSpinLock(MprSpin *lock) |
| Initialize a statically allocated spinlock object. | |
| int | mprInsertCharToBuf(MprBuf *buf, int c) |
| Insert a character into the buffer. | |
| int | mprInsertItemAtPos(MprList *list, int index, cvoid *item) |
| Insert an item into a list at a specific position. | |
| int | mprIsCmdComplete(MprCmd *cmd) |
| Test if a command is complete. | |
| bool | mprIsCmdRunning(MprCmd *cmd) |
| Test if the command is still running. | |
| bool | mprIsExiting() |
| Determine if the MPR is exiting. | |
| bool | mprIsFinished() |
| Determine if the MPR has finished. | |
| bool | mprIsIdle() |
| Determine if the App is idle. | |
| int | mprIsInfinite(double value) |
| Test if a double value is infinte. | |
| int | mprIsNan(double value) |
| Test if a double value is not-a-number. | |
| bool | mprIsPathAbs(cchar *path) |
| Determine if a path is absolute. | |
| bool | mprIsPathRel(cchar *path) |
| Determine if a path is relative. | |
| bool | mprIsPathSeparator(cchar *path, cchar c) |
| Test if a character is a path separarator. | |
| bool | mprIsSocketEof(MprSocket *sp) |
| Test if the other end of the socket has been closed. | |
| bool | mprIsSocketSecure(MprSocket *sp) |
| Determine if the socket is secure. | |
| bool | mprIsStopping() |
| Test if the application is stopping. | |
| bool | mprIsStoppingCore() |
| Test if the application is stopping and core services are being terminated. | |
| int | mprIsValid(cvoid *ptr) |
| Test is a pointer is a valid memory context. | |
| int | mprIsZero(double value) |
| Test if a double value is zero. | |
| char* | mprJoinPath(cchar *base, cchar *path) |
| Join paths. | |
| char* | mprJoinPathExt(cchar *path, cchar *ext) |
| Join an extension to a path. | |
| void | mprJsonParseError(MprJson *jp, cchar *fmt, ...) |
| Signal a parse error in the JSON input stream. | |
| int | mprListenOnSocket(MprSocket *sp, cchar *ip, int port, int flags) |
| Listen on a server socket for incoming connections. | |
| int | mprLoadModule(MprModule *mp) |
| Load a module. | |
| int | mprLoadNativeModule(MprModule *mp) |
| Load a native module. | |
| MprModule* | mprLoadSsl(bool lazy) |
| Load the SSL module. | |
| void | mprLock(MprMutex *lock) |
| Lock access. | |
| void | mprLog(int level, cchar *fmt, ...) |
| Write a message to the diagnostic log file. | |
| int | mprLookAtLastCharInBuf(MprBuf *buf) |
| Peek at the last character in the buffer. | |
| int | mprLookAtNextCharInBuf(MprBuf *buf) |
| Peek at the next character in the buffer. | |
| MprFileSystem* | mprLookupFileSystem(cchar *path) |
| Lookup a file system. | |
| int | mprLookupItem(MprList *list, cvoid *item) |
| Find an item and return its index. | |
| void* | mprLookupKey(MprHash *table, cvoid *key) |
| Lookup a symbol in the hash table. | |
| MprKey* | mprLookupKeyEntry(MprHash *table, cvoid *key) |
| Lookup a symbol in the hash table and return the hash entry. | |
| cchar* | mprLookupMime(MprHash *table, cchar *ext) |
| Get the mime type for an extension. | |
| MprModule* | mprLookupModule(cchar *name) |
| Lookup a module. | |
| void* | mprLookupModuleData(cchar *name) |
| Lookup a module and return the module data. | |
| int | mprMakeArgv(cchar *command, char ***argv, int flags) |
| Make a argv style array of command arguments. | |
| int | mprMakeDir(cchar *path, int perms, int owner, int group, bool makeMissing) |
| Make a directory. | |
| int | mprMakeLink(cchar *path, cchar *target, bool hard) |
| Make a link. | |
| void | mprMapSeparators(char *path, int separator) |
| Map the separators in a path. | |
| void | mprMark(void *ptr) |
| Mark a memory block as in-use. | |
| void | mprMarkBlock(cvoid *ptr) |
| Mark a block as "in-use" for the Garbage Collector. | |
| int | mprMemcmp(cvoid *b1, ssize b1Len, cvoid *b2, ssize b2Len) |
| Compare two byte strings. | |
| ssize | mprMemcpy(void *dest, ssize destMax, cvoid *src, ssize nbytes) |
| Safe copy for a block of data. | |
| void* | mprMemdup(cvoid *ptr, ssize size) |
| Duplicate a block of memory. | |
| void | mprMemoryError(cchar *fmt, ...) |
| Log a memory error message. | |
| void | mprNap(MprTime msec) |
| Nap for a while. | |
| char* | mprNormalizePath(cchar *path) |
| Normalize a path. | |
| MprFile* | mprOpenFile(cchar *filename, int omode, int perms) |
| Open a file. | |
| int | mprParseSocketAddress(cchar *ipSpec, char **ip, int *port, int defaultPort) |
| Parse an socket address IP address. | |
| int | mprParseTestArgs(MprTestService *ts, int argc, char **argv, MprTestParser extraParser) |
| Parse test command arguments. | |
| bool | mprPathExists(cchar *path, int omode) |
| Determine if a file exists for a path name and can be accessed. | |
| int | mprPeekFileChar(MprFile *file) |
| Non-destructively read a character from the file. | |
| void | mprPollCmd(MprCmd *cmd, MprTime timeout) |
| Poll for I/O on the command pipes. | |
| void* | mprPopItem(MprList *list) |
| Pop an item. | |
| void | mprPrintMem(cchar *msg, int detail) |
| Print a memory usage report to stdout. | |
| ssize | mprPrintf(cchar *fmt, ...) |
| Formatted print. | |
| ssize | mprPrintfError(cchar *fmt, ...) |
| Print a formatted message to the standard error channel. | |
| void | mprPruneCache(MprCache *cache) |
| Prune the cache. | |
| int | mprPushItem(MprList *list, cvoid *item) |
| Push an item onto the list. | |
| ssize | mprPutBlockToBuf(MprBuf *buf, cchar *ptr, ssize size) |
| Put a block to the buffer. | |
| int | mprPutCharToBuf(MprBuf *buf, int c) |
| Put a character to the buffer. | |
| int | mprPutCharToWideBuf(MprBuf *buf, int c) |
| Put a wide character to the buffer. | |
| ssize | mprPutFileChar(MprFile *file, int c) |
| Write a character to the file. | |
| ssize | mprPutFileString(MprFile *file, cchar *str) |
| Write a string to the file. | |
| ssize | mprPutFmtToBuf(MprBuf *buf, cchar *fmt, ...) |
| Put a formatted string to the buffer. | |
| int | mprPutFmtToWideBuf(MprBuf *buf, cchar *fmt, ...) |
| Put a formatted wide string to the buffer. | |
| ssize | mprPutIntToBuf(MprBuf *buf, int64 i) |
| Put an integer to the buffer. | |
| ssize | mprPutPadToBuf(MprBuf *buf, int c, ssize count) |
| Put padding characters to the buffer. | |
| ssize | mprPutStringToBuf(MprBuf *buf, cchar *str) |
| Put a string to the buffer. | |
| int | mprPutStringToWideBuf(MprBuf *buf, cchar *str) |
| Put a wide string to the buffer. | |
| ssize | mprPutSubStringToBuf(MprBuf *buf, cchar *str, ssize count) |
| Put a substring to the buffer. | |
| void | mprQueueIOEvent(MprWaitHandler *wp) |
| Queue an IO event for dispatch on the wait handler dispatcher. | |
| int | mprRandom() |
| Return a random number. | |
| void | mprRawLog(int level, cchar *fmt, ...) |
| Write a raw log message to the diagnostic log file. | |
| char* | mprReadCache(MprCache *cache, cchar *key, MprTime *modified, int64 *version) |
| Read an item from the cache. | |
| ssize | mprReadCmd(MprCmd *cmd, int channel, char *buf, ssize bufsize) |
| Make the I/O channels to send and receive data to and from the command. | |
| ssize | mprReadFile(MprFile *file, void *buf, ssize size) |
| Read data from a file. | |
| char* | mprReadLine(MprFile *file, ssize size, ssize *len) |
| Read a line from the file. | |
| char* | mprReadRegistry(cchar *key, cchar *name) |
| Read a key from the Windows registry. | |
| ssize | mprReadSocket(MprSocket *sp, void *buf, ssize size) |
| Read from a socket. | |
| void* | mprRealloc(void *ptr, ssize size) |
| Reallocate a block. | |
| int | mprReapCmd(MprCmd *cmd, MprTime timeout) |
| Reap the command. | |
| void | mprRecallWaitHandler(MprWaitHandler *wp) |
| Recall a wait handler. | |
| void | mprRecallWaitHandlerByFd(int fd) |
| Recall a wait handler by fd. | |
| int | mprRefillBuf(MprBuf *buf) |
| Refill the buffer with data. | |
| void | mprRelayEvent(MprDispatcher *dispatcher, void *proc, void *data, MprEvent *event) |
| Relay an event to a dispatcher. | |
| void | mprRelease(void *ptr) |
| Release a memory block. | |
| void | mprReleaseWorker(MprWorker *worker) |
| Release a worker thread. | |
| bool | mprRemoveCache(MprCache *cache, cchar *key) |
| Remove items from the cache. | |
| void | mprRemoveEvent(MprEvent *event) |
| Remove an event. | |
| int | mprRemoveItem(MprList *list, cvoid *item) |
| Remove an item from the list. | |
| int | mprRemoveItemAtPos(MprList *list, int index) |
| Remove an item from the list. | |
| int | mprRemoveKey(MprHash *table, cvoid *key) |
| Remove a symbol entry from the hash table. | |
| int | mprRemoveLastItem(MprList *list) |
| Remove the last item from the list. | |
| int | mprRemoveRangeOfItems(MprList *list, int start, int end) |
| Remove a range of items from the list. | |
| void | mprRemoveRoot(void *ptr) |
| remove a memory block as a root for garbage collection. | |
| void | mprRemoveSocketHandler(MprSocket *sp) |
| Remove a socket wait handler. | |
| void | mprRemoveWaitHandler(MprWaitHandler *wp) |
| Disconnect a wait handler from its underlying file descriptor. | |
| char* | mprReplacePathExt(cchar *dir, cchar *ext) |
| Replace an extension to a path. | |
| void | mprReportTestResults(MprTestService *ts) |
| Report the test results. | |
| void | mprRequestGC(int flags) |
| Collect garbage. | |
| void | mprRescheduleEvent(MprEvent *event, MprTime period) |
| Reschedule an event. | |
| void | mprResetBufIfEmpty(MprBuf *buf) |
| Reset the buffer. | |
| void | mprResetCond(MprCond *cond) |
| Reset a condition variable. | |
| void | mprResetMemError() |
| Reset the memory allocation error flag. | |
| void | mprResetTestGroup(MprTestGroup *gp) |
| Reset a test group. | |
| void | mprResetYield() |
| Reset a sticky yield. | |
| char* | mprResolvePath(cchar *base, cchar *path) |
| Resolve paths. | |
| void | mprRestart() |
| Restart the application. | |
| void | mprRestartContinuousEvent(MprEvent *event) |
| Restart an event. | |
| int | mprRunCmd(MprCmd *cmd, cchar *command, char **out, char **err, MprTime timeout, int flags) |
| Run a command using a string command line. | |
| int | mprRunCmdV(MprCmd *cmd, int argc, char **argv, char **out, char **err, MprTime timeout, int flags) |
| Run a command using an argv[] array of arguments. | |
| int | mprRunTests(MprTestService *ts) |
| Run the define unit tests. | |
| int | mprSamePath(cchar *path1, cchar *path2) |
| Compare two paths if they are the same. | |
| int | mprSamePathCount(cchar *path1, cchar *path2, ssize len) |
| Compare two paths if they are the same for a given length. | |
| char* | mprSearchForModule(cchar *module) |
| Search for a module on the current module path. | |
| char* | mprSearchPath(cchar *path, int flags, cchar *search, ...) |
| Search for a path. | |
| MprOff | mprSeekFile(MprFile *file, int seekType, MprOff distance) |
| Seek the I/O pointer to a new location in the file. | |
| cchar* | mprSerialize(MprObj *obj, int flags) |
| Serialize a JSON object tree into a string. | |
| int | mprServiceEvents(MprTime delay, int flags) |
| Service events. | |
| bool | mprServicesAreIdle() |
| Determine if the MPR services. | |
| int | mprSetAppName(cchar *name, cchar *title, cchar *version) |
| Set the application name, title and version. | |
| void | mprSetBufMax(MprBuf *buf, ssize maxSize) |
| Set the maximum buffer size. | |
| void | mprSetBufRefillProc(MprBuf *buf, MprBufProc fn, void *arg) |
| Set the buffer refill procedure. | |
| int | mprSetBufSize(MprBuf *buf, ssize size, ssize maxSize) |
| Set the buffer size. | |
| void | mprSetCacheLimits(MprCache *cache, int64 keys, int64 lifespan, int64 memory, int resolution) |
| Set the cache resource limits. | |
| void | mprSetCmdCallback(MprCmd *cmd, MprCmdProc callback, void *data) |
| Define a callback to be invoked to receive response data from the command. | |
| void | mprSetCmdDefaultEnv(MprCmd *cmd, cchar **env) |
| Set the default environment to use for commands. | |
| void | mprSetCmdDir(MprCmd *cmd, cchar *dir) |
| Set the home directory for the command. | |
| void | mprSetCmdEnv(MprCmd *cmd, cchar **env) |
| Set the command environment. | |
| void | mprSetCmdSearchPath(MprCmd *cmd, cchar *search) |
| Set the default command search path. | |
| bool | mprSetCmdlineLogging(bool on) |
| Set if command line logging was requested. | |
| void | mprSetCurrentThreadPriority(int priority) |
| Set the thread priroity for the current thread. | |
| void | mprSetDebugMode(bool on) |
| Turn on debug mode. | |
| void | mprSetDomainName(cchar *s) |
| Set the application domain name string. | |
| void | mprSetExitStrategy(int strategy) |
| Set the exit strategy for when the application terminates. | |
| void | mprSetHostName(cchar *s) |
| Set the application host name string. | |
| void | mprSetHwnd(HWND handle) |
| Set the MPR windows handle. | |
| MprIdleCallback | mprSetIdleCallback(MprIdleCallback idleCallback) |
| Define a new idle callback to be invoked by mprIsIdle() | |
| void | mprSetInst(long inst) |
| Set the windows application instance. | |
| void | mprSetIpAddr(cchar *ip) |
| Sete the application IP address string. | |
| void* | mprSetItem(MprList *list, int index, cvoid *item) |
| Set a list item. | |
| int | mprSetListLimits(MprList *list, int initialSize, int maxSize) |
| Define the list size limits. | |
| void | mprSetLogBackup(ssize logSize, int backupCount, int flags) |
| Set the log rotation parameters. | |
| void | mprSetLogFile(struct MprFile *file) |
| Set a file to be used for logging. | |
| void | mprSetLogHandler(MprLogHandler handler) |
| Set an MPR debug log handler. | |
| void | mprSetLogLevel(int level) |
| Set the current logging level. | |
| void* | mprSetManager(void *ptr, void *manager) |
| Update the manager for a block of memory. | |
| int | mprSetMaxSocketAccept(int max) |
| Set the maximum number of accepted client connections that are permissable. | |
| void | mprSetMaxWorkers(int count) |
| Set the maximum count of worker threads Set the maximum number of worker pool threads for the MPR. | |
| void | mprSetMemError() |
| Set an memory allocation error condition on a memory context. | |
| void | mprSetMemLimits(ssize redline, ssize maxMemory) |
| Configure the application memory limits. | |
| void | mprSetMemNotifier(MprMemNotifier cback) |
| Define a memory notifier. | |
| void | mprSetMemPolicy(int policy) |
| Set the memory allocation policy for when allocations fail. | |
| int | mprSetMimeProgram(MprHash *table, cchar *mimeType, cchar *program) |
| Set the mime type program. | |
| void | mprSetMinWorkers(int count) |
| Set the minimum count of worker threads Set the count of threads the worker pool will have. | |
| void | mprSetModuleFinalizer(MprModule *module, MprModuleProc stop) |
| Define a module finalizer that will be called before a module is stopped. | |
| void | mprSetModuleSearchPath(char *searchPath) |
| Set the module search path. | |
| void | mprSetModuleTimeout(MprModule *module, MprTime timeout) |
| Set a module timeout. | |
| void | mprSetPathNewline(cchar *path, cchar *newline) |
| Set the file system new line character string. | |
| void | mprSetPathSeparators(cchar *path, cchar *separators) |
| Set the file system path separators. | |
| int | mprSetRomFileSystem(MprRomInode *inodeList) |
| Set the ROM file system data. | |
| void | mprSetSecureProvider(MprSocketProvider *provider) |
| Set the provider to be the default secure socket provider. | |
| void | mprSetServerName(cchar *s) |
| Set the application server name string. | |
| int | mprSetSocketBlockingMode(MprSocket *sp, bool on) |
| Set the socket blocking mode. | |
| void | mprSetSocketEof(MprSocket *sp, bool eof) |
| Set an EOF condition on the socket. | |
| void | mprSetSocketMessage(int message) |
| Set the socket message number. | |
| int | mprSetSocketNoDelay(MprSocket *sp, bool on) |
| Set the socket delay mode. | |
| void | mprSetSslCaFile(struct MprSsl *ssl, cchar *caFile) |
| Set the client certificate file to use for SSL. | |
| void | mprSetSslCaPath(struct MprSsl *ssl, cchar *caPath) |
| Set the path for the client certificate directory. | |
| void | mprSetSslCertFile(struct MprSsl *ssl, cchar *certFile) |
| Set certificate to use for SSL. | |
| void | mprSetSslCiphers(struct MprSsl *ssl, cchar *ciphers) |
| Set the ciphers to use for SSL. | |
| void | mprSetSslKeyFile(struct MprSsl *ssl, cchar *keyFile) |
| Set the key file to use for SSL. | |
| void | mprSetSslProtocols(struct MprSsl *ssl, int protocols) |
| Set the SSL protocol to use. | |
| void | mprSetThreadPriority(MprThread *thread, int priority) |
| Set the thread priroity. | |
| void | mprSetWorkerStackSize(int size) |
| Set the default worker stack size. | |
| bool | mprShouldAbortRequests() |
| Test if requests should be aborted. | |
| bool | mprShouldDenyNewRequests() |
| Test if new requests should be denied. | |
| void | mprSignalCond(MprCond *cond) |
| Signal a condition lock variable. | |
| void | mprSignalDispatcher(MprDispatcher *dispatcher) |
| Signal the dispatcher to wakeup and re-examine its queues. | |
| void | mprSignalMultiCond(MprCond *cond) |
| Signal a condition lock variable for use with multiple waiters. | |
| void | mprSignalTest2Complete(MprTestGroup *gp) |
| Signal a test is complete. | |
| void | mprSignalTestComplete(MprTestGroup *gp) |
| Signal a test is complete. | |
| void | mprSleep(MprTime msec) |
| Sleep for a while. | |
| bool | mprSocketHasPendingData(MprSocket *sp) |
| Test if the socket has buffered read data. | |
| void | mprSortList(MprList *list, void *compare) |
| Sort a list. | |
| void | mprSpinLock(MprSpin *lock) |
| Lock a spinlock. | |
| void | mprSpinUnlock(MprSpin *lock) |
| Unlock a spinlock. | |
| char* | mprSprintf(char *buf, ssize maxSize, cchar *fmt, ...) |
| Format a string into a statically allocated buffer. | |
| char* | mprSprintfv(char *buf, ssize maxSize, cchar *fmt, va_list args) |
| Format a string into a statically allocated buffer. | |
| int | mprStart() |
| Start the Mpr services. | |
| int | mprStartCmd(MprCmd *cmd, int argc, char **argv, char **envp, int flags) |
| Start the command. | |
| int | mprStartEventsThread() |
| Start an thread dedicated to servicing events. | |
| int | mprStartLogging(cchar *logSpec, int showConfig) |
| Start logging. | |
| int | mprStartModule(MprModule *mp) |
| Start a module. | |
| int | mprStartModuleService() |
| Start the module service. | |
| int | mprStartOsService() |
| Start the O/S dependent subsystem. | |
| int | mprStartThread(MprThread *thread) |
| Start a thread. | |
| int | mprStartWorker(MprWorkerProc proc, void *data) |
| Start a worker thread. | |
| void | mprStaticError(cchar *fmt, ...) |
| Display an error message to the console without allocating any memory. | |
| int | mprStopCmd(MprCmd *cmd, int signal) |
| Stop the command. | |
| void | mprStopContinuousEvent(MprEvent *event) |
| Stop an event. | |
| void | mprStopModule(MprModule *mp) |
| Stop a module. | |
| void | mprStopModuleService() |
| Stop the module service. | |
| void | mprStopOsService() |
| Stop the O/S dependent subsystem. | |
| void | mprTerminate(int flags, int status) |
| Terminate the application. | |
| char* | mprTransformPath(cchar *path, int flags) |
| Transform a path. | |
| char* | mprTrimPathExt(cchar *path) |
| Trim an extension from a path. | |
| int | mprTruncateFile(cchar *path, MprOff size) |
| Truncate a file. | |
| bool | mprTryLock(MprMutex *lock) |
| Attempt to lock access. | |
| bool | mprTrySpinLock(MprSpin *lock) |
| Attempt to lock access on a spin lock. | |
| void | mprUnloadModule(MprModule *mp) |
| Unload a module. | |
| int | mprUnloadNativeModule(MprModule *mp) |
| Unload a native module. | |
| void | mprUnlock(MprMutex *lock) |
| Unlock a mutex. | |
| void | mprUpdateWaitHandler(MprWaitHandler *wp, bool wakeup) |
| Apply wait handler updates. | |
| char* | mprUriDecode(cchar *uri) |
| Decode a URI string by de-scaping URI characters. | |
| char* | mprUriEncode(cchar *uri, int map) |
| Encode a string by escaping URI characters. | |
| void | mprUserError(cchar *fmt, ...) |
| Display an error message to the user. | |
| int | mprUsingDefaultLogHandler() |
| Determine if the app is using the default MPR log handler. | |
| void | mprValidateBlock(void *ptr) |
| Validate a memory block and issue asserts if the memory block is not valid. | |
| void | mprVerifyMem() |
| Verify all memory. | |
| void | mprVerifySslClients(struct MprSsl *ssl, bool on) |
| Control the verification of SSL clients. | |
| void* | mprVirtAlloc(ssize size, int mode) |
| Memory virtual memory into the applications address space. | |
| void | mprVirtFree(void *ptr, ssize size) |
| Free (unpin) a mapped section of virtual memory. | |
| int | mprWaitForCmd(MprCmd *cmd, MprTime timeout) |
| Wait for the command to complete. | |
| int | mprWaitForCond(MprCond *cond, MprTime timeout) |
| Wait for a condition lock variable. | |
| int | mprWaitForEvent(MprDispatcher *dispatcher, MprTime timeout) |
| Wait for an event to occur on the given dispatcher. | |
| void | mprWaitForIO(MprWaitService *ws, MprTime timeout) |
| Wait for I/O. | |
| int | mprWaitForMultiCond(MprCond *cond, MprTime timeout) |
| Wait for a condition lock variable for use with multiple waiters. | |
| int | mprWaitForSingleIO(int fd, int mask, MprTime timeout) |
| Wait for I/O on a file descriptor. | |
| bool | mprWaitForTest2ToComplete(MprTestGroup *gp, MprTime timeout) |
| Wait for a test to complete. | |
| bool | mprWaitForTestToComplete(MprTestGroup *gp, MprTime timeout) |
| Wait for a test to complete. | |
| void | mprWaitOn(MprWaitHandler *wp, int desiredMask) |
| Subscribe for desired wait events. | |
| int | mprWaitTillIdle(MprTime timeout) |
| Wait until the application is idle. | |
| void | mprWarn(cchar *fmt, ...) |
| Log a warning message. | |
| ssize | mprWriteCache(MprCache *cache, cchar *key, cchar *value, MprTime modified, MprTime lifespan, int64 version, int options) |
| Write a cache item. | |
| ssize | mprWriteCmd(MprCmd *cmd, int channel, char *buf, ssize bufsize) |
| Write data to an I/O channel. | |
| ssize | mprWriteFile(MprFile *file, cvoid *buf, ssize count) |
| Write data to a file. | |
| ssize | mprWriteFileFmt(MprFile *file, cchar *fmt, ...) |
| Write formatted data to a file. | |
| ssize | mprWriteFileString(MprFile *file, cchar *str) |
| Write a string to a file. | |
| ssize | mprWritePathContents(cchar *path, cchar *buf, ssize len, int mode) |
| Create a file and write contents. | |
| int | mprWriteRegistry(cchar *key, cchar *name, cchar *value) |
| Write a key value the Windows registry. | |
| ssize | mprWriteSocket(MprSocket *sp, cvoid *buf, ssize len) |
| Write to a socket. | |
| ssize | mprWriteSocketString(MprSocket *sp, cchar *str) |
| Write to a string to a socket. | |
| ssize | mprWriteSocketVector(MprSocket *sp, MprIOVec *iovec, int count) |
| Write a vector to a socket. | |
| cchar* | mprXmlGetErrorMsg(MprXml *xp) |
| Get the XML error message if mprXmlParse fails. | |
| int | mprXmlGetLineNumber(MprXml *xp) |
| Get the source XML line number. | |
| void* | mprXmlGetParseArg(MprXml *xp) |
| Get the XML callback argument. | |
| MprXml* | mprXmlOpen(ssize initialSize, ssize maxSize) |
| Open an XML parser instance. | |
| int | mprXmlParse(MprXml *xp) |
| Run the XML parser. | |
| void | mprXmlSetInputStream(MprXml *xp, MprXmlInputStream fn, void *arg) |
| Define the XML parser input stream. | |
| void | mprXmlSetParseArg(MprXml *xp, void *parseArg) |
| Set the XML callback argument. | |
| void | mprXmlSetParserHandler(MprXml *xp, MprXmlHandler h) |
| Set the XML parser data handle. | |
| void | mprYield(int flags) |
| Yield a thread to allow garbage collection. | |
| char* | scamel(cchar *str) |
| Create a camel case version of the string. | |
| int | scasecmp(cchar *s1, cchar *s2) |
| Compare strings ignoring case. | |
| bool | scasematch(cchar *s1, cchar *s2) |
| Compare strings ignoring case. | |
| char* | schr(cchar *str, int c) |
| Find a character in a string. | |
| char* | sclone(cchar *str) |
| Clone a string. | |
| int | scmp(cchar *s1, cchar *s2) |
| Compare strings. | |
| char* | scontains(cchar *str, cchar *pattern, ssize limit) |
| Find a pattern in a string. | |
| ssize | scopy(char *dest, ssize destMax, cchar *src) |
| Copy a string. | |
| int | sends(cchar *str, cchar *suffix) |
| Test if the string ends with a given pattern. | |
| char* | sfmt(cchar *fmt, ...) |
| Format a string. | |
| char* | sfmtv(cchar *fmt, va_list args) |
| Format a string. | |
| uint | shash(cchar *str, ssize len) |
| Compute a hash code for a string. | |
| uint | shashlower(cchar *str, ssize len) |
| Compute a caseless hash code for a string. | |
| char* | sjoin(cchar *str, ...) |
| Catenate strings. | |
| char* | sjoinv(cchar *str, va_list args) |
| Catenate strings. | |
| ssize | slen(cchar *str) |
| Return the length of a string. | |
| char* | slower(cchar *str) |
| Convert a string to lower case. | |
| bool | smatch(cchar *s1, cchar *s2) |
| Compare strings. | |
| int | sncasecmp(cchar *s1, cchar *s2, ssize len) |
| Compare strings ignoring case. | |
| char* | snclone(cchar *str, ssize len) |
| Clone a substring. | |
| int | sncmp(cchar *s1, cchar *s2, ssize len) |
| Compare strings. | |
| ssize | sncopy(char *dest, ssize destMax, cchar *src, ssize len) |
| Copy characters from a string. | |
| char* | spascal(cchar *str) |
| Create a Pascal case version of the string. | |
| char* | spbrk(cchar *str, cchar *set) |
| Locate the a character in a string. | |
| char* | srchr(cchar *str, int c) |
| Find a character in a string by searching backwards. | |
| char* | srejoin(char *buf, ...) |
| Append strings to an existing string and reallocate as required. | |
| char* | srejoinv(char *buf, va_list args) |
| Append strings to an existing string and reallocate as required. | |
| ssize | sspn(cchar *str, cchar *set) |
| Find the end of a spanning prefix. | |
| bool | sstarts(cchar *str, cchar *prefix) |
| Test if the string starts with a given pattern. | |
| char* | ssub(cchar *str, ssize offset, ssize length) |
| Create a substring. | |
| char* | stemplate(cchar *str, struct MprHash *tokens) |
| Replace template tokens in a string with values from a lookup table. | |
| int64 | stoi(cchar *str) |
| Convert a string to an integer. | |
| int64 | stoiradix(cchar *str, int radix, int *err) |
| Convert a string to an integer. | |
| char* | stok(char *str, cchar *delim, char **last) |
| Tokenize a string. | |
| char* | strim(cchar *str, cchar *set, int where) |
| Trim a string. | |
| char* | supper(cchar *str) |
| Convert a string to upper case. |
| MprBufProc | Buffer refill callback function. |
| MprCond | Condition variable for single and multi-thread synchronization. |
| MprDirEntry | Directory entry description. |
| MprEventProc | Event callback function. |
| MprForkCallback | Callback function before doing a fork(). |
| MprFreeMem | Block structure when on a free list. |
| MprHash | Hash table control structure. |
| MprHashProc | Hashing function to use for the table. |
| MprHeap | Memory allocator heap. |
| MprIOVec | Vectored write array. |
| MprJsonCallback | JSON callbacks. |
| MprKeyValue | Key value pairs for use with MprList or MprKey. |
| MprListCompareProc | List comparison procedure for sorting. |
| MprLogHandler | Log handler callback type. |
| MprManager | Mpr memory block manager prototype. |
| MprMemNotifier | Memory allocation error callback. |
| MprMemStats | Memory allocator statistics. |
| MprModuleEntry | Loadable module entry point signature. |
| MprModuleProc | Module start/stop point function signature. |
| MprMutex | Multithreading lock control structure. |
| MprObj | Object container for JSON parse trees. |
| MprOff | Signed file offset data type. |
| MprRegion | Memmory regions allocated from the O/S. |
| MprRomInode | A RomInode is created for each file in the Rom file system. |
| MprSignalInfo | Per signal structure. |
| MprSignalProc | Signal callback procedure. |
| MprSignalService | Signal service control. |
| MprSocketPrebind | Callback before binding a socket. |
| MprSocketProc | Socket I/O callback procedure. |
| MprSocketProvider | Socket service provider interface. |
| MprSocketService | Mpr socket service class. |
| MprSpin | Multithreading spin lock control structure. |
| MprTestCase | Test case structure. |
| MprTestDef | Test case definition. |
| MprTestFailure | Test failure record. |
| MprTestGroup | A test group is a group of tests to cover a unit of functionality. |
| MprTestParser | Callback parser for non-standard command line arguments. |
| MprTestProc | Unit test callback procedure. |
| MprThreadLocal | Thread local data storage. |
| MprThreadProc | Thread main procedure. |
| MprThreadService | Thread service. |
| MprWaitService | Wait Service. |
| MprWorkerProc | Worker thread callback signature. |
| MprWorkerService | Worker Thread Service. |
| MprWorkerStats | Statistics for Workers. |
| MprXmlHandler | XML callback handler. |
| MprXmlInputStream | XML input stream function. |
| bool | Boolean data type. |
| cchar | Constant char data type. |
| cuchar | Unsigned char data type. |
| cushort | Constant unsigned short data type. |
| cvoid | Constant void data type. |
| int32 | Integer 32 bits data type. |
| schar | Signed char data type. |
| ssize | Signed integer size field large enough to hold a pointer offset. |
| uchar | Unsigned char data type. |
| uint | Unsigned integer (machine dependent bit size) data type. |
| uint32 | Unsigned integer 32 bits data type. |
| ulong | Unsigned long (machine dependent bit size) data type. |
| ushort | Unsigned short data type. |
| #define | assert assertTrue(gp, MPR_LOC, C, #C) |
| Assert macro for use by unit tests. | |
| #define | MPR_ALLOC_MANAGER 0x1 |
| Reserve room for a manager. | |
| #define | MPR_ALLOC_PAD_MASK 0x1 |
| Flags that impact padding. | |
| #define | MPR_ALLOC_POLICY_EXIT 3 |
| Exit the app if max exceeded with a MPR_EXIT_NORMAL exit. | |
| #define | MPR_ALLOC_POLICY_NOTHING 0 |
| Do nothing. | |
| #define | MPR_ALLOC_POLICY_PRUNE 1 |
| Prune all non-essential memory and continue. | |
| #define | MPR_ALLOC_POLICY_RESTART 2 |
| Gracefully restart the app if redline is exceeded. | |
| #define | MPR_ALLOC_ZERO 0x2 |
| Zero memory. | |
| #define | MPR_ARGV_ARGS_ONLY 0x1 |
| Command is missing program name. | |
| #define | MPR_ASSERT_SRC 0x80 |
| Originated from mprAssert. | |
| #define | MPR_BACKGROUND_PRIORITY 15 |
| May only get CPU if idle. | |
| #define | MPR_BUF_INCR 4096 |
| Default buffer growth inc. | |
| #define | MPR_BUFSIZE 4096 |
| Reasonable size for buffers. | |
| #define | MPR_CACHE_ADD 0x2 |
| Add key if not already existing. | |
| #define | MPR_CACHE_APPEND 0x8 |
| Set and append if already existing. | |
| #define | MPR_CACHE_PREPEND 0x10 |
| Set and prepend if already existing. | |
| #define | MPR_CACHE_SET 0x4 |
| Update key value, create if required. | |
| #define | MPR_CACHE_SHARED 0x1 |
| Use shared cache. | |
| #define | MPR_CMD_DETACH 0x4 |
| mprRunCmd flag to detach the child process and don't wait. | |
| #define | MPR_CMD_ERR 0x4000 |
| mprRunCmd flag to capture stdout. | |
| #define | MPR_CMD_IN 0x1000 |
| mprRunCmd flag to connect to stdin. | |
| #define | MPR_CMD_NEW_SESSION 0x1 |
| mprRunCmd flag to create a new session on unix. | |
| #define | MPR_CMD_OUT 0x2000 |
| mprRunCmd flag to capture stdout. | |
| #define | MPR_CMD_SHOW 0x2 |
| mprRunCmd flag to show the window of the created process on windows. | |
| #define | MPR_CMD_STDERR 2 |
| Stderr for the client side. | |
| #define | MPR_CMD_STDIN 0 |
| Stdout for the client side. | |
| #define | MPR_CMD_STDOUT 1 |
| Stdin for the client side. | |
| #define | MPR_CMD_VXWORKS_EOF "_ _EOF_ _" |
| Special string for VxWorks CGI to emit to signal EOF. | |
| #define | MPR_CMD_VXWORKS_EOF_LEN 9 |
| Length of MPR_CMD_VXWORKS_EOF. | |
| #define | MPR_CONFIG 2 |
| Configuration settings trace level. | |
| #define | MPR_CRITICAL_PRIORITY 99 |
| May not yield. | |
| #define | MPR_DEBUG 4 |
| Debug information trace level. | |
| #define | MPR_DEFAULT_ALLOC 64 |
| Default small alloc size. | |
| #define | MPR_DEFAULT_CIPHER_SUITE "HIGH:MEDIUM" |
| Default cipher suite. | |
| #define | MPR_DEFAULT_DATE "%a %b %d %T %Y %Z" |
| Default date format used in mprFormatLocalTime/mprFormatUniversalTime when no format supplied. | |
| #define | MPR_DEFAULT_HASH_SIZE 23 |
| Default size of hash table. | |
| #define | MPR_DEFAULT_MAX_THREADS 20 |
| Default max threads. | |
| #define | MPR_DEFAULT_MIN_THREADS 0 |
| Default min threads. | |
| #define | MPR_DEFAULT_STACK (64 * 1024) |
| Default thread stack size (0 means use system default). | |
| #define | MPR_DISABLE_GC 0x1 |
| Disable GC. | |
| #define | MPR_DTOA_ALL_DIGITS 0 |
| Return all digits. | |
| #define | MPR_DTOA_EXPONENT_FORM 0x10 |
| Result in exponent form (N.NNNNe+NN). | |
| #define | MPR_DTOA_FIXED_FORM 0x20 |
| Emit in fixed form (NNNN.MMMM). | |
| #define | MPR_DTOA_N_DIGITS 2 |
| Return total N digits. | |
| #define | MPR_DTOA_N_FRACTION_DIGITS 3 |
| Return total fraction digits. | |
| #define | MPR_EPOLL_SIZE 32 |
| Epoll backlog. | |
| #define | MPR_ERR -1 |
| Default error code. | |
| #define | MPR_ERR_ABORTED -2 |
| Action aborted. | |
| #define | MPR_ERR_ALREADY_EXISTS -3 |
| Item already exists. | |
| #define | MPR_ERR_BAD_ARGS -4 |
| Bad arguments or paramaeters. | |
| #define | MPR_ERR_BAD_FORMAT -5 |
| Bad input format. | |
| #define | MPR_ERR_BAD_HANDLE -6 |
| Bad file handle. | |
| #define | MPR_ERR_BAD_STATE -7 |
| Module is in a bad state. | |
| #define | MPR_ERR_BAD_SYNTAX -8 |
| Input has bad syntax. | |
| #define | MPR_ERR_BAD_TYPE -9 |
| Bad object type. | |
| #define | MPR_ERR_BAD_VALUE -10 |
| Bad or unexpected value. | |
| #define | MPR_ERR_BASE -1 |
| Base error code. | |
| #define | MPR_ERR_BUSY -11 |
| Resource is busy. | |
| #define | MPR_ERR_CANT_ACCESS -12 |
| Can't access the file or resource. | |
| #define | MPR_ERR_CANT_ALLOCATE -13 |
| Can't allocate resource. | |
| #define | MPR_ERR_CANT_COMPLETE -14 |
| Operation can't complete. | |
| #define | MPR_ERR_CANT_CONNECT -15 |
| Can't connect to network or resource. | |
| #define | MPR_ERR_CANT_CREATE -16 |
| Can't create the file or resource. | |
| #define | MPR_ERR_CANT_DELETE -17 |
| Can't delete the resource. | |
| #define | MPR_ERR_CANT_FIND -18 |
| Can't find resource. | |
| #define | MPR_ERR_CANT_INITIALIZE -19 |
| Can't initialize resource. | |
| #define | MPR_ERR_CANT_LOAD -20 |
| Can't load the resource. | |
| #define | MPR_ERR_CANT_OPEN -21 |
| Can't open the file or resource. | |
| #define | MPR_ERR_CANT_READ -22 |
| Can't read from the file or resource. | |
| #define | MPR_ERR_CANT_WRITE -23 |
| Can't write to the file or resource. | |
| #define | MPR_ERR_DELETED -24 |
| Resource has been deleted. | |
| #define | MPR_ERR_MEMORY -25 |
| Memory allocation error. | |
| #define | MPR_ERR_NETWORK -26 |
| Underlying network error. | |
| #define | MPR_ERR_NOT_INITIALIZED -27 |
| Module or resource is not initialized. | |
| #define | MPR_ERR_NOT_READY -28 |
| Resource is not ready. | |
| #define | MPR_ERR_OK 0 |
| Success. | |
| #define | MPR_ERR_READ_ONLY -29 |
| The operation timed out. | |
| #define | MPR_ERR_TIMEOUT -30 |
| Operation exceeded specified time allowed. | |
| #define | MPR_ERR_TOO_MANY -31 |
| Too many requests or resources. | |
| #define | MPR_ERR_WONT_FIT -32 |
| Requested operation won't fit in available space. | |
| #define | MPR_ERR_WOULD_BLOCK -33 |
| Blocking operation would block. | |
| #define | MPR_ERROR 1 |
| Standard logging trace levels are 0 to 9 with 0 being the most verbose. | |
| #define | MPR_ERROR_SRC 0x10 |
| Originated from mprError. | |
| #define | MPR_EVENT_CONTINUOUS 0x1 |
| Timer event runs is automatically rescheduled. | |
| #define | MPR_EVENT_DONT_QUEUE 0x4 |
| Don't queue the event. | |
| #define | MPR_EVENT_PRIORITY 50 |
| Normal priority. | |
| #define | MPR_EVENT_QUICK 0x2 |
| Execute inline without executing via a thread. | |
| #define | MPR_EVENT_STATIC_DATA 0x8 |
| Event data is permanent and should not be marked by GC. | |
| #define | MPR_EXIT_DEFAULT 0x1 |
| Exit as per MPR->defaultStrategy. | |
| #define | MPR_EXIT_GRACEFUL 0x8 |
| Graceful shutdown waiting for requests to complete. | |
| #define | MPR_EXIT_IMMEDIATE 0x2 |
| Immediate exit. | |
| #define | MPR_EXIT_NORMAL 0x4 |
| Normal shutdown without waiting for requests to complete. | |
| #define | MPR_EXIT_RESTART 0x10 |
| Restart after exiting. | |
| #define | MPR_FATAL_SRC 0x100 |
| Fatal error. | |
| #define | MPR_FILES_HASH_SIZE 29 |
| Hash size for rom file system. | |
| #define | MPR_FINISHED 0x8 |
| Mpr object destroyed. | |
| #define | MPR_GC_LOW_MEM (32 * 1024) |
| Free memory low water mark before invoking GC. | |
| #define | MPR_GC_WORKERS 0 |
| Run garbage collection non-concurrently. | |
| #define | MPR_GEN_ETERNAL 3 |
| Objects immune from collection. | |
| #define | MPR_HASH_CASELESS 0x1 |
| Key comparisons ignore case. | |
| #define | MPR_HASH_STATIC_KEYS 0x4 |
| Keys are permanent - don't dup or mark. | |
| #define | MPR_HASH_STATIC_VALUES 0x8 |
| Values are permanent - don't mark. | |
| #define | MPR_HASH_UNICODE 0x2 |
| Hash keys are unicode strings. | |
| #define | MPR_HTTP_DATE "%a, %d %b %Y %T GMT" |
| Date format for use in HTTP (headers). | |
| #define | MPR_INFO 3 |
| Informational trace only. | |
| #define | MPR_JSON_ARRAY 3 |
| The object is an array. | |
| #define | MPR_JSON_OBJ 2 |
| The object is an object. | |
| #define | MPR_JSON_PRETTY 0x1 |
| Serialize output in a more human readable, multiline "pretty" format. | |
| #define | MPR_JSON_STRING 1 |
| The property is a string (char*). | |
| #define | MPR_JSON_UNKNOWN 0 |
| The type of a property is unknown. | |
| #define | MPR_LEVEL_MASK 0xf |
| Level mask. | |
| #define | MPR_LIST_INCR 8 |
| Default list growth inc. | |
| #define | MPR_LIST_STATIC_VALUES 0x1 |
| Flag for mprCreateList indicating list values are permanent and should not be marked by GC. | |
| #define | MPR_LOCAL_TIMEZONE MAXINT |
| Constants for mprParseTime. | |
| #define | MPR_LOG_ANEW 0x80 |
| Start anew on boot (rotate). | |
| #define | MPR_LOG_APPEND 0x40 |
| Append to existing log files. | |
| #define | MPR_LOG_SRC 0x40 |
| Originated from mprLog. | |
| #define | MPR_MANAGE_FREE 0x1 |
| Block being freed. | |
| #define | MPR_MANAGE_MARK 0x2 |
| Block being marked by GC. | |
| #define | MPR_MARK_THREAD 0x4 |
| Start a dedicated marker thread for garbage collection. | |
| #define | MPR_MAX_ARGC 128 |
| Reasonable max of args. | |
| #define | MPR_MAX_BUF 4194304 |
| Max buffer size. | |
| #define | MPR_MAX_FNAME 256 |
| Reasonable filename size. | |
| #define | MPR_MAX_GEN 3 |
| Number of generations for object allocation. | |
| #define | MPR_MAX_LOG (8 * 1024) |
| Maximum log message size (impacts stack). | |
| #define | MPR_MAX_PATH 512 |
| Reasonable path name size. | |
| #define | MPR_MAX_STRING 1024 |
| Maximum (stack) string size. | |
| #define | MPR_MAX_URL 512 |
| Max URL size. | |
| #define | MPR_MEM_FAIL 0x4 |
| Memory allocation failed - immediate exit. | |
| #define | MPR_MEM_LIMIT 0x2 |
| Memory use exceeds memory limit - invoking policy. | |
| #define | MPR_MEM_REDLINE 0x1 |
| Memory use exceeds redline limit. | |
| #define | MPR_MEM_REGION_SIZE (128 * 1024) |
| Memory allocation chunk size. | |
| #define | MPR_MEM_TOO_BIG 0x4 |
| Memory allocation request is too big - immediate exit. | |
| #define | MPR_MIN_TIME_FOR_GC 2 |
| Wait till 2 milliseconds of idle time possible. | |
| #define | MPR_MODULE_STARTED 0x1 |
| Module stared. | |
| #define | MPR_MODULE_STOPPED 0x2 |
| Module stopped. | |
| #define | MPR_NEW_QUOTA (4 * 1024) |
| Number of new allocations before a GC is worthwhile. | |
| #define | MPR_NO_WINDOW 0x20 |
| Don't create a windows Window. | |
| #define | MPR_NORMAL_PRIORITY 50 |
| Normal (default) priority. | |
| #define | MPR_PATH_ENUM_DIRS 0x1 |
| Flag for mprFindFiles to traverse directories. | |
| #define | MPR_PATH_INC_DIRS 0x2 |
| Flag for mprFindFiles to include directories in results. | |
| #define | MPR_PROTO_ALL 0x7 |
| All SSL protocols. | |
| #define | MPR_PROTO_SSLV2 0x1 |
| SSL V2 protocol. | |
| #define | MPR_PROTO_SSLV3 0x2 |
| SSL V3 protocol. | |
| #define | MPR_PROTO_TLSV1 0x4 |
| TLS V1 protocol. | |
| #define | MPR_RAW 0x1000 |
| Raw trace output. | |
| #define | MPR_READABLE 0x2 |
| Read event mask. | |
| #define | MPR_REQUEST_PRIORITY 50 |
| Normal priority. | |
| #define | MPR_RFC_DATE "%a, %d %b %Y %T %Z" |
| Format a date according to RFC822: (Fri, 07 Jan 2003 12:12:21 PDT). | |
| #define | MPR_SECURE_CLIENT ((struct MprSsl*) 1) |
| Flag for mprCreateSocket to use the default SSL provider. | |
| #define | MPR_SERVICE_NO_GC 0x8 |
| Don't run GC. | |
| #define | MPR_SERVICE_ONE_THING 0x4 |
| Wait for one event or one I/O. | |
| #define | MPR_SIGNAL_AFTER 0x2 |
| Flag to mprAddSignalHandler to run handler after existing handlers. | |
| #define | MPR_SIGNAL_BEFORE 0x1 |
| Flag to mprAddSignalHandler to run handler before existing handlers. | |
| #define | MPR_SOCKET_BLOCK 0x1 |
| Use blocking I/O. | |
| #define | MPR_SOCKET_BROADCAST 0x2 |
| Broadcast mode. | |
| #define | MPR_SOCKET_CLIENT 0x800 |
| Socket is a client. | |
| #define | MPR_SOCKET_CLOSED 0x4 |
| MprSocket has been closed. | |
| #define | MPR_SOCKET_CONNECTING 0x8 |
| MprSocket is connecting. | |
| #define | MPR_SOCKET_DATAGRAM 0x10 |
| Use datagrams. | |
| #define | MPR_SOCKET_EOF 0x20 |
| Seen end of file. | |
| #define | MPR_SOCKET_GRACEFUL 1 |
| Do a graceful shutdown. | |
| #define | MPR_SOCKET_LISTENER 0x40 |
| MprSocket is server listener. | |
| #define | MPR_SOCKET_NODELAY 0x100 |
| Disable Nagle algorithm. | |
| #define | MPR_SOCKET_NOREUSE 0x80 |
| Dont set SO_REUSEADDR option. | |
| #define | MPR_SOCKET_PENDING 0x1000 |
| Pending buffered read data. | |
| #define | MPR_SOCKET_THREAD 0x400 |
| Process callbacks on a worker thread. | |
| #define | MPR_SSL_BUFSIZE 4096 |
| SSL has 16K max. | |
| #define | MPR_SSL_PROVIDER_LOADED 0x20 |
| SSL provider loaded. | |
| #define | MPR_STARTED 0x1 |
| Mpr services started. | |
| #define | MPR_STOPPING 0x2 |
| App is stopping. | |
| #define | MPR_STOPPING_CORE 0x4 |
| Stopping core services: GC and event dispatch. | |
| #define | MPR_SWEEP_THREAD 0x8 |
| Start a dedicated sweeper thread for garbage collection. | |
| #define | MPR_TICKS_PER_SEC 1000 |
| Time ticks per second. | |
| #define | MPR_TIME_HASH_SIZE 67 |
| Hash size for time token lookup. | |
| #define | MPR_TIMEOUT_CMD 60000 |
| Command Request timeout (60 sec). | |
| #define | MPR_TIMEOUT_GC_SYNC 10000 |
| Wait period for threads to synchronize. | |
| #define | MPR_TIMEOUT_HANDLER 10000 |
| Wait period when removing a wait handler. | |
| #define | MPR_TIMEOUT_LINGER 2000 |
| Close socket linger timeout. | |
| #define | MPR_TIMEOUT_LOG_STAMP 3600000 |
| Time between log time stamps (1 hr). | |
| #define | MPR_TIMEOUT_NAP 20 |
| Short pause. | |
| #define | MPR_TIMEOUT_PRUNER 600000 |
| Time between worker thread pruner runs (10 min). | |
| #define | MPR_TIMEOUT_SOCKETS 10000 |
| General sockets timeout. | |
| #define | MPR_TIMEOUT_START_TASK 10000 |
| Time to start tasks running. | |
| #define | MPR_TIMEOUT_STOP 30000 |
| Wait when stopping resources (30 sec). | |
| #define | MPR_TIMEOUT_STOP_TASK 10000 |
| Time to stop or reap tasks. | |
| #define | MPR_TIMEOUT_STOP_THREAD 10000 |
| Time to stop running threads. | |
| #define | MPR_TIMEOUT_WORKER 300000 |
| Prune worker that has been idle for 5 minutes. | |
| #define | MPR_TRIM_BOTH 0x3 |
| Flag for strim to trim from both the start and the end of the string. | |
| #define | MPR_TRIM_END 0x2 |
| Flag for strim to trim from the end of the string. | |
| #define | MPR_TRIM_START 0x1 |
| Flag for strim to trim from the start of the string. | |
| #define | MPR_TUNE_BALANCED 2 |
| Tune balancing speed and size. | |
| #define | MPR_TUNE_SIZE 1 |
| Tune for size. | |
| #define | MPR_TUNE_SPEED 3 |
| Tune for speed, program will use memory more aggressively. | |
| #define | MPR_USER_EVENTS_THREAD 0x10 |
| User will explicitly manage own mprServiceEvents calls. | |
| #define | MPR_UTC_TIMEZONE 0 |
| Use UTC timezone. | |
| #define | MPR_VERBOSE 9 |
| Highest level of trace. | |
| #define | MPR_WAIT_NEW_DISPATCHER 0x2 |
| Wait handler flag to create a new dispatcher for each I/O event. | |
| #define | MPR_WAIT_RECALL_HANDLER 0x1 |
| Wait handler flag to recall the handler asap. | |
| #define | MPR_WARN 2 |
| Soft warning trace level. | |
| #define | MPR_WARN_SRC 0x20 |
| Originated from mprWarn. | |
| #define | MPR_WORKER_BUSY 0x1 |
| Worker currently running to a callback. | |
| #define | MPR_WORKER_DEDICATED 0x1 |
| Worker reserved and not part of the worker pool. | |
| #define | MPR_WORKER_IDLE 0x2 |
| Worker idle and available for work. | |
| #define | MPR_WORKER_PRIORITY 50 |
| Normal priority. | |
| #define | MPR_WORKER_PRUNED 0x4 |
| Worker has been pruned and will be terminated. | |
| #define | MPR_WORKER_SLEEPING 0x8 |
| Worker is sleeping (idle) on idleCond. | |
| #define | MPR_WRITABLE 0x4 |
| Write event mask. | |
| #define | MPR_XML_AFTER_LS 2 |
| Seen "<". | |
| #define | MPR_XML_ATT_EQ 6 |
| Seen "<tag att" =. | |
| #define | MPR_XML_ATT_NAME 5 |
| Seen "<tag att". | |
| #define | MPR_XML_BEGIN 1 |
| Before next tag. | |
| #define | MPR_XML_BUFSIZE 4096 |
| XML read buffer size. | |
| #define | MPR_XML_CDATA 13 |
| Seen "<![CDATA[" U. | |
| #define | MPR_XML_COMMENT 3 |
| Seen "<!—" (usr) U. | |
| #define | MPR_XML_ELT_DATA 10 |
| Seen "<tag>....<" U. | |
| #define | MPR_XML_ELT_DEFINED 9 |
| Seen "<tag...>" U. | |
| #define | MPR_XML_END_ELT 11 |
| Seen "<tag>....</tag>" U. | |
| #define | MPR_XML_EOF -2 |
| End of input. | |
| #define | MPR_XML_ERR -1 |
| Error. | |
| #define | MPR_XML_NEW_ATT 7 |
| Seen "<tag att = "val" U. | |
| #define | MPR_XML_NEW_ELT 4 |
| Seen "<tag" (usr) U. | |
| #define | MPR_XML_PI 12 |
| Seen "<?processingInst" U. | |
| #define | MPR_XML_SOLO_ELT_DEFINED 8 |
| Seen "<tag../>" U. | |
| #define | assert assertTrue(gp, MPR_LOC, C, #C) |
| Assert macro for use by unit tests. |
Primary MPR application control structure.
| char * | appDir | Path of directory containing app executable. | |
| long | appInstance | Application instance (windows). | |
| char * | appPath | Path name of application executable. | |
| void * | appwebService | Appweb service object. | |
| int | argc | Count of command line args. | |
| char ** | argv | Application command line args (not alloced). | |
| bool | cmdlineLogging | App has specified —log on the command line. | |
| struct MprCmdService * | cmdService | Command service object. | |
| MprCond * | cond | Sync after starting events thread. | |
| bool | debugMode | Run in debug mode (no timers). | |
| struct MprDispatcher * | dispatcher | Primary dispatcher. | |
| char * | domainName | Domain portion. | |
| MprSpin * | dtoaSpin[2] | Dtoa thread synchronization. | |
| void * | ediService | EDI object. | |
| void * | ejsService | Ejscript service. | |
| char * | emptyString | Empty string. | |
| void * | espService | ESP service object. | |
| int | eventing | Servicing events thread is active. | |
| struct MprEventService * | eventService | Event service object. | |
| int | exitStatus | Proposed program exit status. | |
| int | exitStrategy | How to exit the app (normal, immediate, graceful). | |
| struct MprFileSystem * | fileSystem | File system service object. | |
| int | flags | Misc flags. | |
| int | hasError | Mpr has an initialization error. | |
| MprHeap | heap | Memory heap control. | |
| char * | hostName | Host name (fully qualified name). | |
| void * | httpService | Http service object. | |
| MprIdleCallback | idleCallback | Invoked to determine if the process is idle. | |
| char * | ip | Public IP Address. | |
| int | logBackup | Number of log files preserved when backing up. | |
| MprFile * | logFile | Log file. | |
| MprLogHandler | logHandler | Current log handler callback. | |
| int | logLevel | Log trace level. | |
| cchar * | logPath | Log path name. | |
| ssize | logSize | Maximum log size. | |
| MprOsThread | mainOsThread | Main OS thread ID. | |
| int | marker | Marker thread is active. | |
| int | marking | Actually marking objects now. | |
| MprHash * | mimeTypes | Table of mime types. | |
| struct MprModuleService * | moduleService | Module service object. | |
| MprMutex * | mutex | Thread synchronization. | |
| char * | name | Product name. | |
| struct MprDispatcher * | nonBlock | Nonblocking dispatcher. | |
| struct MprOsService * | osService | O/S service object. | |
| char * | pathEnv | Cached PATH env var. Used by MprCmd. | |
| char * | serverName | Server name portion (no domain). | |
| struct MprSignalService * | signalService | Signal service object. | |
| struct MprSocketService * | socketService | Socket service object. | |
| MprSpin * | spin | Quick thread synchronization. | |
| int | state | Processing state. | |
| MprFile * | stdError | Standard error file. | |
| MprFile * | stdInput | Standard input file. | |
| MprFile * | stdOutput | Standard output file. | |
| int | sweeper | Sweeper thread is active. | |
| MprList * | terminators | Termination callbacks. | |
| void * | testService | Test service object. | |
| struct MprThreadService * | threadService | Thread service object. | |
| MprHash * | timeTokens | Date/Time parsing tokens. | |
| char * | title | Product title. | |
| char * | version | Product version. | |
| struct MprWaitService * | waitService | IO Waiting service object. | |
| struct MprWorkerService * | workerService | Worker service object. |
Add a terminator callback.
| terminator | MprTerminator callback function. |
Trigger a breakpoint.
Create an instance of the MPR.
| argc | Count of command line args. |
| argv | Command line arguments for the application. Arguments may be passed into the Mpr for retrieval by the unit test framework. |
| flags |
Create and initialze the O/S dependent subsystem.
Deocde buffer using base-46 encoding.
| str | String to decode. |
Reference to a permanent preallocated empty string.
Encode buffer using base-46 encoding.
| str | String to encode. |
Encode a string escaping typical command (shell) characters.
| cmd | Command string to encode. |
| escChar | Escape character to use when encoding the command. |
Encode a string by escaping typical HTML characters.
| html | HTML content to encode. |
Get the application directory.
Get the application name defined via mprSetAppName.
Get the application executable path.
Get the application title string.
Get the application version string.
Get the debug mode.
Get the application domain name string.
Return the endian byte ordering for the application.
Return the error code for the most recent system or library operation.
Get the application host name string.
Get the application IP address string.
Get the current logging level.
Get an MD5 checksum.
| s | String to examine. |
Get an MD5 checksum with optional prefix string and buffer length.
| buf | Buffer to checksum. |
| len | Size of the buffer. |
| prefix | String prefix to insert at the start of the result. |
Return the MPR control instance.
Return the O/S error code.
Get the application server name string.
Determine if the MPR is exiting.
Determine if the MPR has finished.
Determine if the App is idle.
Test if the application is stopping.
Test if the application is stopping and core services are being terminated.
Nap for a while.
| msec | Number of milliseconds to sleep. |
Return a random number.
Restart the application.
Determine if the MPR services.
Set the application name, title and version.
| name | One word, lower case name for the app. |
| title | Pascal case multi-word descriptive name. |
| version | Version of the app. Major-Minor-Patch. E.g. 1.2.3. |
Turn on debug mode.
| on | Set to true to enable debugging mode. |
Set the application domain name string.
| s | New value to use for the application domain name. |
Set the application host name string.
This is internal to the application and does not affect the O/S host name| s | New host name to use within the application. |
Define a new idle callback to be invoked by mprIsIdle()
| idleCallback | Callback function to invoke to test if the application is idle. |
Sete the application IP address string.
| ip | IP address string to store for the application. |