Lines Matching refs:i
28 static int cs_create_connection(int i);
98 int i; in get_cscope_name() local
109 for (i = 0, current_idx = 0; cs_cmds[i].name != NULL; i++) in get_cscope_name()
110 if (cs_cmds[i].cansplit) in get_cscope_name()
113 return (char_u *)cs_cmds[i].name; in get_cscope_name()
135 for (i = 0, current_idx = 0; i < csinfo_size; i++) in get_cscope_name()
137 if (csinfo[i].fname == NULL) in get_cscope_name()
141 vim_snprintf(connection, sizeof(connection), "%d", i); in get_cscope_name()
390 int i; in cs_connection() local
395 for (i = 0; i < csinfo_size; i++) in cs_connection()
397 if (!csinfo[i].fname) in cs_connection()
406 if (strstr(csinfo[i].fname, (char *)dbpath)) in cs_connection()
410 if (strcmp(csinfo[i].fname, (char *)dbpath) == 0) in cs_connection()
414 if (strstr(csinfo[i].fname, (char *)dbpath) in cs_connection()
415 && ((!ppath && !csinfo[i].ppath) in cs_connection()
417 && csinfo[i].ppath in cs_connection()
418 && strstr(csinfo[i].ppath, (char *)ppath)))) in cs_connection()
422 if ((strcmp(csinfo[i].fname, (char *)dbpath) == 0) in cs_connection()
423 && ((!ppath && !csinfo[i].ppath) in cs_connection()
425 && csinfo[i].ppath in cs_connection()
426 && (strcmp(csinfo[i].ppath, (char *)ppath) == 0)))) in cs_connection()
486 int i; in cs_add_common() local
558 i = cs_insert_filelist(fname2, ppath, flags, &statbuf); in cs_add_common()
562 i = cs_insert_filelist(fname, ppath, flags, &statbuf); in cs_add_common()
573 if (i != -1) in cs_add_common()
575 if (cs_create_connection(i) == CSCOPE_FAILURE in cs_add_common()
576 || cs_read_prompt(i) == CSCOPE_FAILURE) in cs_add_common()
578 cs_release_csp(i, TRUE); in cs_add_common()
587 csinfo[i].fname); in cs_add_common()
624 short i; in cs_cnt_connections() local
627 for (i = 0; i < csinfo_size; i++) in cs_cnt_connections()
629 if (csinfo[i].fname != NULL) in cs_cnt_connections()
771 cs_create_connection(int i) in cs_create_connection() argument
815 switch (csinfo[i].pid = fork()) in cs_create_connection()
869 len = (int)(strlen(prog) + strlen(csinfo[i].fname) + 32); in cs_create_connection()
870 if (csinfo[i].ppath) in cs_create_connection()
883 expand_env((char_u *)csinfo[i].ppath, (char_u *)ppath, MAXPATHL); in cs_create_connection()
888 if (csinfo[i].flags) in cs_create_connection()
889 len += (int)strlen(csinfo[i].flags); in cs_create_connection()
905 (void)sprintf(cmd, "exec %s -dl -f %s", prog, csinfo[i].fname); in cs_create_connection()
908 (void)sprintf(cmd, "%s -dl -f %s", prog, csinfo[i].fname); in cs_create_connection()
910 if (csinfo[i].ppath != NULL) in cs_create_connection()
913 (void)strcat(cmd, csinfo[i].ppath); in cs_create_connection()
915 if (csinfo[i].flags != NULL) in cs_create_connection()
918 (void)strcat(cmd, csinfo[i].flags); in cs_create_connection()
946 if ((csinfo[i].to_fp = fdopen(to_cs[1], "w")) == NULL) in cs_create_connection()
948 if ((csinfo[i].fr_fp = fdopen(from_cs[0], "r")) == NULL) in cs_create_connection()
979 csinfo[i].pid = pi.dwProcessId; in cs_create_connection()
980 csinfo[i].hProc = pi.hProcess; in cs_create_connection()
986 || ((csinfo[i].to_fp = _fdopen(fd, "w")) == NULL)) in cs_create_connection()
990 || ((csinfo[i].fr_fp = _fdopen(fd, "r")) == NULL)) in cs_create_connection()
1013 int i; in cs_find() local
1038 for (i = 0; i < eap_arg_len; ++i) in cs_find()
1039 if (NUL == eap->arg[i]) in cs_find()
1040 eap->arg[i] = ' '; in cs_find()
1059 int i; in cs_find_common() local
1138 for (i = 0; i < csinfo_size; i++) in cs_find_common()
1139 nummatches[i] = 0; in cs_find_common()
1141 for (i = 0; i < csinfo_size; i++) in cs_find_common()
1143 if (csinfo[i].fname == NULL || csinfo[i].to_fp == NULL) in cs_find_common()
1147 (void)fprintf(csinfo[i].to_fp, "%s\n", cmd); in cs_find_common()
1148 (void)fflush(csinfo[i].to_fp); in cs_find_common()
1150 nummatches[i] = cs_cnt_matches(i); in cs_find_common()
1152 if (nummatches[i] > -1) in cs_find_common()
1153 totmatches += nummatches[i]; in cs_find_common()
1155 if (nummatches[i] == 0) in cs_find_common()
1156 (void)cs_read_prompt(i); in cs_find_common()
1277 clear_csinfo(int i) in clear_csinfo() argument
1279 csinfo[i].fname = NULL; in clear_csinfo()
1280 csinfo[i].ppath = NULL; in clear_csinfo()
1281 csinfo[i].flags = NULL; in clear_csinfo()
1283 csinfo[i].st_dev = (dev_t)0; in clear_csinfo()
1284 csinfo[i].st_ino = (ino_t)0; in clear_csinfo()
1286 csinfo[i].nVolume = 0; in clear_csinfo()
1287 csinfo[i].nIndexHigh = 0; in clear_csinfo()
1288 csinfo[i].nIndexLow = 0; in clear_csinfo()
1290 csinfo[i].pid = 0; in clear_csinfo()
1291 csinfo[i].fr_fp = NULL; in clear_csinfo()
1292 csinfo[i].to_fp = NULL; in clear_csinfo()
1294 csinfo[i].hProc = NULL; in clear_csinfo()
1308 short i, j; in cs_insert_filelist() local
1339 i = -1; // can be set to the index of an empty item in csinfo in cs_insert_filelist()
1361 if (csinfo[j].fname == NULL && i == -1) in cs_insert_filelist()
1362 i = j; // remember first empty entry in cs_insert_filelist()
1365 if (i == -1) in cs_insert_filelist()
1367 i = csinfo_size; in cs_insert_filelist()
1395 if ((csinfo[i].fname = alloc(strlen(fname)+1)) == NULL) in cs_insert_filelist()
1398 (void)strcpy(csinfo[i].fname, (const char *)fname); in cs_insert_filelist()
1402 if ((csinfo[i].ppath = alloc(strlen(ppath) + 1)) == NULL) in cs_insert_filelist()
1404 VIM_CLEAR(csinfo[i].fname); in cs_insert_filelist()
1407 (void)strcpy(csinfo[i].ppath, (const char *)ppath); in cs_insert_filelist()
1409 csinfo[i].ppath = NULL; in cs_insert_filelist()
1413 if ((csinfo[i].flags = alloc(strlen(flags) + 1)) == NULL) in cs_insert_filelist()
1415 VIM_CLEAR(csinfo[i].fname); in cs_insert_filelist()
1416 VIM_CLEAR(csinfo[i].ppath); in cs_insert_filelist()
1419 (void)strcpy(csinfo[i].flags, (const char *)flags); in cs_insert_filelist()
1421 csinfo[i].flags = NULL; in cs_insert_filelist()
1424 csinfo[i].st_dev = sb->st_dev; in cs_insert_filelist()
1425 csinfo[i].st_ino = sb->st_ino; in cs_insert_filelist()
1428 csinfo[i].nVolume = bhfi.dwVolumeSerialNumber; in cs_insert_filelist()
1429 csinfo[i].nIndexLow = bhfi.nFileIndexLow; in cs_insert_filelist()
1430 csinfo[i].nIndexHigh = bhfi.nFileIndexHigh; in cs_insert_filelist()
1432 return i; in cs_insert_filelist()
1472 short i; in cs_kill() local
1484 i = atoi(stok); in cs_kill()
1489 for (i = 0; i < csinfo_size; i++) in cs_kill()
1491 if (csinfo[i].fname != NULL && strstr(csinfo[i].fname, stok)) in cs_kill()
1496 if ((i != -1) && (i >= csinfo_size || i < -1 || csinfo[i].fname == NULL)) in cs_kill()
1503 if (i == -1) in cs_kill()
1505 for (i = 0; i < csinfo_size; i++) in cs_kill()
1507 if (csinfo[i].fname) in cs_kill()
1508 cs_kill_execute(i, csinfo[i].fname); in cs_kill()
1512 cs_kill_execute(i, stok); in cs_kill()
1524 int i, // cscope table index in cs_kill_execute() argument
1533 cs_release_csp(i, TRUE); in cs_kill_execute()
1740 int i, j; in cs_file_results() local
1751 for (i = 0; i < csinfo_size; i++) in cs_file_results()
1753 if (nummatches_a[i] < 1) in cs_file_results()
1756 for (j = 0; j < nummatches_a[i]; j++) in cs_file_results()
1758 if ((fullname = cs_parse_results(i, buf, CSREAD_BUFSIZE, &cntx, in cs_file_results()
1783 (void)cs_read_prompt(i); in cs_file_results()
1804 int i, j; in cs_fill_results() local
1824 for (i = 0; i < csinfo_size; i++) in cs_fill_results()
1826 if (nummatches_a[i] < 1) in cs_fill_results()
1829 for (j = 0; j < nummatches_a[i]; j++) in cs_fill_results()
1831 if ((fullname = cs_parse_results(i, buf, CSREAD_BUFSIZE, &cntx, in cs_fill_results()
1852 (void)cs_read_prompt(i); in cs_fill_results()
1877 int i; in cs_pathcomponents() local
1884 for (i = 0; i < p_cspc; ++i) in cs_pathcomponents()
1912 int i, idx, num; in cs_print_tags_priv() local
1948 for (i = 0; i < num_matches; i++) in cs_print_tags_priv()
1950 idx = i; in cs_print_tags_priv()
2052 cs_read_prompt(int i) in cs_read_prompt() argument
2069 while ((ch = getc(csinfo[i].fr_fp)) != EOF && ch != CSCOPE_PROMPT[0]) in cs_read_prompt()
2090 (void)putc('\n', csinfo[i].to_fp); in cs_read_prompt()
2091 (void)fflush(csinfo[i].to_fp); in cs_read_prompt()
2103 ch = getc(csinfo[i].fr_fp); in cs_read_prompt()
2109 cs_reading_emsg(i); // don't have additional information in cs_read_prompt()
2110 cs_release_csp(i, TRUE); in cs_read_prompt()
2148 cs_release_csp(int i, int freefnpp) in cs_release_csp() argument
2153 if (csinfo[i].to_fp != NULL) in cs_release_csp()
2155 (void)fputs("q\n", csinfo[i].to_fp); in cs_release_csp()
2156 (void)fflush(csinfo[i].to_fp); in cs_release_csp()
2179 pid = waitpid(csinfo[i].pid, &pstat, 0); in cs_release_csp()
2193 pid = waitpid(csinfo[i].pid, &pstat, WNOHANG); in cs_release_csp()
2205 if (pid < 0 && csinfo[i].pid > 1) in cs_release_csp()
2227 if (kill(csinfo[i].pid, 0) != 0) in cs_release_csp()
2238 kill(csinfo[i].pid, SIGKILL); in cs_release_csp()
2239 (void)waitpid(csinfo[i].pid, &pstat, 0); in cs_release_csp()
2244 if (csinfo[i].hProc != NULL) in cs_release_csp()
2247 if (WaitForSingleObject(csinfo[i].hProc, 1000) == WAIT_TIMEOUT) in cs_release_csp()
2248 TerminateProcess(csinfo[i].hProc, 0); in cs_release_csp()
2249 CloseHandle(csinfo[i].hProc); in cs_release_csp()
2253 if (csinfo[i].fr_fp != NULL) in cs_release_csp()
2254 (void)fclose(csinfo[i].fr_fp); in cs_release_csp()
2255 if (csinfo[i].to_fp != NULL) in cs_release_csp()
2256 (void)fclose(csinfo[i].to_fp); in cs_release_csp()
2260 vim_free(csinfo[i].fname); in cs_release_csp()
2261 vim_free(csinfo[i].ppath); in cs_release_csp()
2262 vim_free(csinfo[i].flags); in cs_release_csp()
2265 clear_csinfo(i); in cs_release_csp()
2276 int i; in cs_reset() local
2294 for (i = 0; i < csinfo_size; i++) in cs_reset()
2296 dblist[i] = csinfo[i].fname; in cs_reset()
2297 pplist[i] = csinfo[i].ppath; in cs_reset()
2298 fllist[i] = csinfo[i].flags; in cs_reset()
2299 if (csinfo[i].fname != NULL) in cs_reset()
2300 cs_release_csp(i, FALSE); in cs_reset()
2304 for (i = 0; i < csinfo_size; i++) in cs_reset()
2306 if (dblist[i] != NULL) in cs_reset()
2308 cs_add_common(dblist[i], pplist[i], fllist[i]); in cs_reset()
2314 sprintf(buf, " (#%d)", i); in cs_reset()
2318 vim_free(dblist[i]); in cs_reset()
2319 vim_free(pplist[i]); in cs_reset()
2320 vim_free(fllist[i]); in cs_reset()
2342 cs_resolve_file(int i, char *name) in cs_resolve_file() argument
2354 if (csinfo[i].ppath != NULL) in cs_resolve_file()
2355 len += (int)strlen(csinfo[i].ppath); in cs_resolve_file()
2356 else if (p_csre && csinfo[i].fname != NULL) in cs_resolve_file()
2363 vim_strncpy(csdir, (char_u *)csinfo[i].fname, in cs_resolve_file()
2364 gettail((char_u *)csinfo[i].fname) in cs_resolve_file()
2365 - (char_u *)csinfo[i].fname); in cs_resolve_file()
2373 if (csinfo[i].ppath != NULL in cs_resolve_file()
2374 && (strncmp(name, csinfo[i].ppath, strlen(csinfo[i].ppath)) != 0) in cs_resolve_file()
2382 (void)sprintf(fullname, "%s/%s", csinfo[i].ppath, name); in cs_resolve_file()
2384 else if (csdir != NULL && csinfo[i].fname != NULL && *csdir != NUL) in cs_resolve_file()
2406 short i; in cs_show() local
2414 for (i = 0; i < csinfo_size; i++) in cs_show()
2416 if (csinfo[i].fname == NULL) in cs_show()
2419 if (csinfo[i].ppath != NULL) in cs_show()
2421 i, (long)csinfo[i].pid, csinfo[i].fname, csinfo[i].ppath); in cs_show()
2424 i, (long)csinfo[i].pid, csinfo[i].fname); in cs_show()
2439 int i; in cs_end() local
2441 for (i = 0; i < csinfo_size; i++) in cs_end()
2442 cs_release_csp(i, TRUE); in cs_end()