Lines Matching refs:current

108 escl_free_device(ESCL_Device *current)
110 if (!current) return NULL;
111 free((void*)current->ip_address);
112 free((void*)current->model_name);
113 free((void*)current->type);
114 free((void*)current->is);
115 free((void*)current->uuid);
116 free((void*)current->unix_socket);
117 curl_slist_free_all(current->hack);
118 free(current);
189 escl_check_and_add_device(ESCL_Device *current)
191 if(!current) {
192 DBG (10, "ESCL_Device *current us null.\n");
195 if (!current->ip_address) {
199 if (current->port_nb == 0) {
203 if (!current->model_name) {
207 if (!current->type) {
211 if (!current->is) {
216 current->next = list_devices_primary;
217 list_devices_primary = current;
222 * \fn static SANE_Status escl_add_in_list(ESCL_Device *current)
230 escl_add_in_list(ESCL_Device *current)
232 if(!current) {
233 DBG (10, "ESCL_Device *current us null.\n");
238 escl_check_and_add_device(current)) {
239 list_devices_primary = current;
242 current = escl_free_device(current);
252 * \return escl_add_in_list(current)
266 ESCL_Device *current = NULL;
271 for (current = list_devices_primary; current; current = current->next) {
272 if ((strcmp(current->ip_address, ip_address) == 0) ||
273 (uuid && current->uuid && !strcmp(current->uuid, uuid)))
275 if (strcmp(current->type, type))
280 free (current->type);
281 current->type = strdup(type);
282 if (strcmp(current->ip_address, ip_address)) {
283 free (current->ip_address);
284 current->ip_address = strdup(ip_address);
286 current->port_nb = port_nb;
287 current->https = SANE_TRUE;
288 current->tls = tls_version;
292 else if (current->port_nb == port_nb)
296 current = (ESCL_Device*)calloc(1, sizeof(*current));
297 if (current == NULL) {
301 current->port_nb = port_nb;
305 current->https = SANE_TRUE;
307 current->https = SANE_FALSE;
309 current->tls = tls_version;
311 current->model_name = strdup(model);
312 current->ip_address = strdup(ip_address);
315 current->is = strdup(tmp);
316 current->type = strdup(type);
318 current->uuid = strdup(uuid);
319 return escl_add_in_list(current);