Debian Codegraph @

Xpjproject/pjlib/src/pj/guid.c

raw symbols SCIP
1 /*
2 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
3 * Copyright (C) 2003-2008 Benny Prijono <[email protected]>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 #include <pj/ctype.h>
20 #include <pj/guid.h>
21 #include <pj/pool.h>
22
23 PJ_DEF(pj_str_t*) pj_generate_unique_string_lower(pj_str_t *str)
24 {
25 int i;
26
27 pj_generate_unique_string(str);
28 for (i = 0; i < str->slen; i++)
29 str->ptr[i] = (char)pj_tolower(str->ptr[i]);
30
31 return str;
32 }
33
34 PJ_DEF(void) pj_create_unique_string(pj_pool_t *pool, pj_str_t *str)
35 {
36 str->ptr = (char*)pj_pool_alloc(pool, PJ_GUID_STRING_LENGTH);
37 pj_generate_unique_string(str);
38 }
39
40 PJ_DEF(void) pj_create_unique_string_lower(pj_pool_t *pool, pj_str_t *str)
41 {
42 int i;
43
44 pj_create_unique_string(pool, str);
45 for (i = 0; i < str->slen; i++)
46 str->ptr[i] = (char)pj_tolower(str->ptr[i]);
47 }