Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

/home/groups/n/no/noxwizard/cvs/src/basics.cpp File Reference

#include "nxwcommn.h"
#include "basics.h"
#include "inlines.h"

Functions

int str2num (char *sz, int base)
 Conversion from sz to numbers.

int str2num (wchar_t *sz, int base)
 Conversion from sz to numbers.

int RandomNum (int nLowNum, int nHighNum)
 Returns a random number between bounds.

int fillIntArray (char *str, int *array, int maxsize, int defval, int base)
 fills an integer array with tokens extracted from a string

void readSplitted (FILE *F, char *script1, char *script2)
 reads a line splitted (read2 clone)

char * RealTime (char *time_str)
 return current local time

Location Loc (UI16 x, UI16 y, SI08 z, SI08 dispz)
 build a Location structure


Function Documentation

int fillIntArray char *    str,
int *    array,
int    maxsize,
int    defval,
int    base
 

fills an integer array with tokens extracted from a string

Author:
Xanathar
Returns:
int the number of number read from the string
Parameters:
str  the string
array  the array
maxsize  the size of array
defval  -1 -> the default value for uninitialized items
base  the base for number conversion

Location Loc UI16    x,
UI16    y,
SI08    z,
SI08    dispz
 

build a Location structure

Author:
Anthalir
Returns:
The Location structure that represent the, ehm, location
Since:
0.82a
Parameters:
x  X-Coordinate
y  Y-Coordinate
z  Z-Coordinate
dispz  displayed z value

int RandomNum int    nLowNum,
int    nHighNum
 

Returns a random number between bounds.

Author:
?
Returns:
int the number
Parameters:
nLowNum  lower bound
nHighNum  higher bound

void readSplitted FILE *    F,
char *    script1,
char *    script2
 

reads a line splitted (read2 clone)

Author:
Xanathar
Parameters:
F  the file to read from
script1  where we'll put the first token of the string
script2  where we'll put the rest of the string

char* RealTime char *    time_str
 

return current local time

Returns:
char* the time (time_str)
Parameters:
time_str  a string with enough memory allocated

int str2num wchar_t *    sz,
int    base
 

Conversion from sz to numbers.

Author:
Endymion
Returns:
int the number or 0 if no conversion possible
Parameters:
sz  the string
base  number's base

int str2num char *    sz,
int    base
 

Conversion from sz to numbers.

Author:
Xanathar
Returns:
int the number or 0 if no conversion possible
Parameters:
sz  the string
base  number's base
SourceForge.net Logo