Home --> Documentations --> PJLIB Reference
Go to the documentation of this file.
19#ifndef __PJ_STRING_H__
20#define __PJ_STRING_H__
28#include <pj/compat/string.h>
80#define PJ_CHECK_TRUNC_STR(ret, str, len) \
81 if ((ret) >= (len) || (ret) < 0) pj_ansi_strcpy((str) + (len) - 3, "..")
383#if defined(PJ_HAS_STRICMP_ALNUM) && PJ_HAS_STRICMP_ALNUM!=0
387#define strnicmp_alnum pj_ansi_strnicmp
405#if defined(PJ_HAS_STRICMP_ALNUM) && PJ_HAS_STRICMP_ALNUM!=0
408#define pj_stricmp_alnum pj_stricmp
484 return ( char*) memchr(( char*)str-> ptr, chr, str-> slen);
738PJ_DECL( int) pj_utoa( unsigned long val, char *buf);
753PJ_DECL( int) pj_utoa_pad( unsigned long val, char *buf, int min_dig, int pad);
764#if defined(PJ_HAS_BZERO) && PJ_HAS_BZERO!=0
767 memset(dst, 0, size);
783 return memset(dst, c, size);
797 return memcpy(dst, src, size);
811 return memmove(dst, src, size);
825 return memcmp(buf1, buf2, size);
840 return ( void*)memchr(( void*)buf, c, size);
847#if PJ_FUNCTIONS_ARE_INLINED
848# include <pj/string_i.h>
long pj_ssize_t Definition: types.h:64
size_t pj_size_t Definition: types.h:58
int pj_status_t Definition: types.h:68
pj_ssize_t pj_strcspn(const pj_str_t *str, const pj_str_t *set_char)
pj_str_t * pj_strrtrim(pj_str_t *str)
pj_ssize_t pj_strspn2(const pj_str_t *str, const char *set_char)
unsigned long pj_strtoul(const pj_str_t *str)
void * pj_memcpy(void *dst, const void *src, pj_size_t size) Definition: string.h:795
void pj_strcat2(pj_str_t *dst, const char *src)
pj_str_t * pj_strassign(pj_str_t *dst, pj_str_t *src)
pj_ssize_t pj_strtok2(const pj_str_t *str, const char *delim, pj_str_t *tok, pj_size_t start_idx)
const char * pj_strbuf(const pj_str_t *str) Definition: string.h:293
pj_str_t pj_str(char *str)
pj_str_t * pj_strset3(pj_str_t *str, char *begin, char *end) Definition: string.h:148
pj_str_t * pj_strdup2(pj_pool_t *pool, pj_str_t *dst, const char *src)
int pj_strnicmp(const pj_str_t *str1, const pj_str_t *str2, pj_size_t len)
int pj_strcmp2(const pj_str_t *str1, const char *str2)
int pj_utoa_pad(unsigned long val, char *buf, int min_dig, int pad)
pj_str_t * pj_strset(pj_str_t *str, char *ptr, pj_size_t length) Definition: string.h:116
void * pj_memmove(void *dst, const void *src, pj_size_t size) Definition: string.h:809
int pj_stricmp2(const pj_str_t *str1, const char *str2)
int pj_strcmp(const pj_str_t *str1, const pj_str_t *str2)
pj_str_t * pj_strncpy_with_null(pj_str_t *dst, const pj_str_t *src, pj_ssize_t max)
int pj_strncmp2(const pj_str_t *str1, const char *str2, pj_size_t len)
char * pj_stristr(const pj_str_t *str, const pj_str_t *substr)
pj_str_t * pj_strncpy(pj_str_t *dst, const pj_str_t *src, pj_ssize_t max)
int pj_utoa(unsigned long val, char *buf)
void * pj_memchr(const void *buf, int c, pj_size_t size) Definition: string.h:838
void pj_strcat(pj_str_t *dst, const pj_str_t *src)
int pj_strnicmp2(const pj_str_t *str1, const char *str2, pj_size_t len)
pj_str_t * pj_strdup_with_null(pj_pool_t *pool, pj_str_t *dst, const pj_str_t *src)
int pj_memcmp(const void *buf1, const void *buf2, pj_size_t size) Definition: string.h:823
char * pj_strstr(const pj_str_t *str, const pj_str_t *substr)
pj_str_t * pj_strcpy(pj_str_t *dst, const pj_str_t *src)
unsigned long pj_strtoul2(const pj_str_t *str, pj_str_t *endptr, unsigned base)
#define strnicmp_alnum Definition: string.h:387
pj_str_t * pj_strcpy2(pj_str_t *dst, const char *src)
pj_str_t * pj_strtrim(pj_str_t *str)
char * pj_create_random_string(char *str, pj_size_t length)
pj_status_t pj_strtol2(const pj_str_t *str, long *value)
pj_status_t pj_strtoul3(const pj_str_t *str, unsigned long *value, unsigned base)
#define pj_stricmp_alnum Definition: string.h:408
int pj_strncmp(const pj_str_t *str1, const pj_str_t *str2, pj_size_t len)
pj_size_t pj_strlen(const pj_str_t *str) Definition: string.h:281
long pj_strtol(const pj_str_t *str)
pj_str_t * pj_strdup2_with_null(pj_pool_t *pool, pj_str_t *dst, const char *src)
const pj_str_t * pj_cstr(pj_str_t *str, const char *s) Definition: string.h:100
pj_str_t pj_strdup3(pj_pool_t *pool, const char *src)
int pj_stricmp(const pj_str_t *str1, const pj_str_t *str2)
pj_ssize_t pj_strspn(const pj_str_t *str, const pj_str_t *set_char)
pj_str_t * pj_strset2(pj_str_t *str, char *src) Definition: string.h:132
float pj_strtof(const pj_str_t *str)
char * pj_strchr(const pj_str_t *str, int chr) Definition: string.h:480
pj_str_t * pj_strdup(pj_pool_t *pool, pj_str_t *dst, const pj_str_t *src)
pj_ssize_t pj_strcspn2(const pj_str_t *str, const char *set_char)
pj_str_t * pj_strltrim(pj_str_t *str)
void * pj_memset(void *dst, int c, pj_size_t size) Definition: string.h:781
void pj_bzero(void *dst, pj_size_t size) Definition: string.h:762
pj_ssize_t pj_strtok(const pj_str_t *str, const pj_str_t *delim, pj_str_t *tok, pj_size_t start_idx)
#define PJ_BEGIN_DECL Definition: config.h:1284
#define PJ_IDECL(type) Definition: config.h:1333
#define PJ_INLINE(type) Definition: config.h:1178
#define PJ_END_DECL Definition: config.h:1285
pj_ssize_t slen Definition: types.h:125
char * ptr Definition: types.h:122
Declaration of basic types and utility.
PJLIB Open Source, high performance, small footprint, and very very portable framework
Copyright (C) 2006-2009 Teluu Inc.
|