]> git.datanom.net - vcard-parser.git/commitdiff
initialize
authorMichael Rasmussen <mir@datanom.net>
Wed, 25 Dec 2019 19:52:52 +0000 (20:52 +0100)
committerMichael Rasmussen <mir@datanom.net>
Wed, 25 Dec 2019 19:52:52 +0000 (20:52 +0100)
Signed-off-by: Michael Rasmussen <mir@datanom.net>
Makefile.am
configure.ac
example/Makefile.am [new file with mode: 0644]
example/vcard-example.c [new file with mode: 0644]
src/Makefile.am
src/vcard-example.c [deleted file]
src/vcard-parser.h [new file with mode: 0644]
src/vcard.c
src/vcard.h

index 2cba5ad934f226ee88ccb3afe1909b46d6b22e49..0800c5c474731189511f60550bf3b9400b6f5dd0 100644 (file)
@@ -2,6 +2,17 @@ AUTOMAKE_OPTIONS = gnu
 
 SUBDIRS = src
 
+if BUILD_EXAMPLE
+SUBDIRS += example
+endif
+
 ACLOCAL_AMFLAGS = -I m4
 
-EXTRA_DIST = README COPYING AUTHORS ChangeLog INSTALL NEWS
+EXTRA_DIST = \
+           README \
+           COPYING \
+           AUTHORS \
+           ChangeLog \
+           INSTALL \
+           NEWS \
+           autogen.sh
index d811bcf94d117ab0967bbb88a701fb95c311d667..ead011d4d417225e683e33e4a50e13a2a31223fc 100644 (file)
@@ -72,7 +72,7 @@ AM_CONDITIONAL(BUILD_EXAMPLE, test x"$ac_enable_example" = "xyes")
 AC_CONFIG_COMMANDS(
     [summary],
     [[echo ""
-    echo -e "libvcard will be compiled with these settings:"
+    echo -e "libvCard will be compiled with these settings:"
     echo -e "\tCFLAGS:\t\t${CFLAGS}"
     echo -e "\tLIBS:\t\t${LIBS}"
     echo -e "\tExample:\t${EXAMPLE}"
@@ -91,5 +91,6 @@ AC_CONFIG_COMMANDS(
 
 AC_OUTPUT([
     Makefile
+    example/Makefile
     src/Makefile
 ])
diff --git a/example/Makefile.am b/example/Makefile.am
new file mode 100644 (file)
index 0000000..f742448
--- /dev/null
@@ -0,0 +1,19 @@
+AUTOMAKE_OPTIONS = gnu
+
+AM_CPPFLAGS = \
+               @GLIB_CFLAGS@ \
+               -I$(top_srcdir) -I$(top_builddir) \
+               -I$(top_srcdir)/src -I$(top_builddir)/src \
+               -I$(top_srcdir)/example -I$(top_builddir)/example
+
+bin_PROGRAMS = vcard-example
+
+vcard_example_SOURCES = \
+               vcard-example
+
+vcard_example_LDFLAGS = \
+               -L$(top_srcdir)/src/
+
+vcard_example_LDADD = \
+               $(GLIB_LIBS) \
+               -lvCard
diff --git a/example/vcard-example.c b/example/vcard-example.c
new file mode 100644 (file)
index 0000000..254bca4
--- /dev/null
@@ -0,0 +1,5 @@
+# include <vcard.h>
+
+int main() {
+    return 0;
+}
index b1191dc3625973c3f3c158cc439a1094a9279637..e4bf932e84e480b2dd7e48da64b673a25c92264f 100644 (file)
@@ -4,22 +4,17 @@ AM_CPPFLAGS = \
           @GLIB_CFLAGS@ \
           -I $(top_srcdir)
 
-lib_LTLIBRARIES = libvcard.la
+lib_LTLIBRARIES = libvCard.la
 
-libvcard_la_SOURCES = \
-                   vcard.c
+libvCard_la_SOURCES = \
+                   vcard.c \
+                   vcard-parser.h
 
-libvcard_la_LDFLAGS = \
+libvCard_la_LDFLAGS = \
                    -version-info @LIB_VERSION@
 include_HEADERS = \
                    vcard.h
 
-libvcard_la_LIBADD = \
+libvCard_la_LIBADD = \
            @GLIB_LIBS@
 
-if BUILD_EXAMPLE
-bin_PROGRAMS = vcard-example
-vcard_example_SOURCES = vcard-example.c
-vcard_example_LDADD = libvcard.la
-endif
-
diff --git a/src/vcard-example.c b/src/vcard-example.c
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/src/vcard-parser.h b/src/vcard-parser.h
new file mode 100644 (file)
index 0000000..9884abb
--- /dev/null
@@ -0,0 +1,144 @@
+/*
+ * vcard-parser.h
+ *
+ * Copyright 2019 Michael Rasmussen <mir@datanom.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+#ifndef __VCARD_H__
+#define __VCARD_H__
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+typedef enum {
+       // vCard 2.1 properties and up
+       N = 0,
+       FN,
+       PHOTO,
+       BDAY,
+       ADR,
+       LABEL, // Removed in vCard 4.0
+       TEL,
+       EMAIL,
+       MAILER, // Removed in vCard 4.0
+       GEO,
+       TITLE,
+       ROLE,
+       LOGO,
+       ORG,
+       NOTE,
+       REV,
+       SOUND,
+       URL,
+       UID,
+       VERSION,
+       KEY,
+       TZ,
+       // vCard 3.0 properties
+       CATEGORIES,
+       SORT_STRING,
+       PRODID,
+       NICKNAME,
+       CLASS, // Removed in vCard 4.0
+       // rfc2739 properties
+       FBURL,
+       CAPURI,
+       CALURI,
+       CALADRURI,
+       // rfc4770 properties
+       IMPP,
+       // vCard 4.0 properties
+       SOURCE,
+       XML,
+       ANNIVERSARY,
+       CLIENTPIDMAP,
+       LANG,
+       GENDER,
+       KIND,
+       MEMBER,
+       RELATED,
+       // rfc6474 properties
+       BIRTHPLACE,
+       DEATHPLACE,
+       DEATHDATE,
+       // rfc6715 properties
+       EXPERTISE,
+       HOBBY,
+       INTEREST,
+       ORG_DIRECTORY,
+       VCARD_PROPERTIES,
+} Property;
+
+gchar* Proterties[VCARD_PROPERTIES+1] = {
+       "N",
+       "FN",
+       "PHOTO",
+       "BDAY",
+       "ADR",
+       "LABEL",
+       "TEL",
+       "EMAIL",
+       "MAILER",
+       "GEO",
+       "TITLE",
+       "ROLE",
+       "LOGO",
+       "ORG",
+       "NOTE",
+       "REV",
+       "SOUND",
+       "URL",
+       "UID",
+       "VERSION",
+       "KEY",
+       "TZ",
+       "CATEGORIES",
+       "SORT-STRING",
+       "PRODID",
+       "NICKNAME",
+       "CLASS",
+       "FBURL",
+       "CAPURI",
+       "CALURI",
+       "CALADRURI",
+       "IMPP",
+       "SOURCE",
+       "XML",
+       "ANNIVERSARY",
+       "CLIENTPIDMAP",
+       "LANG",
+       "GENDER",
+       "KIND",
+       "MEMBER",
+       "RELATED",
+       "BIRTHPLACE",
+       "DEATHPLACE",
+       "DEATHDATE",
+       "EXPERTISE",
+       "HOBBY",
+       "INTEREST",
+       "ORG-DIRECTORY",
+       NULL
+};
+
+G_END_DECLS
+
+gboolean vcard_parse_text();
+
+#endif
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..9a09ccaf0bbd961923dfadffc83ad6ee21fa6d56 100644 (file)
@@ -0,0 +1,30 @@
+/*
+ * vcard.c
+ *
+ * Copyright 2019 Michael Rasmussen <mir@datanom.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+# include <vcard.h>
+
+struct _VCard {
+       gchar *version;
+};
+
+int main() {
+    return 0;
+}
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..12bbd76c4b32a2b52ffc849cce8bd86281500ba8 100644 (file)
@@ -0,0 +1,49 @@
+/*
+ * vcard.h
+ *
+ * Copyright 2019 Michael Rasmussen <mir@datanom.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+#ifndef __VCARD_PARSER_H__
+#define __VCARD_PARSER_H__
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+#include <stdio.h>
+#include <vcard-parser.h>
+
+typedef enum {
+       DETECT,
+       VERSION_2_1,
+       VERSION_3_0,
+       VERSION_4_0,
+} VCardVersion;
+
+typedef struct _VCard VCard;
+
+VCard* VCard_new(VCardVersion version);
+VCard* VCard_new_from_text(const gchar* text, VCardVersion version);
+VCard* VCard_new_from_file(FILE* file, VCardVersion version);
+void VCard_print(VCard* object);
+void VCard_print_fd(VCard* object, int fd);
+
+G_END_DECLS
+
+#endif
This page took 0.049409 seconds and 5 git commands to generate.