Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ustrtok(3alleg4) [v7 man page]

ustrtok(3alleg4)						  Allegro manual						  ustrtok(3alleg4)

NAME
ustrtok - Retrieves tokens from a string. Allegro game programming library. SYNOPSIS
#include <allegro.h> char *ustrtok(char *s, const char *set); DESCRIPTION
This function retrieves tokens from `s' which are delimited by characters from `set'. To initiate the search, pass the string to be searched as `s'. For the remaining tokens, pass NULL instead. Warning: Since ustrtok alters the string it is parsing, you should always copy the string to a temporary buffer before parsing it. Also, this function is not re-entrant (ie. you cannot parse two strings at the same time). Example: char *word; char string[]="some-words with dashes"; char *temp = ustrdup(string); word = ustrtok(temp, " -"); while (word) { allegro_message("Found `%s' ", word); word = ustrtok(NULL, " -"); } free(temp); RETURN VALUE
Returns a pointer to the token, or NULL if no more are found. SEE ALSO
uconvert(3alleg4), ustrchr(3alleg4), ustrrchr(3alleg4), ustrstr(3alleg4), ustrpbrk(3alleg4), ustrtok_r(3alleg4), allegro_message(3alleg4), ustrncpy(3alleg4), exgui(3alleg4) Allegro version 4.4.2 ustrtok(3alleg4)

Check Out this Related Man Page

ustrtok(3alleg4)						  Allegro manual						  ustrtok(3alleg4)

NAME
ustrtok - Retrieves tokens from a string. Allegro game programming library. SYNOPSIS
#include <allegro.h> char *ustrtok(char *s, const char *set); DESCRIPTION
This function retrieves tokens from `s' which are delimited by characters from `set'. To initiate the search, pass the string to be searched as `s'. For the remaining tokens, pass NULL instead. Warning: Since ustrtok alters the string it is parsing, you should always copy the string to a temporary buffer before parsing it. Also, this function is not re-entrant (ie. you cannot parse two strings at the same time). Example: char *word; char string[]="some-words with dashes"; char *temp = ustrdup(string); word = ustrtok(temp, " -"); while (word) { allegro_message("Found `%s' ", word); word = ustrtok(NULL, " -"); } free(temp); RETURN VALUE
Returns a pointer to the token, or NULL if no more are found. SEE ALSO
uconvert(3alleg4), ustrchr(3alleg4), ustrrchr(3alleg4), ustrstr(3alleg4), ustrpbrk(3alleg4), ustrtok_r(3alleg4), allegro_message(3alleg4), ustrncpy(3alleg4), exgui(3alleg4) Allegro version 4.4.2 ustrtok(3alleg4)
Man Page

15 More Discussions You Might Find Interesting

1. Programming

trying to pass a string

hey guys, I have a function that I need to pass something like this to: function(set=a); so the "set=" part is always the same, but I'm getting the "a" part in a for loop. so the calls would be in a loop and would end up doing: function(set=a); function(set=b); function(set=c);... (4 Replies)
Discussion started by: annie
4 Replies

2. Programming

Bit shift operator

Can someone pls tell me how is the operation different in the following two code snippets? main() { int temp=20742; short temp1; temp1 = temp << 8; printf("The vaue is %d\n",temp1>>8);} result:6 main() { int temp=20742; short temp1; temp1 =(temp << 8)>>8; printf("The vaue... (5 Replies)
Discussion started by: naan
5 Replies

3. AIX

hacmp temp storage for tl8sp2

Hi All, Is it possible to create a temporary storage on the oraclevg FS for the tl8sp2? My rootvg is getting low on free space, less than 3G. I'm I going to use System Management (C-SPOC)/HACMP Logical Volume Management/Shared File Systems. Is that correct? Is that safe? I want to do... (1 Reply)
Discussion started by: itik
1 Replies

4. Programming

Adding 2 difft int to form a number

got 1 problem.. can someone help me wit the logic? Money Money ::operator+(const Money &rhs)const { Money temp; temp.a = a+rhs.a; temp.b = b+rhs.b; return temp; }//end i got 2 number e.g 6.2 and 3.8 (1 Reply)
Discussion started by: xiaojesus
1 Replies

5. Shell Programming and Scripting

Bash script - stripping away characters that can't be used in filenames

I want to create a temp file which is named based on a search string. The search string may contain spaces or characters that aren't supposed to be used in filenames so I want to strip those out. My thought was to use 'tr' with but the result is the opposite of what I want: $ echo "test... (5 Replies)
Discussion started by: mglenney
5 Replies

6. Shell Programming and Scripting

put a string before a searched string

hi all! i have a working that looks like this... file1 MALE JOHN MALE ANJO FEMALE ANNE MALE JAMES FEMALE HONEY FEMALE IZA what i want to do is insert "M" when the first string is "MALE" and insert "F" when the first string is "FEMALE". file1 M MALE ... (10 Replies)
Discussion started by: kingpeejay
10 Replies

7. UNIX for Dummies Questions & Answers

awk again..

hi , i have a temp file with some file names listed in it.. I am parsing all the files in a directory using while loop and if the filename matches the one in the file temp, then the loop should be incremented (continue) else it has to print something. I tired like ls | while read file... (1 Reply)
Discussion started by: anijan
1 Replies

8. UNIX for Dummies Questions & Answers

quick question vi word search

hi, while in vi, we use /string to look for the particular string. after that operation, the particular string is highlighted in yellow color. how do i take the highlight off? thanks so much. (1 Reply)
Discussion started by: hobiwhenuknowme
1 Replies

9. Shell Programming and Scripting

Matching multiple values in a string

I've been battling with parsing a comma-delimited string, and have had what I would call B- success. I'm using perl and trying to parse out specific identifiers from a string, into a new string. When things are "normal," my regex works fine. When things get complicated, my script fails... (1 Reply)
Discussion started by: linber2880
1 Replies

10. Shell Programming and Scripting

string parsing using UNIX

I got multple sql files.such as >>vi abc.sql select A.SITENAME, NULL NULL A.CREATE_DTM NULL A.MODIFY_DTM NULL FROM ${STG_RET_ITEM} A INNER JOIN ${STG_INC_COMP} B ON (A.CUSTID=B.CUSTID) LEFT OUTER JOIN ( select C.SITEID,SITESTATUS,MIN_EFF_DT,CURR_ST_DT,MAX_IN_DT,MAX_ACT_DT from... (4 Replies)
Discussion started by: ali123
4 Replies

11. Shell Programming and Scripting

Read last word of the line.

Hi, I need a script to read last word of the line and out put in some temp file. i it can contain any word like: My name is Harry. or My zip code is 24490 or it can be My secret code is 024H I just need last word of the line (Harry, or 2440 or 024H) Thanks for the posts below.... (10 Replies)
Discussion started by: HarryReid
10 Replies

12. Programming

How can I read complete word from text file?

how can I know that the word in test file end at this point .... I have an Idea to search on ' ' , '\n' or '\0' but don't know what function can store the string before those characters .. help please ! (3 Replies)
Discussion started by: fwrlfo
3 Replies

13. Shell Programming and Scripting

How to search a word in a file?

How to search a particular word in a file. in my file contains lacks of rows. (2 Replies)
Discussion started by: pmreddy
2 Replies

14. Shell Programming and Scripting

Command to extract word from a string

Hi All, I have a word and from that word would like to search for certain set of string, is there any command to do so ? EX : Components from the above word, would like to search for strings set and extract the search string and then do if stmt... pon nen ent Com say... (2 Replies)
Discussion started by: Optimus81
2 Replies

15. Shell Programming and Scripting

How to remove everything after a word containing string?

Hello, I wish to remove any word coming after searched string found in a word. source*.txt #!bin/bash #test1 http://www.aa.bb.cc http://www.xx.yy http://www.11.22.44 #test2 http://www.11.rr.cd http://www.01.yy http://www.yy.22.tt #test3 http://www.22.qq.fc http://www.0x.yy... (15 Replies)
Discussion started by: baris35
15 Replies