xstring.cc File Reference
#include "squid.h"
#include "compat/xalloc.h"
#include "compat/xstring.h"
#include <cerrno>
Include dependency graph for xstring.cc:

Go to the source code of this file.

Functions

char * xstrdup (const char *s)
 
char * xstrncpy (char *dst, const char *src, size_t n)
 
char * xstrndup (const char *s, size_t n)
 

Function Documentation

char* xstrdup ( const char *  s)

xstrdup() - same as strdup(3). Used for portability. Never returns NULL; fatal on error.

Sets errno to EINVAL if a NULL pointer is passed.

Define failure_notify to receive error message. otherwise perror() is used to display it.

Definition at line 16 of file xstring.cc.

References failure_notify, p, and xmalloc.

char* xstrndup ( const char *  s,
size_t  n 
)

xstrndup() - Somewhat similar(XXX) to strndup(3): Allocates up to n bytes, while strndup(3) copies up to n bytes and allocates up to n+1 bytes to fit the terminating character. Assumes s is 0-terminated (another XXX).

Never returns NULL; fatal on error.

Sets errno to EINVAL if a NULL pointer or negative length is passed.

Define failure_notify to receive error message. otherwise perror() is used to display it.

Definition at line 56 of file xstring.cc.

References failure_notify, p, xmalloc, and xstrncpy().

Referenced by ESIVariableProcessor::doFunction(), ESIVariableQuery::ESIVariableQuery(), ESIVariableUserAgent::ESIVariableUserAgent(), ftpListParseParts(), ESIVariableUserAgent::getProductVersion(), getsymbol(), munge_menu_line(), HttpHdrSc::parse(), Adaptation::Icap::Options::TransferList::parse(), process_options(), setLogUri(), and ConfigParser::TokenParse().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors