MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / get_replace_strings

Function get_replace_strings

extra/replace.c:219–248  ·  view source on GitHub ↗
(argc,argv,from_array,to_array)

Source from the content-addressed store, hash-verified

217
218
219static int get_replace_strings(argc,argv,from_array,to_array)
220register int *argc;
221register char **argv[];
222POINTER_ARRAY *from_array,*to_array;
223{
224 char *pos;
225
226 memset(from_array, 0, sizeof(from_array[0]));
227 memset(to_array, 0, sizeof(to_array[0]));
228 while (*argc > 0 && (*(pos = *(*argv)) != '-' || pos[1] != '-' || pos[2]))
229 {
230 insert_pointer_name(from_array,pos);
231 (*argc)--;
232 (*argv)++;
233 if (!*argc || !strcmp(**argv,"--"))
234 {
235 my_message(0,"No to-string for last from-string",MYF(ME_BELL));
236 return 1;
237 }
238 insert_pointer_name(to_array,**argv);
239 (*argc)--;
240 (*argv)++;
241 }
242 if (*argc)
243 { /* Skip "--" argument */
244 (*argc)--;
245 (*argv)++;
246 }
247 return 0;
248}
249
250static int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name)
251{

Callers 1

mainFunction · 0.85

Calls 2

insert_pointer_nameFunction · 0.85
my_messageFunction · 0.85

Tested by

no test coverage detected