Up: GEOS SDK TechDocs | Up | Prev: SysShutdown() ... | Next: ThreadAttachToQueue() ...

TextSearchInString()

char *	TextSearchInSTring(
        const char		*str1,
        conat char		*startPtr,
        const char		*endPtr,
        word		strSize,
        const char		*str2,
        word		str2Size,
        word		searchOptions,
        word		*matchLen);

This routine searches in a single text chunk for a passed text string. If a match is found, a pointer to that match (and the length of the match) are returned in passed buffers.

str1 is a pointer to the main string you will be searching in.

startPtr and endPtr are pointers to locations within str1 to begin and end the search.

strSize stores the size of str1 , or zero if null-terminated.

str2 stores the match string, which may include wildcards (type WildCard ).

str2Size stores the size of str2 , or zero if null-terminated.

searchOptions stores the SearchOptions to use by the search mechanism. The high byte should be zeroed.

matchLen stores a buffer to store the size of the matched word. (The matched word itself is returned by the routine.)

Include: Objects/vTextC.goh

TextSearchInHugeArray()

dword	TextSearchInSTring(
        char		*str2,
        word		str2Size,
        dword		str1Size,
        dword		curOffset,
        dword		endOffset,
        FileHandle		hugeArrayFile,
        VMBlockHandle		hugeArrayBlock,
        word		searchOptions,
        word		*matchLen);

This routine searches in a huge array for a passed text string. If a match is found, a dword offset to the match (and the length of the match) are returned in passed buffers.

str2 stores the match string, which may include wildcards (type WildCard ).

str2Size stores the size of str2 , or zero if null-terminated.

str1Size stores the total length of the string being searched.

curOffset stores the offset from the start of str1 to the first character to check.

endOffset stores the offset from the start of str1 to the last character to check.

hugeArrayFile stores the file handle of the huge array.

hugeArrayBlock stores the VM block handle of the huge array.

searchOptions stores the SearchOptions to use by the search mechanism. The high byte should be zeroed.

matchLen stores a buffer to store the size of the matched word. (The matched word itself is returned by the routine.)

Include: Objects/vTextC.goh

TGI_PRIORITY()

byte	TGI_PRIORITY(val);
        word	val;

This macro extracts the thread priority from the value returned by ThreadGetInfo() .

TGI_RECENT_CPU_USAGE()

byte	TGI_RECENT_CPU_USAGE(val);
        word	val;

This macro extracts the recent CPU usage from the value returned by ThreadGetInfo() .

ThreadAllocSem()

SemaphoreHandle ThreadAllocSem(
        word	value);			/* allowable locks on the semaphore */

This routine allocates and initializes a new semaphore for private use by a multithreaded application. Pass the value with which to initialize the semaphore; this value represents the number of threads that can grab the semaphore before other grab attempts will block. Typically, the passed value will be one. The routine returns the handle of the new semaphore.

Include: sem.h

See Also: ThreadPSem(), ThreadVSem(), ThreadFreeSem(), ThreadPTimedSem().

ThreadAllocThreadLock()

ThreadLockHandle ThreadAllocThreadLock();

This routine allocates a special semaphore called a thread lock. With a normal semaphore, a thread that grabs the semaphore twice without releasing it will deadlock; with a thread lock, a thread can grab it more than once in succession. The thread has to release it once for each time it grabs the thread lock, however.

In all other aspects, however, the thread lock resembles a normal semaphore. ThreadAllocThreadLock() returns the handle of the new thread lock.

Include: sem.h

See Also: ThreadGrabThreadLock(), ThreadReleaseThreadLock().


Up: GEOS SDK TechDocs | Up | Prev: SysShutdown() ... | Next: ThreadAttachToQueue() ...