summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-02-22 10:09:37 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-02-22 10:09:37 +0000
commit69c5b270c22295c74f867304200dda96256b5795 (patch)
tree77b59cd1ef03311667968409d85fe8c3285d8ec4 /include
parent540a75453247c9173e72a7392df129b37aea08e7 (diff)
downloadmailutils-69c5b270c22295c74f867304200dda96256b5795.tar.gz
mailutils-69c5b270c22295c74f867304200dda96256b5795.tar.bz2
Implement associative arrays
Diffstat (limited to 'include')
-rw-r--r--include/mailutils/Makefile.am3
-rw-r--r--include/mailutils/assoc.h45
2 files changed, 47 insertions, 1 deletions
diff --git a/include/mailutils/Makefile.am b/include/mailutils/Makefile.am
index 74ad37917..892e3b2d7 100644
--- a/include/mailutils/Makefile.am
+++ b/include/mailutils/Makefile.am
@@ -1,7 +1,7 @@
## Process this file with GNU Automake to create Makefile.in
## Copyright (C) 2000, 2001, 2002, 2003,
-## 2004, 2005 Free Software Foundation, Inc.
+## 2004, 2005, 2007 Free Software Foundation, Inc.
##
## GNU Mailutils is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
@@ -32,6 +32,7 @@ pkginclude_HEADERS = \
address.h \
argcv.h \
argp.h \
+ assoc.h \
attribute.h \
auth.h \
body.h \
diff --git a/include/mailutils/assoc.h b/include/mailutils/assoc.h
new file mode 100644
index 000000000..6d9df6ce5
--- /dev/null
+++ b/include/mailutils/assoc.h
@@ -0,0 +1,45 @@
+/* GNU Mailutils -- a suite of utilities for electronic mail
+ Copyright (C) 2007 Free Software Foundation, Inc.
+
+ 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 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 _MAILUTILS_ASSOC_H
+#define _MAILUTILS_ASSOC_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <mailutils/types.h>
+
+typedef void (*mu_assoc_free_fn) (void *data);
+
+int mu_assoc_create (mu_assoc_t *passoc, size_t elsize);
+void *mu_assoc_ref (mu_assoc_t assoc, const char *name);
+int mu_assoc_install (mu_assoc_t assoc, const char *name, void *value);
+int mu_assoc_ref_install (mu_assoc_t assoc, const char *name, void **pval);
+int mu_assoc_get_iterator (mu_assoc_t assoc, mu_iterator_t *piterator);
+int mu_assoc_remove_ref (mu_assoc_t assoc, void *data);
+int mu_assoc_remove (mu_assoc_t assoc, const char *name);
+int mu_assoc_set_free (mu_assoc_t assoc, mu_assoc_free_fn fn);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _MAILUTILS_ASSOC_H */
+
+

Return to:

Send suggestions and report system problems to the System administrator.