string.h
author tron
Fri, 29 Jul 2005 18:22:04 +0000
changeset 2230 e461b07aead7
parent 2186 db48cf29b983
child 2234 8a9b4c6d9c2a
permissions -rw-r--r--
(svn r2750) -Fix: Tree tiles above the snow line got redrawn disproportionately often
/* $Id$ */

#ifndef STRING_H
#define STRING_H

/*
 * dst: destination buffer
 * src: string to copy/concatenate
 * size: size of the destination buffer
 * usage: ttd_strlcpy(dst, src, lengthof(dst));
 */
void ttd_strlcat(char *dst, const char *src, size_t size);
void ttd_strlcpy(char *dst, const char *src, size_t size);

/*
 * dst: destination buffer
 * src: string to copy
 * last: pointer to the last element in the dst array
 *       if NULL no boundary check is performed
 * returns a pointer to the terminating \0 in the destination buffer
 * usage: strecpy(dst, src, lastof(dst));
 */
char* strecat(char* dst, const char* src, const char* last);
char* strecpy(char* dst, const char* src, const char* last);

#endif