summaryrefslogtreecommitdiff
path: root/libappstream-glib/as-utils.h
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-03-13 15:42:02 +0000
committerRichard Hughes <richard@hughsie.com>2014-03-13 15:42:02 +0000
commit71cec283d900b52e6d59092637ba5248d6715c08 (patch)
tree4d2dbb3dc8dcc47cfacd5b1da2cde159d7f969fc /libappstream-glib/as-utils.h
parenta4f0fa55a790b07f62e2dac0c98fe9755f95e239 (diff)
downloadappstream-glib-71cec283d900b52e6d59092637ba5248d6715c08.tar.gz
Use strndup so we can use expat-type parsers without an additional copy
Diffstat (limited to 'libappstream-glib/as-utils.h')
-rw-r--r--libappstream-glib/as-utils.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/libappstream-glib/as-utils.h b/libappstream-glib/as-utils.h
new file mode 100644
index 0000000..b70e7cd
--- /dev/null
+++ b/libappstream-glib/as-utils.h
@@ -0,0 +1,36 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2014 Richard Hughes <richard@hughsie.com>
+ *
+ * Licensed under the GNU Lesser General Public License Version 2.1
+ *
+ * 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 2.1 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#if !defined (__APPSTREAM_GLIB_H) && !defined (AS_COMPILATION)
+#error "Only <appstream-glib.h> can be included directly."
+#endif
+
+#ifndef AS_UTILS_H
+#define AS_UTILS_H
+
+#include <glib.h>
+
+gchar *as_strndup (const gchar *text,
+ gssize text_len);
+
+G_END_DECLS
+
+#endif /* AS_UTILS_H */