Lines Matching defs:array
53 XdmcpReadARRAY8 (XdmcpBufferPtr buffer, ARRAY8Ptr array)
58 * When returning FALSE, guarantee that array->data = 0.
59 * This allows the user to safely call XdmcpDisposeARRAY8(array)
61 * Note that XdmcpDisposeARRAY*(array) will call free(array->data),
62 * so we must guarantee that array->data is NULL or a malloced pointer.
64 if (!XdmcpReadCARD16 (buffer, &array->length)) {
65 array->data = NULL;
68 if (!array->length)
70 array->data = NULL;
73 array->data = (CARD8 *) malloc(array->length * sizeof (CARD8));
74 if (!array->data)
76 for (i = 0; i < (int)array->length; i++)
78 if (!XdmcpReadCARD8 (buffer, &array->data[i]))
80 free(array->data);
81 array->data = NULL;
82 array->length = 0;
90 XdmcpReadARRAY16 (XdmcpBufferPtr buffer, ARRAY16Ptr array)
95 * When returning FALSE, guarantee that array->data = 0.
96 * This allows the user to safely call XdmcpDisposeARRAY16(array)
98 * Note that XdmcpDisposeARRAY*(array) will call free(array->data),
99 * so we must guarantee that array->data is NULL or a malloced pointer.
101 if (!XdmcpReadCARD8 (buffer, &array->length)) {
102 array->data = NULL;
105 if (!array->length)
107 array->data = NULL;
110 array->data = (CARD16 *) malloc(array->length * sizeof (CARD16));
111 if (!array->data)
113 for (i = 0; i < (int)array->length; i++)
115 if (!XdmcpReadCARD16 (buffer, &array->data[i]))
117 free(array->data);
118 array->data = NULL;
119 array->length = 0;
127 XdmcpReadARRAY32 (XdmcpBufferPtr buffer, ARRAY32Ptr array)
132 * When returning FALSE, guarantee that array->data = 0.
133 * This allows the user to safely call XdmcpDisposeARRAY32(array)
135 * Note that XdmcpDisposeARRAY*(array) will call free(array->data),
136 * so we must guarantee that array->data is NULL or a malloced pointer.
138 if (!XdmcpReadCARD8 (buffer, &array->length)) {
139 array->data = NULL;
142 if (!array->length)
144 array->data = NULL;
147 array->data = (CARD32 *) malloc(array->length * sizeof (CARD32));
148 if (!array->data)
150 for (i = 0; i < (int)array->length; i++)
152 if (!XdmcpReadCARD32 (buffer, &array->data[i]))
154 free(array->data);
155 array->data = NULL;
156 array->length = 0;
164 XdmcpReadARRAYofARRAY8 (XdmcpBufferPtr buffer, ARRAYofARRAY8Ptr array)
169 * When returning FALSE, guarantee that array->data = 0.
170 * This allows the user to safely call XdmcpDisposeARRAYofARRAY8(array)
172 * Note that XdmcpDisposeARRAY*(array) will call free(array->data),
173 * so we must guarantee that array->data is NULL or a malloced pointer.
175 if (!XdmcpReadCARD8 (buffer, &array->length)) {
176 array->data = NULL;
179 if (!array->length)
181 array->data = NULL;
184 array->data = (ARRAY8 *) malloc(array->length * sizeof (ARRAY8));
185 if (!array->data)
187 for (i = 0; i < array->length; i++)
189 if (!XdmcpReadARRAY8 (buffer, &array->data[i]))
193 * and free array->data and finally set array->data = 0;
195 * XdmcpDisposeARRAYofARRAY8(array).
197 array->length = i;
198 XdmcpDisposeARRAYofARRAY8(array);