|
spBase
|
Macros | |
| #define | spStrCaseEq(s1, s2) ((s1 != NULL) && (s2 != NULL) && (spStrCaseCmp((s1), (s2)) == 0) ? 1 : 0) |
| #define | spStrNCaseEq(s1, s2, n) ((s1 != NULL) && (s2 != NULL) && (spStrNCaseCmp((s1), (s2), n) == 0) ? 1 : 0) |
| #define | spStrVCaseEq(s1, s2) ((s1 != NULL) && (s2 != NULL) && (spStrNCaseCmp((s1), (s2), (int)strlen(s2)) == 0) ? 1 : 0) |
| #define | strcaseeq(s1, s2) spStrCaseEq(s1, s2) |
| #define | strncaseeq(s1, s2, n) spStrNCaseEq(s1, s2, n) |
| #define | strvcaseeq(s1, s2) spStrVCaseEq(s1, s2) |
| #define | strwhite(string) spStrWhite(string) |
Enumerations | |
| enum | spFileKind { SP_FILE_KIND_UNKNOWN = -1 , SP_FILE_KIND_DOCUMENT = 0 , SP_FILE_KIND_SOURCE = 1 , SP_FILE_KIND_CONFIG = 2 , SP_FILE_KIND_INCLUDE = 3 , SP_FILE_KIND_PICTURE = 10 , SP_FILE_KIND_FIGURE = 11 , SP_FILE_KIND_MUSIC = 20 , SP_FILE_KIND_SOUND = 21 , SP_FILE_KIND_MOVIE = 25 , SP_FILE_KIND_APPLICATION = 30 , SP_FILE_KIND_LIBRARY = 31 , SP_FILE_KIND_ARCHIVE = 40 , SP_FILE_KIND_URI = 50 } |
Message Display | |
| void | spSetWarningFlag (int flag) |
| void | spWarning (const char *format,...) |
| void | spSetMessageFlag (int flag) |
| void | spMessage (const char *format,...) |
| void | spError (int status, const char *format,...) |
| void | spProgError (const char *func_name, const char *format,...) |
| void | spSetDebugStdout (int flag) |
| void | spSetDebugLevel (int level) |
| int | spGetDebugLevel (void) |
| void | spDebug (int level, const char *func_name, const char *format,...) |
System Control | |
| void | spSleep (int sec) |
| void | spMSleep (int msec) |
| long | spGetProcessId (void) |
| spBool | spExecBrowser (const char *base_url, const char *sub_url, spBool local_path) |
String Management | |
| int | spStrCaseCmp (const char *s1, const char *s2) |
| int | spStrNCaseCmp (const char *s1, const char *s2, int n) |
| int | spStrWhite (const char *string) |
| char * | spSkipWhite (const char *string) |
| char * | xspStrCat (const char *orig, const char *src) |
| char * | spStrCat (char *dest, int destsize, const char *src) |
| char * | spStrCopy (char *dest, int destsize, const char *src) |
| char * | spGetSuffix (const char *name) |
| int | spEqSuffix (const char *file1, const char *file2) |
| spBool | spRemoveNSuffix (char *path, char *removed_suffix, int suffixsize) |
| spBool | spRemoveSuffix (char *path, char *removed_suffix) |
| spBool | spReplaceNSuffix (char *path, int pathsize, const char *suffix) |
| spBool | spReplaceSuffix (char *path, const char *suffix) |
| int | spConvertToEscapedString (char *escaped, int bufsize, const char *string, const char *charlist) |
| int | spConvertFromEscapedString (char *string, int bufsize, const char *escaped, const char *charlist) |
File and Directory | |
| FILE * | spOpenFile (const char *path, const char *mode) |
| int | spCloseFile (FILE *stream) |
| int | spSeekFile (FILE *stream, spFileOffset offset, int origin) |
| int | spSeekFile64 (FILE *stream, spLong64 offset, int origin) |
| spFileOffset | spTellFile (FILE *stream) |
| spBool | spGetFileInfo (const char *path, spBool *dir_flag, spFileOffset *size) |
| spBool | spExists (const char *path) |
| spBool | spIsExist (const char *path) |
| spBool | spIsFile (const char *path) |
| spBool | spIsDir (const char *path) |
| spBool | spCreateDir (const char *path, unsigned short mode) |
| spBool | spCreateDirRecursive (const char *path, unsigned short mode) |
| spBool | spRemoveDir (const char *path) |
| spBool | spRemoveFile (const char *path) |
| spBool | spRenameFile (const char *oldpath, const char *newpath) |
File and Directory Names | |
| spBool | spAddDirSeparator (char *dir) |
| spBool | spRemoveDirSeparator (char *dir) |
| spBool | spIsExactName (const char *name) |
| char * | xspGetExactName (const char *name) |
| char * | spGetBaseName (const char *name) |
| char * | xspGetBaseName (const char *name) |
| char * | spGetDirName (char *filename) |
| char * | xspGetDirName (const char *filename) |
| char * | xspGetReadablePath (const char *real_path) |
| char * | xspGetRealPath (const char *readable_path) |
| char * | xspCutPathList (const char *pathlist, int col) |
| char * | xspAppendPathList (const char *pathlist, const char *new_list) |
| char * | xspPrependPathList (const char *pathlist, const char *new_list) |
System and Application Directory | |
| const char * | spGetCurrentDir (void) |
| char * | xspGetCurrentDir (void) |
| const char * | spGetHomeDir (void) |
| char * | xspGetHomeDir (void) |
| const char * | spGetTempDir (void) |
| char * | xspGetTempDir (void) |
| spBool | spSetApplicationId (const char *id) |
| const char * | spGetCompanyId (void) |
| const char * | spGetApplicationId (void) |
| const char * | spGetVersionId (void) |
| const char * | spCreateApplicationDir (spBool *id_depend, spBool *version_depend) |
| const char * | spGetApplicationDir (spBool *version_depend) |
| char * | xspGetApplicationDir (spBool *version_depend) |
| const char * | spGetApplicationTempDir (void) |
| char * | xspGetApplicationTempDir (void) |
| spBool | spSetApplicationTempDir (const char *dir) |
| char * | xspGetDocumentDir (spFileKind file_kind) |
Numeric Functions | |
| double | spRound (double x) |
| double | spFix (double x) |
| double | spFrac (double x) |
| double | spRem (double x, double y) |
| long | spFactorial (int n) |
| void | spNFtos (char *buf, int bufsize, double x) |
| void | spFtos (char *buf, double x) |
| long | spNextPow2 (long n) |
Type Conversion | |
| int | spGetBitByte (int samp_bit, spBool *float_flag) |
| double | spGetBitNormalizeFactor (int samp_bit) |
| long | spConvertDoubleToBitWeighted (double *idata, long length, void *odata, int samp_bit, double weight) |
| long | spConvertDoubleToBit (double *idata, long length, void *odata, int samp_bit, double max) |
| long | spConvertDoubleToClippedBitWeighted (double *idata, long length, void *odata, int samp_bit, double weight) |
| long | spConvertDoubleToClippedBit (double *idata, long length, void *odata, int samp_bit, double max) |
| long | spConvertBitToDoubleWeighted (void *idata, long length, double *odata, int samp_bit, double weight) |
| long | spConvertBitToDouble (void *idata, long length, double *odata, int samp_bit, double max) |
| #define spStrCaseEq | ( | s1, | |
| s2 ) ((s1 != NULL) && (s2 != NULL) && (spStrCaseCmp((s1), (s2)) == 0) ? 1 : 0) |
Compares two strings ignoring case.
| #define spStrNCaseEq | ( | s1, | |
| s2, | |||
| n ) ((s1 != NULL) && (s2 != NULL) && (spStrNCaseCmp((s1), (s2), n) == 0) ? 1 : 0) |
Compares two strings until n ignoring case.
| #define spStrVCaseEq | ( | s1, | |
| s2 ) ((s1 != NULL) && (s2 != NULL) && (spStrNCaseCmp((s1), (s2), (int)strlen(s2)) == 0) ? 1 : 0) |
Compares two strings until one string ends ignoring case.
| #define strcaseeq | ( | s1, | |
| s2 ) spStrCaseEq(s1, s2) |
Compares two strings ignoring case (abbreviated version).
| #define strncaseeq | ( | s1, | |
| s2, | |||
| n ) spStrNCaseEq(s1, s2, n) |
Compares two strings until n ignoring case (abbreviated version).
| #define strvcaseeq | ( | s1, | |
| s2 ) spStrVCaseEq(s1, s2) |
Compares two strings until one string ends ignoring case (abbreviated version).
| #define strwhite | ( | string | ) | spStrWhite(string) |
Checks whether the string consists of white characters only (abbreviated version).
| enum spFileKind |
Indicates the file kind for applications to deal with documents.
|
extern |
Sets a flag to determine whether warning messages are displayed.
|
extern |
Displays a warning message to stderr.
|
extern |
Sets a flag to determine whether normal messages are displayed.
|
extern |
Displays a normal message to stderr.
|
extern |
Displays an error message to stderr, and then terminates the current program.
|
extern |
Displays an error message and the name of the function causing the error to stderr, and then terminates the current program.
|
extern |
Sets a flag to determine whether the desitination of debug messages is stdout or stderr.
|
extern |
Gets the current debug level.
|
extern |
Displays a debug message.
|
extern |
Suspends the execution of the current program for the specified interval in seconds.
|
extern |
Suspends the execution of the current program for the specified interval in milliseconds.
|
extern |
Gets the unique ID for the current process.
Opens the URL with a web browser.
| [in] | base_url | The main part of URL including scheme, host, etc. This can be a local path (file or directory). In this case, local_path must be SP_TRUE. |
| [in] | sub_url | The optional path following the main part. This part must be used if base_url is a local path and the URL includes '#' such as 'index.html#foo'. |
| [in] | local_path | SP_TRUE if base_url is a local path. |
| SP_TRUE | Success |
| SP_FALSE | Failure |
|
extern |
Compares the two strings ignoring the case of the characters.
|
extern |
Compares the two strings ignoring the case of the characters.
|
extern |
Checks whether the string consists of white characters only.
|
extern |
Skips white characters in the string.
|
extern |
Gets the memory-allocated string which is generated by concatenating src contents into the end of orig .
|
extern |
Concatenates src contents into the end of dest. The resultant contents of dest is always terminated with '\0' regardless of src 's length.
|
extern |
Copies the contents of src to the address of dest . The resultant contents of dest is always terminated with '\0' regardless of src 's length.
|
extern |
Searches the suffix (extension) from the string specified by name and returns the beginning address of the suffix which includes dot such as ".wav".
|
extern |
Checks whether two strings have the same suffix.
|
extern |
Removes the suffix in the string and copies the removed suffix to the address specifed by removed_suffix assuming the buffer size of removed_suffix is suffixsize . removed_suffix can be NULL.
|
extern |
Removes the suffix in the string and copies the removed suffix to the address specifed by removed_suffix.
|
extern |
Replaces a suffix of the string of path with another one specified by suffix assuming the buffer size of path is pathsize . If the string of path doesn't have a suffix, a new suffix will be appended.
|
extern |
Replaces a suffix of the string of path with another one specified by suffix . If the string of path doesn't have a suffix, a new suffix will be appended.
|
extern |
Prepends the escape character '\' to a character specified by charlist .
| [in] | escaped | The output null-terminated string. |
| [in] | bufsize | The buffer size of escaped . |
| [in] | string | The input null-terminated string. |
| [in] | charlist | The list of the target characters. |
|
extern |
Deletes the escape character '\' before a character specified by charlist from the input string.
| [in] | string | The output null-terminated string. |
| [in] | bufsize | The buffer size of string . |
| [in] | escaped | The input null-terminated string including escape characters. |
| [in] | charlist | The list of the target characters. If charlist is NULL, all escapes by '\' will be deleted. |
|
extern |
Opens the file whose name is path with the mode specified by mode .
|
extern |
Closes the stream opened by spOpenFile() .
|
extern |
Moves the file pointer to the specified location.
|
extern |
Moves the file pointer to the specified location.
|
extern |
Gets the current position of the file pointer.
Gets the information of the path.
|
extern |
Checks whether the file or directory exists.
|
extern |
Checks whether the file or directory exists.
|
extern |
Checks whether the path represents a file.
|
extern |
Checks whether the path represents a directory.
|
extern |
Creates a directory.
|
extern |
Creates a directory recursively.
|
extern |
Removes a directory.
|
extern |
Removes a file.
|
extern |
Renames a file or directory.
|
extern |
Adds a character for directory separator to the path.
|
extern |
Removes a character for directory separator from the path.
|
extern |
Checks whether the name is an exact path name.
|
extern |
Gets the exact path.
|
extern |
Strips a directory path from the specified path. Note that the argument name is not modified by this function call.
|
extern |
Strips a directory path from the specified path.
|
extern |
Extract a directory path from the specified path. Note that the argument filename is modified by this function call.
|
extern |
Extract a directory path from the specified path.
|
extern |
Gets a path for the use of display from the real path.
|
extern |
Gets a real path from the path for the use of display.
|
extern |
Extracts a path from the list of paths.
|
extern |
Appends a new path list to the tail of the current path list.
|
extern |
Prepends a new path list to the head of the current path list.
|
extern |
Gets the current directory.
|
extern |
Gets the current directory.
|
extern |
Gets the home directory.
|
extern |
Gets the home directory.
|
extern |
Gets the temporal directory.
|
extern |
Gets the temporal directory.
|
extern |
Sets the application ID. This ID can includes the company ID and the version ID by using the character '/' as a separator.
|
extern |
Gets the company ID from the ID specified by spSetApplicationId() .
|
extern |
Gets the application ID from the ID specified by spSetApplicationId() .
|
extern |
Gets the version ID from the ID specified by spSetApplicationId() .
Creates the application directory which corresponds to the ID specified by spSetApplicationId() .
|
extern |
Gets the application directory. If spCreateApplicationDir() has not been called yet, this function creates a new application directory.
|
extern |
Gets the application directory. If spCreateApplicationDir() has not been called yet, this function creates a new application directory.
|
extern |
Gets the temporal directory for the current application.
|
extern |
Gets the temporal directory for the current application.
|
extern |
Sets the temporal directory for the current application.
|
extern |
Gets the special directory for a kind of files.
|
extern |
Rounds to the nearest integer.
|
extern |
Rounds toward zero.
|
extern |
Gets the fractional part of x with the same sign.
|
extern |
Calculates remainder after division.
|
extern |
Calculates the factorial.
|
extern |
Converts the floating point value to a null-terminated string.
|
extern |
Converts the floating point value to a null-terminated string.
|
extern |
Calculates the exponent for the next power of 2.
|
extern |
Gets a size in bytes for the specified bit format.
|
extern |
Gets a weighting factor to normalize the specified bit format.
|
extern |
Converts a buffer of double type into a buffer of the specified bit format.
|
extern |
Converts a buffer of double type into a buffer of the specified bit format.
|
extern |
Converts a buffer of double type into a buffer of the specified bit format with hard clipping.
|
extern |
Converts a buffer of double type into a buffer of the specified bit format with hard clipping.
|
extern |
Converts a buffer of the specified bit format into a buffer of double type.
|
extern |
Converts a buffer of the specified bit format into a buffer of double type.