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)
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)
I have a question concerning string functions. I have not been able to locate a function that does what I want, so I fugured I'd ask before I wrote on myself.
Is there a function to which I can pass 2 strings (character string a and character string b) and have it tell me if string b appears... (7 Replies)
I have two string returning function in ESQL/C
char *segment_name(lbuffer)
char *lbuffer;
{.....
and
char *get_bpdvalue(f_name)
char *f_name;
{......
both declared above main()
char *get_bpdvalue();
char *segment_name();
my problem is segment_name works on sprintf and strcpy... (5 Replies)
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)
#!/usr/bin/perl -w
use strict;
open(FH,"$ARGV") or die;
my @temp=<FH>;
close FH;
my $mean = Mean(\@temp);
my $var = variance(\@temp);
print "$var\n";
sub estimate_variance {
my ($arrayref) = @_;
my ($mean,$result) = (mean($arrayref),0);
foreach (@$arrayref) {... (4 Replies)
Hello I am trying to append an incrimenting number to the end of each line I have it working with a temp file. But I want to do this without a temp file.
a=1
cat "file" | while read LINE
do
echo "$LINE, $a" >> filewithnumbers
a=`expr $a + 1`
... (4 Replies)
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)
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)
Hi ,
Please help me in understanding the below commands
temp="$dirname.temp.cc.$$"
This will eliminate any trailing white spaces???
k=$(grep -cvE " |\+|-|0|1|\f" $temp
if (substr(file,2,24) ~ /{13,}/) {print "N" file} -- this is inside an awk script (4 Replies)
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)
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)
I want change the file when the line contains $(AA) but NOT contains $(BB), then change $(AA) to $(AA) $(BB)
eg:
$(AA) something
$(AA) $(BB) something (7 Replies)
Hi,
I am new to unix. Kindly help me on this.
My requirement is as below:
I have a path temp/input , temp/CL and temp/CM
I have files in temp/input as below (dates in YYYYMMDDHHMISS)
NMP1515O.CL.20181026111213
NMP1515O.CM.20181025111213
... (4 Replies)
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)