blob: f7662a13e49a31a0c17afe4624d6c57251986876 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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 )
{
}
|