2 Copyright © 2002-2012, The AROS Development Team. All rights reserved.
5 SAS/C function stpsym().
10 /*****************************************************************************
23 Searches for a symbol in a string.
26 str_ptr - points to the string to scan
28 dest_ptr - points to the string where stpsym stores the symbol
30 dest_size - specifies the size in bytes of *dest_ptr
33 Pointer to the next character in the string after the symbol.
34 If stpsym could not find a symbol, it returns str_ptr.
37 A symbol consists of an alphabetic character followed by zero
38 or more alphanumeric characters. stpsym() does not skip leading
41 Note that if you want to retrieve a symbol of length n, you need
42 to ensure that *dest_ptr can accommodate at least n+1 elements,
43 and that dest_size == n+1. This extra element is needed for the
44 terminating null character.
57 r = stpsym(text,symbol,10);
58 printf("%s",symbol); // prints "alpha1"
67 ******************************************************************************/
77 dest_ptr
[count
++] = *str
++;
78 while(isalnum(*str
) && count
<(dest_size
-1))
80 dest_ptr
[count
++] = *str
++;