$treeview $search $mathjax
Stratagus
2.2.7
$projectbrief
|
$projectbrief
|
$searchbox |
_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include "stratagus.h"
#include "util.h"
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
util.cpp - General utilites. | |
unsigned | SyncRandSeed |
void | InitSyncRand () |
sync random seed value. | |
int | SyncRand () |
Initialize the syncron rand. | |
int | SyncRand (int max) |
Syncron rand. | |
int | MyRand () |
Syncron rand. | |
long | isqrt (long num) |
Compute a square root using ints. | |
unsigned int | strcpy_s (char *dst, size_t dstsize, const char *src) |
size_t | strnlen (const char *str, size_t strsize) |
determine length of a fixed-length string | |
unsigned int | strncpy_s (char *dst, size_t dstsize, const char *src, size_t count) |
unsigned int | strcat_s (char *dst, size_t dstsize, const char *src) |
char * | strcasestr (const char *a, const char *b) |
case insensitive strstr | |
int | GetClipboard (std::string &str) |
int | UTF8GetPrev (const std::string &text, int curpos) |
int | UTF8GetNext (const std::string &text, int curpos) |
int GetClipboard | ( | std::string & | str | ) |
Standard implementation of getopt(3).
One extension: If the first character of the optionsstring is a ':' the error return for 'argument required' is a ':' not a '?'. This makes it easier to differentiate between an 'illegal option' and an 'argument required' error. Paste text from the clipboard
void InitSyncRand | ( | ) |
sync random seed value.
Sync random seed value.
Inititalize sync rand seed.
long isqrt | ( | long | num | ) |
Compute a square root using ints.
Compute a square root using ints
Uses John Halleck's method, see http://www.cc.utah.edu/~nahaj/factoring/isqrt.legalize.c.html
num | Calculate the square root of this number |
int MyRand | ( | ) |
Syncron rand.
rand only used on this computer.
char* strcasestr | ( | const char * | a, | |
const char * | b | |||
) |
case insensitive strstr
Case insensitive version of strstr
a | String to search in | |
b | Substring to search for |
unsigned int strcat_s | ( | char * | dst, | |
size_t | dstsize, | |||
const char * | src | |||
) |
unsigned int strcpy_s | ( | char * | dst, | |
size_t | dstsize, | |||
const char * | src | |||
) |
unsigned int strncpy_s | ( | char * | dst, | |
size_t | dstsize, | |||
const char * | src, | |||
size_t | count | |||
) |
size_t strnlen | ( | const char * | str, | |
size_t | strsize | |||
) |
determine length of a fixed-length string
int SyncRand | ( | int | max | ) |
Syncron rand.
Synchronized random number.
max | Max value of random number to return |
int SyncRand | ( | ) |
Initialize the syncron rand.
Synchronized random number.
int UTF8GetNext | ( | const std::string & | text, | |
int | curpos | |||
) |
int UTF8GetPrev | ( | const std::string & | text, | |
int | curpos | |||
) |
unsigned SyncRandSeed |