summaryrefslogtreecommitdiff
path: root/preppie/sprep.h
diff options
context:
space:
mode:
Diffstat (limited to 'preppie/sprep.h')
-rw-r--r--preppie/sprep.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/preppie/sprep.h b/preppie/sprep.h
new file mode 100644
index 0000000..d5f28a8
--- /dev/null
+++ b/preppie/sprep.h
@@ -0,0 +1,67 @@
+/*
+ * This file is part of preppie.
+ *
+ * Copyright (C) 2010 Mikhail Zabaluev <mikhail.zabaluev@gmail.com>
+ *
+ * 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
+ */
+
+#ifndef PREPPIE_SPREP_H_
+#define PREPPIE_SPREP_H_
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+
+#define SPREP_ERRORS (sprep_error_quark ())
+
+typedef enum {
+ SPREP_ERROR_NONE = 0,
+ SPREP_ERROR_INVALID_INPUT,
+ SPREP_ERROR_UNASSIGNED_CODE_POINT,
+ SPREP_ERROR_PROHIBITED_CHARACTER,
+ SPREP_ERROR_BIDI_CHECK_FAILED,
+ SPREP_ERROR_BAD_PROFILE_NAME,
+ SPREP_ERROR_PROFILE_NOT_AVAILABLE,
+ SPREP_ERROR_UNSUPPORTED_PROFILE_FORMAT,
+ SPREP_ERROR_PROFILE_MALFORMED,
+} SprepError;
+
+typedef struct _SprepProfile SprepProfile;
+
+typedef enum {
+ SPREP_QUERY,
+ SPREP_STORED
+} SprepStrictness;
+
+
+SprepProfile *sprep_profile_open (const gchar *profile_name, GError **error);
+
+void sprep_profile_destroy (SprepProfile *profile);
+
+gchar *sprep_prepare (SprepProfile *profile,
+ const gchar *str,
+ gssize len,
+ SprepStrictness strictness,
+ GError **error);
+
+GQuark sprep_error_quark (void);
+
+
+G_END_DECLS
+
+#endif /* !PREPPIE_SPREP_H_ */