2 * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation
4 * Author: Nikos Mavroyanopoulos
6 * This file is part of GNUTLS.
8 * The GNUTLS library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 #include <gnutls_int.h>
30 void _gnutls_str_cpy (char *dest
, size_t dest_tot_size
, const char *src
);
31 void _gnutls_mem_cpy (char *dest
, size_t dest_tot_size
, const char *src
,
33 void _gnutls_str_cat (char *dest
, size_t dest_tot_size
, const char *src
);
40 gnutls_realloc_function realloc_func
;
41 gnutls_alloc_function alloc_func
;
42 gnutls_free_function free_func
;
45 void _gnutls_string_init (gnutls_string
*, gnutls_alloc_function
,
46 gnutls_realloc_function
, gnutls_free_function
);
47 void _gnutls_string_clear (gnutls_string
*);
49 /* Beware, do not clear the string, after calling this
52 gnutls_datum_t
_gnutls_string2datum (gnutls_string
* str
);
54 int _gnutls_string_copy_str (gnutls_string
* dest
, const char *src
);
55 int _gnutls_string_append_str (gnutls_string
*, const char *str
);
56 int _gnutls_string_append_data (gnutls_string
*, const void *data
,
58 int _gnutls_string_append_printf (gnutls_string
* dest
, const char *fmt
, ...);
60 char *_gnutls_bin2hex (const void *old
, size_t oldlen
, char *buffer
,
62 int _gnutls_hex2bin (const opaque
* hex_data
, int hex_size
, opaque
* bin_data
,