![]() |
fuse_kafka
|
00001 #include "server_list.h" 00002 #include "string_list.c" 00010 int server_list_add_once(server_list** list, char* servers) 00011 { 00012 char* server = servers; 00013 int result = 0, zero = 0; 00014 int i; 00015 int length; 00016 if(servers == NULL) return 0; 00017 length = strlen(servers); 00018 for(i = 0; i <= length; i++) 00019 if((zero = !servers[i]) || servers[i] == ',') 00020 { 00021 if(!zero) servers[i] = 0; 00022 result |= string_list_add_once(list, server); 00023 if(!zero) servers[i] = ','; 00024 server = servers + i + 1; 00025 } 00026 return result; 00027 }