author | Nicolas Cornu <nicolas.cornu@ensi-bourges.fr> |
Tue, 25 May 2010 00:40:38 +0200 | |
changeset 1 | 6a9a25d32364 |
child 5 | 2155c65c7455 |
permissions | -rw-r--r-- |
1
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
1 |
#include <loudmouth/loudmouth.h> |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
2 |
|
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
3 |
#define PARSE_OK 0 |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
4 |
#define PARSE_ERROR_NAME 1 |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
5 |
#define PARSE_ERROR_REQUIRED 2 |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
6 |
#define PARSE_ERROR_RESTRICTION 3 |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
7 |
#define PARSE_ERROR_TOO_MANY_CHILDS 4 |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
8 |
|
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
9 |
struct info_iq { |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
10 |
char* from; |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
11 |
char* id; |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
12 |
char* to; |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
13 |
char* set; |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
14 |
}; |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
15 |
|
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
16 |
struct info_jingle { |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
17 |
char* action; // required (content-accept, content-add, |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
18 |
// content-modify, content-reject, content-remove, description-info |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
19 |
// security-info, session-accept, session-info, session-initiate, |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
20 |
// session-terminate, transport-accept, transport-info, transport-reject, |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
21 |
// transport-replace) |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
22 |
char* initiator; // optional |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
23 |
char* responder; // optional |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
24 |
char* sid; // required |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
25 |
}; |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
26 |
|
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
27 |
struct info_content { |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
28 |
char* creator; // required (initiator, responder) |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
29 |
char* disposition; // optional, default=session |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
30 |
char* name; // required |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
31 |
char* senders; // optional (both, initiator, none, responder) |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
32 |
}; |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
33 |
|
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
34 |
int parse_jingle(LmMessageNode* node, struct info_jingle* ij); |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
35 |
void free_jingle(struct info_jingle* ij); |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
36 |
int parse_content(LmMessageNode* node, struct info_content* ic); |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
37 |
void free_content(struct info_content* ic); |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
38 |
|
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
39 |
int check_restriction(const char* name, const char** values) |
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
40 |
|
6a9a25d32364
Add the parser of node and the CMakeList.txt
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
41 |
char* attrcpy(const char* attr); |