CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csutil/util.h File Reference

More...

#include <stdio.h>
#include "csunicode.h"

Go to the source code of this file.

Compounds

struct  csCtoW
 Helper class to convert (UTF-8)widechar* to char* strings for use as function parameters. More...

struct  csWtoC
 Helper class to convert widechar* to char*(UTF-8) strings for use as function parameters. More...


Functions

char * csStrNew (const char *s)
 Allocate a new char [] and copy the string into the newly allocated storage.

char * csStrNew (const wchar_t *s)
 Allocate a new char [] and copy an UTF-8 version of the string into the newly allocated storage.

wchar_t * csStrNewW (const wchar_t *s)
 Allocate a new widechar [] and the string into the newly allocated storage.

wchar_t * csStrNewW (const char *s)
 Allocate a new widechar [] and copy the string converted from UTF-8 into the newly allocated storage.

char * csExpandName (const char *iName)
 Expand a filename if it contains shortcuts.

void csSplitPath (const char *iPathName, char *oPath, size_t iPathSize, char *oName, size_t iNameSize)
 Split a pathname into separate path and name.

bool csGlobMatches (const char *fName, const char *fMask)
 This is a really simple function that does very nice "filename against filemask" comparisons.

int csFindNearestPowerOf2 (int n)
 Finds the smallest number that is a power of two and is larger or equal to n.

bool csIsPowerOf2 (int n)
 returns true if n is a power of two

int csLog2 (int n)
 Find the log2 of argument.

void csFindReplace (char *dest, const char *src, const char *search, const char *replace, int max)
 given src and dest, which are already allocated, copy source to dest.


Detailed Description

Definition in file util.h.


Generated for Crystal Space by doxygen 1.2.18