Components | Typedefs | Functions | Defines

MPR - Multithreaded Portable Runtime Native API

The Multithreaded Portable Runtime (MPR) is a portable runtime library for embedded applications.



The MPR provides management for logging, error handling, events, files, http, memory, ssl, sockets, strings, xml parsing, and date/time functions. It also provides a foundation of safe routines for secure programming, that help to prevent buffer overflows and other security threats. The MPR is a library and a C API that can be used in both C and C++ programs.

The MPR uses a set extended typedefs for common types. These include: bool, cchar, cvoid, uchar, short, ushort, int, uint, long, ulong, int32, uint32, int64, uint64, float, and double. The cchar type is a const char, cvoid is const void. Several types have "u" prefixes to denote unsigned qualifiers.

The MPR includes a memory allocator and generational garbage collector. The allocator is a fast, immediate coalescing allocator that will return memory back to the O/S if not required. It is optimized for frequent allocations of small blocks (< 4K) and uses a scheme of free queues for fast allocation.

Not all of these APIs are thread-safe.

Components

Mpr Primary MPR application control structure.
MprBuf Dynamic Buffer Module.
MprCache In-memory caching.
MprCmd Command execution Service.
MprEvent Event object.
MprFile File I/O Module.
MprFileSystem File system service.
MprFloat Floating Point Services.
MprHash Hash table entry structure.
MprJson JSON parser.
MprList List data structure.
MprLog Logging Services.
MprMem Memory Allocation Service.
MprMime Mime Type hash table entry (the URL extension is the key).
MprModule Loadable Module Service.
MprModuleSerivce Loadable module service.
MprPath Path (filename) Information.
MprSignal Signal control structure.
MprSocket Socket Service.
MprString Safe String Module.
MprSynch Multithreaded Synchronization Services.
MprTestService Test service facility.
MprThread Thread Service.
MprTime Date and Time Service.
MprWaitHandler Wait Handler Service.
MprWorker Worker thread structure.
MprXml Per XML session structure.

Functions

boolassertTrue(MprTestGroup *gp, cchar *loc, bool success, cchar *msg)
 Assert test.
char*itos(int64 value)
 Convert an integer to a string.
char*itosbuf(char *buf, ssize size, int64 value, int radix)
 Convert an integer to a string buffer.
char*itosradix(int64 value, int radix)
 Convert an integer to a string.
MprSocket*mprAcceptSocket(MprSocket *listen)
 Accept an incoming connection.
MprKey*mprAddDuplicateKey(MprHash *table, cvoid *key, cvoid *ptr)
 Add a duplicate symbol value into the hash table.
voidmprAddFileSystem(MprFileSystem *fs)
 Create and initialize the disk FileSystem.
intmprAddItem(MprList *list, cvoid *item)
 Add an item to a list.
MprKey*mprAddKey(MprHash *table, cvoid *key, cvoid *ptr)
 Add a symbol value into the hash table.
MprKey*mprAddKeyFmt(MprHash *table, cvoid *key, cchar *fmt, ...)
 Add a key with a formatting value into the hash table.
MprMime*mprAddMime(MprHash *table, cchar *ext, cchar *mimeType)
 Add a mime type to the mime type table.
intmprAddNullItem(MprList *list)
 Add a null item to the list.
voidmprAddNullToBuf(MprBuf *buf)
 Add a null character to the buffer contents.
voidmprAddNullToWideBuf(MprBuf *buf)
 Add a wide null character to the buffer contents.
voidmprAddRoot(void *ptr)
 Add a memory block as a root for garbage collection.
MprSignal*mprAddSignalHandler(int signo, void *handler, void *arg, MprDispatcher *dispatcher, int flags)
 Add a signal handler.
MprWaitHandler*mprAddSocketHandler(MprSocket *sp, int mask, MprDispatcher *dispatcher, void *proc, void *data, int flags)
 Add a wait handler to a socket.
voidmprAddStandardSignals()
 Add standard trapping of system signals.
voidmprAddTerminator(MprTerminator terminator)
 Add a terminator callback.
MprTestGroup*mprAddTestGroup(MprTestService *ts, MprTestDef *def)
 Add a test group to the test service.
voidmprAdjustBufEnd(MprBuf *buf, ssize count)
 Adjust the buffer end position.
voidmprAdjustBufStart(MprBuf *buf, ssize count)
 Adjust the buffer start position.
void*mprAlloc(ssize size)
 Allocate a block of memory.
void*mprAllocMem(ssize size, int flags)
 Allocate a block of memory.
void*mprAllocObj(Type type, MprManager manager)
 Allocate an object of a given type.
void*mprAllocZeroed(ssize size)
 Allocate a zeroed block of memory.
MprList*mprAppendList(MprList *list, MprList *add)
 Append a list.
char*mprAsprintf(cchar *fmt, ...)
 Format a string into an allocated buffer.
char*mprAsprintfv(cchar *fmt, va_list arg)
 Allocate a buffer of sufficient length to hold the formatted string.
voidmprAssertError(cchar *loc, cchar *msg)
 Output an assertion failed message.
voidmprAtomicAdd(volatile int *target, int value)
 Atomic Add.
voidmprAtomicAdd64(volatile int64 *target, int value)
 Atomic 64 bit Add.
voidmprAtomicBarrier()
 Apply a full (read+write) memory barrier.
intmprAtomicCas(void *volatile *target, void *expected, cvoid *value)
 Atomic Compare and Swap.
void*mprAtomicExchange(void *volatile *target, cvoid *value)
 Exchange the target and a value.
voidmprAtomicListInsert(void *volatile *head, volatile void **link, void *item)
 Atomic list insertion.
MprFile*mprAttachFileFd(int fd, cchar *name, int omode)
 Attach to an existing file descriptor.
intmprBackupLog(cchar *path, int count)
 Backup a log.
MprHash*mprBlendHash(MprHash *target, MprHash *other)
 Blend two hash tables.
voidmprBreakpoint()
 Trigger a breakpoint.
voidmprClearList(MprList *list)
 Clears the list of all items.
MprBuf*mprCloneBuf(MprBuf *orig)
 Clone a buffer.
MprHash*mprCloneHash(MprHash *table)
 Copy a hash table.
MprList*mprCloneList(MprList *src)
 Clone a list and all elements.
voidmprCloseCmdFd(MprCmd *cmd, int channel)
 Close the command channel.
intmprCloseFile(MprFile *file)
 Close a file.
voidmprCloseSocket(MprSocket *sp, bool graceful)
 Close a socket.
voidmprCompactBuf(MprBuf *buf)
 Compact the buffer contents.
intmprCompareTime(MprTime t1, MprTime t2)
 Compare two times.
voidmprConfigureSsl(struct MprSsl *ssl)
 Configure SSL based on the parsed MprSsl configuration.
intmprConnectSocket(MprSocket *sp, cchar *hostName, int port, int flags)
 Connect a client socket.
intmprCopyListContents(MprList *dest, MprList *src)
 Copy list contents.
intmprCopyPath(cchar *from, cchar *to, int omode)
 Copy a file.
Mpr*mprCreate(int argc, char **argv, int flags)
 Create an instance of the MPR.
MprBuf*mprCreateBuf(ssize initialSize, ssize maxSize)
 Create a new buffer.
MprCache*mprCreateCache(int options)
 Create a new cache object.
MprCmd*mprCreateCmd(MprDispatcher *dispatcher)
 Create a new Command object.
MprCond*mprCreateCond()
 Create a condition lock variable.
MprDispatcher*mprCreateDispatcher(cchar *name, int enable)
 Create a new event dispatcher.
MprEvent*mprCreateEvent(MprDispatcher *dispatcher, cchar *name, MprTime period, void *proc, void *data, int flags)
 Create a new event.
MprFileSystem*mprCreateFileSystem(cchar *path)
 Create and initialize the FileSystem subsystem.
MprHash*mprCreateHash(int hashSize, int flags)
 Create a hash table.
MprHash*mprCreateHashFromWords(cchar *str)
 Create a hash of words.
MprKeyValue*mprCreateKeyPair(cchar *key, cchar *value)
 Create a key / value pair.
MprList*mprCreateList(int size, int flags)
 Create a list.
MprMutex*mprCreateLock()
 Create a Mutex lock object.
voidmprCreateLogService()
 Initialize the log service.
struct Mpr*mprCreateMemService(MprManager manager, int flags)
 Create and initialize the Memory service.
MprHash*mprCreateMimeTypes(cchar *path)
 Create the mime types.
MprModule*mprCreateModule(cchar *name, cchar *path, cchar *entry, void *data)
 Create a module.
MprModuleService*mprCreateModuleService()
 Create and initialize the module service.
intmprCreateOsService()
 Create and initialze the O/S dependent subsystem.
MprRomFileSystem*mprCreateRomFileSystem(cchar *path)
 Create and initialize the ROM FileSystem.
MprSocket*mprCreateSocket(struct MprSsl *ssl)
 Create a socket.
MprSpin*mprCreateSpinLock()
 Create a spin lock lock object.
struct MprSsl*mprCreateSsl()
 Create the SSL control structure.
MprTestService*mprCreateTestService()
 Create the test service.
MprThread*mprCreateThread(cchar *name, void *proc, void *data, ssize stackSize)
 Create a new thread.
intmprCreateTimeService()
 Mpr time structure.
MprEvent*mprCreateTimerEvent(MprDispatcher *dispatcher, cchar *name, MprTime period, void *proc, void *data, int flags)
 Create a timer event.
MprWaitHandler*mprCreateWaitHandler(int fd, int mask, MprDispatcher *dispatcher, void *proc, void *data, int flags)
 Create a wait handler.
char*mprDecode64(cchar *str)
 Deocde buffer using base-46 encoding.
voidmprDecodeLocalTime(struct tm *timep, MprTime time)
 Decode a time value into a tokenized local time value.
voidmprDecodeUniversalTime(struct tm *timep, MprTime time)
 Decode a time value into a tokenized UTC time structure.
voidmprDedicateWorker(MprWorker *worker)
 Dedicate a worker thread to a current real thread.
intmprDeletePath(cchar *path)
 Delete a file.
MprObj*mprDeserialize(cchar *str)
 Deserialize a JSON string into an object tree.
MprObj*mprDeserializeCustom(cchar *str, MprJsonCallback callback, void *data)
 Custom deserialization from a JSON string into an object tree.
voidmprDestroy(int how)
 Destroy the MPR.
void*mprDestroyCache(MprCache *cache)
 Destroy a new cache object.
voidmprDestroyCmd(MprCmd *cmd)
 Destroy the command.
voidmprDestroyDispatcher(MprDispatcher *dispatcher)
 Destroy a dispatcher.
voidmprDestroyMemService()
 Destroy the memory service.
voidmprDisableCmdEvents(MprCmd *cmd, int channel)
 Disable command I/O events.
voidmprDisableFileBuffering(MprFile *file)
 Disable file buffering.
voidmprDisconnectCmd(MprCmd *cmd)
 Disconnect a command its underlying I/O channels.
voidmprDisconnectSocket(MprSocket *sp)
 Disconnect a socket by closing its underlying file descriptor.
char*mprDtoa(double value, int ndigits, int mode, int flags)
 Convert a double to ascii.
char*mprEmptyString()
 Reference to a permanent preallocated empty string.
voidmprEnableCmdEvents(MprCmd *cmd, int channel)
 Enable command I/O events.
voidmprEnableContinuousEvent(MprEvent *event, int enable)
 Enable or disable an event being continous.
voidmprEnableDispatcher(MprDispatcher *dispatcher)
 Enable a dispatcher to service events.
intmprEnableFileBuffering(MprFile *file, ssize size, ssize maxSize)
 Enable file buffering.
boolmprEnableGC(bool on)
 Enable or disable the garbage collector.
voidmprEnableSocketEvents(MprSocket *sp, int mask)
 Enable socket events for a socket callback.
char*mprEncode64(cchar *str)
 Encode buffer using base-46 encoding.
voidmprError(cchar *fmt, ...)
 Log an error message.
char*mprEscapeCmd(cchar *cmd, int escChar)
 Encode a string escaping typical command (shell) characters.
char*mprEscapeHtml(cchar *html)
 Encode a string by escaping typical HTML characters.
intmprExpireCache(MprCache *cache, cchar *key, MprTime expires)
 Set the expiry date for a cache item.
voidmprFatalError(cchar *fmt, ...)
 Log a fatal error message and exit.
voidmprFinalizeCmd(MprCmd *cmd)
 Finalize the writing of data to the command process.
voidmprFlushBuf(MprBuf *buf)
 Flush the buffer contents.
intmprFlushFile(MprFile *file)
 Flush any buffered write data.
ssizemprFlushSocket(MprSocket *sp)
 Flush a socket.
char*mprFormatLocalTime(cchar *fmt, MprTime time)
 Convert a time value to local time and format as a string.
char*mprFormatTm(cchar *fmt, struct tm *timep)
 Format a time value as a local time.
char*mprFormatUniversalTime(cchar *fmt, MprTime time)
 Convert a time value to universal time and format as a string.
ssizemprFprintf(struct MprFile *file, cchar *fmt, ...)
 Print a formatted message to a file descriptor.
char*mprGetAbsPath(cchar *path)
 Convert a path to an absolute path.
char*mprGetAppDir()
 Get the application directory.
cchar*mprGetAppName()
 Get the application name defined via mprSetAppName.
char*mprGetAppPath()
 Get the application executable path.
cchar*mprGetAppTitle()
 Get the application title string.
cchar*mprGetAppVersion()
 Get the application version string.
intmprGetAvailableWorkers()
 Get the count of available worker threads Return the count of free threads in the worker thread pool.
ssizemprGetBlockFromBuf(MprBuf *buf, char *blk, ssize count)
 Get a block of data from the buffer.
ssizemprGetBlockSize(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.
ssizemprGetBufLength(MprBuf *buf)
 Get the buffer content length.
MprBufProcmprGetBufRefillProc(MprBuf *buf)
 Get the buffer refill procedure.
ssizemprGetBufSize(MprBuf *buf)
 Get the current size of the buffer content storage.
ssizemprGetBufSpace(MprBuf *buf)
 Get the space available to store content.
char*mprGetBufStart(MprBuf *buf)
 Get the start of the buffer contents.
intmprGetCharFromBuf(MprBuf *buf)
 Get a character from the buffer.
MprBuf*mprGetCmdBuf(MprCmd *cmd, int channel)
 Get the underlying buffer for a channel.
intmprGetCmdExitStatus(MprCmd *cmd)
 Get the command exit status.
intmprGetCmdFd(MprCmd *cmd, int channel)
 Get the underlying file descriptor for an I/O channel.
boolmprGetCmdlineLogging()
 Get if command line logging is being used.
MprOsThreadmprGetCurrentOsThread()
 Get the O/S thread.
char*mprGetCurrentPath()
 Return the current working directory.
MprThread*mprGetCurrentThread()
 Get the currently executing thread.
cchar*mprGetCurrentThreadName()
 Return the name of the current thread.
char*mprGetDate(char *fmt)
 Get a string representation of the current date/time.
boolmprGetDebugMode()
 Get the debug mode.
MprDispatcher*mprGetDispatcher()
 Get the MPR primary dispatcher.
cchar*mprGetDomainName()
 Get the application domain name string.
MprTimemprGetElapsedTime(MprTime mark)
 Get the elapsed time since a time mark.
intmprGetEndian()
 Return the endian byte ordering for the application.
intmprGetError()
 Return the error code for the most recent system or library operation.
intmprGetFileChar(MprFile *file)
 Read a character from the file.
intmprGetFileFd(MprFile *file)
 Get the file descriptor for a file.
MprOffmprGetFilePosition(MprFile *file)
 Return the current file position.
MprOffmprGetFileSize(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.
intmprGetHashLength(MprHash *table)
 Return the count of symbols in a symbol entry.
cchar*mprGetHostName()
 Get the application host name string.
HWNDmprGetHwnd()
 Get the Windows window handle.
longmprGetInst()
 Get the windows application instance.
cchar*mprGetIpAddr()
 Get the application IP address string.
void*mprGetItem(MprList *list, int index)
 Get an list item.
void*mprGetLastItem(MprList *list)
 Get the last item in the list.
intmprGetListCapacity(MprList *list)
 Get the current capacity of the list.
intmprGetListLength(MprList *list)
 Get the number of items in the list.
struct MprFile*mprGetLogFile()
 Get the log file object.
MprLogHandlermprGetLogHandler()
 Get the current MPR debug log handler.
intmprGetLogLevel()
 Get the current logging level.
char*mprGetMD5(cchar *s)
 Get an MD5 checksum.
char*mprGetMD5WithPrefix(cchar *buf, ssize len, cchar *prefix)
 Get an MD5 checksum with optional prefix string and buffer length.
intmprGetMaxWorkers()
 Get the maximum count of worker pool threads Get the maximum limit of worker pool threads.
ssizemprGetMem()
 Return the amount of memory currently used by the application.
MprMemStats*mprGetMemStats()
 Return the current allocation memory statistics block.
cchar*mprGetMimeProgram(MprHash *table, cchar *mimeType)
 Get the mime type program for a given mimeType.
cchar*mprGetModuleSearchPath()
 Get the module search path.
Mpr*mprGetMpr()
 Return the MPR control instance.
char*mprGetNativePath(cchar *path)
 Get a path formatted according to the native O/S conventions.
void*mprGetNextItem(MprList *list, int *lastIndex)
 Get the next item in the list.
MprKey*mprGetNextKey(MprHash *table, MprKey *last)
 Return the next symbol in a symbol entry.
intmprGetOsError()
 Return the O/S error code.
intmprGetPageSize()
 Get the current O/S virtual page size.
char*mprGetPathBase(cchar *path)
 Get the base portion of a path.
char*mprGetPathDir(cchar *path)
 Get the directory portion of a path.
char*mprGetPathExt(cchar *path)
 Get the file extension portion of a path.
MprList*mprGetPathFiles(cchar *dir, bool enumDirs)
 Create a directory list of files.
intmprGetPathInfo(cchar *path, MprPath *info)
 Return information about a file represented by a path.
char*mprGetPathLink(cchar *path)
 Get the target of a symbolic link.
cchar*mprGetPathNewline(cchar *path)
 Get the file newline character string for a given path.
char*mprGetPathParent(cchar *path)
 Get the parent directory of a path.
cchar*mprGetPathSeparators(cchar *path)
 Get the path directory separator.
MprList*mprGetPathTree(cchar *path, int flags)
 Find files below a path directory.
char*mprGetPortablePath(cchar *path)
 Get a portable path.
void*mprGetPrevItem(MprList *list, int *lastIndex)
 Get the previous item in the list.
intmprGetRandomBytes(char *buf, ssize size, bool block)
 Get some random data.
char*mprGetRelPath(cchar *path)
 Get a relative path.
MprTimemprGetRemainingTime(MprTime mark, MprTime timeout)
 Return the time remaining until a timeout has elapsed.
cchar*mprGetServerName()
 Get the application server name string.
boolmprGetSocketBlockingMode(MprSocket *sp)
 Get the socket blocking mode.
intmprGetSocketError(MprSocket *sp)
 Get a socket error code.
intmprGetSocketFd(MprSocket *sp)
 Get the socket file descriptor.
intmprGetSocketInfo(cchar *ip, int port, int *family, int *protocol, struct sockaddr **addr, socklen_t *addrlen)
 Get the socket for an IP:Port address.
intmprGetSocketPort(MprSocket *sp)
 Get the port used by a socket.
MprFile*mprGetStderr()
 Return a file object for the Stderr I/O channel.
MprFile*mprGetStdin()
 Return a file object for the Stdin I/O channel.
MprFile*mprGetStdout()
 Return a file object for the Stdout I/O channel.
char*mprGetTempPath(cchar *tmpDir)
 Make a temporary file.
cchar*mprGetThreadName(MprThread *thread)
 Get the thread name.
intmprGetThreadPriority(MprThread *thread)
 Get the thread priroity.
uint64mprGetTicks()
 Get the CPU tick count.
MprTimemprGetTime()
 Get the system time.
intmprGetTimeZoneOffset(MprTime when)
 Get the current timezone offset for a given time.
char*mprGetWinPath(cchar *path)
 Convert a path to an absolute windows path.
voidmprGetWorkerServiceStats(MprWorkerService *ws, MprWorkerStats *stats)
 Get the Worker service statistics.
voidmprGlobalLock()
 Globally lock the application.
voidmprGlobalUnlock()
 Unlock the global mutex.
intmprGrowBuf(MprBuf *buf, ssize count)
 Grow the buffer.
boolmprHasMemError()
 Determine if the MPR has encountered memory allocation errors.
boolmprHasSecureSockets()
 Determine if SSL is available.
voidmprHold(void *ptr)
 Hold a memory block.
int64mprIncCache(MprCache *cache, cchar *key, int64 amount)
 Increment a numeric cache item.
voidmprInitList(MprList *list)
 Initialize a list structure.
MprMutex*mprInitLock(MprMutex *mutex)
 Initialize a statically allocated Mutex lock object.
MprSpin*mprInitSpinLock(MprSpin *lock)
 Initialize a statically allocated spinlock object.
intmprInsertCharToBuf(MprBuf *buf, int c)
 Insert a character into the buffer.
intmprInsertItemAtPos(MprList *list, int index, cvoid *item)
 Insert an item into a list at a specific position.
intmprIsCmdComplete(MprCmd *cmd)
 Test if a command is complete.
boolmprIsCmdRunning(MprCmd *cmd)
 Test if the command is still running.
boolmprIsExiting()
 Determine if the MPR is exiting.
boolmprIsFinished()
 Determine if the MPR has finished.
boolmprIsIdle()
 Determine if the App is idle.
intmprIsInfinite(double value)
 Test if a double value is infinte.
intmprIsNan(double value)
 Test if a double value is not-a-number.
boolmprIsPathAbs(cchar *path)
 Determine if a path is absolute.
boolmprIsPathRel(cchar *path)
 Determine if a path is relative.
boolmprIsPathSeparator(cchar *path, cchar c)
 Test if a character is a path separarator.
boolmprIsSocketEof(MprSocket *sp)
 Test if the other end of the socket has been closed.
boolmprIsSocketSecure(MprSocket *sp)
 Determine if the socket is secure.
boolmprIsStopping()
 Test if the application is stopping.
boolmprIsStoppingCore()
 Test if the application is stopping and core services are being terminated.
intmprIsValid(cvoid *ptr)
 Test is a pointer is a valid memory context.
intmprIsZero(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.
voidmprJsonParseError(MprJson *jp, cchar *fmt, ...)
 Signal a parse error in the JSON input stream.
intmprListenOnSocket(MprSocket *sp, cchar *ip, int port, int flags)
 Listen on a server socket for incoming connections.
intmprLoadModule(MprModule *mp)
 Load a module.
intmprLoadNativeModule(MprModule *mp)
 Load a native module.
MprModule*mprLoadSsl(bool lazy)
 Load the SSL module.
voidmprLock(MprMutex *lock)
 Lock access.
voidmprLog(int level, cchar *fmt, ...)
 Write a message to the diagnostic log file.
intmprLookAtLastCharInBuf(MprBuf *buf)
 Peek at the last character in the buffer.
intmprLookAtNextCharInBuf(MprBuf *buf)
 Peek at the next character in the buffer.
MprFileSystem*mprLookupFileSystem(cchar *path)
 Lookup a file system.
intmprLookupItem(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.
intmprMakeArgv(cchar *command, char ***argv, int flags)
 Make a argv style array of command arguments.
intmprMakeDir(cchar *path, int perms, int owner, int group, bool makeMissing)
 Make a directory.
intmprMakeLink(cchar *path, cchar *target, bool hard)
 Make a link.
voidmprMapSeparators(char *path, int separator)
 Map the separators in a path.
voidmprMark(void *ptr)
 Mark a memory block as in-use.
voidmprMarkBlock(cvoid *ptr)
 Mark a block as "in-use" for the Garbage Collector.
intmprMemcmp(cvoid *b1, ssize b1Len, cvoid *b2, ssize b2Len)
 Compare two byte strings.
ssizemprMemcpy(void *dest, ssize destMax, cvoid *src, ssize nbytes)
 Safe copy for a block of data.
void*mprMemdup(cvoid *ptr, ssize size)
 Duplicate a block of memory.
voidmprMemoryError(cchar *fmt, ...)
 Log a memory error message.
voidmprNap(MprTime msec)
 Nap for a while.
char*mprNormalizePath(cchar *path)
 Normalize a path.
MprFile*mprOpenFile(cchar *filename, int omode, int perms)
 Open a file.
intmprParseSocketAddress(cchar *ipSpec, char **ip, int *port, int defaultPort)
 Parse an socket address IP address.
intmprParseTestArgs(MprTestService *ts, int argc, char **argv, MprTestParser extraParser)
 Parse test command arguments.
boolmprPathExists(cchar *path, int omode)
 Determine if a file exists for a path name and can be accessed.
intmprPeekFileChar(MprFile *file)
 Non-destructively read a character from the file.
voidmprPollCmd(MprCmd *cmd, MprTime timeout)
 Poll for I/O on the command pipes.
void*mprPopItem(MprList *list)
 Pop an item.
voidmprPrintMem(cchar *msg, int detail)
 Print a memory usage report to stdout.
ssizemprPrintf(cchar *fmt, ...)
 Formatted print.
ssizemprPrintfError(cchar *fmt, ...)
 Print a formatted message to the standard error channel.
voidmprPruneCache(MprCache *cache)
 Prune the cache.
intmprPushItem(MprList *list, cvoid *item)
 Push an item onto the list.
ssizemprPutBlockToBuf(MprBuf *buf, cchar *ptr, ssize size)
 Put a block to the buffer.
intmprPutCharToBuf(MprBuf *buf, int c)
 Put a character to the buffer.
intmprPutCharToWideBuf(MprBuf *buf, int c)
 Put a wide character to the buffer.
ssizemprPutFileChar(MprFile *file, int c)
 Write a character to the file.
ssizemprPutFileString(MprFile *file, cchar *str)
 Write a string to the file.
ssizemprPutFmtToBuf(MprBuf *buf, cchar *fmt, ...)
 Put a formatted string to the buffer.
intmprPutFmtToWideBuf(MprBuf *buf, cchar *fmt, ...)
 Put a formatted wide string to the buffer.
ssizemprPutIntToBuf(MprBuf *buf, int64 i)
 Put an integer to the buffer.
ssizemprPutPadToBuf(MprBuf *buf, int c, ssize count)
 Put padding characters to the buffer.
ssizemprPutStringToBuf(MprBuf *buf, cchar *str)
 Put a string to the buffer.
intmprPutStringToWideBuf(MprBuf *buf, cchar *str)
 Put a wide string to the buffer.
ssizemprPutSubStringToBuf(MprBuf *buf, cchar *str, ssize count)
 Put a substring to the buffer.
voidmprQueueIOEvent(MprWaitHandler *wp)
 Queue an IO event for dispatch on the wait handler dispatcher.
intmprRandom()
 Return a random number.
voidmprRawLog(int level, cchar *fmt, ...)
 Write a raw log message to the diagnostic log file.
char*mprReadCache(MprCache *cache, cchar *key, MprTime *modified, int64 *version)
 Read an item from the cache.
ssizemprReadCmd(MprCmd *cmd, int channel, char *buf, ssize bufsize)
 Make the I/O channels to send and receive data to and from the command.
ssizemprReadFile(MprFile *file, void *buf, ssize size)
 Read data from a file.
char*mprReadLine(MprFile *file, ssize size, ssize *len)
 Read a line from the file.
char*mprReadRegistry(cchar *key, cchar *name)
 Read a key from the Windows registry.
ssizemprReadSocket(MprSocket *sp, void *buf, ssize size)
 Read from a socket.
void*mprRealloc(void *ptr, ssize size)
 Reallocate a block.
intmprReapCmd(MprCmd *cmd, MprTime timeout)
 Reap the command.
voidmprRecallWaitHandler(MprWaitHandler *wp)
 Recall a wait handler.
voidmprRecallWaitHandlerByFd(int fd)
 Recall a wait handler by fd.
intmprRefillBuf(MprBuf *buf)
 Refill the buffer with data.
voidmprRelayEvent(MprDispatcher *dispatcher, void *proc, void *data, MprEvent *event)
 Relay an event to a dispatcher.
voidmprRelease(void *ptr)
 Release a memory block.
voidmprReleaseWorker(MprWorker *worker)
 Release a worker thread.
boolmprRemoveCache(MprCache *cache, cchar *key)
 Remove items from the cache.
voidmprRemoveEvent(MprEvent *event)
 Remove an event.
intmprRemoveItem(MprList *list, cvoid *item)
 Remove an item from the list.
intmprRemoveItemAtPos(MprList *list, int index)
 Remove an item from the list.
intmprRemoveKey(MprHash *table, cvoid *key)
 Remove a symbol entry from the hash table.
intmprRemoveLastItem(MprList *list)
 Remove the last item from the list.
intmprRemoveRangeOfItems(MprList *list, int start, int end)
 Remove a range of items from the list.
voidmprRemoveRoot(void *ptr)
 remove a memory block as a root for garbage collection.
voidmprRemoveSocketHandler(MprSocket *sp)
 Remove a socket wait handler.
voidmprRemoveWaitHandler(MprWaitHandler *wp)
 Disconnect a wait handler from its underlying file descriptor.
char*mprReplacePathExt(cchar *dir, cchar *ext)
 Replace an extension to a path.
voidmprReportTestResults(MprTestService *ts)
 Report the test results.
voidmprRequestGC(int flags)
 Collect garbage.
voidmprRescheduleEvent(MprEvent *event, MprTime period)
 Reschedule an event.
voidmprResetBufIfEmpty(MprBuf *buf)
 Reset the buffer.
voidmprResetCond(MprCond *cond)
 Reset a condition variable.
voidmprResetMemError()
 Reset the memory allocation error flag.
voidmprResetTestGroup(MprTestGroup *gp)
 Reset a test group.
voidmprResetYield()
 Reset a sticky yield.
char*mprResolvePath(cchar *base, cchar *path)
 Resolve paths.
voidmprRestart()
 Restart the application.
voidmprRestartContinuousEvent(MprEvent *event)
 Restart an event.
intmprRunCmd(MprCmd *cmd, cchar *command, char **out, char **err, MprTime timeout, int flags)
 Run a command using a string command line.
intmprRunCmdV(MprCmd *cmd, int argc, char **argv, char **out, char **err, MprTime timeout, int flags)
 Run a command using an argv[] array of arguments.
intmprRunTests(MprTestService *ts)
 Run the define unit tests.
intmprSamePath(cchar *path1, cchar *path2)
 Compare two paths if they are the same.
intmprSamePathCount(cchar *path1, cchar *path2, ssize len)
 Compare two paths if they are the same for a given length.
char*mprSearchForModule(cchar *module)
 Search for a module on the current module path.
char*mprSearchPath(cchar *path, int flags, cchar *search, ...)
 Search for a path.
MprOffmprSeekFile(MprFile *file, int seekType, MprOff distance)
 Seek the I/O pointer to a new location in the file.
cchar*mprSerialize(MprObj *obj, int flags)
 Serialize a JSON object tree into a string.
intmprServiceEvents(MprTime delay, int flags)
 Service events.
boolmprServicesAreIdle()
 Determine if the MPR services.
intmprSetAppName(cchar *name, cchar *title, cchar *version)
 Set the application name, title and version.
voidmprSetBufMax(MprBuf *buf, ssize maxSize)
 Set the maximum buffer size.
voidmprSetBufRefillProc(MprBuf *buf, MprBufProc fn, void *arg)
 Set the buffer refill procedure.
intmprSetBufSize(MprBuf *buf, ssize size, ssize maxSize)
 Set the buffer size.
voidmprSetCacheLimits(MprCache *cache, int64 keys, int64 lifespan, int64 memory, int resolution)
 Set the cache resource limits.
voidmprSetCmdCallback(MprCmd *cmd, MprCmdProc callback, void *data)
 Define a callback to be invoked to receive response data from the command.
voidmprSetCmdDefaultEnv(MprCmd *cmd, cchar **env)
 Set the default environment to use for commands.
voidmprSetCmdDir(MprCmd *cmd, cchar *dir)
 Set the home directory for the command.
voidmprSetCmdEnv(MprCmd *cmd, cchar **env)
 Set the command environment.
voidmprSetCmdSearchPath(MprCmd *cmd, cchar *search)
 Set the default command search path.
boolmprSetCmdlineLogging(bool on)
 Set if command line logging was requested.
voidmprSetCurrentThreadPriority(int priority)
 Set the thread priroity for the current thread.
voidmprSetDebugMode(bool on)
 Turn on debug mode.
voidmprSetDomainName(cchar *s)
 Set the application domain name string.
voidmprSetExitStrategy(int strategy)
 Set the exit strategy for when the application terminates.
voidmprSetHostName(cchar *s)
 Set the application host name string.
voidmprSetHwnd(HWND handle)
 Set the MPR windows handle.
MprIdleCallbackmprSetIdleCallback(MprIdleCallback idleCallback)
 Define a new idle callback to be invoked by mprIsIdle()
voidmprSetInst(long inst)
 Set the windows application instance.
voidmprSetIpAddr(cchar *ip)
 Sete the application IP address string.
void*mprSetItem(MprList *list, int index, cvoid *item)
 Set a list item.
intmprSetListLimits(MprList *list, int initialSize, int maxSize)
 Define the list size limits.
voidmprSetLogBackup(ssize logSize, int backupCount, int flags)
 Set the log rotation parameters.
voidmprSetLogFile(struct MprFile *file)
 Set a file to be used for logging.
voidmprSetLogHandler(MprLogHandler handler)
 Set an MPR debug log handler.
voidmprSetLogLevel(int level)
 Set the current logging level.
void*mprSetManager(void *ptr, void *manager)
 Update the manager for a block of memory.
intmprSetMaxSocketAccept(int max)
 Set the maximum number of accepted client connections that are permissable.
voidmprSetMaxWorkers(int count)
 Set the maximum count of worker threads Set the maximum number of worker pool threads for the MPR.
voidmprSetMemError()
 Set an memory allocation error condition on a memory context.
voidmprSetMemLimits(ssize redline, ssize maxMemory)
 Configure the application memory limits.
voidmprSetMemNotifier(MprMemNotifier cback)
 Define a memory notifier.
voidmprSetMemPolicy(int policy)
 Set the memory allocation policy for when allocations fail.
intmprSetMimeProgram(MprHash *table, cchar *mimeType, cchar *program)
 Set the mime type program.
voidmprSetMinWorkers(int count)
 Set the minimum count of worker threads Set the count of threads the worker pool will have.
voidmprSetModuleFinalizer(MprModule *module, MprModuleProc stop)
 Define a module finalizer that will be called before a module is stopped.
voidmprSetModuleSearchPath(char *searchPath)
 Set the module search path.
voidmprSetModuleTimeout(MprModule *module, MprTime timeout)
 Set a module timeout.
voidmprSetPathNewline(cchar *path, cchar *newline)
 Set the file system new line character string.
voidmprSetPathSeparators(cchar *path, cchar *separators)
 Set the file system path separators.
intmprSetRomFileSystem(MprRomInode *inodeList)
 Set the ROM file system data.
voidmprSetSecureProvider(MprSocketProvider *provider)
 Set the provider to be the default secure socket provider.
voidmprSetServerName(cchar *s)
 Set the application server name string.
intmprSetSocketBlockingMode(MprSocket *sp, bool on)
 Set the socket blocking mode.
voidmprSetSocketEof(MprSocket *sp, bool eof)
 Set an EOF condition on the socket.
voidmprSetSocketMessage(int message)
 Set the socket message number.
intmprSetSocketNoDelay(MprSocket *sp, bool on)
 Set the socket delay mode.
voidmprSetSslCaFile(struct MprSsl *ssl, cchar *caFile)
 Set the client certificate file to use for SSL.
voidmprSetSslCaPath(struct MprSsl *ssl, cchar *caPath)
 Set the path for the client certificate directory.
voidmprSetSslCertFile(struct MprSsl *ssl, cchar *certFile)
 Set certificate to use for SSL.
voidmprSetSslCiphers(struct MprSsl *ssl, cchar *ciphers)
 Set the ciphers to use for SSL.
voidmprSetSslKeyFile(struct MprSsl *ssl, cchar *keyFile)
 Set the key file to use for SSL.
voidmprSetSslProtocols(struct MprSsl *ssl, int protocols)
 Set the SSL protocol to use.
voidmprSetThreadPriority(MprThread *thread, int priority)
 Set the thread priroity.
voidmprSetWorkerStackSize(int size)
 Set the default worker stack size.
boolmprShouldAbortRequests()
 Test if requests should be aborted.
boolmprShouldDenyNewRequests()
 Test if new requests should be denied.
voidmprSignalCond(MprCond *cond)
 Signal a condition lock variable.
voidmprSignalDispatcher(MprDispatcher *dispatcher)
 Signal the dispatcher to wakeup and re-examine its queues.
voidmprSignalMultiCond(MprCond *cond)
 Signal a condition lock variable for use with multiple waiters.
voidmprSignalTest2Complete(MprTestGroup *gp)
 Signal a test is complete.
voidmprSignalTestComplete(MprTestGroup *gp)
 Signal a test is complete.
voidmprSleep(MprTime msec)
 Sleep for a while.
boolmprSocketHasPendingData(MprSocket *sp)
 Test if the socket has buffered read data.
voidmprSortList(MprList *list, void *compare)
 Sort a list.
voidmprSpinLock(MprSpin *lock)
 Lock a spinlock.
voidmprSpinUnlock(MprSpin *lock)
 Unlock a spinlock.
char*mprSprintf(char *buf, ssize maxSize, cchar *fmt, ...)
 Format a string into a statically allocated buffer.
char*mprSprintfv(char *buf, ssize maxSize, cchar *fmt, va_list args)
 Format a string into a statically allocated buffer.
intmprStart()
 Start the Mpr services.
intmprStartCmd(MprCmd *cmd, int argc, char **argv, char **envp, int flags)
 Start the command.
intmprStartEventsThread()
 Start an thread dedicated to servicing events.
intmprStartLogging(cchar *logSpec, int showConfig)
 Start logging.
intmprStartModule(MprModule *mp)
 Start a module.
intmprStartModuleService()
 Start the module service.
intmprStartOsService()
 Start the O/S dependent subsystem.
intmprStartThread(MprThread *thread)
 Start a thread.
intmprStartWorker(MprWorkerProc proc, void *data)
 Start a worker thread.
voidmprStaticError(cchar *fmt, ...)
 Display an error message to the console without allocating any memory.
intmprStopCmd(MprCmd *cmd, int signal)
 Stop the command.
voidmprStopContinuousEvent(MprEvent *event)
 Stop an event.
voidmprStopModule(MprModule *mp)
 Stop a module.
voidmprStopModuleService()
 Stop the module service.
voidmprStopOsService()
 Stop the O/S dependent subsystem.
voidmprTerminate(int flags, int status)
 Terminate the application.
char*mprTransformPath(cchar *path, int flags)
 Transform a path.
char*mprTrimPathExt(cchar *path)
 Trim an extension from a path.
intmprTruncateFile(cchar *path, MprOff size)
 Truncate a file.
boolmprTryLock(MprMutex *lock)
 Attempt to lock access.
boolmprTrySpinLock(MprSpin *lock)
 Attempt to lock access on a spin lock.
voidmprUnloadModule(MprModule *mp)
 Unload a module.
intmprUnloadNativeModule(MprModule *mp)
 Unload a native module.
voidmprUnlock(MprMutex *lock)
 Unlock a mutex.
voidmprUpdateWaitHandler(MprWaitHandler *wp, bool wakeup)
 Apply wait handler updates.
char*mprUriDecode(cchar *uri)
 Decode a URI string by de-scaping URI characters.
char*mprUriEncode(cchar *uri, int map)
 Encode a string by escaping URI characters.
voidmprUserError(cchar *fmt, ...)
 Display an error message to the user.
intmprUsingDefaultLogHandler()
 Determine if the app is using the default MPR log handler.
voidmprValidateBlock(void *ptr)
 Validate a memory block and issue asserts if the memory block is not valid.
voidmprVerifyMem()
 Verify all memory.
voidmprVerifySslClients(struct MprSsl *ssl, bool on)
 Control the verification of SSL clients.
void*mprVirtAlloc(ssize size, int mode)
 Memory virtual memory into the applications address space.
voidmprVirtFree(void *ptr, ssize size)
 Free (unpin) a mapped section of virtual memory.
intmprWaitForCmd(MprCmd *cmd, MprTime timeout)
 Wait for the command to complete.
intmprWaitForCond(MprCond *cond, MprTime timeout)
 Wait for a condition lock variable.
intmprWaitForEvent(MprDispatcher *dispatcher, MprTime timeout)
 Wait for an event to occur on the given dispatcher.
voidmprWaitForIO(MprWaitService *ws, MprTime timeout)
 Wait for I/O.
intmprWaitForMultiCond(MprCond *cond, MprTime timeout)
 Wait for a condition lock variable for use with multiple waiters.
intmprWaitForSingleIO(int fd, int mask, MprTime timeout)
 Wait for I/O on a file descriptor.
boolmprWaitForTest2ToComplete(MprTestGroup *gp, MprTime timeout)
 Wait for a test to complete.
boolmprWaitForTestToComplete(MprTestGroup *gp, MprTime timeout)
 Wait for a test to complete.
voidmprWaitOn(MprWaitHandler *wp, int desiredMask)
 Subscribe for desired wait events.
intmprWaitTillIdle(MprTime timeout)
 Wait until the application is idle.
voidmprWarn(cchar *fmt, ...)
 Log a warning message.
ssizemprWriteCache(MprCache *cache, cchar *key, cchar *value, MprTime modified, MprTime lifespan, int64 version, int options)
 Write a cache item.
ssizemprWriteCmd(MprCmd *cmd, int channel, char *buf, ssize bufsize)
 Write data to an I/O channel.
ssizemprWriteFile(MprFile *file, cvoid *buf, ssize count)
 Write data to a file.
ssizemprWriteFileFmt(MprFile *file, cchar *fmt, ...)
 Write formatted data to a file.
ssizemprWriteFileString(MprFile *file, cchar *str)
 Write a string to a file.
ssizemprWritePathContents(cchar *path, cchar *buf, ssize len, int mode)
 Create a file and write contents.
intmprWriteRegistry(cchar *key, cchar *name, cchar *value)
 Write a key value the Windows registry.
ssizemprWriteSocket(MprSocket *sp, cvoid *buf, ssize len)
 Write to a socket.
ssizemprWriteSocketString(MprSocket *sp, cchar *str)
 Write to a string to a socket.
ssizemprWriteSocketVector(MprSocket *sp, MprIOVec *iovec, int count)
 Write a vector to a socket.
cchar*mprXmlGetErrorMsg(MprXml *xp)
 Get the XML error message if mprXmlParse fails.
intmprXmlGetLineNumber(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.
intmprXmlParse(MprXml *xp)
 Run the XML parser.
voidmprXmlSetInputStream(MprXml *xp, MprXmlInputStream fn, void *arg)
 Define the XML parser input stream.
voidmprXmlSetParseArg(MprXml *xp, void *parseArg)
 Set the XML callback argument.
voidmprXmlSetParserHandler(MprXml *xp, MprXmlHandler h)
 Set the XML parser data handle.
voidmprYield(int flags)
 Yield a thread to allow garbage collection.
char*scamel(cchar *str)
 Create a camel case version of the string.
intscasecmp(cchar *s1, cchar *s2)
 Compare strings ignoring case.
boolscasematch(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.
intscmp(cchar *s1, cchar *s2)
 Compare strings.
char*scontains(cchar *str, cchar *pattern, ssize limit)
 Find a pattern in a string.
ssizescopy(char *dest, ssize destMax, cchar *src)
 Copy a string.
intsends(cchar *str, cchar *suffix)
 Test if the string ends with a given pattern.
char*sfmt(cchar *fmt, ...)
 Format a string.
char*sfmtv(cchar *fmt, va_list args)
 Format a string.
uintshash(cchar *str, ssize len)
 Compute a hash code for a string.
uintshashlower(cchar *str, ssize len)
 Compute a caseless hash code for a string.
char*sjoin(cchar *str, ...)
 Catenate strings.
char*sjoinv(cchar *str, va_list args)
 Catenate strings.
ssizeslen(cchar *str)
 Return the length of a string.
char*slower(cchar *str)
 Convert a string to lower case.
boolsmatch(cchar *s1, cchar *s2)
 Compare strings.
intsncasecmp(cchar *s1, cchar *s2, ssize len)
 Compare strings ignoring case.
char*snclone(cchar *str, ssize len)
 Clone a substring.
intsncmp(cchar *s1, cchar *s2, ssize len)
 Compare strings.
ssizesncopy(char *dest, ssize destMax, cchar *src, ssize len)
 Copy characters from a string.
char*spascal(cchar *str)
 Create a Pascal case version of the string.
char*spbrk(cchar *str, cchar *set)
 Locate the a character in a string.
char*srchr(cchar *str, int c)
 Find a character in a string by searching backwards.
char*srejoin(char *buf, ...)
 Append strings to an existing string and reallocate as required.
char*srejoinv(char *buf, va_list args)
 Append strings to an existing string and reallocate as required.
ssizesspn(cchar *str, cchar *set)
 Find the end of a spanning prefix.
boolsstarts(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.
int64stoi(cchar *str)
 Convert a string to an integer.
int64stoiradix(cchar *str, int radix, int *err)
 Convert a string to an integer.
char*stok(char *str, cchar *delim, char **last)
 Tokenize a string.
char*strim(cchar *str, cchar *set, int where)
 Trim a string.
char*supper(cchar *str)
 Convert a string to upper case.

Typedefs

MprBufProcBuffer refill callback function.
MprCondCondition variable for single and multi-thread synchronization.
MprDirEntryDirectory entry description.
MprEventProcEvent callback function.
MprForkCallbackCallback function before doing a fork().
MprFreeMemBlock structure when on a free list.
MprHashHash table control structure.
MprHashProcHashing function to use for the table.
MprHeapMemory allocator heap.
MprIOVecVectored write array.
MprJsonCallbackJSON callbacks.
MprKeyValueKey value pairs for use with MprList or MprKey.
MprListCompareProcList comparison procedure for sorting.
MprLogHandlerLog handler callback type.
MprManagerMpr memory block manager prototype.
MprMemNotifierMemory allocation error callback.
MprMemStatsMemory allocator statistics.
MprModuleEntryLoadable module entry point signature.
MprModuleProcModule start/stop point function signature.
MprMutexMultithreading lock control structure.
MprObjObject container for JSON parse trees.
MprOffSigned file offset data type.
MprRegionMemmory regions allocated from the O/S.
MprRomInodeA RomInode is created for each file in the Rom file system.
MprSignalInfoPer signal structure.
MprSignalProcSignal callback procedure.
MprSignalServiceSignal service control.
MprSocketPrebindCallback before binding a socket.
MprSocketProcSocket I/O callback procedure.
MprSocketProviderSocket service provider interface.
MprSocketServiceMpr socket service class.
MprSpinMultithreading spin lock control structure.
MprTestCaseTest case structure.
MprTestDefTest case definition.
MprTestFailureTest failure record.
MprTestGroupA test group is a group of tests to cover a unit of functionality.
MprTestParserCallback parser for non-standard command line arguments.
MprTestProcUnit test callback procedure.
MprThreadLocalThread local data storage.
MprThreadProcThread main procedure.
MprThreadServiceThread service.
MprWaitServiceWait Service.
MprWorkerProcWorker thread callback signature.
MprWorkerServiceWorker Thread Service.
MprWorkerStatsStatistics for Workers.
MprXmlHandlerXML callback handler.
MprXmlInputStreamXML input stream function.
boolBoolean data type.
ccharConstant char data type.
cucharUnsigned char data type.
cushortConstant unsigned short data type.
cvoidConstant void data type.
int32Integer 32 bits data type.
scharSigned char data type.
ssizeSigned integer size field large enough to hold a pointer offset.
ucharUnsigned char data type.
uintUnsigned integer (machine dependent bit size) data type.
uint32Unsigned integer 32 bits data type.
ulongUnsigned long (machine dependent bit size) data type.
ushortUnsigned short data type.

Defines

#defineassert   assertTrue(gp, MPR_LOC, C, #C)
 Assert macro for use by unit tests.
#defineMPR_ALLOC_MANAGER   0x1
 Reserve room for a manager.
#defineMPR_ALLOC_PAD_MASK   0x1
 Flags that impact padding.
#defineMPR_ALLOC_POLICY_EXIT   3
 Exit the app if max exceeded with a MPR_EXIT_NORMAL exit.
#defineMPR_ALLOC_POLICY_NOTHING   0
 Do nothing.
#defineMPR_ALLOC_POLICY_PRUNE   1
 Prune all non-essential memory and continue.
#defineMPR_ALLOC_POLICY_RESTART   2
 Gracefully restart the app if redline is exceeded.
#defineMPR_ALLOC_ZERO   0x2
 Zero memory.
#defineMPR_ARGV_ARGS_ONLY   0x1
 Command is missing program name.
#defineMPR_ASSERT_SRC   0x80
 Originated from mprAssert.
#defineMPR_BACKGROUND_PRIORITY   15
 May only get CPU if idle.
#defineMPR_BUF_INCR   4096
 Default buffer growth inc.
#defineMPR_BUFSIZE   4096
 Reasonable size for buffers.
#defineMPR_CACHE_ADD   0x2
 Add key if not already existing.
#defineMPR_CACHE_APPEND   0x8
 Set and append if already existing.
#defineMPR_CACHE_PREPEND   0x10
 Set and prepend if already existing.
#defineMPR_CACHE_SET   0x4
 Update key value, create if required.
#defineMPR_CACHE_SHARED   0x1
 Use shared cache.
#defineMPR_CMD_DETACH   0x4
 mprRunCmd flag to detach the child process and don't wait.
#defineMPR_CMD_ERR   0x4000
 mprRunCmd flag to capture stdout.
#defineMPR_CMD_IN   0x1000
 mprRunCmd flag to connect to stdin.
#defineMPR_CMD_NEW_SESSION   0x1
 mprRunCmd flag to create a new session on unix.
#defineMPR_CMD_OUT   0x2000
 mprRunCmd flag to capture stdout.
#defineMPR_CMD_SHOW   0x2
 mprRunCmd flag to show the window of the created process on windows.
#defineMPR_CMD_STDERR   2
 Stderr for the client side.
#defineMPR_CMD_STDIN   0
 Stdout for the client side.
#defineMPR_CMD_STDOUT   1
 Stdin for the client side.
#defineMPR_CMD_VXWORKS_EOF   "_ _EOF_ _"
 Special string for VxWorks CGI to emit to signal EOF.
#defineMPR_CMD_VXWORKS_EOF_LEN   9
 Length of MPR_CMD_VXWORKS_EOF.
#defineMPR_CONFIG   2
 Configuration settings trace level.
#defineMPR_CRITICAL_PRIORITY   99
 May not yield.
#defineMPR_DEBUG   4
 Debug information trace level.
#defineMPR_DEFAULT_ALLOC   64
 Default small alloc size.
#defineMPR_DEFAULT_CIPHER_SUITE   "HIGH:MEDIUM"
 Default cipher suite.
#defineMPR_DEFAULT_DATE   "%a %b %d %T %Y %Z"
 Default date format used in mprFormatLocalTime/mprFormatUniversalTime when no format supplied.
#defineMPR_DEFAULT_HASH_SIZE   23
 Default size of hash table.
#defineMPR_DEFAULT_MAX_THREADS   20
 Default max threads.
#defineMPR_DEFAULT_MIN_THREADS   0
 Default min threads.
#defineMPR_DEFAULT_STACK   (64 * 1024)
 Default thread stack size (0 means use system default).
#defineMPR_DISABLE_GC   0x1
 Disable GC.
#defineMPR_DTOA_ALL_DIGITS   0
 Return all digits.
#defineMPR_DTOA_EXPONENT_FORM   0x10
 Result in exponent form (N.NNNNe+NN).
#defineMPR_DTOA_FIXED_FORM   0x20
 Emit in fixed form (NNNN.MMMM).
#defineMPR_DTOA_N_DIGITS   2
 Return total N digits.
#defineMPR_DTOA_N_FRACTION_DIGITS   3
 Return total fraction digits.
#defineMPR_EPOLL_SIZE   32
 Epoll backlog.
#defineMPR_ERR   -1
 Default error code.
#defineMPR_ERR_ABORTED   -2
 Action aborted.
#defineMPR_ERR_ALREADY_EXISTS   -3
 Item already exists.
#defineMPR_ERR_BAD_ARGS   -4
 Bad arguments or paramaeters.
#defineMPR_ERR_BAD_FORMAT   -5
 Bad input format.
#defineMPR_ERR_BAD_HANDLE   -6
 Bad file handle.
#defineMPR_ERR_BAD_STATE   -7
 Module is in a bad state.
#defineMPR_ERR_BAD_SYNTAX   -8
 Input has bad syntax.
#defineMPR_ERR_BAD_TYPE   -9
 Bad object type.
#defineMPR_ERR_BAD_VALUE   -10
 Bad or unexpected value.
#defineMPR_ERR_BASE   -1
 Base error code.
#defineMPR_ERR_BUSY   -11
 Resource is busy.
#defineMPR_ERR_CANT_ACCESS   -12
 Can't access the file or resource.
#defineMPR_ERR_CANT_ALLOCATE   -13
 Can't allocate resource.
#defineMPR_ERR_CANT_COMPLETE   -14
 Operation can't complete.
#defineMPR_ERR_CANT_CONNECT   -15
 Can't connect to network or resource.
#defineMPR_ERR_CANT_CREATE   -16
 Can't create the file or resource.
#defineMPR_ERR_CANT_DELETE   -17
 Can't delete the resource.
#defineMPR_ERR_CANT_FIND   -18
 Can't find resource.
#defineMPR_ERR_CANT_INITIALIZE   -19
 Can't initialize resource.
#defineMPR_ERR_CANT_LOAD   -20
 Can't load the resource.
#defineMPR_ERR_CANT_OPEN   -21
 Can't open the file or resource.
#defineMPR_ERR_CANT_READ   -22
 Can't read from the file or resource.
#defineMPR_ERR_CANT_WRITE   -23
 Can't write to the file or resource.
#defineMPR_ERR_DELETED   -24
 Resource has been deleted.
#defineMPR_ERR_MEMORY   -25
 Memory allocation error.
#defineMPR_ERR_NETWORK   -26
 Underlying network error.
#defineMPR_ERR_NOT_INITIALIZED   -27
 Module or resource is not initialized.
#defineMPR_ERR_NOT_READY   -28
 Resource is not ready.
#defineMPR_ERR_OK   0
 Success.
#defineMPR_ERR_READ_ONLY   -29
 The operation timed out.
#defineMPR_ERR_TIMEOUT   -30
 Operation exceeded specified time allowed.
#defineMPR_ERR_TOO_MANY   -31
 Too many requests or resources.
#defineMPR_ERR_WONT_FIT   -32
 Requested operation won't fit in available space.
#defineMPR_ERR_WOULD_BLOCK   -33
 Blocking operation would block.
#defineMPR_ERROR   1
 Standard logging trace levels are 0 to 9 with 0 being the most verbose.
#defineMPR_ERROR_SRC   0x10
 Originated from mprError.
#defineMPR_EVENT_CONTINUOUS   0x1
 Timer event runs is automatically rescheduled.
#defineMPR_EVENT_DONT_QUEUE   0x4
 Don't queue the event.
#defineMPR_EVENT_PRIORITY   50
 Normal priority.
#defineMPR_EVENT_QUICK   0x2
 Execute inline without executing via a thread.
#defineMPR_EVENT_STATIC_DATA   0x8
 Event data is permanent and should not be marked by GC.
#defineMPR_EXIT_DEFAULT   0x1
 Exit as per MPR->defaultStrategy.
#defineMPR_EXIT_GRACEFUL   0x8
 Graceful shutdown waiting for requests to complete.
#defineMPR_EXIT_IMMEDIATE   0x2
 Immediate exit.
#defineMPR_EXIT_NORMAL   0x4
 Normal shutdown without waiting for requests to complete.
#defineMPR_EXIT_RESTART   0x10
 Restart after exiting.
#defineMPR_FATAL_SRC   0x100
 Fatal error.
#defineMPR_FILES_HASH_SIZE   29
 Hash size for rom file system.
#defineMPR_FINISHED   0x8
 Mpr object destroyed.
#defineMPR_GC_LOW_MEM   (32 * 1024)
 Free memory low water mark before invoking GC.
#defineMPR_GC_WORKERS   0
 Run garbage collection non-concurrently.
#defineMPR_GEN_ETERNAL   3
 Objects immune from collection.
#defineMPR_HASH_CASELESS   0x1
 Key comparisons ignore case.
#defineMPR_HASH_STATIC_KEYS   0x4
 Keys are permanent - don't dup or mark.
#defineMPR_HASH_STATIC_VALUES   0x8
 Values are permanent - don't mark.
#defineMPR_HASH_UNICODE   0x2
 Hash keys are unicode strings.
#defineMPR_HTTP_DATE   "%a, %d %b %Y %T GMT"
 Date format for use in HTTP (headers).
#defineMPR_INFO   3
 Informational trace only.
#defineMPR_JSON_ARRAY   3
 The object is an array.
#defineMPR_JSON_OBJ   2
 The object is an object.
#defineMPR_JSON_PRETTY   0x1
 Serialize output in a more human readable, multiline "pretty" format.
#defineMPR_JSON_STRING   1
 The property is a string (char*).
#defineMPR_JSON_UNKNOWN   0
 The type of a property is unknown.
#defineMPR_LEVEL_MASK   0xf
 Level mask.
#defineMPR_LIST_INCR   8
 Default list growth inc.
#defineMPR_LIST_STATIC_VALUES   0x1
 Flag for mprCreateList indicating list values are permanent and should not be marked by GC.
#defineMPR_LOCAL_TIMEZONE   MAXINT
 Constants for mprParseTime.
#defineMPR_LOG_ANEW   0x80
 Start anew on boot (rotate).
#defineMPR_LOG_APPEND   0x40
 Append to existing log files.
#defineMPR_LOG_SRC   0x40
 Originated from mprLog.
#defineMPR_MANAGE_FREE   0x1
 Block being freed.
#defineMPR_MANAGE_MARK   0x2
 Block being marked by GC.
#defineMPR_MARK_THREAD   0x4
 Start a dedicated marker thread for garbage collection.
#defineMPR_MAX_ARGC   128
 Reasonable max of args.
#defineMPR_MAX_BUF   4194304
 Max buffer size.
#defineMPR_MAX_FNAME   256
 Reasonable filename size.
#defineMPR_MAX_GEN   3
 Number of generations for object allocation.
#defineMPR_MAX_LOG   (8 * 1024)
 Maximum log message size (impacts stack).
#defineMPR_MAX_PATH   512
 Reasonable path name size.
#defineMPR_MAX_STRING   1024
 Maximum (stack) string size.
#defineMPR_MAX_URL   512
 Max URL size.
#defineMPR_MEM_FAIL   0x4
 Memory allocation failed - immediate exit.
#defineMPR_MEM_LIMIT   0x2
 Memory use exceeds memory limit - invoking policy.
#defineMPR_MEM_REDLINE   0x1
 Memory use exceeds redline limit.
#defineMPR_MEM_REGION_SIZE   (128 * 1024)
 Memory allocation chunk size.
#defineMPR_MEM_TOO_BIG   0x4
 Memory allocation request is too big - immediate exit.
#defineMPR_MIN_TIME_FOR_GC   2
 Wait till 2 milliseconds of idle time possible.
#defineMPR_MODULE_STARTED   0x1
 Module stared.
#defineMPR_MODULE_STOPPED   0x2
 Module stopped.
#defineMPR_NEW_QUOTA   (4 * 1024)
 Number of new allocations before a GC is worthwhile.
#defineMPR_NO_WINDOW   0x20
 Don't create a windows Window.
#defineMPR_NORMAL_PRIORITY   50
 Normal (default) priority.
#defineMPR_PATH_ENUM_DIRS   0x1
 Flag for mprFindFiles to traverse directories.
#defineMPR_PATH_INC_DIRS   0x2
 Flag for mprFindFiles to include directories in results.
#defineMPR_PROTO_ALL   0x7
 All SSL protocols.
#defineMPR_PROTO_SSLV2   0x1
 SSL V2 protocol.
#defineMPR_PROTO_SSLV3   0x2
 SSL V3 protocol.
#defineMPR_PROTO_TLSV1   0x4
 TLS V1 protocol.
#defineMPR_RAW   0x1000
 Raw trace output.
#defineMPR_READABLE   0x2
 Read event mask.
#defineMPR_REQUEST_PRIORITY   50
 Normal priority.
#defineMPR_RFC_DATE   "%a, %d %b %Y %T %Z"
 Format a date according to RFC822: (Fri, 07 Jan 2003 12:12:21 PDT).
#defineMPR_SECURE_CLIENT   ((struct MprSsl*) 1)
 Flag for mprCreateSocket to use the default SSL provider.
#defineMPR_SERVICE_NO_GC   0x8
 Don't run GC.
#defineMPR_SERVICE_ONE_THING   0x4
 Wait for one event or one I/O.
#defineMPR_SIGNAL_AFTER   0x2
 Flag to mprAddSignalHandler to run handler after existing handlers.
#defineMPR_SIGNAL_BEFORE   0x1
 Flag to mprAddSignalHandler to run handler before existing handlers.
#defineMPR_SOCKET_BLOCK   0x1
 Use blocking I/O.
#defineMPR_SOCKET_BROADCAST   0x2
 Broadcast mode.
#defineMPR_SOCKET_CLIENT   0x800
 Socket is a client.
#defineMPR_SOCKET_CLOSED   0x4
 MprSocket has been closed.
#defineMPR_SOCKET_CONNECTING   0x8
 MprSocket is connecting.
#defineMPR_SOCKET_DATAGRAM   0x10
 Use datagrams.
#defineMPR_SOCKET_EOF   0x20
 Seen end of file.
#defineMPR_SOCKET_GRACEFUL   1
 Do a graceful shutdown.
#defineMPR_SOCKET_LISTENER   0x40
 MprSocket is server listener.
#defineMPR_SOCKET_NODELAY   0x100
 Disable Nagle algorithm.
#defineMPR_SOCKET_NOREUSE   0x80
 Dont set SO_REUSEADDR option.
#defineMPR_SOCKET_PENDING   0x1000
 Pending buffered read data.
#defineMPR_SOCKET_THREAD   0x400
 Process callbacks on a worker thread.
#defineMPR_SSL_BUFSIZE   4096
 SSL has 16K max.
#defineMPR_SSL_PROVIDER_LOADED   0x20
 SSL provider loaded.
#defineMPR_STARTED   0x1
 Mpr services started.
#defineMPR_STOPPING   0x2
 App is stopping.
#defineMPR_STOPPING_CORE   0x4
 Stopping core services: GC and event dispatch.
#defineMPR_SWEEP_THREAD   0x8
 Start a dedicated sweeper thread for garbage collection.
#defineMPR_TICKS_PER_SEC   1000
 Time ticks per second.
#defineMPR_TIME_HASH_SIZE   67
 Hash size for time token lookup.
#defineMPR_TIMEOUT_CMD   60000
 Command Request timeout (60 sec).
#defineMPR_TIMEOUT_GC_SYNC   10000
 Wait period for threads to synchronize.
#defineMPR_TIMEOUT_HANDLER   10000
 Wait period when removing a wait handler.
#defineMPR_TIMEOUT_LINGER   2000
 Close socket linger timeout.
#defineMPR_TIMEOUT_LOG_STAMP   3600000
 Time between log time stamps (1 hr).
#defineMPR_TIMEOUT_NAP   20
 Short pause.
#defineMPR_TIMEOUT_PRUNER   600000
 Time between worker thread pruner runs (10 min).
#defineMPR_TIMEOUT_SOCKETS   10000
 General sockets timeout.
#defineMPR_TIMEOUT_START_TASK   10000
 Time to start tasks running.
#defineMPR_TIMEOUT_STOP   30000
 Wait when stopping resources (30 sec).
#defineMPR_TIMEOUT_STOP_TASK   10000
 Time to stop or reap tasks.
#defineMPR_TIMEOUT_STOP_THREAD   10000
 Time to stop running threads.
#defineMPR_TIMEOUT_WORKER   300000
 Prune worker that has been idle for 5 minutes.
#defineMPR_TRIM_BOTH   0x3
 Flag for strim to trim from both the start and the end of the string.
#defineMPR_TRIM_END   0x2
 Flag for strim to trim from the end of the string.
#defineMPR_TRIM_START   0x1
 Flag for strim to trim from the start of the string.
#defineMPR_TUNE_BALANCED   2
 Tune balancing speed and size.
#defineMPR_TUNE_SIZE   1
 Tune for size.
#defineMPR_TUNE_SPEED   3
 Tune for speed, program will use memory more aggressively.
#defineMPR_USER_EVENTS_THREAD   0x10
 User will explicitly manage own mprServiceEvents calls.
#defineMPR_UTC_TIMEZONE   0
 Use UTC timezone.
#defineMPR_VERBOSE   9
 Highest level of trace.
#defineMPR_WAIT_NEW_DISPATCHER   0x2
 Wait handler flag to create a new dispatcher for each I/O event.
#defineMPR_WAIT_RECALL_HANDLER   0x1
 Wait handler flag to recall the handler asap.
#defineMPR_WARN   2
 Soft warning trace level.
#defineMPR_WARN_SRC   0x20
 Originated from mprWarn.
#defineMPR_WORKER_BUSY   0x1
 Worker currently running to a callback.
#defineMPR_WORKER_DEDICATED   0x1
 Worker reserved and not part of the worker pool.
#defineMPR_WORKER_IDLE   0x2
 Worker idle and available for work.
#defineMPR_WORKER_PRIORITY   50
 Normal priority.
#defineMPR_WORKER_PRUNED   0x4
 Worker has been pruned and will be terminated.
#defineMPR_WORKER_SLEEPING   0x8
 Worker is sleeping (idle) on idleCond.
#defineMPR_WRITABLE   0x4
 Write event mask.
#defineMPR_XML_AFTER_LS   2
 Seen "<".
#defineMPR_XML_ATT_EQ   6
 Seen "<tag att" =.
#defineMPR_XML_ATT_NAME   5
 Seen "<tag att".
#defineMPR_XML_BEGIN   1
 Before next tag.
#defineMPR_XML_BUFSIZE   4096
 XML read buffer size.
#defineMPR_XML_CDATA   13
 Seen "<![CDATA[" U.
#defineMPR_XML_COMMENT   3
 Seen "<!—" (usr) U.
#defineMPR_XML_ELT_DATA   10
 Seen "<tag>....<" U.
#defineMPR_XML_ELT_DEFINED   9
 Seen "<tag...>" U.
#defineMPR_XML_END_ELT   11
 Seen "<tag>....</tag>" U.
#defineMPR_XML_EOF   -2
 End of input.
#defineMPR_XML_ERR   -1
 Error.
#defineMPR_XML_NEW_ATT   7
 Seen "<tag att = "val" U.
#defineMPR_XML_NEW_ELT   4
 Seen "<tag" (usr) U.
#defineMPR_XML_PI   12
 Seen "<?processingInst" U.
#defineMPR_XML_SOLO_ELT_DEFINED   8
 Seen "<tag../>" U.
#defineassert   assertTrue(gp, MPR_LOC, C, #C)
 Assert macro for use by unit tests.

Mpr

Mpr

Primary MPR application control structure.

Description:
The Mpr structure stores critical application state information.
API Stability:
Evolving.
See Also:
mprAddTerminator, mprBreakpoint, mprCreate, mprCreateOsService, mprDecode64, mprDestroy, mprEmptyString, mprEncode64, mprEscapeCmd, mprGetAppDir, mprGetAppName, mprGetAppPath, mprGetAppTitle, mprGetAppVersion, mprGetCmdlineLogging, mprGetDebugMode, mprGetDomainName, mprGetEndian, mprGetError, mprGetHostName, mprGetHwnd, mprGetInst, mprGetIpAddr, mprGetLogLevel, mprGetMD5, mprGetMD5WithPrefix, mprGetOsError, mprGetRandomBytes, mprGetServerName, mprIsExiting, mprIsFinished, mprIsIdle, mprIsStopping, mprIsStoppingCore, mprMakeArgv, mprRandom, mprReadRegistry, mprRestart, mprServicesAreIdle, mprSetAppName, mprSetCmdlineLogging, mprSetDebugMode, mprSetDomainName, mprSetExitStrategy, mprSetHostName, mprSetHwnd, mprSetIdleCallback, mprSetInst, mprSetIpAddr, mprSetLogLevel, mprSetServerName, mprSetSocketMessage, mprShouldAbortRequests, mprShouldDenyNewRequests, mprSleep, mprStart, mprStartEventsThread, mprStartOsService, mprStopOsService, mprTerminate, mprUriDecode, mprUriEncode, mprWaitTillIdle, mprWriteRegistry
Fields:
char *appDir Path of directory containing app executable.
longappInstance Application instance (windows).
char *appPath Path name of application executable.
void *appwebService Appweb service object.
intargc Count of command line args.
char **argv Application command line args (not alloced).
boolcmdlineLogging App has specified —log on the command line.
struct MprCmdService *cmdService Command service object.
MprCond *cond Sync after starting events thread.
booldebugMode Run in debug mode (no timers).
struct MprDispatcher *dispatcher Primary dispatcher.
char *domainName Domain portion.
MprSpin *dtoaSpin[2] Dtoa thread synchronization.
void *ediService EDI object.
void *ejsService Ejscript service.
char *emptyString Empty string.
void *espService ESP service object.
inteventing Servicing events thread is active.
struct MprEventService *eventService Event service object.
intexitStatus Proposed program exit status.
intexitStrategy How to exit the app (normal, immediate, graceful).
struct MprFileSystem *fileSystem File system service object.
intflags Misc flags.
inthasError Mpr has an initialization error.
MprHeapheap Memory heap control.
char *hostName Host name (fully qualified name).
void *httpService Http service object.
MprIdleCallbackidleCallback Invoked to determine if the process is idle.
char *ip Public IP Address.
intlogBackup Number of log files preserved when backing up.
MprFile *logFile Log file.
MprLogHandlerlogHandler Current log handler callback.
intlogLevel Log trace level.
cchar *logPath Log path name.
ssizelogSize Maximum log size.
MprOsThreadmainOsThread Main OS thread ID.
intmarker Marker thread is active.
intmarking Actually marking objects now.
MprHash *mimeTypes Table of mime types.
struct MprModuleService *moduleService Module service object.
MprMutex *mutex Thread synchronization.
char *name Product name.
struct MprDispatcher *nonBlock Nonblocking dispatcher.
struct MprOsService *osService O/S service object.
char *pathEnv Cached PATH env var. Used by MprCmd.
char *serverName Server name portion (no domain).
struct MprSignalService *signalService Signal service object.
struct MprSocketService *socketService Socket service object.
MprSpin *spin Quick thread synchronization.
intstate Processing state.
MprFile *stdError Standard error file.
MprFile *stdInput Standard input file.
MprFile *stdOutput Standard output file.
intsweeper Sweeper thread is active.
MprList *terminators Termination callbacks.
void *testService Test service object.
struct MprThreadService *threadService Thread service object.
MprHash *timeTokens Date/Time parsing tokens.
char *title Product title.
char *version Product version.
struct MprWaitService *waitService IO Waiting service object.
struct MprWorkerService *workerService Worker service object.
void mprAddTerminator (MprTerminator terminator)
void mprBreakpoint ()
Mpr * mprCreate (int argc, char **argv, int flags)
int mprCreateOsService ()
char * mprDecode64 (cchar *str)
char * mprEmptyString ()
char * mprEncode64 (cchar *str)
char * mprEscapeCmd (cchar *cmd, int escChar)
char * mprEscapeHtml (cchar *html)
char * mprGetAppDir ()
cchar * mprGetAppName ()
char * mprGetAppPath ()
cchar * mprGetAppTitle ()
cchar * mprGetAppVersion ()
bool mprGetDebugMode ()
cchar * mprGetDomainName ()
int mprGetEndian ()
int mprGetError ()
cchar * mprGetHostName ()
cchar * mprGetIpAddr ()
int mprGetLogLevel ()
char * mprGetMD5 (cchar *s)
char * mprGetMD5WithPrefix (cchar *buf, ssize len, cchar *prefix)
Mpr * mprGetMpr ()
int mprGetOsError ()
cchar * mprGetServerName ()
bool mprIsExiting ()
bool mprIsFinished ()
bool mprIsIdle ()
bool mprIsStopping ()
bool mprIsStoppingCore ()
void mprNap (MprTime msec)
int mprRandom ()
void mprRestart ()
bool mprServicesAreIdle ()
int mprSetAppName (cchar *name, cchar *title, cchar *version)
void mprSetDebugMode (bool on)
void mprSetDomainName (cchar *s)
void mprSetHostName (cchar *s)
MprIdleCallback mprSetIdleCallback (MprIdleCallback idleCallback)
void mprSetIpAddr (cchar *ip)
void mprSetServerName (cchar *s)

Set the application server name string.

Parameters:
sNew application server name to use within the application.
See Also: