added new functions

- qse_strxfcpy(), qse_strfcpy()
cleaned up code a little
- renamed a few functions. qse_awk_strtok() to qse_awk_rtx_strtok(), etc
This commit is contained in:
2009-02-15 00:21:19 +00:00
parent 172725273c
commit 10adba9ed0
11 changed files with 321 additions and 108 deletions

View File

@ -1520,7 +1520,7 @@ int qse_awk_rtx_strtonum (
* SYNOPSIS
*/
qse_awk_t* qse_awk_opensimple (
qse_size_t xtn /* size of extension area in bytes */
void
);
/******/

View File

@ -116,18 +116,86 @@ extern "C" {
/*
* basic string functions
*/
qse_size_t qse_strlen (const qse_char_t* str);
qse_size_t qse_strbytes (const qse_char_t* str);
/****f* Common/qse_strlen
* NAME
* qse_strlen - get the number of characters
* DESCRIPTION
* The qse_strlen() function returns the number of characters in a
* null-terminated string. The length returned excludes a terminating null.
* SYNOPSIS
*/
qse_size_t qse_strlen (
const qse_char_t* str
);
/******/
/****f* Common/qse_strbytes
* NAME
* qse_strbytes - get the length of a string in bytes
* DESCRIPTOIN
* The qse_strbytes() function returns the number of bytes a null-terminated
* string is holding excluding a terminating null.
* SYNOPSIS
*/
qse_size_t qse_strbytes (
const qse_char_t* str
);
/******/
qse_size_t qse_strcpy (
qse_char_t* buf, const qse_char_t* str);
qse_size_t qse_strxcpy (
qse_char_t* buf, qse_size_t bsz, const qse_char_t* str);
qse_size_t qse_strncpy (
qse_char_t* buf, const qse_char_t* str, qse_size_t len);
qse_size_t qse_strxncpy (
qse_char_t* buf, qse_size_t bsz, const qse_char_t* str, qse_size_t len);
qse_char_t* buf,
const qse_char_t* str
);
qse_size_t qse_strxcpy (
qse_char_t* buf,
qse_size_t bsz,
const qse_char_t* str
);
qse_size_t qse_strncpy (
qse_char_t* buf,
const qse_char_t* str,
qse_size_t len
);
qse_size_t qse_strxncpy (
qse_char_t* buf,
qse_size_t bsz,
const qse_char_t* str,
qse_size_t len
);
/****f* Common/qse_strfcpy
* NAME
* qse_strfcpy - copy a string
* DESCRIPTION
* "format ${1} ${3} ${2} \\${1} string"
* SYNOPSIS
*/
qse_size_t qse_strfcpy (
qse_char_t* buf,
const qse_char_t* fmt,
...
);
/******/
/****f* Common/qse_strxfcpy
* NAME
* qse_strxfcpy - copy a string
* DESCRIPTION
* "format $1 $3 $2 \\$1 string"
* SYNOPSIS
*/
qse_size_t qse_strxfcpy (
qse_char_t* buf,
qse_size_t bsz,
const qse_char_t* fmt,
...
);
/******/
qse_size_t qse_strxcat (
qse_char_t* buf, qse_size_t bsz, const qse_char_t* str);
qse_size_t qse_strxncat (