MPR API
The Multithreaded Portable Runtime (MPR) is a portable runtime library for embedded applications.
Description :
The MPR provides management for logging, error handling, events, files, memory, ssl, sockets, strings, JSON, 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.
The MPR provides a high-performance thread-pool to share threads as required to service clients. When a client request arrives, the MPR allocates an event queue called a dispatcher. This dispatcher then serializes all activity for the request so that it essentially runs single-threaded This simplifies the code as most interactions do not need to be lock protected. When a request has activity, it borrows a thread from the thread pool, does its work and then returns the thread to the thread pool. This all happens very quickly, so a small pool of threads are effectivelyshared over many requests. Thread are free to block if required, but typically non-blocking patterns are more economical. If you have non-MPR threads that need to call into the MPR, you must synchronize such calls via mprCreateEvent.
Extensions
Mpr | Primary MPR application control structure. |
MprBuf | Dynamic Buffer Module. |
MprCache | In-memory caching. |
MprCmd | Command execution Service. |
MprDispatcher | Event Dispatcher. |
MprEvent | Event object. |
MprFile | File I/O Module. |
MprFileSystem | File system service. |
MprFloat | Floating Point Services. |
MprHash | Hash table entry structure. |
MprJson | JSON Object. |
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. |
MprSsl | SSL control structure. |
MprString | Safe String Module. |
MprSync | Multithreaded Synchronization Services. |
MprThread | Thread Service. |
MprTime | Date and Time Service. |
MprWaitHandler | Wait Handler Service. |
MprWorker | Worker thread structure. |
MprXml | Per XML session structure. |
Functions
void | assert(bool cond) |
Assert that a condition is true. | |
char * | fmt(char *buf, ssize maxSize, cchar *fmt, ...) PRINTF_ATTRIBUTE(3 |
Format a string into a static buffer. | |
char char * | fmtv(char *buf, ssize maxSize, cchar *fmt, va_list args) |
Format a string into a statically allocated buffer. | |
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, ...) PRINTF_ATTRIBUTE(3 |
Add a key with a formatting value into the hash table. | |
MprKey * | mprAddKeyWithType(MprHash *table, cvoid *key, cvoid *ptr, int type) |
Add a symbol value into the hash table and set the key type. | |
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 | mprAddRoot(cvoid *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 | mprAddSslCiphers(struct MprSsl *ssl, cchar *ciphers) |
Add the ciphers to use for SSL. | |
void | mprAddStandardSignals(void) |
Add standard trapping of system signals. | |
void | mprAddTerminator(MprTerminator terminator) |
Add a service terminator. | |
void | mprAdjustBufEnd(MprBuf *buf, ssize count) |
Adjust the buffer end position. | |
void | mprAdjustBufStart(MprBuf *buf, ssize count) |
Adjust the buffer start position. | |
void * | mprAlloc(size_t size) |
Allocate a block of memory. | |
void * | mprAllocMem(size_t size, int flags) |
Allocate a block of memory. | |
void * | mprAllocObj(Type type, MprManager manager) |
Allocate an object of a given type. | |
void * | mprAllocObjWithFlags(Type type, MprManager manager, int flags) |
Allocate an object of a given type. | |
void * | mprAllocZeroed(size_t size) |
Allocate a zeroed block of memory. | |
MprList * | mprAppendList(MprList *list, MprList *add) |
Append a list. | |
bool | mprAreCmdEventsEnabled(MprCmd *cmd, int channel) |
Return true if command events are enabled. | |
void | mprAssert(cchar *loc, cchar *msg) |
Output an assure assertion failed message. | |
void | mprAtomicAdd(volatile int *target, int value) |
Atomic Add. | |
void | mprAtomicAdd64(volatile int64 *target, int64 value) |
Atomic 64 bit Add. | |
void | mprAtomicBarrier(int model) |
Apply a full (read+write) memory barrier. | |
int | mprAtomicCas(void *volatile *target, void *expected, cvoid *value) |
Atomic Compare and Swap. | |
void | mprAtomicListInsert(void **head, void **link, void *item) |
Atomic list insertion. | |
void | mprAtomicOpen(void) |
Open and initialize the atomic subystem. | |
MprFile * | mprAttachFileFd(int fd, cchar *name, int omode) |
Attach to an existing file descriptor. | |
int | mprAvailableWorkers(void) |
Get the count of available worker threads Return the count of free threads in the worker thread pool. | |
int | mprBackupLog(cchar *path, int count) |
Backup a log. | |
MprHash * | mprBlendHash(MprHash *target, MprHash *other) |
Blend two hash tables. | |
int | mprBlendJson(MprJson *dest, MprJson *src, int flags) |
Blend two JSON objects. | |
void | mprBreakpoint(void) |
Trigger a breakpoint. | |
char * | mprBufToString(MprBuf *buf) |
Convert the buffer contents to a string. | |
bool | mprCancelShutdown(void) |
Cancel a shutdown request. | |
bool | mprCheckPassword(cchar *plainTextPassword, cchar *passwordHash) |
Check a plain-text password against the defined hashed password. | |
void | mprClearList(MprList *list) |
Clears the list of all items. | |
void | mprClearWaiting(void) |
Clear the event service waiting flag. | |
MprBuf * | mprCloneBuf(MprBuf *orig) |
Clone a buffer. | |
char * | mprCloneBufAsString(MprBuf *bp) |
Clone a buffer contents. | |
char * | mprCloneBufMem(MprBuf *bp) |
Clone a buffer contents. | |
MprKey MprHash,* | mprCloneHash(MprHash *table) |
Copy a hash table. | |
MprJson * | mprCloneJson(MprJson *obj) |
Clone a JSON object. | |
MprList * | mprCloneList(MprList *src) |
Clone a list and all elements. | |
MprSocket * | mprCloneSocket(MprSocket *sp) |
Clone a socket object. | |
struct MprSsl * | mprCloneSsl(MprSsl *src) |
Create the a new SSL control structure based on an existing structure. | |
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. | |
int | mprConnectSocket(MprSocket *sp, cchar *ip, 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) |
Initialize the application by creating an instance of the MPR. | |
MprBuf * | mprCreateBuf(ssize initialSize, ssize maxSize) |
Create a new buffer. | |
MprCache * | mprCreateCache(int options) |
Create a new cache object. | |
int | mprCreateCacheService(void) |
Initialize the cache service on startup. | |
MprCmd * | mprCreateCmd(MprDispatcher *dispatcher) |
Create a new Command object. | |
MprCond * | mprCreateCond(void) |
Create a condition lock variable. | |
MprDiskFileSystem * | mprCreateDiskFileSystem(cchar *path) |
Create and initialize the disk FileSystem. | |
MprDispatcher * | mprCreateDispatcher(cchar *name, int flags) |
Create a new event dispatcher. | |
MprEvent * | mprCreateEvent(MprDispatcher *dispatcher, cchar *name, MprTicks period, void *proc, void *data, int flags) |
Queue an new event on a dispatcher. | |
MprHash * | mprCreateHash(int hashSize, int flags) |
Create a hash table. | |
MprHash * | mprCreateHashFromWords(cchar *str) |
Create a hash of words. | |
void | mprCreateIOEvent(MprDispatcher *dispatcher, void *proc, void *data, struct MprWaitHandler *wp, struct MprSocket *sock) |
Create and queue an IO event for a wait handler. | |
MprJson * | mprCreateJson(int type) |
Create a JSON object. | |
MprJson * | mprCreateJsonValue(cchar *value, int type) |
Create a JSON object value. | |
MprKeyValue * | mprCreateKeyPair(cchar *key, cchar *value, int flags) |
Create a key / value pair. | |
MprList * | mprCreateList(int size, int flags) |
Create a list. | |
MprList * | mprCreateListFromWords(cchar *str) |
Create a list of words. | |
MprEvent * | mprCreateLocalEvent(MprDispatcher *dispatcher, cchar *name, MprTicks period, void *proc, void *data, int flags) |
Optimized variety of mprCreateEvent for use by local MPR threads only. | |
MprMutex * | mprCreateLock(void) |
Create a Mutex lock object. | |
void | mprCreateLogService(void) |
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(void) |
Create and initialize the module service. | |
int | mprCreateNotifierService(MprWaitService *ws) |
Internal. | |
int | mprCreateOsService(void) |
Create and initialze the O/S dependent subsystem. | |
MprRomFileSystem * | mprCreateRomFileSystem(cchar *path, MprRomInode *inodes) |
Create and initialize the ROM FileSystem. | |
MprSocket * | mprCreateSocket(void) |
Create a socket. | |
MprSpin * | mprCreateSpinLock(void) |
Create a spin lock lock object. | |
struct MprSsl * | mprCreateSsl(int server) |
Create the SSL control structure. | |
MprThread * | mprCreateThread(cchar *name, void *proc, void *data, ssize stackSize) |
Create a new thread. | |
int | mprCreateTimeService(void) |
Mpr time structure. | |
MprEvent * | mprCreateTimerEvent(MprDispatcher *dispatcher, cchar *name, MprTicks 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 * | mprCryptPassword(cchar *password, cchar *salt, int rounds) |
Encrypt a password using the Blowfish algorithm. | |
int | mprDaemon(void) |
Convert the process into a daemon on unix systems. | |
void | mprDebug(cchar *tags, int level, cchar *fmt, ...) |
Write a log message to the log file when the product is built in debug mode. | |
char * | mprDecode64(cchar *str) |
Decode a null terminated string using base-46 encoding. | |
char * | mprDecode64Block(cchar *buf, ssize *len, int flags) |
Decode a null terminated string 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. | |
void | mprDefaultLogHandler(cchar *tags, int level, cchar *msg) |
Default MPR log handler. | |
int | mprDeletePath(cchar *path) |
Delete a file. | |
MprHash * | mprDeserialize(cchar *str) |
Deserialize a simple JSON string and return a hash of properties. | |
MprHash * | mprDeserializeInto(cchar *str, MprHash *hash) |
Deserialize a simple JSON string into the given hash object. | |
bool | mprDestroy(void) |
Destroy the MPR and all services using the MPR. | |
void * | mprDestroyCache(MprCache *cache) |
Destroy a new cache object. | |
void | mprDestroyCmd(MprCmd *cmd) |
Destroy the command. | |
void | mprDestroyDispatcher(MprDispatcher *dispatcher) |
Disable a dispatcher from service events. | |
void | mprDestroyWaitHandler(MprWaitHandler *wp) |
Destroy a wait handler. | |
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 * | mprEmptyString(void) |
Reference to a permanent preallocated empty string. | |
void | mprEnableCmdEvents(MprCmd *cmd, int channel) |
Enable command I/O events. | |
void | mprEnableCmdOutputEvents(MprCmd *cmd, bool on) |
Enable command I/O events for the command's STDOUT and STDERR channels. | |
void | mprEnableContinuousEvent(MprEvent *event, int enable) |
Enable or disable an event being continous. | |
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 a string using base-46 encoding. | |
char * | mprEncode64Block(cchar *buf, ssize len) |
Encode buffer using base-46 encoding. | |
ssize | mprEprintf(cchar *fmt, ...) PRINTF_ATTRIBUTE(1 |
Print a formatted message to the standard error channel. | |
void | mprError(cchar *fmt, ...) PRINTF_ATTRIBUTE(1 |
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. | |
char * | mprEscapeSQL(cchar *cmd) |
Encode a string by escaping SQL special characters. | |
int | mprExpireCacheItem(MprCache *cache, cchar *key, MprTicks expires) |
Set the expiry date for a cache item. | |
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. | |
void | mprFormatJsonName(MprBuf *buf, cchar *name, int flags) |
Format a JSON name into and output buffer. | |
void | mprFormatJsonString(MprBuf *buf, cchar *value) |
Format a string as a JSON string. | |
void | mprFormatJsonValue(MprBuf *buf, int type, cchar *value, int flags) |
Format a value as a simple JSON string. | |
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 ssize | mprFprintf(struct MprFile *file, cchar *fmt, ...) PRINTF_ATTRIBUTE(2 |
Print a formatted message to a file descriptor. | |
int | mprGC(int flags) |
Collect garbage. | |
char * | mprGetAbsPath(cchar *path) |
Convert a path to an absolute path. | |
ssize | mprGetActiveCmdCount(void) |
Get the count of active commands. | |
cchar * | mprGetAppDir(void) |
Get the application directory. | |
cchar * | mprGetAppName(void) |
Get the application name defined via mprSetAppName. | |
cchar * | mprGetAppPath(void) |
Get the application executable path. | |
cchar * | mprGetAppTitle(void) |
Get the application title string. | |
cchar * | mprGetAppVersion(void) |
Get the application version string. | |
ssize | mprGetBlockFromBuf(MprBuf *buf, char *blk, ssize count) |
Get a block of data from the buffer. | |
size_t | 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. | |
ssize | mprGetBusyWorkerCount(void) |
Get the count of workers in the busy queue. | |
uint64 | mprGetCPU(void) |
Return the process CPU usage. | |
void | mprGetCacheStats(MprCache *cache, int *numKeys, ssize *mem) |
Get the Cache statistics. | |
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(void) |
Get if command line logging is being used. | |
MprOsThread | mprGetCurrentOsThread(void) |
Get the O/S thread. | |
cchar * | mprGetCurrentPath(void) |
Return the current working directory. | |
MprThread * | mprGetCurrentThread(void) |
Get the currently executing thread. | |
cchar * | mprGetCurrentThreadName(void) |
Return the name of the current thread. | |
MprWorker * | mprGetCurrentWorker(void) |
Get the worker object if the current thread is actually a worker thread. | |
char * | mprGetDate(char *fmt) |
Get a string representation of the current date/time. | |
bool | mprGetDebugMode(void) |
Get the debug mode. | |
MprDispatcher * | mprGetDispatcher(void) |
Get the MPR primary dispatcher. | |
cchar * | mprGetDomainName(void) |
Get the application domain name string. | |
MprTicks | mprGetElapsedTicks(MprTicks mark) |
Get the elapsed time since a ticks mark. | |
MprTime | mprGetElapsedTime(MprTime mark) |
Get the elapsed time since a starting time mark. | |
int | mprGetEndian(void) |
Return the endian byte ordering for the application. | |
int | mprGetError(void) |
Return the error code for the most recent system or library operation. | |
int64 | mprGetEventMark(MprDispatcher *dispatcher) |
Get an event mark for a dispatcher. | |
int | mprGetExitStatus(void) |
Get the exit status. | |
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. | |
uint64 | mprGetHiResTicks(void) |
Get the CPU tick count. | |
cchar * | mprGetHostName(void) |
Get the application host name string. | |
cchar * | mprGetIpAddr(void) |
Get the application IP address string. | |
void * | mprGetItem(MprList *list, int index) |
Get an list item. | |
cchar * | mprGetJson(MprJson *obj, cchar *key) |
Get a JSON key and return a string value. | |
ssize | mprGetJsonLength(MprJson *obj) |
Get the number of child properties in a JSON object. | |
MprJson * | mprGetJsonObj(MprJson *obj, cchar *key) |
Get a parsed JSON object for a key value. | |
void * | mprGetKey(cchar *key) |
Get a key value. | |
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. | |
void struct MprFile * | mprGetLogFile(void) |
Get the log file object. | |
MprLogHandler | mprGetLogHandler(void) |
Get the current MPR debug log handler. | |
int | mprGetLogLevel(void) |
Get the current logging level. | |
char * | mprGetMD5(cchar *str) |
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(void) |
Get the maximum count of worker pool threads Get the maximum limit of worker pool threads. | |
size_t | mprGetMem(void) |
Return the amount of memory currently used by the application. | |
MprMemStats * | mprGetMemStats(void) |
Return the current allocation memory statistics block. | |
cchar * | mprGetMimeProgram(MprHash *table, cchar *mimeType) |
Get the mime type program for a given mimeType. | |
cchar * | mprGetModuleSearchPath(void) |
Get the module search path. | |
Mpr * | mprGetMpr(void) |
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. | |
void * | mprGetNextStableItem(MprList *list, int *lastIndex) |
Get the next item in a stable list. | |
int | mprGetOsError(void) |
Return the O/S error code. | |
int | mprGetPageSize(void) |
Get the current O/S virtual page size. | |
char * | mprGetPassword(cchar *prompt) |
Get a password from the terminal console. | |
char * | mprGetPathBase(cchar *path) |
Get the base portion of a path. | |
cchar * | mprGetPathBaseRef(cchar *path) |
Get a reference to 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, int flags) |
Create a list of files in a directory or subdirectories. | |
char * | mprGetPathFirstDir(cchar *path) |
Get the first directory portion of a path. | |
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. | |
char | mprGetPathSeparator(cchar *path) |
Get the default path directory separator. | |
cchar * | mprGetPathSeparators(cchar *path) |
Get the path directory separator. | |
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 * | mprGetRandomString(ssize size) |
Get some random data in ascii. | |
char * | mprGetRelPath(cchar *dest, cchar *origin) |
Get a path relative to another path. | |
MprTicks | mprGetRemainingTicks(MprTicks mark, MprTicks timeout) |
Return the time remaining until a timeout has elapsed. | |
MprRomInode * | mprGetRomFiles(void) |
Get the ROM file system data. | |
char * | mprGetSHA(cchar *str) |
Get an SHA1 checksum. | |
char * | mprGetSHABase64(cchar *str) |
Get an SHA1 checksum of a null terminated string. | |
char * | mprGetSHAWithPrefix(cchar *buf, ssize len, cchar *prefix) |
Get an SHA1 checksum with optional prefix string and buffer length. | |
cchar * | mprGetServerName(void) |
Get the application server name string. | |
bool | mprGetSocketBlockingMode(MprSocket *sp) |
Get the socket blocking mode. | |
int | mprGetSocketError(MprSocket *sp) |
Get a socket error code. | |
Socket | mprGetSocketHandle(MprSocket *sp) |
Get the socket file descriptor. | |
int | mprGetSocketInfo(cchar *ip, int port, int *family, int *protocol, struct sockaddr **addr, Socklen *addrlen) |
Get the socket for an IP:Port address. | |
int | mprGetSocketPort(MprSocket *sp) |
Get the port used by a socket. | |
char * | mprGetSocketState(MprSocket *sp) |
Get the socket state. | |
int | mprGetState(void) |
Get the MPR execution state. | |
MprFile * | mprGetStderr(void) |
Return a file object for the Stderr I/O channel. | |
MprFile * | mprGetStdin(void) |
Return a file object for the Stdin I/O channel. | |
MprFile * | mprGetStdout(void) |
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. | |
MprTicks | mprGetTicks(void) |
Get the system time. | |
MprTime | mprGetTime(void) |
Get the 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 | mprGetWorkerStats(MprWorkerStats *stats) |
Get the Worker service statistics. | |
MprList * | mprGlobPathFiles(cchar *path, cchar *patterns, int flags) |
Create a list of files in a directory or subdirectories that match the given wildcard pattern. | |
void | mprGlobalLock(void) |
Globally lock the application. | |
void | mprGlobalUnlock(void) |
Unlock the global mutex. | |
int | mprGrowBuf(MprBuf *buf, ssize count) |
Grow the buffer. | |
bool | mprHasDualNetworkStack(void) |
has the system got a dual IPv4 + IPv6 network stack. | |
bool | mprHasIPv6(void) |
Determine if the system support IPv6. | |
bool | mprHasMemError(void) |
Determine if the MPR has encountered memory allocation errors. | |
bool | mprHasSecureSockets(void) |
Determine if SSL is available. | |
char * | mprHashKeysToString(MprHash *hash, cchar *join) |
Convert hash keys to a single string. | |
MprJson * | mprHashToJson(MprHash *hash) |
Convert a hash object into a JSON object. | |
char * | mprHashToString(MprHash *hash, cchar *join) |
Convert a hash of strings to a single string. | |
void | mprHiddenSocketData(MprSocket *sp, ssize len, int dir) |
Indicate that the application layer has buffered data for the socket. | |
void | mprHold(cvoid *ptr) |
Hold a memory block. | |
void | mprHoldBlocks(cvoid *ptr, ...) |
Hold memory blocks. | |
int64 | mprIncCache(MprCache *cache, cchar *key, int64 amount) |
Increment a numeric cache item. | |
void | mprInitFileSystem(MprFileSystem *fs, cchar *path) |
Create and initialize the FileSystem subsystem. | |
void | mprInitList(MprList *list, int flags) |
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. | |
bool | mprIsAbsPathContained(cchar *path, cchar *dir) |
Fast version of mprIsPathContained that works only for absolute paths. | |
int | mprIsCmdComplete(MprCmd *cmd) |
Test if a command is complete. | |
bool | mprIsCmdRunning(MprCmd *cmd) |
Test if the command is still running. | |
bool | mprIsDestroyed(void) |
Determine if the MPR has finished. | |
bool | mprIsDestroying(void) |
Test if the application is terminating and core services are being destroyed All request should immediately terminate. | |
bool | mprIsIPv6(cchar *ip) |
Determine if the IP address is an IPv6 address. | |
bool | mprIsIdle(bool traceRequests) |
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 | mprIsPathContained(cchar *path, cchar *dir) |
Determine if a directory is the same as or a parent of a path. | |
bool | mprIsPathDir(cchar *path) |
Determine if a path is a directory. | |
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 | mprIsSocketV6(MprSocket *sp) |
Determine if the socket is using IPv6 Currently only works for server side addresses. | |
bool | mprIsStopped(void) |
Test if the application is stopped If this routine returns true, the application shutdown has passed the point of no return. | |
bool | mprIsStopping(void) |
Test if the application is stopping If mprIsStopping is true, the application has commenced a shutdown. | |
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. | |
char * | mprJoinPaths(cchar *base, ...) |
Join paths. | |
MprList * | mprJsonToEnv(MprJson *json, cchar *prefix, MprList *list) |
Convert a JSON object to a string of environment variables. | |
MprHash * | mprJsonToHash(MprJson *json) |
Convert a JSON object into a Hash object. | |
char * | mprJsonToString(MprJson *obj, int flags) |
Serialize a JSON object into a string. | |
char * | mprListToString(MprList *list, cchar *join) |
Convert a list of strings to a single string. | |
Socket | mprListenOnSocket(MprSocket *sp, cchar *ip, int port, int flags) |
Listen on a server socket for incoming connections. | |
MprJson * | mprLoadJson(cchar *path) |
Load a JSON object from a filename. | |
int | mprLoadModule(MprModule *mp) |
Load a module. | |
int | mprLoadNativeModule(MprModule *mp) |
Load a native module. | |
int | mprLoadSsl(void) |
Load the SSL module. | |
void | mprLock(MprMutex *lock) |
Lock access. | |
void | mprLog(cchar *tags, int level, cchar *fmt, ...) |
Write a message to the error log file. | |
void void | mprLogConfig(void) |
Show the product configuration at the start of the log file. | |
void | mprLogJson(int level, MprJson *obj, cchar *fmt, ...) PRINTF_ATTRIBUTE(3 |
Trace the JSON object to the debug log. | |
int | mprLookAtLastCharInBuf(MprBuf *buf) |
Peek at the last character in the buffer. | |
int | mprLookAtNextCharInBuf(MprBuf *buf) |
Peek at the next character in the buffer. | |
char * | mprLookupCache(MprCache *cache, cchar *key, MprTime *modified, int64 *version) |
Lookup an item in the cache. | |
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 | mprLookupStringItem(MprList *list, cchar *str) |
Find a string item and return its index. | |
int | mprMakeArgv(cchar *command, cchar ***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. | |
char * | mprMakePassword(cchar *password, int saltLength, int rounds) |
Make a password hash for a plain-text password using the Blowfish algorithm. | |
char * | mprMakeSalt(ssize size) |
Make salt for adding to a password. | |
void | mprMapSeparators(char *path, int separator) |
Map the separators in a path. | |
void | mprMark(void *ptr) |
Mark a memory block as in-use. | |
int | mprMemcmp(cvoid *b1, size_t b1Len, cvoid *b2, size_t b2Len) |
Compare two byte strings. | |
size_t | mprMemcpy(void *dest, size_t destMax, cvoid *src, size_t nbytes) |
Safe copy for a block of data. | |
void * | mprMemdup(cvoid *ptr, size_t size) |
Duplicate a block of memory. | |
void | mprNap(MprTicks msec) |
Nap for a while. | |
bool | mprNeedYield(void) |
Test if a thread should call mprYield. | |
char * | mprNormalizePath(cchar *path) |
Normalize a path. | |
int | mprNotifyOn(MprWaitHandler *wp, int mask) |
Begin I/O notification services on a wait handler. | |
MprFile * | mprOpenFile(cchar *filename, int omode, int perms) |
Open a file. | |
int | mprParseArgs(char *command, char **argv, int maxArgs) |
Make a argv style array of command arguments. | |
void MprJson * | mprParseJson(cchar *str) |
Parse a JSON string into an object tree. | |
MprJson * | mprParseJsonEx(cchar *str, MprJsonCallback *callback, void *data, MprJson *obj, cchar **errorMsg) |
Extended JSON parsing from a JSON string into an object tree. | |
MprJson * | mprParseJsonInto(cchar *str, MprJson *obj) |
Parse a JSON string into an existing object. | |
int | mprParseSocketAddress(cchar *address, cchar **ip, int *port, int *secure, int defaultPort) |
Parse an socket address IP address. | |
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 * | mprPopItem(MprList *list) |
Pop an item. | |
int | mprPreloadSsl(struct MprSsl *ssl, int flags) |
Preload SSL configuration. | |
void | mprPrintMem(cchar *msg, int flags) |
Print a memory usage report to stdout. | |
ssize ssize,ssize | mprPrintf(cchar *fmt, ...) PRINTF_ATTRIBUTE(1 |
Formatted print. | |
ssize ssize,ssize,ssize,char,* | mprPrintfCore(char *buf, ssize maxsize, cchar *fmt, va_list args) |
Format a string into a buffer. | |
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. | |
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 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. | |
ssize | mprPutSubStringToBuf(MprBuf *buf, cchar *str, ssize count) |
Put a substring to the buffer. | |
ssize | mprPutToBuf(MprBuf *buf, cchar *fmt, ...) PRINTF_ATTRIBUTE(2 |
Put a formatted string to the buffer. | |
MprJson * | mprQueryJson(MprJson *obj, cchar *key, cchar *value, int type) |
Query a JSON object for a property key path and execute the given command. | |
void | mprQueueIOEvent(MprWaitHandler *wp) |
Queue an IO event for dispatch on the wait handler dispatcher. | |
int | mprRandom(void) |
Return a random number. | |
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. | |
cchar * | mprReadJson(MprJson *obj, cchar *name) |
Read a JSON property. | |
MprJson * | mprReadJsonObj(MprJson *obj, cchar *name) |
Read a JSON object. | |
MprJson * | mprReadJsonValue(MprJson *obj, cchar *value) |
Read a JSON object by value. | |
char * | mprReadLine(MprFile *file, ssize size, ssize *len) |
Read a line from the file. | |
ssize | mprReadSocket(MprSocket *sp, void *buf, ssize size) |
Read from a socket. | |
void * | mprRealloc(void *ptr, size_t size) |
Reallocate a block. | |
int | mprReapCmd(MprCmd *cmd, MprTicks timeout) |
Reap the command. | |
void | mprRecallWaitHandler(MprWaitHandler *wp) |
Recall a wait handler. | |
void | mprRecallWaitHandlerByFd(Socket fd) |
Recall a wait handler by fd. | |
int | mprRefillBuf(MprBuf *buf) |
Refill the buffer with data. | |
void | mprRelease(cvoid *ptr) |
Release a memory block. | |
void | mprReleaseBlocks(cvoid *ptr, ...) |
Release a memory blocks. | |
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. | |
MprJson * | mprRemoveJson(MprJson *obj, cchar *key) |
Remove a property from a JSON object. | |
MprJson * | mprRemoveJsonChild(MprJson *obj, MprJson *child) |
Remove a child from a JSON object WARNING: do not call this API when traversing the object in question using ITERATE_JSON. | |
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(cvoid *ptr) |
Remove a memory block as a root for garbage collection. | |
void | mprRemoveSocketHandler(MprSocket *sp) |
Remove a socket wait handler. | |
int | mprRemoveStringItem(MprList *list, cchar *str) |
Remove a string item from the list. | |
void | mprRemoveWaitHandler(MprWaitHandler *wp) |
Remove a wait handler from the wait service. | |
char * | mprReplacePathExt(cchar *path, cchar *ext) |
Replace an extension to a path. | |
void | mprRescheduleEvent(MprEvent *event, MprTicks period) |
Reschedule an event. | |
void | mprResetBufIfEmpty(MprBuf *buf) |
Reset the buffer. | |
void | mprResetCond(MprCond *cond) |
Reset a condition variable. | |
void | mprResetMemError(void) |
Reset the memory allocation error flag. | |
void | mprResetYield(void) |
Reset a sticky yield. | |
char * | mprResolvePath(cchar *base, cchar *path) |
Resolve paths. | |
void | mprRestart(void) |
Restart the application. | |
void | mprRestartContinuousEvent(MprEvent *event) |
Restart an event. | |
int | mprRun(MprDispatcher *dispatcher, cchar *command, cchar *input, char **output, char **error, MprTicks timeout) |
Run a simple blocking command using a string command line. | |
int | mprRunCmd(MprCmd *cmd, cchar *command, cchar **envp, cchar *in, char **out, char **err, MprTicks timeout, int flags) |
Run a command using a string command line. | |
int | mprRunCmdV(MprCmd *cmd, int argc, cchar **argv, cchar **envp, cchar *in, char **out, char **err, MprTicks timeout, int flags) |
Run a command using an argv[] array of arguments. | |
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. | |
int | mprSaveJson(MprJson *obj, cchar *path, int flags) |
Save a JSON object to a filename. | |
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. | |
char * | mprSerialize(MprHash *hash, int flags) |
Serialize a hash of properties as a JSON string. | |
int | mprServiceEvents(MprTicks delay, int flags) |
Service events. | |
bool | mprServicesAreIdle(bool traceRequests) |
Determine if the MPR services. | |
int | mprSetAppName(cchar *name, cchar *title, cchar *version) |
Set the application name, title and version. | |
void | mprSetAppPath(cchar *path) |
Set the application executable path. | |
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, MprTicks lifespan, int64 memory, int resolution) |
Set the cache resource limits. | |
int | mprSetCacheLink(MprCache *cache, cchar *key, void *link) |
Set a linked managed memory reference for a cached item. | |
void | mprSetCacheNotify(MprCache *cache, MprCacheProc notify) |
Set a notification callback to be invoked for events of interest on cached items. | |
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 | mprSetDebugMode(bool on) |
Turn on debug mode. | |
void | mprSetDomainName(cchar *s) |
Set the application domain name string. | |
void | mprSetEnv(cchar *key, cchar *value) |
Set an environment variable value. | |
void | mprSetError(int error) |
Set the error code. | |
void | mprSetEventServiceSleep(MprTicks delay) |
Set the maximum sleep time for the event service. | |
void | mprSetExitStatus(int status) |
Set the proposed exit status. | |
void | mprSetExitTimeout(MprTicks timeout) |
Set the exit timeout for a shutdown. | |
void | mprSetFilesLimit(int limit) |
Set the maximum number of open file/socket descriptors. | |
void | mprSetHostName(cchar *s) |
Set the application host name string. | |
MprIdleCallback | mprSetIdleCallback(MprIdleCallback idleCallback) |
Define a new idle callback to be invoked by mprIsIdle() | |
void | mprSetIpAddr(cchar *ip) |
Sete the application IP address string. | |
void * | mprSetItem(MprList *list, int index, cvoid *item) |
Set a list item. | |
int | mprSetJson(MprJson *obj, cchar *key, cchar *value, int type) |
Update a key/value in the JSON object with a string value. | |
void | mprSetJsonError(MprJsonParser *jp, cchar *fmt, ...) PRINTF_ATTRIBUTE(2 |
Signal a parse error in the JSON input stream. | |
void int | mprSetJsonObj(MprJson *obj, cchar *key, MprJson *value) |
Update a property in a JSON object. | |
void | mprSetKey(cchar *key, void *value) |
Store a key/value pair. | |
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. | |
MprLogHandler | mprSetLogHandler(MprLogHandler handler) |
Set an MPR debug log handler. | |
void | mprSetLogLevel(int level) |
Set the current logging verbosity level. | |
void * | mprSetManager(void *ptr, MprManager 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(void) |
Set an memory allocation error condition on a memory context. | |
void | mprSetMemLimits(ssize warnHeap, ssize maximum, ssize cache) |
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, MprTicks timeout) |
Set a module timeout. | |
void | mprSetOsError(int error) |
Set the O/S error code. | |
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. | |
void | mprSetServerName(cchar *s) |
Set the application server name string. | |
int | mprSetSocketBlockingMode(MprSocket *sp, bool on) |
Set the socket blocking mode. | |
void | mprSetSocketDispatcher(MprSocket *sp, MprDispatcher *dispatcher) |
Set the dispatcher to use for socket events. | |
void | mprSetSocketEof(MprSocket *sp, bool eof) |
Set an EOF condition on the socket. | |
int | mprSetSocketNoDelay(MprSocket *sp, bool on) |
Set the socket delay mode. | |
void | mprSetSslAlpn(struct MprSsl *ssl, cchar *protocols) |
Set the ALPN protocols for SSL. | |
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(MprSsl *ssl, cchar *ciphers) |
Set the ciphers to use. | |
void | mprSetSslDevice(MprSsl *ssl, cchar *device) |
Set the SSL Engine to use. | |
void | mprSetSslHostname(MprSsl *ssl, cchar *hostname) |
Set the desired hostname for this SSL configuration when using SNI. | |
void | mprSetSslKeyFile(struct MprSsl *ssl, cchar *keyFile) |
Set the key file to use for SSL. | |
void | mprSetSslLogLevel(struct MprSsl *ssl, int level) |
Set the SSL log level at which to start tracing SSL events. | |
void | mprSetSslMatch(struct MprSsl *ssl, MprMatchSsl match) |
Set a match callback to select the appropriate SSL configuration to use in response to a client SNI hello. | |
void | mprSetSslProtocols(struct MprSsl *ssl, int protocols) |
Set the SSL protocol to use. | |
void | mprSetSslProvider(MprSocketProvider *provider) |
Set the SSL provider to use. | |
void | mprSetSslRenegotiate(MprSsl *ssl, bool enable) |
Control SSL session renegotiation. | |
void | mprSetSslRevoke(struct MprSsl *ssl, cchar *revoke) |
Define a list of certificates to revoke. | |
void | mprSetSslTicket(MprSsl *ssl, bool enable) |
Enable SSL session tickets. | |
bool | mprSetThreadYield(MprThread *tp, bool on) |
Set whether a thread can yield for GC. | |
void | mprSetWorkerStackSize(int size) |
Set the default worker stack size. | |
bool | mprShouldAbortRequests(void) |
Test if requests should be aborted. | |
bool | mprShouldDenyNewRequests(void) |
Test if new requests should be denied. | |
void | mprShutdown(int exitStrategy, int status, MprTicks timeout) |
Initiate shutdown of the MPR and application. | |
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 | mprSleep(MprTicks msec) |
Sleep for a while. | |
bool | mprSocketHandshaking(MprSocket *sp) |
Test if the socket is doing an SSL handshake. | |
bool | mprSocketHasBuffered(MprSocket *sp) |
Test if the socket has buffered data. | |
bool | mprSocketHasBufferedRead(MprSocket *sp) |
Test if the socket has buffered read data. | |
bool | mprSocketHasBufferedWrite(MprSocket *sp) |
Test if the socket has buffered write data. | |
void * | mprSort(void *base, ssize num, ssize width, MprSortProc compare, void *ctx) |
Quicksort. | |
MprList * | mprSortList(MprList *list, MprSortProc compare, void *ctx) |
Sort a list. | |
void | mprSpinLock(MprSpin *lock) |
Lock a spinlock. | |
void | mprSpinUnlock(MprSpin *lock) |
Unlock a spinlock. | |
int | mprSslInit(void *unused, MprModule *module) |
Initialize the SSL provider. | |
int | mprStart(void) |
Start the Mpr services. | |
int | mprStartCmd(MprCmd *cmd, int argc, cchar **argv, cchar **envp, int flags) |
Start the command. | |
int | mprStartDispatcher(MprDispatcher *dispatcher) |
Start a dispatcher by setting it on the run queue. | |
int | mprStartEventsThread(void) |
Start an thread dedicated to servicing events. | |
int | mprStartLogging(cchar *logSpec, int flags) |
Start logging. | |
int | mprStartModule(MprModule *mp) |
Start a module. | |
int | mprStartModuleService(void) |
Start the module service. | |
int | mprStartOsService(void) |
Start the O/S dependent subsystem. | |
int | mprStartOsThread(cchar *name, void *proc, void *data, MprThread *tp) |
Start an O/S thread. | |
int | mprStartThread(MprThread *thread) |
Start a thread. | |
int | mprStartWorker(MprWorkerProc proc, void *data) |
Start a worker thread. | |
Socket | mprStealSocketHandle(MprSocket *sp) |
Steal the socket handle. | |
int | mprStopCmd(MprCmd *cmd, int signal) |
Stop the command. | |
void | mprStopContinuousEvent(MprEvent *event) |
Stop an event. | |
int | mprStopDispatcher(MprDispatcher *dispatcher) |
Stop a dispatcher by removing it from the run queue. | |
int | mprStopModule(MprModule *mp) |
Stop a module. | |
void | mprStopModuleService(void) |
Stop the module service. | |
void | mprStopOsService(void) |
Stop the O/S dependent subsystem. | |
void | mprSuspendThread(MprTicks timeout) |
Suspend the current thread. | |
char * | mprTransformPath(cchar *path, int flags) |
Transform a path. | |
char * | mprTrimPathComponents(cchar *path, int count) |
Trim path components from a path. | |
char * | mprTrimPathDrive(cchar *path) |
Trim the drive from 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. | |
int | mprUnloadModule(MprModule *mp) |
Unload a module. | |
int | mprUnloadNativeModule(MprModule *mp) |
Unload a native module. | |
void | mprUnlock(MprMutex *lock) |
Unlock a mutex. | |
int | mprUpgradeSocket(MprSocket *sp, struct MprSsl *ssl, cchar *peerName) |
Upgrade a socket to use SSL/TLS. | |
char * | mprUriDecode(cchar *uri) |
Decode a URI string by de-scaping URI characters. | |
char * | mprUriDecodeInSitu(char *uri) |
Decode a URI string by de-scaping URI characters. | |
char * | mprUriEncode(cchar *uri, int map) |
Encode a string by escaping URI characters. | |
void int | mprUsingDefaultLogHandler(void) |
Determine if the app is using the default MPR log handler. | |
void | mprVerifySslDepth(struct MprSsl *ssl, int depth) |
Control the depth of SSL SSL certificate verification. | |
void | mprVerifySslIssuer(struct MprSsl *ssl, bool on) |
Control the verification of SSL certificate issuers. | |
void | mprVerifySslPeer(struct MprSsl *ssl, cchar *mode) |
Require verification of peer certificates. | |
void * | mprVirtAlloc(size_t size, int mode) |
Memory virtual memory into the applications address space. | |
void | mprVirtFree(void *ptr, size_t size) |
Free (unpin) a mapped section of virtual memory. | |
int | mprWaitForCmd(MprCmd *cmd, MprTicks timeout) |
Wait for the command to complete. | |
int | mprWaitForCond(MprCond *cond, MprTicks timeout) |
Wait for a condition lock variable. | |
int | mprWaitForEvent(MprDispatcher *dispatcher, MprTicks timeout, int64 mark) |
Wait for an event to occur on the given dispatcher. | |
void | mprWaitForIO(MprWaitService *ws, MprTicks timeout) |
Wait for I/O. | |
int | mprWaitForMultiCond(MprCond *cond, MprTicks timeout) |
Wait for a condition lock variable for use with multiple waiters. | |
int | mprWaitForSingleIO(int fd, int mask, MprTicks timeout) |
Wait for I/O on a file descriptor. | |
void | mprWaitOn(MprWaitHandler *wp, int desiredMask) |
Subscribe for desired wait events. | |
void | mprWakeEventService(void) |
Wake the event service. | |
ssize | mprWriteCache(MprCache *cache, cchar *key, cchar *value, MprTime modified, MprTicks lifespan, int64 version, int options) |
Write a cache item. | |
ssize | mprWriteCmd(MprCmd *cmd, int channel, cchar *buf, ssize bufsize) |
Write data to an I/O channel. | |
ssize | mprWriteCmdBlock(MprCmd *cmd, int channel, cchar *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, ...) PRINTF_ATTRIBUTE(2 |
Write formatted data to a file. | |
ssize ssize | mprWriteFileString(MprFile *file, cchar *str) |
Write a string to a file. | |
int | mprWriteJson(MprJson *obj, cchar *key, cchar *value, int type) |
Write a key/value in the JSON object with a string value. | |
int | mprWriteJsonObj(MprJson *obj, cchar *key, MprJson *value) |
Write a property in a JSON object. | |
ssize | mprWritePathContents(cchar *path, cchar *buf, ssize len, int mode) |
Create a file and write contents. | |
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 of buffers 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) |
Signify to the garbage collector that the thread is ready for garbage collection. | |
void * | palloc(size_t size) |
Allocate a "permanent" block of memory that is not subject GC. | |
void | pfree(void *ptr) |
Free a "permanent" block of memory allocated via "palloc". | |
void * | prealloc(void *ptr, size_t size) |
Reallocate a "permanent" block of memory allocated via "palloc". | |
ssize ssize,ssize,ssize | print(cchar *fmt, ...) PRINTF_ATTRIBUTE(1 |
Print to stdout and add a trailing newline. | |
size_t | psize(void *ptr) |
Return the size of the block. | |
char * | scamel(cchar *str) |
Create a camel case version of the string. | |
int | scaselesscmp(cchar *s1, cchar *s2) |
Compare strings ignoring case. | |
char * | scaselesscontains(cchar *str, cchar *pattern) |
Find a pattern in a string with a caseless comparison. | |
bool | scaselessmatch(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) |
Find a pattern in a string. | |
ssize | scopy(char *dest, ssize destMax, cchar *src) |
Copy a string. | |
cchar * | sends(cchar *str, cchar *suffix) |
Test if the string ends with a given pattern. | |
void | serase(char *str) |
Erase the contents of a string. | |
char * | sfmt(cchar *fmt, ...) PRINTF_ATTRIBUTE(1 |
Format a string. | |
char 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. | |
cchar * | sjoinArgs(int argc, cchar **argv, cchar *sep) |
Join an array of 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. | |
bool | smatchsec(cchar *s1, cchar *s2) |
Secure compare strings. | |
int | sncaselesscmp(cchar *s1, cchar *s2, ssize len) |
Compare strings ignoring case. | |
char * | sncaselesscontains(cchar *str, cchar *pattern, ssize limit) |
Find a pattern in a string with a limit and a caseless comparison. | |
char * | snclone(cchar *str, ssize len) |
Clone a substring. | |
int | sncmp(cchar *s1, cchar *s2, ssize len) |
Compare strings. | |
char * | sncontains(cchar *str, cchar *pattern, ssize limit) |
Find a pattern in a string with a limit. | |
ssize | sncopy(char *dest, ssize destMax, cchar *src, ssize len) |
Copy characters from a string. | |
char * | spbrk(cchar *str, cchar *set) |
Locate the a character from a set in a string. | |
char * | sptok(char *str, cchar *pattern, char **last) |
Tokenize 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. | |
char * | ssplit(char *str, cchar *delim, char **last) |
Split a string at a delimiter. | |
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. | |
char * | stemplateJson(cchar *str, struct MprJson *tokens) |
Replace template tokens in a string with values from a lookup table. | |
char * | stitle(cchar *str) |
Create a Title Case version of the string. | |
double | stof(cchar *str) |
Convert a string to a double. | |
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. | |
struct MprList * | stolist(cchar *src) |
String to list. | |
char * | strim(cchar *str, cchar *set, int where) |
Trim a string. | |
char * | supper(cchar *str) |
Convert a string to upper case. |
Typedefs
MprBufProc | Buffer refill callback function. |
MprCacheProc | Cache item expiry callback. |
MprCmdService | Command execution service. |
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. |
MprFreeQueue | Free queue head structure. |
MprHash | Hash table control structure. |
MprHashProc | Hashing function to use for the table. |
MprHeap | Memory allocator heap. |
MprIOVec | Vectored write array. |
MprJsonCallback | JSON parsing callbacks. |
MprJsonParser | JSON parser. |
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. |
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. |
MprSortProc | Quicksort callback function. |
MprSpin | Multithreading spin lock control structure. |
MprSsl | Callback function for SNI connections. |
MprTerminator | Service shutdown notifier. |
MprThreadLocal | Thread local data storage. |
MprThreadProc | Thread main procedure. |
MprThreadService | Thread service. |
MprTicks | Elapsed time data type. |
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. |
Socket | Argument for sockets. |
size_t | Unsigned integral type. |
Defines
#define | ME_MAX_EVENTS 32 |
Maximum number of notifier events. | |
#define | ME_MPR_ALLOC_TRACE 0 |
Trace to stdout. | |
#define | ME_MPR_LOGGING 1 |
Default for logging is "on". | |
#define | ME_MPR_MAX_PASSWORD 256 |
Max password length. | |
#define | MPR_ALLOC_HOLD 0x4 |
Allocate and hold | |
#define | MPR_ALLOC_MANAGER 0x1 |
Reserve room for a manager. | |
#define | MPR_ALLOC_PAD_MASK 0x1 |
Flags that impact padding. | |
#define | MPR_ALLOC_POLICY_ABORT 4 |
Abort the app and dump core. | |
#define | MPR_ALLOC_POLICY_EXIT 3 |
Exit the app cleanly. | |
#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. | |
#define | MPR_ALLOC_ZERO 0x2 |
Zero memory. | |
#define | MPR_ARGV_ARGS_ONLY 0x1 |
Command is missing program name. | |
#define | MPR_BACKGROUND_PRIORITY 15 |
May only get CPU if idle. | |
#define | MPR_CACHE_ADD 0x2 |
mprWriteCache option to add key only if not already existing. | |
#define | MPR_CACHE_APPEND 0x8 |
mprWriteCache option to set and append if already existing. | |
#define | MPR_CACHE_NOTIFY_CREATE 1 |
Item has been created. | |
#define | MPR_CACHE_NOTIFY_REMOVE 2 |
Item is about to be removed. | |
#define | MPR_CACHE_NOTIFY_UPDATE 4 |
Item has been updated. | |
#define | MPR_CACHE_PREPEND 0x10 |
mprWriteCache option to set and prepend if already existing. | |
#define | MPR_CACHE_SET 0x4 |
mprWriteCache option to update key value, create if required. | |
#define | MPR_CACHE_SHARED 0x1 |
Use shared cache for mprCreateCache() | |
#define | MPR_CG_DEFAULT 0x0 |
mprGC flag to run GC if necessary. | |
#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_EXACT_ENV 0x8 |
mprRunCmd flag to use the exact environment (no inherit from parent). | |
#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_CREATED 1 |
Applicationa and MPR services started. | |
#define | MPR_CRITICAL_PRIORITY 99 |
May not yield. | |
#define | MPR_DAEMON 0x10 |
Make the process a daemon. | |
#define | MPR_DECODE_TOKEQ 1 |
Decode base 64 blocks up to a NULL or equals. | |
#define | MPR_DEFAULT_DATE "%a %b %d %T %Y %Z" |
Default date format used in mprFormatLocalTime/mprFormatUniversalTime when no format supplied. | |
#define | MPR_DEFAULT_MAX_THREADS 5 |
Default max threads. | |
#define | MPR_DEFAULT_MIN_THREADS 0 |
Default min threads. | |
#define | MPR_DELAY_GC_THREAD 0x8 |
Delay starting the GC thread. | |
#define | MPR_DESTROYED 6 |
Application and MPR object destroyed | |
#define | MPR_DESTROYING 5 |
Destroying core MPR services and releasing memory. | |
#define | MPR_DISABLE_GC 0x1 |
Disable GC. | |
#define | MPR_DISPATCHER_AUTO 0x8 |
Dispatcher was auto created in response to accept event. | |
#define | MPR_DISPATCHER_COMPLETE 0x10 |
Test operation is complete. | |
#define | MPR_DISPATCHER_DESTROYED 0x4 |
Dispatcher has been destroyed. | |
#define | MPR_DISPATCHER_IMMEDIATE 0x1 |
Dispatcher should run using the service events thread. | |
#define | MPR_DISPATCHER_WAITING 0x2 |
Dispatcher waiting for an event in mprWaitForEvent. | |
#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 |
Cannot access the file or resource. | |
#define | MPR_ERR_CANT_ALLOCATE -13 |
Cannot allocate resource. | |
#define | MPR_ERR_CANT_COMPLETE -14 |
Operation cannot complete. | |
#define | MPR_ERR_CANT_CONNECT -15 |
Cannot connect to network or resource. | |
#define | MPR_ERR_CANT_CREATE -16 |
Cannot create the file or resource. | |
#define | MPR_ERR_CANT_DELETE -17 |
Cannot delete the resource. | |
#define | MPR_ERR_CANT_FIND -18 |
Cannot find resource. | |
#define | MPR_ERR_CANT_INITIALIZE -19 |
Cannot initialize resource. | |
#define | MPR_ERR_CANT_LOAD -20 |
Cannot load the resource. | |
#define | MPR_ERR_CANT_OPEN -21 |
Cannot open the file or resource. | |
#define | MPR_ERR_CANT_READ -22 |
Cannot read from the file or resource. | |
#define | MPR_ERR_CANT_WRITE -23 |
Cannot 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_EVENT_ALWAYS 0x10 |
Always invoke the callback even if the event not run | |
#define | MPR_EVENT_ASYNC 1 |
Windows async select. | |
#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_EPOLL 2 |
epoll_wait. | |
#define | MPR_EVENT_KQUEUE 3 |
BSD kqueue. | |
#define | MPR_EVENT_LOCAL 0x20 |
Invoked from an MPR local thread. | |
#define | MPR_EVENT_PRIORITY 50 |
Normal priority. | |
#define | MPR_EVENT_QUICK 0x2 |
Execute inline without executing via a thread. | |
#define | MPR_EVENT_SELECT 4 |
traditional select(). | |
#define | MPR_EVENT_SELECT_PIPE 5 |
Select with pipe for wakeup. | |
#define | MPR_EVENT_STATIC_DATA 0x8 |
Event data is permanent and should not be marked by GC. | |
#define | MPR_EVENT_TIME_SLICE 20 /* 20 msec */ |
Events. | |
#define | MPR_EXIT_ABORT 0x1 |
Abort everything and call exit(). | |
#define | MPR_EXIT_NORMAL 0x0 |
Normal (graceful) exit. | |
#define | MPR_EXIT_RESTART 0x4 |
Restart after exiting. | |
#define | MPR_EXIT_SAFE 0x2 |
Graceful shutdown only if all requests complete. | |
#define | MPR_EXIT_TIMEOUT -1 |
Use timeout specified via mprSetExitTimeout | |
#define | MPR_GC_COMPLETE 0x4 |
mprGC flag to force start a GC and wait until the GC cycle fully completes including sweep phase. | |
#define | MPR_GC_FORCE 0x1 |
mprGC flag to force start a GC sweep whether it is required or not. | |
#define | MPR_GC_NO_BLOCK 0x2 |
mprGC flag to run GC if ncessary and return without yielding. | |
#define | MPR_HASH_CASELESS 0x10 |
Key comparisons ignore case. | |
#define | MPR_HASH_MANAGED_KEYS 0x100 |
Keys are managed - mark but don't dup. | |
#define | MPR_HASH_MANAGED_VALUES 0x200 |
Values are managed - mark but don't dup. | |
#define | MPR_HASH_STABLE 0x800 |
Contents are stable or only accessed by one thread. | |
#define | MPR_HASH_STATIC_KEYS 0x40 |
Keys are permanent - don't dup or mark. | |
#define | MPR_HASH_STATIC_VALUES 0x80 |
Values are permanent - don't mark. | |
#define | MPR_HASH_UNICODE 0x20 |
Hash keys are unicode strings. | |
#define | MPR_HASH_UNIQUE 0x400 |
Add to existing will fail. | |
#define | MPR_HTTP_DATE "%a, %d %b %Y %T GMT" |
Date format for use in HTTP (headers). | |
#define | MPR_JSON_APPEND 0x4 |
Default to append to existing '+' (default). | |
#define | MPR_JSON_ARRAY 0x2 |
The property is an array. | |
#define | MPR_JSON_COMBINE 0x1 |
Combine properties using '+' '-' '=' '?' prefixes. | |
#define | MPR_JSON_CREATE 0x10 |
Create if not already existing '?'. | |
#define | MPR_JSON_DATA_TYPE 0xFF8 |
Mask for core type of obj (obj|array|value). | |
#define | MPR_JSON_ENCODE_TYPES 0x8 |
Encode dates and regexp with {type:date} or {type:regexp}. | |
#define | MPR_JSON_FALSE 0x8 |
The property is false. | |
#define | MPR_JSON_NULL 0x10 |
The property is null. | |
#define | MPR_JSON_NUMBER 0x20 |
The property is a number. | |
#define | MPR_JSON_OBJ 0x1 |
The property is an object. | |
#define | MPR_JSON_OBJ_TYPE 0x7 |
Mask for core type of obj (obj|array|value). | |
#define | MPR_JSON_OVERWRITE 0x2 |
Default to overwrite existing properties '='. | |
#define | MPR_JSON_PRETTY 0x1 |
Serialize output in a more human readable, multiline "pretty" format. | |
#define | MPR_JSON_QUOTES 0x2 |
Serialize output quoting keys. | |
#define | MPR_JSON_REGEXP 0x40 |
The property is a regular expression. | |
#define | MPR_JSON_REPLACE 0x8 |
Replace existing properties '-'. | |
#define | MPR_JSON_STRING 0x80 |
The property is a string. | |
#define | MPR_JSON_STRINGS 0x4 |
Emit all values as quoted strings. | |
#define | MPR_JSON_TRUE 0x100 |
The property is true. | |
#define | MPR_JSON_UNDEFINED 0x200 |
The property is undefined. | |
#define | MPR_JSON_VALUE 0x4 |
The property is a value (false|true|null|undefined|regexp|number|string) | |
#define | MPR_LIST_STABLE 0x40 |
Contents are stable or only accessed by one thread. | |
#define | MPR_LIST_STATIC_VALUES 0x20 |
Flag for mprCreateList when values are permanent. | |
#define | MPR_LOCAL_TIMEZONE MAXINT |
Constants for mprParseTime. | |
#define | MPR_LOG_ANEW 0x1 |
Start anew on restart after backup. | |
#define | MPR_LOG_CMDLINE 0x4 |
Command line log switch uses. | |
#define | MPR_LOG_CONFIG 0x2 |
Show the configuration at the start of the log. | |
#define | MPR_LOG_DATE "%D %T" |
Date for use in log files (compact). | |
#define | MPR_LOG_DETAILED 0x8 |
Use detailed log formatting with timestamps and tags. | |
#define | MPR_LOG_HEXDUMP 0x10 |
Emit hexdump. | |
#define | MPR_LOG_TAGGED 0x10 |
Use tagged message formatting. | |
#define | MPR_MANAGE_FREE 0x1 |
Block being freed. | |
#define | MPR_MANAGE_MARK 0x2 |
Block being marked by GC. | |
#define | MPR_MAX_FILE 256 |
Maximum number of files to close when forking. | |
#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_TOO_BIG 0x8 |
Memory allocation request is too big - immediate exit. | |
#define | MPR_MEM_WARNING 0x1 |
Memory use exceeds warnHeap level limit. | |
#define | MPR_MIN_TIME_FOR_GC 2 |
Wait till 2 milliseconds of idle time possible. | |
#define | MPR_MODULE_DATA_MANAGED 0x8 |
Module.moduleData is managed. | |
#define | MPR_MODULE_LOADED 0x4 |
Dynamic module loaded. | |
#define | MPR_MODULE_STARTED 0x1 |
Module stared. | |
#define | MPR_MODULE_STOPPED 0x2 |
Module stopped. | |
#define | MPR_NO_WINDOW 0x4 |
Don't create a windows Window. | |
#define | MPR_NORMAL_PRIORITY 50 |
Normal (default) priority. | |
#define | MPR_NOT_ALL 0x20 |
Don't invoke all destructors when terminating. | |
#define | MPR_OBJ_HASH 0x1 |
Object is a hash. | |
#define | MPR_OBJ_LIST 0x1 |
Object is a hash. | |
#define | MPR_PATH_DEPTH_FIRST 0x2 |
Flag for mprGetPathFiles to do a depth-first traversal. | |
#define | MPR_PATH_DESCEND 0x1 |
Flag for mprGetPathFiles to traverse subdirectories. | |
#define | MPR_PATH_INC_HIDDEN 0x4 |
Flag for mprGetPathFiles to include hidden files. | |
#define | MPR_PATH_NO_DIRS 0x8 |
Flag for mprGetPathFiles to exclude subdirectories. | |
#define | MPR_PATH_RELATIVE 0x10 |
Flag for mprGetPathFiles to return paths relative to the directory. | |
#define | MPR_PROTO_ALL 0xF3 |
All protocols. | |
#define | MPR_PROTO_SSLV2 0x1 |
SSL V2 protocol. | |
#define | MPR_PROTO_SSLV3 0x2 |
SSL V3 protocol. | |
#define | MPR_PROTO_TLSV1_0 0x10 |
TLS V1.0 protocol. | |
#define | MPR_PROTO_TLSV1_1 0x20 |
TLS V1.1 protocol. | |
#define | MPR_PROTO_TLSV1_2 0x40 |
TLS V1.2 protocol. | |
#define | MPR_PROTO_TLSV1_3 0x80 |
TLS V1.3 protocol. | |
#define | MPR_READABLE 0x2 |
Read event mask. | |
#define | MPR_REQUEST_PRIORITY 50 |
Normal priority. | |
#define | MPR_RFC3399_DATE "%FT%TZ" |
Date format for RFC 3399 for use in HTML 5. | |
#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_SERVICE_NO_BLOCK 0x4 |
Do not block in mprServiceEvents. | |
#define | MPR_SERVICE_NO_GC 0x8 |
Don't run GC. | |
#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_BUFFERED_READ 0x800 |
Socket has buffered read data (in SSL stack). | |
#define | MPR_SOCKET_BUFFERED_WRITE 0x1000 |
Socket has buffered write data (in SSL stack). | |
#define | MPR_SOCKET_CERT_ERROR 0x10000 |
Error when validating peer certificate. | |
#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_DISCONNECTED 0x4000 |
The mprDisconnectSocket has been called. | |
#define | MPR_SOCKET_EOF 0x20 |
Seen end of file. | |
#define | MPR_SOCKET_ERROR 0x20000 |
Hard error (not just eof). | |
#define | MPR_SOCKET_GRACEFUL 1 |
Do a graceful shutdown. | |
#define | MPR_SOCKET_HANDSHAKING 0x8000 |
Doing an SSL handshake. | |
#define | MPR_SOCKET_INHERIT 0x80000 |
Allow children processes to inherit. | |
#define | MPR_SOCKET_LISTENER 0x40 |
MprSocket is server listener. | |
#define | MPR_SOCKET_NODELAY 0x100 |
Disable Nagle algorithm. | |
#define | MPR_SOCKET_NOREUSE 0x80 |
Don't set SO_REUSEADDR option. | |
#define | MPR_SOCKET_REUSE_PORT 0x40000 |
Set SO_REUSEPORT option. | |
#define | MPR_SOCKET_SERVER 0x400 |
Socket is on the server-side. | |
#define | MPR_SOCKET_THREAD 0x200 |
Process callbacks on a worker thread. | |
#define | MPR_STARTED 2 |
Applicationa and MPR services started. | |
#define | MPR_STOPPED 4 |
App is idle and now stopped. | |
#define | MPR_STOPPING 3 |
App has been instructed to shutdown. | |
#define | MPR_TIMEOUT_GC_SYNC 100 |
Short wait period for threads to synchronize. | |
#define | MPR_TIMEOUT_LINGER 2000 |
Close socket linger timeout. | |
#define | MPR_TIMEOUT_NAP 20 |
Short pause. | |
#define | MPR_TIMEOUT_NO_BUSY 1000 |
Wait period to minimize CPU drain. | |
#define | MPR_TIMEOUT_PRUNER 120000 |
Time between worker thread pruner runs (2 min). | |
#define | MPR_TIMEOUT_START_TASK 10000 |
Time to start tasks running. | |
#define | MPR_TIMEOUT_STOP 30000 |
Default wait when stopping resources (30 sec). | |
#define | MPR_TIMEOUT_STOP_TASK 10000 |
Time to stop or reap tasks (vxworks). | |
#define | MPR_TIMEOUT_WORKER 60000 |
Prune worker that has been idle for 1 min. | |
#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_USER_EVENTS_THREAD 0x2 |
User will explicitly manage own mprServiceEvents calls. | |
#define | MPR_UTC_TIMEZONE 0 |
Use UTC timezone. | |
#define | MPR_WAIT_IMMEDIATE 0x4 |
Wait handler flag to immediately service event on same thread. | |
#define | MPR_WAIT_NEW_DISPATCHER 0x2 |
Wait handler flag to create a new dispatcher for each I/O event. | |
#define | MPR_WAIT_NOT_SOCKET 0x8 |
I/O file descriptor is not a socket - windows will ignore. | |
#define | MPR_WAIT_RECALL_HANDLER 0x1 |
Wait handler flag to recall the handler asap. | |
#define | MPR_WORKER_BUSY 0x1 |
Worker currently running to a callback. | |
#define | MPR_WORKER_IDLE 0x4 |
Worker is sleeping (idle) on idleCond. | |
#define | MPR_WORKER_PRIORITY 50 |
Normal priority. | |
#define | MPR_WORKER_PRUNED 0x2 |
Worker has been pruned and will be terminated. | |
#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_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 | MPR_YIELD_COMPLETE 0x1 |
mprYield flag to wait until the GC entirely completes including sweep phase. | |
#define | MPR_YIELD_DEFAULT 0x0 |
mprYield flag if GC is required, yield and wait for mark phase to coplete, otherwise return without blocking. | |
#define | MPR_YIELD_STICKY 0x2 |
mprYield flag to yield and remain yielded until reset. |
Mpr
Primary MPR application control structure.
- Description:
- The Mpr structure stores critical application state information.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
- API Stability:
- Internal.
- Fields:
-
cchar * appDir Path of directory containing app executable. cchar * appPath Path name of application executable. void * appwebService Appweb service object. char ** argBuf Space for allocated argv. int argc Count of command line args. cchar ** argv Application command line args (not alloced). 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. void * ediService EDI object. void * ejsService Ejscript service. char * emptyString "" string. void * espService ESP service object. int eventing Servicing events thread is active. struct MprEventService * eventService Event service object. int exitStrategy How to exit the app. MprTicks exitTimeout Request timeout when exiting. MprList * fileSystems File system objects. 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. MprHash * keys Simple key/value store. 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. MprHash * mimeTypes Table of mime types. struct MprModuleService * moduleService Module service object. MprMutex * mutex Thread synchronization used for global lock. char * name Product name. struct MprDispatcher * nonBlock Nonblocking dispatcher. char * oneString "1" string. struct MprOsService * osService O/S service object. char * pathEnv Cached PATH env var. Used by MprCmd. MprFileSystem * romfs Rom file system object. char * serverName Server name portion (no domain). MprTicks shutdownStarted When the shutdown started. struct MprSignalService * signalService Signal service object. struct MprSocketService * socketService Socket service object. MprSpin * spin Quick thread synchronization. MprTime start When the MPR started. MprFile * stdError Standard error file. MprFile * stdInput Standard input file. MprFile * stdOutput Standard output file. MprCond * stopCond Sync for stopping. MprList * terminators Termination callbacks. struct MprThreadService * threadService Thread service object. MprHash * timeTokens Date/Time parsing tokens. char * title Product title. int verifySsl Default verification of SSL certificates. char * version Product version. struct MprWaitService * waitService IO Waiting service object. struct MprWorkerService * workerService Worker service object.
Assert that a condition is true.
- Parameters:
-
cond Boolean result of a conditional test.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Add a service terminator.
- Description:
- Services may create shutdown notifiers called terminators that are informed when the application commences a shutdown. The terminator may be invoked several times and the service should take appropriate action based on the MPR state.
If the state parameter is set to MPR_STOPPING, the service should not accept any new requests, but otherwise not take any destructive actions. Note this state is required to be reversible if the shutdown is cancelled.
If the state is MPR_STOPPED, the service should cancel all running requests, close files and connections and release all resources. This state is not reversible.
This exitStrategy parameter is a flags word that defines the shutdown exit strategy. See mprShutdown for details.
Services may also call mprShouldDenyNewRequests to test if the MPR state is MPR_STOPPING and mprShouldAbortRequests if the state is MPR_STOPPED.
- Parameters:
-
terminator MprTerminator callback function.
- API Stability:
- Stable.
- See Also:
- mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Trigger a breakpoint.
- Description:
- This routine is invoked for assertion errors from mprAssert and errors from mprError. It is useful in debuggers as breakpoint location for detecting errors.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Cancel a shutdown request.
- Description:
- A graceful shutdown request initiated via mprShutdown may be cancelled if the shutdown is still in progress and has not passed the point of no return. If the MPR is still in the MPR_STOPPING state, the shutdown may be cancelled. See mprGetState
- Returns:
- True if the shutdown can be cancelled. Returns false if a shutdown has not been requested or if the shutdown has advanced past the point of no return.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Check a plain-text password against the defined hashed password.
- Parameters:
-
plainTextPassword User's plain-text-password to check. passwordHash Required password in hashed format previously computed by mprMakePassword.
- Returns:
- True if the password is correct.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Initialize the application by creating an instance of the MPR.
- Description:
- Initializes the MPR and creates an Mpr control object. The Mpr Object manages all MPR facilities and services. This must be called before using any MPR API. When processing is complete, you should call mprDestroy before exiting the application.
- Parameters:
-
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 Set MPR_USER_EVENTS_THREAD if you will manage calling mprServiceEvents manually if required. There are three styles of MPR applications with respect to servicing events:
1) Applications that don't require servicing events for I/O, commands or timers
2) Applications that call mprServiceEvents directly from their main program
3) Applications that have a dedicated service events thread
Applications that do not perform I/O, run commands or create events may not need a service events thread. While creating one will do no harm, performance may be enhanced for these applications by specifying MPR_USER_EVENTS_THREAD.
Applications that have not forground processing requirements may invoke mprServiceEvents from their main program instead of creating a service events thread. This saves one thread.
The default is to create a service events thread so the full scope of MPR services are supported.
- Returns:
- Returns a pointer to the Mpr object.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Create and initialze the O/S dependent subsystem.
- Description:
- Called internally by the MPR. Should not be called by users.
- API Stability:
- Internal.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Encrypt a password using the Blowfish algorithm.
- Parameters:
-
password User's password to encrypt. salt Salt text to add to password. Helps to make each user's password unique. rounds Number of times to encrypt. More times, makes the routine slower and passwords harder to crack.
- Returns:
- The encrypted password.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Convert the process into a daemon on unix systems.
- Description:
- This converts the current process into a detached child without a parent.
- Returns:
- Zero if successful. Otherwise a negative MPR error code.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Decode a null terminated string using base-46 encoding.
- Description:
- Decoding will terminate at the first null or '='.
- Parameters:
-
str String to decode.
- Returns:
- Buffer containing the encoded data.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Decode a null terminated string using base-46 encoding.
- Parameters:
-
buf String to decode. len Return parameter with the Length of the decoded data. flags Set to MPR_DECODE_TOKEQ to stop at the first '='.
- Returns:
- Buffer containing the encoded data and returns length in len.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Destroy the MPR and all services using the MPR.
- Description:
- This call terminates the MPR and all services.
An application initializes the MPR by calling mprCreate. This creates the Mpr object, the memory allocator, garbage collector and other services. An application exits by invoking mprDestroy or by calling mprShutdown then mprDestroy.
There are two styles of MPR applications with respect to shutdown:
1) Applications that have a dedicated service events thread.
2) Applications that call mprServiceEvents directly from their main program.
Applications that have a service events thread can call mprDestroy directly from their main program when ready to exit. Applications that call mprServiceEvents from their main program will typically have some other MPR thread call mprShutdown to initiate a shutdown sequence. This will stop accepting new requests or connections and when the application is idle, the mprServiceEvents routine will return and then the main program can call then call mprDestroy.
Once the shutdown conditions are satisfied, a thread executing mprServiceEvents will return from that API and then the application should call mprDestroy and exit().
If an application needs to tailor how it exits with respect to current requests, use mprShutdown first to specify a shutdown strategy.
- Returns:
- True if the MPR can be destroyed. Returns false if the exit strategy MPR_EXIT_SAFE has been defined via mprShutdown and current requests have not completed within the exit timeout period defined by mprSetExitTimeout. In this case, the shutdown is cancelled and normal operations continue.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Reference to a permanent preallocated empty string.
- Returns:
- An empty string.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Encode a string using base-46 encoding.
- Parameters:
-
str String to encode.
- Returns:
- Buffer containing the encoded string.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Encode buffer using base-46 encoding.
- Parameters:
-
buf Buffer to encode. len Length of the buffer to encode.
- Returns:
- Buffer containing the encoded string.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Encode a string escaping typical command (shell) characters.
- Description:
- Encode a string escaping all dangerous characters that have meaning for the unix or MS-DOS command shells.
- Parameters:
-
cmd Command string to encode. escChar Escape character to use when encoding the command.
- Returns:
- An allocated string containing the escaped command.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Encode a string by escaping typical HTML characters.
- Description:
- Encode a string escaping all dangerous characters that have meaning in HTML documents.
- Parameters:
-
html HTML content to encode.
- Returns:
- An allocated string containing the escaped HTML.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Encode a string by escaping SQL special characters.
- Description:
- Encode a string escaping all dangerous characters that have meaning in SQL commands.
- Parameters:
-
cmd SQL command to encode.
- Returns:
- An allocated string containing the escaped SQL command.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get the application directory.
- Description:
- Get the directory containing the application executable.
- Returns:
- A string containing the application directory.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get the application name defined via mprSetAppName.
- Returns:
- The one-word lower case application name defined via mprSetAppName.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get the application executable path.
- Returns:
- A string containing the application executable path.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get the application title string.
- Returns:
- A string containing the application title string.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get the application version string.
- Returns:
- A string containing the application version string.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get if command line logging is being used.
- Description:
- Logging may be initiated by invoking an MPR based program with a "—log" switch. This API assists programs to tell the MPR that command line logging has been used.
- Returns:
- True if command line logging is in use.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get the debug mode.
- Description:
- Returns whether the debug mode is enabled. Some modules observe debug mode and disable timeouts and timers so that single-step debugging can be used.
- Returns:
- Returns true if debug mode is enabled, otherwise returns false.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get the application domain name string.
- Returns:
- A string containing the application domain name string.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Return the endian byte ordering for the application.
- Returns:
- MPR_LITTLE_ENDIAN or MPR_BIG_ENDIAN.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Return the error code for the most recent system or library operation.
- Description:
- Returns an error code from the most recent system call. This will be mapped to be either a POSIX error code or an MPR error code.
- Returns:
- The mapped error code.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get the exit status.
- Description:
- Get the exit status set via mprShutdown May be called after mprDestroy
- Returns:
- The proposed application exit status.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get the application host name string.
- Returns:
- A string containing the application host name string.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get the application IP address string.
- Returns:
- A string containing the application IP address string.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get a key value.
- Parameters:
-
key String key value.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get the current logging level.
- Returns:
- The current log level.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get an MD5 checksum.
- Parameters:
-
str String to examine.
- Returns:
- An allocated MD5 checksum string.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get an MD5 checksum with optional prefix string and buffer length.
- Parameters:
-
buf Buffer to checksum. len Size of the buffer. prefix String prefix to insert at the start of the result.
- Returns:
- An allocated MD5 checksum string.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Return the MPR control instance.
- Description:
- Return the MPR singleton control object.
- Returns:
- The MPR control object.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Return the O/S error code.
- Description:
- Returns an O/S error code from the most recent system call. This returns errno on Unix systems or GetLastError() on Windows.
- Returns:
- The O/S error code.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get a password from the terminal console.
- Parameters:
-
prompt Text prompt to display before reading the password.
- Returns:
- The entered password.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get some random data.
- Parameters:
-
buf Reference to a buffer to hold the random data. size Size of the buffer. block Set to true if it is acceptable to block while accumulating entropy sufficient to provide good random data. Setting to false will cause this API to not block and may return random data of a lower quality.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get some random data in ascii.
- Parameters:
-
size Size of the random data string.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get the application server name string.
- Returns:
- A string containing the application server name string.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get an SHA1 checksum.
- Parameters:
-
str String to examine.
- Returns:
- An allocated SHA1 checksum string.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get an SHA1 checksum of a null terminated string.
- Parameters:
-
str String to checksum.
- Returns:
- An allocated string containing an SHA1 checksum.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get an SHA1 checksum with optional prefix string and buffer length.
- Parameters:
-
buf Buffer to checksum. len Size of the buffer. prefix String prefix to insert at the start of the result.
- Returns:
- An allocated string containing an SHA1 checksum.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Get the MPR execution state.
- Returns:
- MPR_CREATED, MPR_STARTED, MPR_STOPPING, MPR_STOPPED, MPR_DESTROYING, or MPR_DESTROYED.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Determine if the MPR has finished.
- Description:
- This is true if the MPR services have been shutdown completely. This is typically used to determine if the App has been shutdown.
- Returns:
- True if the App has been instructed to exit and all the MPR services have been destroyed.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Test if the application is terminating and core services are being destroyed All request should immediately terminate.
- Returns:
- True if the application is in the process of exiting and core services should also exit.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Determine if the App is idle.
- Description:
- This call returns true if the App is not currently servicing any requests. By default this returns true if the MPR dispatcher, worker thread and command subsytems are idle. Callers can replace or augment the standard idle testing by definining a new idle callback via mprSetIdleCallback.
Note: this routine tests for worker threads but ignores other threads created via mprCreateThread
- Parameters:
-
traceRequests If true, emit trace regarding running requests.
- Returns:
- True if the App are idle.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Test if the application is stopped If this routine returns true, the application shutdown has passed the point of no return.
No new requests should be accepted and current requests should be aborted. Use mprIsStopping to test if shutdown has been initiated but current requests may continue. Use mprIsDestroyed to test if the application has completed its shutdown- Returns:
- True if the application is in the process of exiting.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Test if the application is stopping If mprIsStopping is true, the application has commenced a shutdown.
No new requests should be accepted and current request should complete if possible. Use mprIsDestroyed to test if the application has completed its shutdown- Returns:
- True if the application is in the process of exiting.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Make a argv style array of command arguments.
- Description:
- The given command is parsed and broken into separate arguments and returned in a null-terminated, argv array. Arguments in the command may be quoted with single or double quotes to group words into one argument. Use back-quote "\\" to escape quotes. This routine allocates memory and must not be called before #mprCreate. Consider #mprParseArgs if you need to convert a command line before calling #mprCreate. @param command Command string to parse. @param argv Output parameter containing the parsed arguments. @param flags Set to MPR_ARGV_ARGS_ONLY if the command string does not contain a program name. In this case, argv[0] will be set to "".
- Returns:
- The count of arguments in argv.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Make a password hash for a plain-text password using the Blowfish algorithm.
- Parameters:
-
password User's password to encrypt. saltLength Length of salt text to add to password. Helps to make each user's password unique. rounds Number of times to encrypt. More times, makes the routine slower and passwords harder to crack.
- Returns:
- The encrypted password.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Make salt for adding to a password.
- Parameters:
-
size Size in bytes of the salt text.
- Returns:
- The random salt text.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Nap for a while.
- Description:
- This routine blocks and does not yield for GC. Only use it for very short naps.
- Parameters:
-
msec Number of milliseconds to sleep.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Make a argv style array of command arguments.
- Description:
- The given command is parsed and broken into separate arguments and returned in a null-terminated, argv array. Arguments in the command may be quoted with single or double quotes to group words into one argument. Use back-quote "\\" to escape quotes. This routine modifies supplied command parameter and does not allocate any memory and may be used before mprCreate is invoked.
- Parameters:
-
command Command string to parse. argv Array for the arguments. maxArgs Size of the argv array.
- Returns:
- The count of arguments in argv.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Return a random number.
- Returns:
- A random integer.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Restart the application.
- Description:
- This call immediately restarts the application. The standard input, output and error I/O channels are preserved. All other open file descriptors are closed.
If the application is started via a monitoring launch daemon such as launchd or appman, the application should not use this API, but rather defer to the launch daemon to restart the application. In that case, the application should simply do a shutdown via mprShutdown and/or mprDestroy
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Determine if the MPR services.
- Description:
- This is the default routine invoked by mprIsIdle()
- Parameters:
-
traceRequests If true, emit trace regarding running requests.
- Returns:
- True if the MPR services are idle.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Set the application name, title and version.
- Parameters:
-
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.
- Returns:
- Zero if successful. Otherwise a negative MPR error code.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Set the application executable path.
- Parameters:
-
path A string containing the application executable path.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Set if command line logging was requested.
- Description:
- Logging may be initiated by invoking an MPR based program with a "—log" switch. This API assists programs to tell the MPR that command line logging has been used.
- Parameters:
-
on Set to true to indicate command line logging is being used.
- Returns:
- True if command line logging was enabled before this call.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Turn on debug mode.
- Description:
- Debug mode disables timeouts and timers. This makes debugging much easier.
- Parameters:
-
on Set to true to enable debugging mode.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Set the application domain name string.
- Parameters:
-
s New value to use for the application domain name.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Set an environment variable value.
- Parameters:
-
key Variable name. value Variable value.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Set the error code.
- Description:
- Set errno or equivalent.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Set the proposed exit status.
- Description:
- Set the exit status that can be retrieved via mprGetExitStatus
- Parameters:
-
status Proposed exit status value.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Set the exit timeout for a shutdown.
- Description:
- A shutdown waits for existing requests to complete before exiting. After this timeout has expired, the application will either invoke exit() or cancel the shutdown depending on whether MPR_EXIT_SAFE is defined in the exit strategy via mprShutdown. The default exit timeout is zero.
- Parameters:
-
timeout Time in milliseconds to wait for current requests to complete and the application to become idle.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Set the maximum number of open file/socket descriptors.
- Parameters:
-
limit Limit to enforce.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Set the application host name string.
This is internal to the application and does not affect the O/S host name- Parameters:
-
s New host name to use within the application.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Define a new idle callback to be invoked by mprIsIdle()
- Parameters:
-
idleCallback Callback function to invoke to test if the application is idle.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Sete the application IP address string.
- Parameters:
-
ip IP address string to store for the application.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Store a key/value pair.
- Parameters:
-
key String key value. value Manage object reference.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Set the O/S error code.
- Description:
- Set errno or equivalent.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Set the application server name string.
- Parameters:
-
s New application server name to use within the application.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Test if requests should be aborted.
- Description:
- This routine indicates that current requests should be terminated due to an application shutdown. This will be true then the MPR->state >= MPR_EXIT_STOPPED. See also mprShouldDenyNewRequests
- Returns:
- True if new requests should be denied.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Test if new requests should be denied.
- Description:
- This routine indicates if an application shutdown has been initiated and services should not accept new requests or connections. This will be true then the MPR->state >= MPR_EXIT_STOPPING. See also mprShouldAbortRequests
- Returns:
- True if new requests should be denied.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Initiate shutdown of the MPR and application.
- Description:
- Commence shutdown of the application according to the shutdown policy defined by the "exitStrategy" parameter. An application may call this routine from any thread to request the application exit. Depending on the exitStrategy, this may be an abortive or graceful exit. A desired application exit status code can defined to indicate the cause of the shutdown.
Once called, this routine will set the MPR execution state to MPR_EXIT_STOPPING. Services should detect this by calling mprShouldDenyNewRequests before accepting new connections or requests, but otherwise, services should not take any destructive actions until the MPR state is advanced to MPR_EXIT_STOPPED by mprDestroy. This state can be detected by calling mprShouldAbortRequests. Users can invoke mprCancelShutdown to resume normal operations provided mprDestroy has not proceeded past the point of no return when destructive termination actions are commenced.
Applications that have a user events thread and call mprServiceEvents from their main program, will typically invoke mprShutdown from some other MPR thread to initiate the shutdown. When running requests have completed, or when the shutdown timeout expires (MPR->exitTimeout), the call to mprServiceEvents in the main program will return and the application can then call mprDestroy to complete the shutdown.
Note: This routine starts the shutdown process but does not perform any destructive actions.
- Parameters:
-
exitStrategy Shutdown policy. If the MPR_EXIT_ABORT flag is specified, the application will immediately call exit() and will terminate without waiting for current requests to complete. This is not recommended for normal operation as data may be lost.
If MPR_EXIT_SAFE is defined, the shutdown will be cancelled if all requests do not complete before the exit timeout defined via mprSetExitTimeout expires.
Define the MPR_EXIT_RESTART flag for the application to automatically restart after exiting. Do not use this option if the application is using a watchdog/angel process to automatically restart the application (such as appman by appweb).status Proposed exit status to use when the application exits. See mprGetExitStatus timeout Exit timeout in milliseconds to wait for current requests to complete. If set to -1, for the default exit timeout.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Sleep for a while.
- Description:
- This routine blocks for the given time and yields for GC during that time. Ensure all memory is held before the sleep.
- Parameters:
-
msec Number of milliseconds to sleep.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Start the Mpr services.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Start an thread dedicated to servicing events.
This will create a new thread and invoke mprServiceEvents- Returns:
- Zero if successful.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Start the O/S dependent subsystem.
- API Stability:
- Internal.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStopOsService, mprUriDecode, mprUriEncode
Stop the O/S dependent subsystem.
- API Stability:
- Internal.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprUriDecode, mprUriEncode
Decode a URI string by de-scaping URI characters.
- Description:
- Decode a string with www-encoded characters that have meaning for URIs.
- Parameters:
-
uri URI to decode.
- Returns:
- A reference to the buf argument.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriEncode
Decode a URI string by de-scaping URI characters.
- Description:
- Decode a string with www-encoded characters that have meaning for URIs. This routines operates in-situ and modifies the buffer.
- Parameters:
-
uri URI to decode.
- Returns:
- A reference to the buf argument.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode, mprUriEncode
Encode a string by escaping URI characters.
- Description:
- Encode a string escaping all characters that have meaning for URIs.
- Parameters:
-
uri URI to encode. map Map to encode characters. Select from MPR_ENCODE_URI or MPR_ENCODE_URI_COMPONENT.
- Returns:
- An allocated string containing the encoded URI.
- API Stability:
- Stable.
- See Also:
- mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsDestroyed, mprIsDestroying, mprIsIdle, mprIsStopping, mprMakeArgv, mprRandom, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetDebugMode, mprSetDomainName, mprSetHostName, mprSetIdleCallback, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprShouldAbortRequests, mprShouldDenyNewRequests, mprShutdown, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprUriDecode
MprBuf
Dynamic Buffer Module.
- Description:
- MprBuf is a flexible, dynamic growable buffer structure. It has start and end pointers to the data buffer which act as read/write pointers. Routines are provided to get and put data into and out of the buffer and automatically advance the appropriate start/end pointer. By definition, the buffer is empty when the start pointer == the end pointer. Buffers can be created with a fixed size or can grow dynamically as more data is added to the buffer.
For performance, the specification of MprBuf is deliberately exposed. All members of MprBuf are implicitly public. However, it is still recommended that wherever possible, you use the accessor routines provided.
- See Also:
- MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
- API Stability:
- Internal.
- Fields:
-
ssize buflen Current size of buffer. char * data Actual buffer for data. char * end Pointer one past the last data chr. char * endbuf Pointer one past the end of buffer. ssize growBy Next growth increment to use. ssize maxsize Max size the buffer can ever grow. void * refillArg Refill arg - must be alloced memory. MprBufProc refillProc Auto-refill procedure. char * start Pointer to next data char.
Add a null character to the buffer contents.
- Description:
- Add a null byte but do not change the buffer content lengths. The null is added outside the "official" content length. This is useful when calling mprGetBufStart and using the returned pointer as a "C" string pointer.
- Parameters:
-
buf Buffer created via mprCreateBuf.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Adjust the buffer end position.
- Description:
- Adjust the buffer end position by the specified amount. This is typically used to advance the end position as content is appended to the buffer. Adjusting the start or end position will change the value returned by mprGetBufLength. If using the mprPutBlock or mprPutChar routines, adjusting the end position is done automatically.
- Parameters:
-
buf Buffer created via mprCreateBuf. count Positive or negative count of bytes to adjust the end position.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Adjust the buffer start position.
- Description:
- Adjust the buffer start position by the specified amount. This is typically used to advance the start position as content is consumed. Adjusting the start or end position will change the value returned by mprGetBufLength. If using the mprGetBlock or mprGetChar routines, adjusting the start position is done automatically.
- Parameters:
-
buf Buffer created via mprCreateBuf. count Positive or negative count of bytes to adjust the start position.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Convert the buffer contents to a string.
- Parameters:
-
buf Buffer created via mprCreateBuf.
- Returns:
- Allocated string.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Compact the buffer contents.
- Description:
- Compact the buffer contents by copying the contents down to start the the buffer origin.
- Parameters:
-
buf Buffer created via mprCreateBuf.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Create a new buffer.
- Description:
- Create a new buffer.
- Parameters:
-
initialSize Initial size of the buffer. maxSize Maximum size the buffer can grow to.
- Returns:
- A new buffer.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Flush the buffer contents.
- Description:
- Discard the buffer contents and reset the start end content pointers.
- Parameters:
-
buf Buffer created via mprCreateBuf.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Get a block of data from the buffer.
- Description:
- Get a block of data from the buffer start and advance the start position. If the requested length is greater than the available buffer content, then return whatever data is available.
- Parameters:
-
buf Buffer created via mprCreateBuf. blk Destination block for the read data. count Count of bytes to read from the buffer.
- Returns:
- The count of bytes read into the block or -1 if the buffer is empty.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Get the origin of the buffer content storage.
- Description:
- Get a pointer to the start of the buffer content storage. This is always and allocated block.
- Parameters:
-
buf Buffer created via mprCreateBuf.
- Returns:
- A pointer to the buffer content storage.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Get a reference to the end of the buffer contents.
- Description:
- Get a pointer to the location immediately after the end of the buffer contents.
- Parameters:
-
buf Buffer created via mprCreateBuf.
- Returns:
- Pointer to the end of the buffer data contents. Points to the location one after the last data byte.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Get the buffer content length.
- Description:
- Get the length of the buffer contents. This is not the same as the buffer size which may be larger.
- Parameters:
-
buf Buffer created via mprCreateBuf.
- Returns:
- The length of the content stored in the buffer in bytes.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Get the buffer refill procedure.
- Description:
- Return the buffer refill callback function.
- Parameters:
-
buf Buffer created via mprCreateBuf.
- Returns:
- The refill call back function if defined.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Get the current size of the buffer content storage.
- Description:
- This returns the size of the memory block allocated for storing the buffer contents.
- Parameters:
-
buf Buffer created via mprCreateBuf.
- Returns:
- The size of the buffer content storage.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Get the space available to store content.
- Description:
- Get the number of bytes available to store content in the buffer.
- Parameters:
-
buf Buffer created via mprCreateBuf.
- Returns:
- The number of bytes available.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Get the start of the buffer contents.
- Description:
- Get a pointer to the start of the buffer contents. Use mprGetBufLength to determine the length of the content. Use mprGetBufEnd to get a pointer to the location after the end of the content.
- Parameters:
-
buf Buffer created via mprCreateBuf.
- Returns:
- Pointer to the start of the buffer data contents.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Get a character from the buffer.
- Description:
- Get the next byte from the buffer start and advance the start position.
- Parameters:
-
buf Buffer created via mprCreateBuf.
- Returns:
- The character or -1 if the buffer is empty.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Grow the buffer.
- Description:
- Grow the storage allocated for content for the buffer. The new size must be less than the maximum limit specified via mprCreateBuf or mprSetBufSize
- Parameters:
-
buf Buffer created via mprCreateBuf. count Count of bytes by which to grow the buffer content size.
- Returns:
- Zero if successful and otherwise a negative error code.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Insert a character into the buffer.
- Description:
- Insert a character into to the buffer prior to the current buffer start point.
- Parameters:
-
buf Buffer created via mprCreateBuf. c Character to append.
- Returns:
- Zero if successful and otherwise a negative error code.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Peek at the last character in the buffer.
- Description:
- Non-destructively return the last character from just prior to the end position in the buffer. The character is returned and the end position is not altered.
- Parameters:
-
buf Buffer created via mprCreateBuf.
- Returns:
- Zero if successful and otherwise a negative error code.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Peek at the next character in the buffer.
- Description:
- Non-destructively return the next character from the start position in the buffer. The character is returned and the start position is not altered.
- Parameters:
-
buf Buffer created via mprCreateBuf.
- Returns:
- Zero if successful and otherwise a negative error code.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Put a block to the buffer.
- Description:
- Append a block of data to the buffer at the end position and increment the end pointer.
- Parameters:
-
buf Buffer created via mprCreateBuf. ptr Block to append. size Size of block to append.
- Returns:
- Zero if successful and otherwise a negative error code.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Put a character to the buffer.
- Description:
- Append a character to the buffer at the end position and increment the end pointer.
- Parameters:
-
buf Buffer created via mprCreateBuf. c Character to append.
- Returns:
- Zero if successful and otherwise a negative error code.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Put an integer to the buffer.
- Description:
- Append a integer to the buffer at the end position and increment the end pointer.
- Parameters:
-
buf Buffer created via mprCreateBuf. i Integer to append to the buffer.
- Returns:
- Number of characters added to the buffer, otherwise a negative error code.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Put padding characters to the buffer.
- Description:
- Append padding characters to the buffer at the end position and increment the end pointer.
- Parameters:
-
buf Buffer created via mprCreateBuf. c Character to append. count Count of pad characters to put.
- Returns:
- Zero if successful and otherwise a negative error code.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Put a string to the buffer.
- Description:
- Append a null terminated string to the buffer at the end position and increment the end pointer.
- Parameters:
-
buf Buffer created via mprCreateBuf. str String to append.
- Returns:
- Zero if successful and otherwise a negative error code.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Put a substring to the buffer.
- Description:
- Append a null terminated substring to the buffer at the end position and increment the end pointer.
- Parameters:
-
buf Buffer created via mprCreateBuf. str String to append. count Put at most count characters to the buffer.
- Returns:
- Zero if successful and otherwise a negative error code.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Put a formatted string to the buffer.
- Description:
- Format a string and append to the buffer at the end position and increment the end pointer.
- Parameters:
-
buf Buffer created via mprCreateBuf. fmt Printf style format string. ... Variable arguments for the format string.
- Returns:
- Zero if successful and otherwise a negative error code.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Refill the buffer with data.
- Description:
- Refill the buffer by calling the refill procedure specified via mprSetBufRefillProc
- Parameters:
-
buf Buffer created via mprCreateBuf.
- Returns:
- Zero if successful and otherwise a negative error code.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Reset the buffer.
- Description:
- If the buffer is empty, reset the buffer start and end pointers to the beginning of the buffer.
- Parameters:
-
buf Buffer created via mprCreateBuf.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprSetBufMax, mprSetBufRefillProc, mprSetBufSize
Set the maximum buffer size.
- Description:
- Update the maximum buffer size set when the buffer was created.
- Parameters:
-
buf Buffer created via mprCreateBuf. maxSize New maximum size the buffer can grow to.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufRefillProc, mprSetBufSize
Set the buffer refill procedure.
- Description:
- Define a buffer refill procedure. The MprBuf module will not invoke or manage this refill procedure. It is simply stored to allow upper layers to use and provide their own auto-refill mechanism.
- Parameters:
-
buf Buffer created via mprCreateBuf. fn Callback function to store. arg Callback data argument.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufSize
Set the buffer size.
- Description:
- Set the current buffer content size and maximum size limit. Setting a current size will immediately grow the buffer to be this size. If the size is less than the current buffer size, the requested size will be ignored. ie. this call will not shrink the buffer. Setting a maxSize will define a maximum limit for how big the buffer contents can grow. Set either argument to -1 to be ignored.
- Parameters:
-
buf Buffer created via mprCreateBuf. size Size to immediately make the buffer. If size is less than the current buffer size, it will be ignored. Set to -1 to ignore this parameter. maxSize Maximum size the buffer contents can grow to.
- Returns:
- Zero if successful and otherwise a negative error code.
- API Stability:
- Stable.
- See Also:
- MprBuf, MprBufProc, mprAddNullToBuf, mprAdjustBufEnd, mprAdjustBufStart, mprBufToString, mprCloneBuf, mprCompactBuf, mprCreateBuf, mprFlushBuf, mprGetBlockFromBuf, mprGetBufRefillProc, mprGetCharFromBuf, mprGrowBuf, mprInsertCharToBuf, mprLookAtLastCharInBuf, mprLookAtNextCharInBuf, mprPutBlockToBuf, mprPutCharToBuf, mprPutIntToBuf, mprPutPadToBuf, mprPutStringToBuf, mprPutSubStringToBuf, mprPutToBuf, mprRefillBuf, mprResetBufIfEmpty, mprSetBufMax, mprSetBufRefillProc
MprCache
In-memory caching.
- See Also:
- mprCreateCache, mprDestroyCache, mprIncCache, mprReadCache, mprRemoveCache, mprSetCacheLimits, mprWriteCache
- API Stability:
- Internal.
- Fields:
-
MprTicks lifespan Default lifespan (msec). ssize maxKeys Max number of keys. ssize maxMem Max memory for session data. MprMutex * mutex Cache lock. int resolution Frequence for pruner. struct MprCache * shared Shared common cache. MprHash * store Key/value store. MprEvent * timer Pruning timer. ssize usedMem Memory in use for keys and data.
Create a new cache object.
- Parameters:
-
options Set of option flags. Use MPR_CACHE_SHARED to select a global shared cache object.
- Returns:
- A cache instance object. On error, return null.
- API Stability:
- Stable.
Destroy a new cache object.
- Parameters:
-
cache The cache instance object returned from mprCreateCache
- API Stability:
- Stable.
Set the expiry date for a cache item.
- Parameters:
-
cache The cache instance object returned from mprCreateCache key Cache item key. expires Time when the cache item will expire. If expires is zero, the item is immediately removed from the cache.
- Returns:
- Zero if the expiry is successfully updated. Return MPR_ERR_CANT_FIND if the cache item is not present in the cache.
- API Stability:
- Stable.
Get the Cache statistics.
- Parameters:
-
cache The cache instance object returned from mprCreateCache numKeys Number of keys currently stored. mem Memory in use to store keys.
- API Stability:
- Stable.
Increment a numeric cache item.
- Parameters:
-
cache The cache instance object returned from mprCreateCache key Cache item key. amount Numeric amount to increment the cache item. This may be a negative number to decrement the item.
- Returns:
- The new value for the cache item after incrementing.
- API Stability:
- Stable.
Lookup an item in the cache.
- Description:
- Same as mprReadCache but will not update the last accessed time.
- Parameters:
-
cache The cache instance object returned from mprCreateCache key Cache item key. modified Optional MprTime value reference to receive the last modified time of the cache item. Set to null if not required. version Optional int64 value reference to receive the version number of the cache item. Set to null if not required. Cache items have a version number that is incremented every time the item is updated.
- Returns:
- The cache item value.
- API Stability:
- Stable.
Prune the cache.
- Description:
- Prune the cache and discard all cached items.
- Parameters:
-
cache The cache instance object returned from mprCreateCache
- API Stability:
- Stable.
Read an item from the cache.
- Parameters:
-
cache The cache instance object returned from mprCreateCache key Cache item key. modified Optional MprTime value reference to receive the last modified time of the cache item. Set to null if not required. version Optional int64 value reference to receive the version number of the cache item. Set to null if not required. Cache items have a version number that is incremented every time the item is updated.
- Returns:
- The cache item value.
- API Stability:
- Stable.
Remove items from the cache.
- Parameters:
-
cache The cache instance object returned from mprCreateCache key Cache item key. If set to null, then remove all keys from the cache.
- Returns:
- True if the cache item was removed.
- API Stability:
- Stable.
Set the cache resource limits.
- Parameters:
-
cache The cache instance object returned from mprCreateCache keys Set the maximum number of keys the cache can store. lifespan Set the default lifespan for cache items in milliseconds. memory Memory limit in bytes for all cache keys and items. resolution Set the cache item pruner resolution. This defines how frequently the cache manager will check items for expiration.
- API Stability:
- Stable.
- See Also:
- mprCreateCache, mprDestroyCache, mprIncCache, mprReadCache, mprRemoveCache, mprWriteCache
Set a linked managed memory reference for a cached item.
- Parameters:
-
cache The cache instance object returned from mprCreateCache key Cache item key to write. link Managed memory reference. May be NULL.
- API Stability:
- Stable.
Set a notification callback to be invoked for events of interest on cached items.
WARNING: the callback may happen on any thread. Use careful locking to synchronize access to data. Take care not to block the thread issuing the callback- Parameters:
-
cache The cache instance object returned from mprCreateCache notify MprCacheProc notification callback. Invoked for events of interest on cache items. The event is set to MPR_CACHE_NOTIFY_REMOVE when items are removed from the cache. Invoked as:.
- API Stability:
- Stable.
Write a cache item.
- Parameters:
-
cache The cache instance object returned from mprCreateCache key Cache item key to write. value Value to set for the cache item. This must be allocated memory. modified Value to set for the cache last modified time. If set to zero, the current time is obtained via mprGetTime lifespan Lifespan of the item in milliseconds. The item will be removed from the cache by the Cache manager when the lifetime expires unless it is rewritten to extend the lifespan. version Expected version number of the item. This is used to do transactional writes to the cache item. First the version number is retrieved via mprReadCache and that version number is supplied to mprWriteCache when the item is updated. If another caller updates the item in between the read/write, the version number will not match when the item is subsequently written and this call will fail with the MPR_ERR_BAD_STATE return code. Set to zero if version checking is not required. options Options to control how the item value is updated. Use MPR_CACHE_SET to update the cache item and create if it does not exist. Use MPR_CACHE_ADD to add the item only if it does not already exits. Use MPR_CACHE_APPEND to append the parameter value to any existing cache item value. Use MPR_CACHE_PREPEND to prepend the value.
- Returns:
- If writing the cache item was successful this call returns the number of bytes written. Otherwise a negative MPR error code is returned. MPR_ERR_BAD_STATE will be returned if an invalid version number is supplied. MPR_ERR_ALREADY_EXISTS will be returned if MPR_CACHE_ADD is specified and the cache item already exists.
- API Stability:
- Stable.
MprCmd
Command execution Service.
- Description:
- The MprCmd service enables execution of local commands. It uses three full-duplex pipes to communicate read, write and error data with the command.
- API Stability:
- Stable.
- See Also:
- mprCloseCmdFd, mprCreateCmd, mprDestroyCmd, mprDisableCmdEvents, mprDisconnectCmd, mprEnableCmdEvents, mprFinalizeCmd, mprGetCmdBuf, mprGetCmdExitStatus, mprGetCmdFd, mprIsCmdComplete, mprIsCmdRunning, mprReadCmd, mprReapCmd, mprRunCmd, mprRunCmdV, mprSetCmdCallback, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
- API Stability:
- Internal.
- Fields:
-
int argc Count of args in argv. cchar ** argv List of args. Null terminated. MprCmdProc callback Handler for client output and completion. void * callbackData Managed callback data reference. bool complete All channels EOF and status gathered. cchar ** defaultEnv Environment to use if no env passed to mprStartCmd. char * dir Current working dir for the process. MprDispatcher * dispatcher Dispatcher to use for wait events. MprList * env List of environment variables. Null terminated. int eofCount Count of end-of-files. MprCmdFile files[MPR_CMD_MAX_PIPE] Stdin, stdout for the command. int flags Control flags (userFlags not here). MprForkCallback forkCallback Forked client callback. void * forkData Managed fork callback data reference. cchar ** makeArgv Allocated argv. MprMutex * mutex Multithread sync. int originalPid Persistent copy of the pid. int pid Process ID of the created process. cchar * program Program path name. int requiredEof Number of EOFs required for an exit. char * searchPath Search path to use to locate the command. MprSignal * signal Signal handler for SIGCHLD. int status Command exit status. MprBuf * stderrBuf Standard error output from the client. MprBuf * stdoutBuf Standard output from the client. bool stopped Command stopped. int timedout Request has timedout. void * userData User data storage. int userFlags User flags storage.
Return true if command events are enabled.
- Parameters:
-
cmd MprCmd object created via mprCreateCmd. channel Channel number to close. Should be either MPR_CMD_STDIN, MPR_CMD_STDOUT or MPR_CMD_STDERR.
- Returns:
- True if I/O events are enabled for the given channel.
- API Stability:
- Internal.
- See Also:
- mprCloseCmdFd, mprCreateCmd, mprDestroyCmd, mprDisableCmdEvents, mprDisconnectCmd, mprEnableCmdEvents, mprFinalizeCmd, mprGetCmdBuf, mprGetCmdExitStatus, mprGetCmdFd, mprIsCmdComplete, mprIsCmdRunning, mprReadCmd, mprReapCmd, mprRunCmd, mprRunCmdV, mprSetCmdCallback, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
Close the command channel.
- Parameters:
-
cmd MprCmd object created via mprCreateCmd. channel Channel number to close. Should be either MPR_CMD_STDIN, MPR_CMD_STDOUT or MPR_CMD_STDERR.
- API Stability:
- Stable.
- See Also:
- mprCreateCmd, mprDestroyCmd, mprDisableCmdEvents, mprDisconnectCmd, mprEnableCmdEvents, mprFinalizeCmd, mprGetCmdBuf, mprGetCmdExitStatus, mprGetCmdFd, mprIsCmdComplete, mprIsCmdRunning, mprReadCmd, mprReapCmd, mprRunCmd, mprRunCmdV, mprSetCmdCallback, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
Create a new Command object.
- Returns:
- A newly allocated MprCmd object.
- API Stability:
- Stable.
- See Also:
- mprCloseCmdFd, mprDestroyCmd, mprDisableCmdEvents, mprDisconnectCmd, mprEnableCmdEvents, mprFinalizeCmd, mprGetCmdBuf, mprGetCmdExitStatus, mprGetCmdFd, mprIsCmdComplete, mprIsCmdRunning, mprReadCmd, mprReapCmd, mprRunCmd, mprRunCmdV, mprSetCmdCallback, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
Destroy the command.
- Parameters:
-
cmd MprCmd object created via mprCreateCmd.
- API Stability:
- Stable.
- See Also:
- mprCloseCmdFd, mprCreateCmd, mprDisableCmdEvents, mprDisconnectCmd, mprEnableCmdEvents, mprFinalizeCmd, mprGetCmdBuf, mprGetCmdExitStatus, mprGetCmdFd, mprIsCmdComplete, mprIsCmdRunning, mprReadCmd, mprReapCmd, mprRunCmd, mprRunCmdV, mprSetCmdCallback, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
Disable command I/O events.
This disables events on a given channel- Parameters:
-
cmd MprCmd object created via mprCreateCmd. channel Channel number to close. Should be either MPR_CMD_STDIN, MPR_CMD_STDOUT or MPR_CMD_STDERR.
- API Stability:
- Stable.
- See Also:
- mprCloseCmdFd, mprCreateCmd, mprDestroyCmd, mprDisconnectCmd, mprEnableCmdEvents, mprFinalizeCmd, mprGetCmdBuf, mprGetCmdExitStatus, mprGetCmdFd, mprIsCmdComplete, mprIsCmdRunning, mprReadCmd, mprReapCmd, mprRunCmd, mprRunCmdV, mprSetCmdCallback, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
Disconnect a command its underlying I/O channels.
This is used to prevent further I/O wait events while still preserving the MprCmd object- Parameters:
-
cmd MprCmd object created via mprCreateCmd.
- API Stability:
- Stable.
- See Also:
- mprCloseCmdFd, mprCreateCmd, mprDestroyCmd, mprDisableCmdEvents, mprEnableCmdEvents, mprFinalizeCmd, mprGetCmdBuf, mprGetCmdExitStatus, mprGetCmdFd, mprIsCmdComplete, mprIsCmdRunning, mprReadCmd, mprReapCmd, mprRunCmd, mprRunCmdV, mprSetCmdCallback, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
Enable command I/O events.
This enables events on a given channel- Parameters:
-
cmd MprCmd object created via mprCreateCmd. channel Channel number to close. Should be either MPR_CMD_STDIN, MPR_CMD_STDOUT or MPR_CMD_STDERR.
- API Stability:
- Stable.
- See Also:
- mprCloseCmdFd, mprCreateCmd, mprDestroyCmd, mprDisableCmdEvents, mprDisconnectCmd, mprFinalizeCmd, mprGetCmdBuf, mprGetCmdExitStatus, mprGetCmdFd, mprIsCmdComplete, mprIsCmdRunning, mprReadCmd, mprReapCmd, mprRunCmd, mprRunCmdV, mprSetCmdCallback, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
Enable command I/O events for the command's STDOUT and STDERR channels.
- Parameters:
-
cmd MprCmd object created via mprCreateCmd. on Set to true to enable events. Set to false to disable.
- API Stability:
- Stable.
- See Also:
- mprCloseCmdFd, mprCreateCmd, mprDestroyCmd, mprDisableCmdEvents, mprDisconnectCmd, mprEnableCmdEvents, mprFinalizeCmd, mprGetCmdBuf, mprGetCmdExitStatus, mprGetCmdFd, mprIsCmdComplete, mprIsCmdRunning, mprReadCmd, mprReapCmd, mprRunCmd, mprRunCmdV, mprSetCmdCallback, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
Finalize the writing of data to the command process.
- Parameters:
-
cmd MprCmd object created via mprCreateCmd.
- API Stability:
- Stable.
- See Also:
- mprCloseCmdFd, mprCreateCmd, mprDestroyCmd, mprDisableCmdEvents, mprDisconnectCmd, mprEnableCmdEvents, mprGetCmdBuf, mprGetCmdExitStatus, mprGetCmdFd, mprIsCmdComplete, mprIsCmdRunning, mprReadCmd, mprReapCmd, mprRunCmd, mprRunCmdV, mprSetCmdCallback, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
Get the count of active commands.
- Description:
- This is thread-safe with respect to MPR->state.
- Returns:
- Count of running commands.
- API Stability:
- Stable.
- See Also:
- mprCloseCmdFd, mprCreateCmd, mprDestroyCmd, mprDisableCmdEvents, mprDisconnectCmd, mprEnableCmdEvents, mprFinalizeCmd, mprGetCmdBuf, mprGetCmdExitStatus, mprGetCmdFd, mprIsCmdComplete, mprIsCmdRunning, mprReadCmd, mprReapCmd, mprRunCmd, mprRunCmdV, mprSetCmdCallback, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
Get the underlying buffer for a channel.
- Parameters:
-
cmd MprCmd object created via mprCreateCmd. channel Channel number to close. Should be either MPR_CMD_STDIN, MPR_CMD_STDOUT or MPR_CMD_STDERR.
- Returns:
- A reference to the MprBuf buffer structure.
- API Stability:
- Stable.
- See Also:
- mprCloseCmdFd, mprCreateCmd, mprDestroyCmd, mprDisableCmdEvents, mprDisconnectCmd, mprEnableCmdEvents, mprFinalizeCmd, mprGetCmdExitStatus, mprGetCmdFd, mprIsCmdComplete, mprIsCmdRunning, mprReadCmd, mprReapCmd, mprRunCmd, mprRunCmdV, mprSetCmdCallback, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
Get the command exit status.
- Parameters:
-
cmd MprCmd object created via mprCreateCmd.
- Returns:
- Status If the command has exited, a status between 0 and 255 is returned. Otherwise, a negative error code is returned.
- API Stability:
- Stable.
- See Also:
- mprCloseCmdFd, mprCreateCmd, mprDestroyCmd, mprDisableCmdEvents, mprDisconnectCmd, mprEnableCmdEvents, mprFinalizeCmd, mprGetCmdBuf, mprGetCmdFd, mprIsCmdComplete, mprIsCmdRunning, mprReadCmd, mprReapCmd, mprRunCmd, mprRunCmdV, mprSetCmdCallback, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
Get the underlying file descriptor for an I/O channel.
- Parameters:
-
cmd MprCmd object created via mprCreateCmd. channel Channel number to close. Should be either MPR_CMD_STDIN, MPR_CMD_STDOUT or MPR_CMD_STDERR.
- Returns:
- The file descriptor.
- API Stability:
- Stable.
- See Also:
- mprCloseCmdFd, mprCreateCmd, mprDestroyCmd, mprDisableCmdEvents, mprDisconnectCmd, mprEnableCmdEvents, mprFinalizeCmd, mprGetCmdBuf, mprGetCmdExitStatus, mprIsCmdComplete, mprIsCmdRunning, mprReadCmd, mprReapCmd, mprRunCmd, mprRunCmdV, mprSetCmdCallback, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
Test if the command is still running.
- Parameters:
-
cmd MprCmd object created via mprCreateCmd.
- Returns:
- True if the command is still running.
- API Stability:
- Stable.
- See Also:
- mprCloseCmdFd, mprCreateCmd, mprDestroyCmd, mprDisableCmdEvents, mprDisconnectCmd, mprEnableCmdEvents, mprFinalizeCmd, mprGetCmdBuf, mprGetCmdExitStatus, mprGetCmdFd, mprIsCmdComplete, mprReadCmd, mprReapCmd, mprRunCmd, mprRunCmdV, mprSetCmdCallback, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
Make the I/O channels to send and receive data to and from the command.
- Parameters:
-
cmd MprCmd object created via mprCreateCmd. channel Channel number to read from. Should be either MPR_CMD_STDIN, MPR_CMD_STDOUT or MPR_CMD_STDERR. buf Buffer to read into. bufsize Size of buffer.
- Returns:
- Zero if successful. Otherwise a negative MPR error code.
- API Stability:
- Stable.
- See Also:
- mprCloseCmdFd, mprCreateCmd, mprDestroyCmd, mprDisableCmdEvents, mprDisconnectCmd, mprEnableCmdEvents, mprFinalizeCmd, mprGetCmdBuf, mprGetCmdExitStatus, mprGetCmdFd, mprIsCmdComplete, mprIsCmdRunning, mprReapCmd, mprRunCmd, mprRunCmdV, mprSetCmdCallback, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
Reap the command.
This waits for and collect the command exit status- Parameters:
-
cmd MprCmd object created via mprCreateCmd. timeout Time in milliseconds to wait for the command to complete and exit.
- Returns:
- Zero if successful. Otherwise a negative MPR error code.
- API Stability:
- Stable.
- See Also:
- mprCloseCmdFd, mprCreateCmd, mprDestroyCmd, mprDisableCmdEvents, mprDisconnectCmd, mprEnableCmdEvents, mprFinalizeCmd, mprGetCmdBuf, mprGetCmdExitStatus, mprGetCmdFd, mprIsCmdComplete, mprIsCmdRunning, mprReadCmd, mprRunCmd, mprRunCmdV, mprSetCmdCallback, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
Run a simple blocking command using a string command line.
- Parameters:
-
dispatcher MprDispatcher event queue to use for waiting. Set to NULL to use the default MPR dispatcher. command Command line to run. input Command input. Data to write to the command which will be received on the comamnds stdin. output Reference to a string to receive the stdout from the command. error Reference to a string to receive the stderr from the command. timeout Time in milliseconds to wait for the command to complete and exit. Set to -1 to wait forever.
- Returns:
- Command exit status, or negative MPR error code.
- API Stability:
- Stable.
- See Also:
- mprCloseCmdFd, mprCreateCmd, mprDestroyCmd, mprDisableCmdEvents, mprDisconnectCmd, mprEnableCmdEvents, mprFinalizeCmd, mprGetCmdBuf, mprGetCmdExitStatus, mprGetCmdFd, mprIsCmdComplete, mprIsCmdRunning, mprReadCmd, mprReapCmd, mprRunCmd, mprRunCmdV, mprSetCmdCallback, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
Run a command using a string command line.
This starts the command via mprStartCmd() and waits for its completion- Parameters:
-
cmd MprCmd object created via mprCreateCmd. command Command line to run. envp Array of environment strings. Each environment string should be of the form: "KEY=VALUE". The array must be null terminated. in Command input. Data to write to the command which will be received on the comamnds stdin. out Reference to a string to receive the stdout from the command. err Reference to a string to receive the stderr from the command. timeout Time in milliseconds to wait for the command to complete and exit. flags Flags to modify execution. Valid flags are: MPR_CMD_NEW_SESSION Create a new session on Unix MPR_CMD_SHOW Show the commands window on Windows MPR_CMD_IN Connect to stdin MPR_CMD_OUT Capture stdout MPR_CMD_ERR Capture stderr MPR_CMD_EXACT_ENV Use the exact environment supplied. Don't inherit and blend with existing environment.
- Returns:
- Command exit status, or negative MPR error code.
- API Stability:
- Stable.
- See Also:
- mprCloseCmdFd, mprCreateCmd, mprDestroyCmd, mprDisableCmdEvents, mprDisconnectCmd, mprEnableCmdEvents, mprFinalizeCmd, mprGetCmdBuf, mprGetCmdExitStatus, mprGetCmdFd, mprIsCmdComplete, mprIsCmdRunning, mprReadCmd, mprReapCmd, mprRunCmdV, mprSetCmdCallback, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
Run a command using an argv[] array of arguments.
This invokes mprStartCmd() and waits for its completion- Parameters:
-
cmd MprCmd object created via mprCreateCmd. argc Count of arguments in argv. argv Command arguments array. envp Array of environment strings. Each environment string should be of the form: "KEY=VALUE". The array must be null terminated. in Command input. Data to write to the command which will be received on the comamnds stdin. out Reference to a string to receive the stdout from the command. err Reference to a string to receive the stderr from the command. timeout Time in milliseconds to wait for the command to complete and exit. flags Flags to modify execution. Valid flags are: MPR_CMD_NEW_SESSION Create a new session on Unix MPR_CMD_SHOW Show the commands window on Windows MPR_CMD_IN Connect to stdin MPR_CMD_OUT Capture stdout MPR_CMD_ERR Capture stderr.
- Returns:
- Zero if successful. Otherwise a negative MPR error code.
- API Stability:
- Stable.
- See Also:
- mprCloseCmdFd, mprCreateCmd, mprDestroyCmd, mprDisableCmdEvents, mprDisconnectCmd, mprEnableCmdEvents, mprFinalizeCmd, mprGetCmdBuf, mprGetCmdExitStatus, mprGetCmdFd, mprIsCmdComplete, mprIsCmdRunning, mprReadCmd, mprReapCmd, mprRunCmd, mprSetCmdCallback, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
Define a callback to be invoked to receive response data from the command.
- Parameters:
-
cmd MprCmd object created via mprCreateCmd. callback Function of the signature MprCmdProc which will be invoked for receive notification for data from the commands stdout and stderr channels. MprCmdProc has the signature: int callback(MprCmd *cmd, int channel, void *data) {}. data User defined data to be passed to the callback.
- API Stability:
- Stable.
- See Also:
- mprCloseCmdFd, mprCreateCmd, mprDestroyCmd, mprDisableCmdEvents, mprDisconnectCmd, mprEnableCmdEvents, mprFinalizeCmd, mprGetCmdBuf, mprGetCmdExitStatus, mprGetCmdFd, mprIsCmdComplete, mprIsCmdRunning, mprReadCmd, mprReapCmd, mprRunCmd, mprRunCmdV, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
Set the default environment to use for commands.
- Description:
- This environment is used if one is not defined via mprStartCmd
- Parameters:
-
cmd MprCmd object created via mprCreateCmd. env Array of environment "KEY=VALUE" strings. Null terminated.
- API Stability:
- Stable.
- See Also:
- mprCloseCmdFd, mprCreateCmd, mprDestroyCmd, mprDisableCmdEvents, mprDisconnectCmd, mprEnableCmdEvents, mprFinalizeCmd, mprGetCmdBuf, mprGetCmdExitStatus, mprGetCmdFd, mprIsCmdComplete, mprIsCmdRunning, mprReadCmd, mprReapCmd, mprRunCmd, mprRunCmdV, mprSetCmdCallback, mprSetCmdDir, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock
Set the home directory for the command.
- Parameters:
-
cmd MprCmd object created via mprCreateCmd. dir String directory path name.
- API Stability:
- Stable.
- See Also:
- mprCloseCmdFd, mprCreateCmd, mprDestroyCmd, mprDisableCmdEvents, mprDisconnectCmd, mprEnableCmdEvents, mprFinalizeCmd, mprGetCmdBuf, mprGetCmdExitStatus, mprGetCmdFd, mprIsCmdComplete, mprIsCmdRunning, mprReadCmd, mprReapCmd, mprRunCmd, mprRunCmdV, mprSetCmdCallback, mprSetCmdEnv, mprSetCmdSearchPath, mprStartCmd, mprStopCmd, mprWaitForCmd, mprWriteCmd, mprWriteCmdBlock