Main Page | Class List | File List | Class Members | File Members | Related Pages

gi_strobj.h

Go to the documentation of this file.
00001 /* 00002 * $Id: gi_strobj.h,v 1.1.2.7 2003/12/30 12:12:09 hipnod Exp $ 00003 * 00004 * Copyright (C) 2001-2003 giFT project (gift.sourceforge.net) 00005 * 00006 * This program is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU General Public License as published by the 00008 * Free Software Foundation; either version 2, or (at your option) any 00009 * later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, but 00012 * WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * General Public License for more details. 00015 */ 00016 00017 #ifndef __GI_STROBJ_H 00018 #define __GI_STROBJ_H 00019 00020 /*****************************************************************************/ 00021 00033 /*****************************************************************************/ 00034 00035 #include "gi_buffer.h" 00036 00037 /*****************************************************************************/ 00038 00042 typedef struct 00043 { 00044 GiBuffer buf; 00045 bool managed; 00046 } GiString; 00047 00048 /* shorthand */ 00049 #define GI_STRBUF(string) (gi_string_buffer ((string))) 00050 #define GI_STRLEN(string) (gi_string_length ((string))) 00051 00052 /*****************************************************************************/ 00053 00054 EXTERN_C_BEGIN 00055 00056 /*****************************************************************************/ 00057 00062 LIBGIFT_EXPORT 00063 void gi_string_init (GiString *string); 00064 00086 LIBGIFT_EXPORT 00087 void gi_string_initex (GiString *string, char *str, size_t alloc, size_t len, 00088 bool can_resize); 00089 00094 LIBGIFT_EXPORT 00095 void gi_string_finish (GiString *string); 00096 00103 LIBGIFT_EXPORT 00104 char *gi_string_finish_keep (GiString *string); 00105 00106 /*****************************************************************************/ 00107 00112 LIBGIFT_EXPORT 00113 GiString *gi_string_new (char *str, size_t alloc, size_t len, bool rok); 00114 00119 LIBGIFT_EXPORT 00120 void gi_string_free (GiString *string); 00121 00126 LIBGIFT_EXPORT 00127 char *gi_string_free_keep (GiString *string); 00128 00129 /*****************************************************************************/ 00130 00134 LIBGIFT_EXPORT 00135 char *gi_string_buffer (GiString *string); 00136 00140 LIBGIFT_EXPORT 00141 size_t gi_string_length (GiString *string); 00142 00143 /*****************************************************************************/ 00144 00148 LIBGIFT_EXPORT 00149 int gi_string_appendvf (GiString *string, const char *fmt, va_list args); 00150 00154 LIBGIFT_EXPORT 00155 int gi_string_appendf (GiString *string, const char *fmt, ...); 00156 00163 LIBGIFT_EXPORT 00164 int gi_string_append (GiString *string, const char *str); 00165 00172 LIBGIFT_EXPORT 00173 int gi_string_appendu (GiString *string, unsigned char *str, size_t len); 00174 00181 LIBGIFT_EXPORT 00182 int gi_string_appendc (GiString *string, int c); 00183 00184 /*****************************************************************************/ 00185 00186 EXTERN_C_END 00187 00188 /*****************************************************************************/ 00189 00190 #endif /* __GI_STROBJ_H */

Generated on Sun Aug 22 07:56:40 2004 by doxygen 1.3.7