2 * $Id: BLI_blenlib.h 17433 2008-11-12 21:16:53Z blendix $
4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21 * All rights reserved.
23 * The Original Code is: all of this file.
25 * Contributor(s): none yet.
27 * ***** END GPL LICENSE BLOCK *****
40 * Duplicates the cstring @a str into a newly mallocN'd
41 * string and returns it.
43 * @param str The string to be duplicated
44 * @retval Returns the duplicated string
46 char *BLI_strdup(const char *str);
49 * Duplicates the first @a len bytes of cstring @a str
50 * into a newly mallocN'd string and returns it. @a str
51 * is assumed to be at least len bytes long.
53 * @param str The string to be duplicated
54 * @param len The number of bytes to duplicate
55 * @retval Returns the duplicated string
57 char *BLI_strdupn(const char *str, int len);
60 * Like strncpy but ensures dst is always
63 * @param dst Destination for copy
64 * @param src Source string to copy
65 * @param maxncpy Maximum number of characters to copy (generally
69 char *BLI_strncpy(char *dst, const char *src, int maxncpy);
72 * Replacement for snprintf
74 int BLI_snprintf(char *buffer, size_t count, const char *format, ...);
77 * Print formatted string into a newly mallocN'd string
80 char *BLI_sprintfN(const char *format, ...);
85 * @retval True if the strings are equal, false otherwise.
87 int BLI_streq(char *a, char *b);
90 * Compare two strings without regard to case.
92 * @retval True if the strings are equal, false otherwise.
94 int BLI_strcaseeq(char *a, char *b);
96 char *BLI_strcasestr(const char *s, const char *find);
97 int BLI_strcasecmp(const char *s1, const char *s2);
98 int BLI_strncasecmp(const char *s1, const char *s2, int n);
100 void BLI_timestr(double _time, char *str); /* time var is global */