summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfcolin2005-07-22 14:21:12 +0000
committerfcolin2005-07-22 14:21:12 +0000
commit97c5a6a52b134334f04a394f4ed774b287f8e774 (patch)
tree66ff24c97e6b0325309862351b2356082eb7a15d /src
parent334891f7c465cc00798511863a8a651713642202 (diff)
downloadivy-c-97c5a6a52b134334f04a394f4ed774b287f8e774.zip
ivy-c-97c5a6a52b134334f04a394f4ed774b287f8e774.tar.gz
ivy-c-97c5a6a52b134334f04a394f4ed774b287f8e774.tar.bz2
ivy-c-97c5a6a52b134334f04a394f4ed774b287f8e774.tar.xz
gestion argument des messages sous forme de Tree
Diffstat (limited to 'src')
-rwxr-xr-xsrc/ivyargument.c77
-rwxr-xr-xsrc/ivyargument.h28
2 files changed, 105 insertions, 0 deletions
diff --git a/src/ivyargument.c b/src/ivyargument.c
new file mode 100755
index 0000000..f7662a1
--- /dev/null
+++ b/src/ivyargument.c
@@ -0,0 +1,77 @@
+/*
+ * Ivy, C interface
+ *
+ * Copyright (C) 1997-2000
+ * Centre d'Études de la Navigation Aérienne
+ *
+ * Argument message comtent
+ *
+ * Authors: François-Régis Colin <fcolin@cena.fr>
+ *
+ * $Id$
+ *
+ * Please refer to file version.h for the
+ * copyright notice regarding this software
+ */
+/* Module de gestion de la syntaxe des messages Ivy */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <time.h>
+#include <stdlib.h>
+#include <memory.h>
+
+
+#include "list.h"
+#include "ivyargument.h"
+
+
+
+struct _argument {
+ /* childrens */
+ struct _argument *next;
+ /* arg value */
+ char *value;
+ };
+
+IvyArgument IvyArgumentNew( const char * value )
+{
+ IvyArgument arg = malloc( sizeof( struct _argument ) );
+ arg->value = strdup( value );
+ arg->next = 0;
+ return arg;
+}
+void IvyArgumentFree( IvyArgument arg )
+{
+ free( arg->value );
+ free( arg );
+}
+const char * IvyArgumentGetValue( IvyArgument arg )
+{
+ return arg->value;
+}
+
+IvyArgument IvyArgumentGetNextChild( IvyArgument arg )
+{
+ return arg->next;
+}
+IvyArgument IvyAddChild( IvyArgument arg, const char* childvalue )
+{
+ IvyArgument child;
+ IVY_LIST_ADD( arg->next, child )
+ if ( child )
+ {
+ arg->value = strdup( childvalue );
+ arg->next = 0;
+ }
+ return child;
+}
+IvyArgument IvyArgumentDeserialize( int fd )
+{
+ return 0;
+}
+void IvyArgumentSerialize(IvyArgument arg, int fd )
+{
+
+}
+
diff --git a/src/ivyargument.h b/src/ivyargument.h
new file mode 100755
index 0000000..e54a444
--- /dev/null
+++ b/src/ivyargument.h
@@ -0,0 +1,28 @@
+/*
+ * Ivy, C interface
+ *
+ * Copyright (C) 1997-2000
+ * Centre d'Études de la Navigation Aérienne
+ *
+ * Argument message comtent
+ *
+ * Authors: François-Régis Colin <fcolin@cena.fr>
+ *
+ * $Id$
+ *
+ * Please refer to file version.h for the
+ * copyright notice regarding this software
+ */
+
+/* Module de gestion de la syntaxe des messages Ivy */
+
+typedef struct _argument *IvyArgument;
+
+IvyArgument IvyArgumentNew( const char * expression );
+void IvyArgumentFree( IvyArgument arg );
+const char * IvyArgumentGetValue( IvyArgument arg );
+IvyArgument IvyArgumentGetNextChild( IvyArgument arg );
+IvyArgument IvyAddChild( IvyArgument arg, const char* childvalue );
+IvyArgument IvyArgumentDeserialize( int fd );
+void IvyArgumentSerialize(IvyArgument arg, int fd );
+