initial import for sdlhaa & sdlhim
[sdlhildon] / sdlhim / src / ds.h
diff --git a/sdlhim/src/ds.h b/sdlhim/src/ds.h
new file mode 100644 (file)
index 0000000..58b6b0a
--- /dev/null
@@ -0,0 +1,42 @@
+/* This file is part of SDL_him - SDL Hildon Input Method addon
+ * Copyright (C) 2010 Javier S. Pedro
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA or see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DS_H_
+#define DS_H_
+
+/* A very simple dynamic string library, used internally for holding the
+ * preedit buffer.
+ */
+
+#pragma GCC visibility push(hidden)
+
+typedef struct dstring
+{
+       unsigned long len;
+       unsigned long capacity;
+       char * str;
+} dstring_t;
+
+void ds_clear(dstring_t *ds);
+void ds_set(dstring_t *ds, const char *str);
+void ds_append(dstring_t *ds, const char *str);
+
+#pragma GCC visibility pop
+
+#endif