|
NONSTATIC_INLINE int | elinks_ulongcat (char *s, unsigned int *slen, unsigned long long number, unsigned int width, unsigned char fillchar, unsigned int base, unsigned int upper) |
| This function takes string s and stores the number (of a result width width) in string format there, starting at position [*slen].
|
|
NONSTATIC_INLINE int | elinks_longcat (char *s, unsigned int *slen, long long number, unsigned int width, unsigned char fillchar, unsigned int base, unsigned int upper) |
| Similar to elinks_ulongcat() but for long number.
|
|
struct string * | add_string_replace (struct string *string, char *src, int len, unsigned char replaceable, unsigned char replacement) |
|
struct string * | add_html_to_string (struct string *string, const char *src2, int len) |
|
struct string * | add_cp_html_to_string (struct string *string, int src_codepage, const char *src, int len) |
|
struct string * | add_quoted_to_string (struct string *string, const char *src, int len) |
|
struct string * | add_shell_quoted_to_string (struct string *string, const char *src, int len) |
|
struct string * | add_shell_safe_to_string (struct string *string, const char *cmd, int cmdlen) |
|
long | strtolx (char *str, char **end) |
|
int | month2num (const char *str) |
| Return 0 if starting with jan, 11 for dec, -1 for failure.
|
|
void | clr_spaces (char *str2) |
| This function drops control chars, nbsp char and limit the number of consecutive space chars to one.
|
|
void | sanitize_title (char *title) |
| Replace invalid chars in title with ' ' and trim all starting/ending spaces.
|
|
int | sanitize_url (char *url) |
| Returns 0 if url contains invalid chars, 1 if ok.
|
|
int | c_tolower (int c) |
|
int | c_toupper (int c) |
|
int | c_isupper (int c) |
|
int | c_islower (int c) |
|
NONSTATIC_INLINE int elinks_ulongcat |
( |
char * | s, |
|
|
unsigned int * | slen, |
|
|
unsigned long long | number, |
|
|
unsigned int | width, |
|
|
unsigned char | fillchar, |
|
|
unsigned int | base, |
|
|
unsigned int | upper ) |
This function takes string s and stores the number (of a result width width) in string format there, starting at position [*slen].
If the number would take more space than width, it is truncated and only the last digits of it are inserted to the string. If the number takes less space than width, it is padded by fillchar from left. base defined which base should be used (10, 16, 8, 2, ...) upper selects either hexa uppercased chars or lowercased chars.
A NUL char is always added at the end of the string. s must point to a sufficiently large memory space, at least *slen + width + 1.
Examples:
NONSTATIC_INLINE int elinks_ulongcat(char *s, unsigned int *slen, unsigned long long number, unsigned int width, unsigned char fillchar, unsigned int base, unsigned int upper)
This function takes string s and stores the number (of a result width width) in string format there,...
Definition conv.c:52
#define NULL
Definition explodename.c:35
const char * s
Definition general.c:869
Note that this function exists to provide a fast and efficient, however still quite powerful alternative to sprintf(). It is optimized for speed and is MUCH faster than sprintf(). If you can use it, use it ;-). But do not get too enthusiastic, do not use it in cases where it would break i18n.
- Returns
- 0 if OK or width needed for the whole number to fit there, if it had to be truncated. A negative value signs an error.