Lines Matching refs:cwd

100 	(d)->cwd = (char *) emalloc((s)->cwd_length+1);	\
101 memcpy((d)->cwd, (s)->cwd, (s)->cwd_length+1);
104 efree((s)->cwd); \
373 if (php_sys_stat(state->cwd, &buf) == 0 && S_ISDIR(buf.st_mode)) in php_is_dir_ok()
384 if (php_sys_stat(state->cwd, &buf) == 0 && S_ISREG(buf.st_mode)) in php_is_file_ok()
393 CWD_STATE_COPY(&cwd_g->cwd, &main_cwd_state); in cwd_globals_ctor()
409 char cwd[MAXPATHLEN]; in virtual_cwd_main_cwd_init() local
413 free(main_cwd_state.cwd); in virtual_cwd_main_cwd_init()
417 ZeroMemory(&cwd, sizeof(cwd)); in virtual_cwd_main_cwd_init()
418 result = php_win32_ioutil_getcwd(cwd, sizeof(cwd)); in virtual_cwd_main_cwd_init()
420 result = getcwd(cwd, sizeof(cwd)); in virtual_cwd_main_cwd_init()
424 cwd[0] = '\0'; in virtual_cwd_main_cwd_init()
427 main_cwd_state.cwd_length = (int)strlen(cwd); in virtual_cwd_main_cwd_init()
429 if (main_cwd_state.cwd_length >= 2 && cwd[1] == ':') { in virtual_cwd_main_cwd_init()
430 cwd[0] = toupper(cwd[0]); in virtual_cwd_main_cwd_init()
433 main_cwd_state.cwd = strdup(cwd); in virtual_cwd_main_cwd_init()
461 …free(main_cwd_state.cwd); /* Don't use CWD_STATE_FREE because the non global states will probably … in virtual_cwd_shutdown()
467 if (CWDG(cwd).cwd == NULL) { in virtual_cwd_activate()
468 CWD_STATE_COPY(&CWDG(cwd), &main_cwd_state); in virtual_cwd_activate()
476 if (CWDG(cwd).cwd != NULL) { in virtual_cwd_deactivate()
477 CWD_STATE_FREE(&CWDG(cwd)); in virtual_cwd_deactivate()
478 CWDG(cwd).cwd = NULL; in virtual_cwd_deactivate()
488 state = &CWDG(cwd); in virtual_getcwd_ex()
502 if (state->cwd_length == 2 && state->cwd[state->cwd_length-1] == ':') { in virtual_getcwd_ex()
507 memcpy(retval, state->cwd, *length); in virtual_getcwd_ex()
514 if (!state->cwd) { in virtual_getcwd_ex()
520 return estrdup(state->cwd); in virtual_getcwd_ex()
528 char *cwd; in virtual_getcwd() local
530 cwd = virtual_getcwd_ex(&length); in virtual_getcwd()
533 return cwd; in virtual_getcwd()
536 efree(cwd); in virtual_getcwd()
540 if (!cwd) { in virtual_getcwd()
543 memcpy(buf, cwd, length+1); in virtual_getcwd()
544 efree(cwd); in virtual_getcwd()
1240 fprintf(stderr,"cwd = %s path = %s\n", state->cwd, path); in virtual_file_ex()
1256 if (state->cwd[1] == ':') { in virtual_file_ex()
1259 } else if (IS_UNC_PATH(state->cwd, state->cwd_length)) { in virtual_file_ex()
1262 while (IS_SLASH(state->cwd[state_cwd_length])) { in virtual_file_ex()
1265 while (state->cwd[state_cwd_length] && in virtual_file_ex()
1266 !IS_SLASH(state->cwd[state_cwd_length])) { in virtual_file_ex()
1269 while (IS_SLASH(state->cwd[state_cwd_length])) { in virtual_file_ex()
1272 while (state->cwd[state_cwd_length] && in virtual_file_ex()
1273 !IS_SLASH(state->cwd[state_cwd_length])) { in virtual_file_ex()
1282 memcpy(resolved_path, state->cwd, state_cwd_length); in virtual_file_ex()
1371 tmp = erealloc(state->cwd, state->cwd_length+1); in virtual_file_ex()
1372 state->cwd = (char *) tmp; in virtual_file_ex()
1374 memcpy(state->cwd, resolved_path, state->cwd_length+1); in virtual_file_ex()
1385 tmp = erealloc(state->cwd, state->cwd_length+1); in virtual_file_ex()
1386 state->cwd = (char *) tmp; in virtual_file_ex()
1388 memcpy(state->cwd, resolved_path, state->cwd_length+1); in virtual_file_ex()
1393 fprintf (stderr, "virtual_file_ex() = %s\n",state->cwd); in virtual_file_ex()
1401 return virtual_file_ex(&CWDG(cwd), path, php_is_dir_ok, CWD_REALPATH)?-1:0; in virtual_chdir()
1443 char cwd[MAXPATHLEN]; in virtual_realpath() local
1447 new_state.cwd = (char*)emalloc(1); in virtual_realpath()
1448 new_state.cwd[0] = '\0'; in virtual_realpath()
1450 if (VCWD_GETCWD(cwd, MAXPATHLEN)) { in virtual_realpath()
1451 path = cwd; in virtual_realpath()
1454 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_realpath()
1456 new_state.cwd = (char*)emalloc(1); in virtual_realpath()
1457 new_state.cwd[0] = '\0'; in virtual_realpath()
1464 memcpy(real_path, new_state.cwd, len); in virtual_realpath()
1481 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_filepath_ex()
1484 *filepath = new_state.cwd; in virtual_filepath_ex()
1506 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_fopen()
1513 f = php_win32_ioutil_fopen(new_state.cwd, mode); in virtual_fopen()
1515 f = fopen(new_state.cwd, mode); in virtual_fopen()
1529 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_access()
1536 ret = tsrm_win32_access(new_state.cwd, mode); in virtual_access()
1538 ret = access(new_state.cwd, mode); in virtual_access()
1553 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_utime()
1560 ret = win32_utime(new_state.cwd, buf); in virtual_utime()
1562 ret = utime(new_state.cwd, buf); in virtual_utime()
1576 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_chmod()
1594 ret = php_win32_ioutil_chmod(new_state.cwd, mode); in virtual_chmod()
1597 ret = chmod(new_state.cwd, mode); in virtual_chmod()
1611 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_chown()
1619 ret = lchown(new_state.cwd, owner, group); in virtual_chown()
1624 ret = chown(new_state.cwd, owner, group); in virtual_chown()
1638 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_open()
1653 f = php_win32_ioutil_open(new_state.cwd, flags, mode); in virtual_open()
1655 f = open(new_state.cwd, flags, mode); in virtual_open()
1659 f = php_win32_ioutil_open(new_state.cwd, flags); in virtual_open()
1661 f = open(new_state.cwd, flags); in virtual_open()
1674 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_creat()
1680 f = creat(new_state.cwd, mode); in virtual_creat()
1693 CWD_STATE_COPY(&old_state, &CWDG(cwd)); in virtual_rename()
1698 oldname = old_state.cwd; in virtual_rename()
1700 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_rename()
1706 newname = new_state.cwd; in virtual_rename()
1729 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_stat()
1735 retval = php_sys_stat(new_state.cwd, buf); in virtual_stat()
1747 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_lstat()
1753 retval = php_sys_lstat(new_state.cwd, buf); in virtual_lstat()
1765 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_unlink()
1772 retval = php_win32_ioutil_unlink(new_state.cwd); in virtual_unlink()
1774 retval = unlink(new_state.cwd); in virtual_unlink()
1787 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_mkdir()
1794 retval = php_win32_ioutil_mkdir(new_state.cwd, mode); in virtual_mkdir()
1796 retval = mkdir(new_state.cwd, mode); in virtual_mkdir()
1808 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_rmdir()
1815 retval = php_win32_ioutil_rmdir(new_state.cwd); in virtual_rmdir()
1817 retval = rmdir(new_state.cwd); in virtual_rmdir()
1833 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_opendir()
1839 retval = opendir(new_state.cwd); in virtual_opendir()
1849 return popen_ex(command, type, CWDG(cwd).cwd, NULL); in virtual_popen()
1863 dir_length = CWDG(cwd).cwd_length; in virtual_popen()
1864 dir = CWDG(cwd).cwd; in virtual_popen()
1870 dir_length = CWDG(cwd).cwd_length; in virtual_popen()
1871 dir = CWDG(cwd).cwd; in virtual_popen()
1877 if (CWDG(cwd).cwd_length == 0) { in virtual_popen()
1913 char cwd[MAXPATHLEN]; in tsrm_realpath() local
1917 new_state.cwd = (char*)emalloc(1); in tsrm_realpath()
1918 new_state.cwd[0] = '\0'; in tsrm_realpath()
1920 if (VCWD_GETCWD(cwd, MAXPATHLEN)) { in tsrm_realpath()
1921 path = cwd; in tsrm_realpath()
1924 VCWD_GETCWD(cwd, MAXPATHLEN)) { in tsrm_realpath()
1925 new_state.cwd = estrdup(cwd); in tsrm_realpath()
1926 new_state.cwd_length = (int)strlen(cwd); in tsrm_realpath()
1928 new_state.cwd = (char*)emalloc(1); in tsrm_realpath()
1929 new_state.cwd[0] = '\0'; in tsrm_realpath()
1934 efree(new_state.cwd); in tsrm_realpath()
1940 memcpy(real_path, new_state.cwd, copy_len); in tsrm_realpath()
1942 efree(new_state.cwd); in tsrm_realpath()
1945 return new_state.cwd; in tsrm_realpath()