annotate src/protocols/novell/nmfield.h @ 10554:0ad82505bde8

[gaim-migrate @ 11931] Buddies can be in more than one group (at least on some protocols), so we should update their status/idle/warning/etc. in all groups. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 29 Jan 2005 18:03:48 +0000
parents 6663ad2386d9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8675
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1 /*
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2 * nmfield.h
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3 *
8933
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
4 * Copyright (c) 2004 Novell, Inc. All Rights Reserved.
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
5 *
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
6 * This program is free software; you can redistribute it and/or modify
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
7 * it under the terms of the GNU General Public License as published by
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
8 * the Free Software Foundation; version 2 of the License.
8675
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
9 *
8933
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
10 * This program is distributed in the hope that it will be useful,
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
13 * GNU General Public License for more details.
8684
046dd8ef2920 [gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents: 8675
diff changeset
14 *
8933
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
15 * You should have received a copy of the GNU General Public License
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
16 * along with this program; if not, write to the Free Software
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
8675
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
18 *
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
19 */
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
20
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21 #ifndef NMFIELD_H
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
22 #define NMFIELD_H
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
24 #include <glib.h>
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
25
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
26 typedef struct NMField_t
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27 {
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
28 char *tag; /* Field tag */
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29 guint8 method; /* Method of the field */
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
30 guint8 flags; /* Flags */
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
31 guint8 type; /* Type of value */
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
32 guint32 size; /* Size of value if binary */
8933
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
33 guint32 value; /* Value of a numeric field */
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
34 gpointer ptr_value; /* Value of a string or sub array field */
8675
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
35 guint32 len; /* Length of the array */
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
36 } NMField;
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
37
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
38 /* Field types */
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
39 #define NMFIELD_TYPE_INVALID 0
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
40 #define NMFIELD_TYPE_NUMBER 1
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
41 #define NMFIELD_TYPE_BINARY 2
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
42 #define NMFIELD_TYPE_BYTE 3
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
43 #define NMFIELD_TYPE_UBYTE 4
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
44 #define NMFIELD_TYPE_WORD 5
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
45 #define NMFIELD_TYPE_UWORD 6
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
46 #define NMFIELD_TYPE_DWORD 7
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
47 #define NMFIELD_TYPE_UDWORD 8
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
48 #define NMFIELD_TYPE_ARRAY 9
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
49 #define NMFIELD_TYPE_UTF8 10
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
50 #define NMFIELD_TYPE_BOOL 11
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
51 #define NMFIELD_TYPE_MV 12
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
52 #define NMFIELD_TYPE_DN 13
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
53
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
54 /* Field methods */
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
55 #define NMFIELD_METHOD_VALID 0
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
56 #define NMFIELD_METHOD_IGNORE 1
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
57 #define NMFIELD_METHOD_DELETE 2
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
58 #define NMFIELD_METHOD_DELETE_ALL 3
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
59 #define NMFIELD_METHOD_EQUAL 4
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
60 #define NMFIELD_METHOD_ADD 5
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
61 #define NMFIELD_METHOD_UPDATE 6
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
62 #define NMFIELD_METHOD_GTE 10
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
63 #define NMFIELD_METHOD_LTE 12
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
64 #define NMFIELD_METHOD_NE 14
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
65 #define NMFIELD_METHOD_EXIST 15
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
66 #define NMFIELD_METHOD_NOTEXIST 16
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
67 #define NMFIELD_METHOD_SEARCH 17
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
68 #define NMFIELD_METHOD_MATCHBEGIN 19
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
69 #define NMFIELD_METHOD_MATCHEND 20
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
70 #define NMFIELD_METHOD_NOT_ARRAY 40
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
71 #define NMFIELD_METHOD_OR_ARRAY 41
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
72 #define NMFIELD_METHOD_AND_ARRAY 42
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
73
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
74 /* Attribute Names (field tags) */
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
75 #define NM_A_IP_ADDRESS "nnmIPAddress"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
76 #define NM_A_PORT "nnmPort"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
77 #define NM_A_FA_FOLDER "NM_A_FA_FOLDER"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
78 #define NM_A_FA_CONTACT "NM_A_FA_CONTACT"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
79 #define NM_A_FA_CONVERSATION "NM_A_FA_CONVERSATION"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
80 #define NM_A_FA_MESSAGE "NM_A_FA_MESSAGE"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
81 #define NM_A_FA_CONTACT_LIST "NM_A_FA_CONTACT_LIST"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
82 #define NM_A_FA_RESULTS "NM_A_FA_RESULTS"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
83 #define NM_A_FA_INFO_DISPLAY_ARRAY "NM_A_FA_INFO_DISPLAY_ARRAY"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
84 #define NM_A_FA_USER_DETAILS "NM_A_FA_USER_DETAILS"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
85 #define NM_A_SZ_OBJECT_ID "NM_A_SZ_OBJECT_ID"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
86 #define NM_A_SZ_PARENT_ID "NM_A_SZ_PARENT_ID"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
87 #define NM_A_SZ_SEQUENCE_NUMBER "NM_A_SZ_SEQUENCE_NUMBER"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
88 #define NM_A_SZ_TYPE "NM_A_SZ_TYPE"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
89 #define NM_A_SZ_STATUS "NM_A_SZ_STATUS"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
90 #define NM_A_SZ_STATUS_TEXT "NM_A_SZ_STATUS_TEXT"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
91 #define NM_A_SZ_DN "NM_A_SZ_DN"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
92 #define NM_A_SZ_DISPLAY_NAME "NM_A_SZ_DISPLAY_NAME"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
93 #define NM_A_SZ_USERID "NM_A_SZ_USERID"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
94 #define NM_A_SZ_CREDENTIALS "NM_A_SZ_CREDENTIALS"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
95 #define NM_A_SZ_MESSAGE_BODY "NM_A_SZ_MESSAGE_BODY"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
96 #define NM_A_SZ_MESSAGE_TEXT "NM_A_SZ_MESSAGE_TEXT"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
97 #define NM_A_UD_MESSAGE_TYPE "NM_A_UD_MESSAGE_TYPE"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
98 #define NM_A_FA_PARTICIPANTS "NM_A_FA_PARTICIPANTS"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
99 #define NM_A_FA_INVITES "NM_A_FA_INVITES"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
100 #define NM_A_FA_EVENT "NM_A_FA_EVENT"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
101 #define NM_A_UD_COUNT "NM_A_UD_COUNT"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
102 #define NM_A_UD_DATE "NM_A_UD_DATE"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
103 #define NM_A_UD_EVENT "NM_A_UD_EVENT"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
104 #define NM_A_B_NO_CONTACTS "NM_A_B_NO_CONTACTS"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
105 #define NM_A_B_NO_CUSTOMS "NM_A_B_NO_CUSTOMS"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
106 #define NM_A_B_NO_PRIVACY "NM_A_B_NO_PRIVACY"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
107 #define NM_A_UW_STATUS "NM_A_UW_STATUS"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
108 #define NM_A_UD_OBJECT_ID "NM_A_UD_OBJECT_ID"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
109 #define NM_A_SZ_TRANSACTION_ID "NM_A_SZ_TRANSACTION_ID"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
110 #define NM_A_SZ_RESULT_CODE "NM_A_SZ_RESULT_CODE"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
111 #define NM_A_UD_BUILD "NM_A_UD_BUILD"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
112 #define NM_A_SZ_AUTH_ATTRIBUTE "NM_A_SZ_AUTH_ATTRIBUTE"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
113 #define NM_A_UD_KEEPALIVE "NM_A_UD_KEEPALIVE"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
114 #define NM_A_SZ_USER_AGENT "NM_A_SZ_USER_AGENT"
8933
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
115 #define NM_A_BLOCKING "nnmBlocking"
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
116 #define NM_A_BLOCKING_DENY_LIST "nnmBlockingDenyList"
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
117 #define NM_A_BLOCKING_ALLOW_LIST "nnmBlockingAllowList"
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
118 #define NM_A_SZ_BLOCKING_ALLOW_ITEM "NM_A_SZ_BLOCKING_ALLOW_ITEM"
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
119 #define NM_A_SZ_BLOCKING_DENY_ITEM "NM_A_SZ_BLOCKING_DENY_ITEM"
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
120 #define NM_A_LOCKED_ATTR_LIST "nnmLockedAttrList"
8675
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
121
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
122 #define NM_PROTOCOL_VERSION 2
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
123
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
124 #define NM_FIELD_TRUE "1"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
125 #define NM_FIELD_FALSE "0"
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
126
8753
c7e9687bfd79 [gaim-migrate @ 9508]
Luke Schierer <lschiere@pidgin.im>
parents: 8684
diff changeset
127 #define NMFIELD_MAX_STR_LENGTH 32768
c7e9687bfd79 [gaim-migrate @ 9508]
Luke Schierer <lschiere@pidgin.im>
parents: 8684
diff changeset
128
8675
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
129 /**
8684
046dd8ef2920 [gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents: 8675
diff changeset
130 * Count the number of fields
8675
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
131 *
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
132 * @param fields Field array
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
133 *
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
134 * @return The number of fields in the array.
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
135 *
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
136 */
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
137 guint32 nm_count_fields(NMField * fields);
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
138
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
139 /**
8933
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
140 * Add a field to the field array. The field should be of type NMFIELD_TYPE_UTF8,
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
141 * NMFIELD_TYPE_DN, NMFIELD_TYPE_ARRAY, or NMFIELD_TYPE_MV
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
142 *
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
143 * NOTE: field array that is passed in may be realloc'd so you should use
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
144 * the returned field array pointer not the passed in pointer after calling
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
145 * this function.
8675
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
146 *
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
147 * @param fields Field array
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
148 * @param tag Tag for the new field
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
149 * @param size Size of the field value (if type = binary)
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
150 * @param method Field method (see method defines above)
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
151 * @param flags Flags for new field
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
152 * @param value The value of the field
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
153 * @param type The type of the field value
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
154 *
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
155 * @return Pointer to the updated field array
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
156 *
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
157 */
8933
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
158 NMField *nm_field_add_pointer(NMField *fields, const char *tag, guint32 size, guint8 method,
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
159 guint8 flags, gpointer value, guint8 type);
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
160
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
161 /**
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
162 * Add a numeric field to the field array.
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
163 *
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
164 * NOTE: field array that is passed in may be realloc'd so you should use
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
165 * the returned field array pointer not the passed in pointer after calling
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
166 * this function.
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
167 *
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
168 * @param fields Field array
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
169 * @param tag Tag for the new field
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
170 * @param size Size of the field value (if type = binary)
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
171 * @param method Field method (see method defines above)
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
172 * @param flags Flags for new field
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
173 * @param value The value of the field
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
174 * @param type The type of the field value
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
175 *
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
176 * @return Pointer to the updated field array
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
177 *
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
178 */
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
179 NMField *nm_field_add_number(NMField *fields, const char *tag, guint32 size, guint8 method,
6663ad2386d9 [gaim-migrate @ 9703]
Luke Schierer <lschiere@pidgin.im>
parents: 8753
diff changeset
180 guint8 flags, guint32 value, guint8 type);
8675
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
181
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
182 /**
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
183 * Recursively free an array of fields and set pointer to NULL.
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
184 *
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
185 * @param fields Pointer to a field array
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
186 *
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
187 */
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
188 void nm_free_fields(NMField ** fields);
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
189
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
190 /**
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
191 * Find first field with given tag in field array.
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
192 *
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
193 * Note: this will only work for 7-bit ascii tags (which is all that
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
194 * we use currently).
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
195 *
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
196 * @param tag Tag to search for
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
197 * @param fields Field array
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
198 *
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
199 * @return The first matching field, or NULL if no fields match.
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
200 *
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
201 */
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
202 NMField *nm_locate_field(char *tag, NMField * fields);
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
203
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
204 /**
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
205 * Make a deep copy of a field array
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
206 *
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
207 * @param src The array to copy
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
208 *
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
209 * @return The new (copied) array, which must be freed.
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
210 *
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
211 */
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
212 NMField *nm_copy_field_array(NMField * src);
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
213
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
214 /**
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
215 * Remove a field and move other fields up to fill the gap
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
216 *
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
217 * @param field The field to remove
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
218 *
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
219 */
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
220 void nm_remove_field(NMField * field);
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
221
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
222 /* Print a field array (for debugging purposes) */
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
223 void nm_print_fields(NMField * fields);
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
224
9ee2542d1104 [gaim-migrate @ 9428]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
225 #endif