strfuncs.c revision 710129a6c8666e19df82a2a7349c7683d531f837
/* Copyright (c) 2002-2014 Dovecot authors, see the included COPYING file */
/* @UNSAFE: whole file */
#include "lib.h"
#include "printf-format-fix.h"
#include "strfuncs.h"
#include <stdio.h>
#include <limits.h>
#include <ctype.h>
#define STRCONCAT_BUFSIZE 512
const unsigned char uchar_nul = '\0';
{
int ret;
args);
}
{
void *mem;
return NULL;
return mem;
}
{
return NULL;
}
{
char *mem;
return mem;
}
{
char *mem;
return NULL;
len = 0;
len++;
return mem;
}
{
char *ret;
return ret;
}
unsigned int *size_r)
{
#define SNPRINTF_INITIAL_EXTRA_SIZE 256
char *tmp;
unsigned int init_size;
int ret;
#ifdef DEBUG
#endif
/* the format string is modified only if %m exists in it. it happens
only in error conditions, so don't try to t_push() here since it'll
just slow down the normal code path. */
/* didn't fit with the first guess. now we know the size,
so try again. */
}
#ifdef DEBUG
/* we rely on errno not changing. it shouldn't. */
#endif
return tmp;
}
{
unsigned int size;
if (pool->datastack_pool) {
return tmp;
} else {
return buf;
}
}
{
const char *str;
char *temp;
return NULL;
i = 0;
do {
/* need more memory */
}
/* next string */
temp[i++] = '\0';
*ret_len = i;
return temp;
}
{
if (pool->datastack_pool) {
} else {
T_BEGIN {
else {
}
} T_END;
}
return ret;
}
{
}
char *t_strdup_noconst(const char *str)
{
}
const char *t_strdup_empty(const char *str)
{
}
{
}
{
}
const char *t_strdup_printf(const char *format, ...)
{
const char *ret;
return ret;
}
{
}
const char *t_strconcat(const char *str1, ...)
{
const char *ret;
return ret;
}
{
const char *p;
for (p = str; *p != '\0'; p++) {
if (*p == cutchar)
return t_strdup_until(str, p);
}
return str;
}
{
if (dstsize == 0)
return -1;
dstsize--;
}
*dest = '\0';
}
{
char *p;
for (p = str; *p != '\0'; p++)
*p = i_toupper(*p);
return str;
}
{
char *p;
for (p = str; *p != '\0'; p++)
*p = i_tolower(*p);
return str;
}
const char *t_str_lcase(const char *str)
{
}
const char *t_str_ucase(const char *str)
{
}
{
return 1;
}
{
int ret;
while (size > 0) {
if (ret != 0)
return ret;
}
return 0;
}
{
}
{
}
{
}
{
}
static char **
{
char **array;
char *str;
if (spaces) {
/* skip leading separators */
data++;
}
if (*data == '\0')
alloc_count = 32;
while (*str != '\0') {
/* separator found */
sizeof(char *) * alloc_count,
sizeof(char *) *
}
*str = '\0';
if (spaces) {
str++;
/* ignore trailing separators */
break;
}
}
str++;
}
return array;
}
{
separators, FALSE);
}
{
separators, TRUE);
}
{
}
const char *separators)
{
}
const char **t_strsplit_tab(const char *data)
{
const char **array;
char *dest;
if (*data == '\0')
return t_new(const char *, 1);
array_size = 1;
dest_size = 128;
for (i = 0; data[i] != '\0'; i++) {
if (i >= dest_size) {
}
if (data[i] != '\t')
else {
dest[i] = '\0';
array_size++;
}
}
dest[i] = '\0';
t_buffer_alloc(i+1);
dest_size = i;
for (i = 0; i < dest_size; i++) {
if (dest[i] == '\0')
}
return array;
}
{
}
unsigned int str_array_length(const char *const *arr)
{
unsigned int count;
return 0;
count++;
return count;
}
{
char *str;
alloc_len = 64;
if (needed_space > alloc_len) {
}
if (pos != 0) {
}
}
return str;
}
{
const char **dest;
/* found it. now move the rest. */
return TRUE;
}
}
return FALSE;
}
{
return TRUE;
}
return FALSE;
}
{
return TRUE;
}
return FALSE;
}
{
unsigned int i;
const char **ret;
char *p;
ret[i] = p;
p += len;
}
return ret;
}
{
char *buffer;
int pos;
do {
number /= 10;
}