Lines Matching refs:new_state
1432 cwd_state new_state; in virtual_realpath() local
1438 new_state.cwd = (char*)emalloc(1); in virtual_realpath()
1439 if (new_state.cwd == NULL) { in virtual_realpath()
1443 new_state.cwd[0] = '\0'; in virtual_realpath()
1444 new_state.cwd_length = 0; in virtual_realpath()
1449 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_realpath()
1451 new_state.cwd = (char*)emalloc(1); in virtual_realpath()
1452 if (new_state.cwd == NULL) { in virtual_realpath()
1456 new_state.cwd[0] = '\0'; in virtual_realpath()
1457 new_state.cwd_length = 0; in virtual_realpath()
1460 if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)==0) { in virtual_realpath()
1461 int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length; in virtual_realpath()
1463 memcpy(real_path, new_state.cwd, len); in virtual_realpath()
1470 CWD_STATE_FREE(&new_state); in virtual_realpath()
1478 cwd_state new_state; in virtual_filepath_ex() local
1481 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_filepath_ex()
1482 retval = virtual_file_ex(&new_state, path, verify_path, CWD_FILEPATH TSRMLS_CC); in virtual_filepath_ex()
1484 *filepath = new_state.cwd; in virtual_filepath_ex()
1499 cwd_state new_state; in virtual_fopen() local
1506 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_fopen()
1507 if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND TSRMLS_CC)) { in virtual_fopen()
1508 CWD_STATE_FREE_ERR(&new_state); in virtual_fopen()
1512 f = fopen(new_state.cwd, mode); in virtual_fopen()
1514 CWD_STATE_FREE_ERR(&new_state); in virtual_fopen()
1522 cwd_state new_state; in virtual_access() local
1525 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_access()
1526 if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH TSRMLS_CC)) { in virtual_access()
1527 CWD_STATE_FREE_ERR(&new_state); in virtual_access()
1532 ret = tsrm_win32_access(new_state.cwd, mode TSRMLS_CC); in virtual_access()
1534 ret = access(new_state.cwd, mode); in virtual_access()
1537 CWD_STATE_FREE_ERR(&new_state); in virtual_access()
1595 cwd_state new_state; in virtual_utime() local
1598 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_utime()
1599 if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) { in virtual_utime()
1600 CWD_STATE_FREE_ERR(&new_state); in virtual_utime()
1605 ret = win32_utime(new_state.cwd, buf); in virtual_utime()
1607 ret = utime(new_state.cwd, buf); in virtual_utime()
1610 CWD_STATE_FREE_ERR(&new_state); in virtual_utime()
1618 cwd_state new_state; in virtual_chmod() local
1621 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_chmod()
1622 if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) { in virtual_chmod()
1623 CWD_STATE_FREE_ERR(&new_state); in virtual_chmod()
1627 ret = chmod(new_state.cwd, mode); in virtual_chmod()
1629 CWD_STATE_FREE_ERR(&new_state); in virtual_chmod()
1637 cwd_state new_state; in virtual_chown() local
1640 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_chown()
1641 if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) { in virtual_chown()
1642 CWD_STATE_FREE_ERR(&new_state); in virtual_chown()
1648 ret = lchown(new_state.cwd, owner, group); in virtual_chown()
1653 ret = chown(new_state.cwd, owner, group); in virtual_chown()
1656 CWD_STATE_FREE_ERR(&new_state); in virtual_chown()
1664 cwd_state new_state; in virtual_open() local
1667 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_open()
1668 if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH TSRMLS_CC)) { in virtual_open()
1669 CWD_STATE_FREE_ERR(&new_state); in virtual_open()
1681 f = open(new_state.cwd, flags, mode); in virtual_open()
1683 f = open(new_state.cwd, flags); in virtual_open()
1685 CWD_STATE_FREE_ERR(&new_state); in virtual_open()
1692 cwd_state new_state; in virtual_creat() local
1695 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_creat()
1696 if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH TSRMLS_CC)) { in virtual_creat()
1697 CWD_STATE_FREE_ERR(&new_state); in virtual_creat()
1701 f = creat(new_state.cwd, mode); in virtual_creat()
1703 CWD_STATE_FREE_ERR(&new_state); in virtual_creat()
1711 cwd_state new_state; in virtual_rename() local
1721 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_rename()
1722 if (virtual_file_ex(&new_state, newname, NULL, CWD_EXPAND TSRMLS_CC)) { in virtual_rename()
1724 CWD_STATE_FREE_ERR(&new_state); in virtual_rename()
1727 newname = new_state.cwd; in virtual_rename()
1739 CWD_STATE_FREE_ERR(&new_state); in virtual_rename()
1747 cwd_state new_state; in virtual_stat() local
1750 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_stat()
1751 if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)) { in virtual_stat()
1752 CWD_STATE_FREE_ERR(&new_state); in virtual_stat()
1756 retval = php_sys_stat(new_state.cwd, buf); in virtual_stat()
1758 CWD_STATE_FREE_ERR(&new_state); in virtual_stat()
1765 cwd_state new_state; in virtual_lstat() local
1768 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_lstat()
1769 if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND TSRMLS_CC)) { in virtual_lstat()
1770 CWD_STATE_FREE_ERR(&new_state); in virtual_lstat()
1774 retval = php_sys_lstat(new_state.cwd, buf); in virtual_lstat()
1776 CWD_STATE_FREE_ERR(&new_state); in virtual_lstat()
1783 cwd_state new_state; in virtual_unlink() local
1786 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_unlink()
1787 if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND TSRMLS_CC)) { in virtual_unlink()
1788 CWD_STATE_FREE_ERR(&new_state); in virtual_unlink()
1792 retval = unlink(new_state.cwd); in virtual_unlink()
1794 CWD_STATE_FREE_ERR(&new_state); in virtual_unlink()
1801 cwd_state new_state; in virtual_mkdir() local
1804 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_mkdir()
1805 if (virtual_file_ex(&new_state, pathname, NULL, CWD_FILEPATH TSRMLS_CC)) { in virtual_mkdir()
1806 CWD_STATE_FREE_ERR(&new_state); in virtual_mkdir()
1811 retval = mkdir(new_state.cwd); in virtual_mkdir()
1813 retval = mkdir(new_state.cwd, mode); in virtual_mkdir()
1815 CWD_STATE_FREE_ERR(&new_state); in virtual_mkdir()
1822 cwd_state new_state; in virtual_rmdir() local
1825 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_rmdir()
1826 if (virtual_file_ex(&new_state, pathname, NULL, CWD_EXPAND TSRMLS_CC)) { in virtual_rmdir()
1827 CWD_STATE_FREE_ERR(&new_state); in virtual_rmdir()
1831 retval = rmdir(new_state.cwd); in virtual_rmdir()
1833 CWD_STATE_FREE_ERR(&new_state); in virtual_rmdir()
1844 cwd_state new_state; in virtual_opendir() local
1847 CWD_STATE_COPY(&new_state, &CWDG(cwd)); in virtual_opendir()
1848 if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH TSRMLS_CC)) { in virtual_opendir()
1849 CWD_STATE_FREE_ERR(&new_state); in virtual_opendir()
1853 retval = opendir(new_state.cwd); in virtual_opendir()
1855 CWD_STATE_FREE_ERR(&new_state); in virtual_opendir()
1959 cwd_state new_state; in tsrm_realpath() local
1964 new_state.cwd = (char*)emalloc(1); in tsrm_realpath()
1965 if (new_state.cwd == NULL) { in tsrm_realpath()
1968 new_state.cwd[0] = '\0'; in tsrm_realpath()
1969 new_state.cwd_length = 0; in tsrm_realpath()
1975 new_state.cwd = estrdup(cwd); in tsrm_realpath()
1976 new_state.cwd_length = strlen(cwd); in tsrm_realpath()
1978 new_state.cwd = (char*)emalloc(1); in tsrm_realpath()
1979 if (new_state.cwd == NULL) { in tsrm_realpath()
1982 new_state.cwd[0] = '\0'; in tsrm_realpath()
1983 new_state.cwd_length = 0; in tsrm_realpath()
1986 if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)) { in tsrm_realpath()
1987 efree(new_state.cwd); in tsrm_realpath()
1992 int copy_len = new_state.cwd_length>MAXPATHLEN-1 ? MAXPATHLEN-1 : new_state.cwd_length; in tsrm_realpath()
1993 memcpy(real_path, new_state.cwd, copy_len); in tsrm_realpath()
1995 efree(new_state.cwd); in tsrm_realpath()
1998 return new_state.cwd; in tsrm_realpath()