Lines Matching refs:os2
11 os2.c
113 /* Strings used in os2.c */
769 dp -> _d_size = G.os2.find.cbFile;
770 dp -> _d_mode = G.os2.find.attrFile;
771 dp -> _d_time = *(unsigned *) &(G.os2.find.ftimeLastWrite);
772 dp -> _d_date = *(unsigned *) &(G.os2.find.fdateLastWrite);
797 G.os2.dp.d_namlen = G.os2.dp.d_reclen =
798 strlen(strcpy(G.os2.dp.d_name, dirp -> dd_cp -> _d_entry));
800 G.os2.dp.d_ino = 0;
802 G.os2.dp.d_size = dirp -> dd_cp -> _d_size;
803 G.os2.dp.d_mode = dirp -> dd_cp -> _d_mode;
804 G.os2.dp.d_time = dirp -> dd_cp -> _d_time;
805 G.os2.dp.d_date = dirp -> dd_cp -> _d_date;
810 return &G.os2.dp;
864 G.os2.hdir = HDIR_SYSTEM;
865 G.os2.count = 1;
866 done = DosFindFirst((PSZ) dir, &G.os2.hdir, attributes,
867 &G.os2.find, sizeof(G.os2.find), &G.os2.count);
868 G.os2.lower = IsFileSystemFAT(__G__ dir);
871 done = DosFindNext(G.os2.hdir,
872 &G.os2.find, sizeof(G.os2.find), &G.os2.count);
876 if ( G.os2.lower )
877 StringLower(G.os2.find.achName);
878 return G.os2.find.achName;
882 DosFindClose(G.os2.hdir);
913 if ( nDrive == G.os2.nLastDrive )
914 return G.os2.nResult;
920 G.os2.nLastDrive = nDrive;
924 G.os2.nResult = !strcmp((char *) (pData -> szFSDName) + pData -> cbName,
927 G.os2.nResult = FALSE;
930 return G.os2.nResult;
959 if (!G.os2.notfirstcall) { /* first call: must initialize everything */
960 G.os2.notfirstcall = TRUE;
963 strncpy(G.os2.matchname, wildspec, FILNAMSIZ);
964 G.os2.matchname[FILNAMSIZ-1] = '\0';
965 G.os2.have_dirname = FALSE;
966 G.os2.wild_dir = NULL;
967 return G.os2.matchname;
971 if ((G.os2.wildname = (ZCONST char *)strrchr(wildspec, '/')) == NULL &&
972 (G.os2.wildname = (ZCONST char *)strrchr(wildspec, ':')) == NULL) {
973 G.os2.dirname = ".";
974 G.os2.dirnamelen = 1;
975 G.os2.have_dirname = FALSE;
976 G.os2.wildname = wildspec;
978 ++G.os2.wildname; /* point at character after '/' or ':' */
979 G.os2.dirnamelen = G.os2.wildname - wildspec;
980 if ((G.os2.dirname = (char *)malloc(G.os2.dirnamelen+1)) == NULL) {
983 strncpy(G.os2.matchname, wildspec, FILNAMSIZ);
984 G.os2.matchname[FILNAMSIZ-1] = '\0';
985 return G.os2.matchname; /* but maybe filespec was not a wildcard */
987 strncpy(G.os2.dirname, wildspec, G.os2.dirnamelen);
988 G.os2.dirname[G.os2.dirnamelen] = '\0'; /* terminate for strcpy below */
989 G.os2.have_dirname = TRUE;
992 FnFilter1(G.os2.dirname)));
994 if ((G.os2.wild_dir = opendir(__G__ G.os2.dirname)) != NULL) {
995 if (G.os2.have_dirname) {
996 strcpy(G.os2.matchname, G.os2.dirname);
997 fnamestart = G.os2.matchname + G.os2.dirnamelen;
999 fnamestart = G.os2.matchname;
1000 while ((file = readdir(__G__ G.os2.wild_dir)) != NULL) {
1006 if (match(fnamestart, G.os2.wildname, 1 WISEP) &&
1015 return G.os2.matchname;
1019 closedir(G.os2.wild_dir);
1020 G.os2.wild_dir = NULL;
1025 FnFilter1(G.os2.dirname)));
1031 strncpy(G.os2.matchname, wildspec, FILNAMSIZ);
1032 G.os2.matchname[FILNAMSIZ-1] = '\0';
1033 return G.os2.matchname;
1037 if (G.os2.wild_dir == NULL) {
1038 G.os2.notfirstcall = FALSE; /* nothing left to try--reset */
1039 if (G.os2.have_dirname)
1040 free(G.os2.dirname);
1048 if (G.os2.have_dirname) {
1049 /* strcpy(G.os2.matchname, G.os2.dirname); */
1050 fnamestart = G.os2.matchname + G.os2.dirnamelen;
1052 fnamestart = G.os2.matchname;
1053 while ((file = readdir(__G__ G.os2.wild_dir)) != NULL) {
1059 if (match(fnamestart, G.os2.wildname, 1 WISEP)) { /* 1==ignore case */
1065 return G.os2.matchname;
1069 closedir(G.os2.wild_dir); /* have read at least one entry; nothing left */
1070 G.os2.wild_dir = NULL;
1071 G.os2.notfirstcall = FALSE; /* reset for new wildspec */
1072 if (G.os2.have_dirname)
1073 free(G.os2.dirname);
1205 G.os2.created_dir = FALSE; /* not yet */
1206 G.os2.renamed_fullpath = FALSE;
1207 G.os2.fnlen = strlen(G.filename);
1218 G.os2.renamed_fullpath = TRUE;
1223 G.os2.renamed_fullpath = TRUE;
1321 if (G.filename[G.os2.fnlen-1] == '/') {
1323 if (G.os2.created_dir) {
1418 (char)(G.os2.nLabelDrive + 'a' - 1), FnFilter1(G.filename)));
1419 if (DosSetFSInfo(G.os2.nLabelDrive, FSIL_VOLSER, (PBYTE)&FSInfoBuf,
1482 while ((*G.os2.endHPFS = *p++) != '\0') /* copy to HPFS filename */
1483 ++G.os2.endHPFS;
1484 if (IsFileNameValid(G.os2.buildpathHPFS)) {
1487 while ((*G.os2.endFAT = *p++) != '\0') /* copy to FAT filename, too */
1488 ++G.os2.endFAT;
1492 map2fat(pathcomp, &G.os2.endFAT); /* map, put in FAT fn, update endFAT */
1496 * check endHPFS-G.os2.buildpathHPFS after each append, set warning variable
1501 if ((G.os2.endHPFS-G.os2.buildpathHPFS) > FILNAMSIZ-3)
1504 if (GetFileTime(G.os2.buildpathFAT) == -1 || stat(G.os2.buildpathFAT, &G.statbuf))
1506 if (stat(G.os2.buildpathFAT, &G.statbuf)) /* path doesn't exist */
1510 free(G.os2.buildpathHPFS);
1511 free(G.os2.buildpathFAT);
1517 FnFilter1(G.os2.buildpathHPFS)));
1518 free(G.os2.buildpathHPFS);
1519 free(G.os2.buildpathFAT);
1523 if (MKDIR(G.os2.buildpathFAT, 0777) == -1) { /* create the directory */
1525 FnFilter2(G.os2.buildpathFAT), FnFilter1(G.filename)));
1526 free(G.os2.buildpathHPFS);
1527 free(G.os2.buildpathFAT);
1531 G.os2.created_dir = TRUE;
1538 SetLongNameEA(G.os2.buildpathFAT, pathcomp);
1543 FnFilter2(G.os2.buildpathFAT), FnFilter1(G.filename)));
1544 free(G.os2.buildpathHPFS);
1545 free(G.os2.buildpathFAT);
1551 FnFilter1(G.os2.buildpathHPFS)));
1552 free(G.os2.buildpathHPFS);
1553 free(G.os2.buildpathFAT);
1557 *G.os2.endHPFS++ = '/';
1558 *G.os2.endFAT++ = '/';
1559 *G.os2.endHPFS = *G.os2.endFAT = '\0';
1561 FnFilter1(G.os2.buildpathHPFS)));
1563 FnFilter1(G.os2.buildpathFAT)));
1576 FnFilter1(G.os2.buildpathFAT)));
1578 FnFilter1(G.os2.buildpathHPFS)));
1579 strcpy(pathcomp, G.os2.buildpathFAT);
1580 free(G.os2.buildpathFAT);
1581 free(G.os2.buildpathHPFS);
1582 G.os2.buildpathHPFS = G.os2.buildpathFAT = G.os2.endHPFS = G.os2.endFAT = (char *)NULL;
1600 while ((*G.os2.endHPFS = *p++) != '\0') { /* copy to HPFS filename */
1601 ++G.os2.endHPFS;
1606 if ((G.os2.endHPFS-G.os2.buildpathHPFS) >= FILNAMSIZ) {
1607 G.os2.buildpathHPFS[FILNAMSIZ-1] = '\0';
1609 FnFilter1(G.filename), FnFilter2(G.os2.buildpathHPFS)));
1616 * if (!G.os2.longnameEA && ((G.os2.longnameEA = !IsFileNameValid(name)) != 0))
1622 if (G.pInfo->vollabel || IsFileNameValid(G.os2.buildpathHPFS)) {
1623 G.os2.longnameEA = FALSE;
1626 while ((*G.os2.endFAT = *p++) != '\0')
1627 ++G.os2.endFAT;
1629 G.os2.longnameEA = TRUE;
1630 if ((G.os2.lastpathcomp = (char *)malloc(strlen(pathcomp)+1)) ==
1635 G.os2.longnameEA = FALSE;
1639 strcpy(G.os2.lastpathcomp, pathcomp);
1641 map2fat(pathcomp, &G.os2.endFAT);
1651 if ((G.os2.endFAT-G.os2.buildpathFAT) >= FILNAMSIZ)
1652 G.os2.buildpathFAT[FILNAMSIZ-1] = '\0';
1654 FnFilter1(G.os2.buildpathHPFS), FnFilter2(G.os2.buildpathFAT)));
1669 if ((G.os2.buildpathHPFS = (char *)malloc(G.os2.fnlen+G.os2.rootlen+
1672 if ((G.os2.buildpathHPFS = (char *)malloc(G.os2.fnlen+G.os2.rootlen+1))
1677 if ((G.os2.buildpathFAT = (char *)malloc(G.os2.fnlen+G.os2.rootlen+
1680 if ((G.os2.buildpathFAT = (char *)malloc(G.os2.fnlen+G.os2.rootlen+1))
1683 free(G.os2.buildpathHPFS);
1688 if (G.os2.renamed_fullpath && pathcomp[1] == ':')
1689 *G.os2.buildpathHPFS = (char)ToLower(*pathcomp);
1690 else if (!G.os2.renamed_fullpath && G.os2.rootlen > 1 && G.os2.rootpath[1] == ':')
1691 *G.os2.buildpathHPFS = (char)ToLower(*G.os2.rootpath);
1694 DosQueryCurrentDisk(&G.os2.nLabelDrive, &lMap);
1695 *G.os2.buildpathHPFS = (char)(G.os2.nLabelDrive - 1 + 'a');
1697 G.os2.nLabelDrive = *G.os2.buildpathHPFS - 'a' + 1; /* save for mapname() */
1698 if (uO.volflag == 0 || *G.os2.buildpathHPFS < 'a' || /* no labels/bogus? */
1699 (uO.volflag == 1 && !isfloppy(G.os2.nLabelDrive))) { /* -$: no fixed */
1700 free(G.os2.buildpathHPFS);
1701 free(G.os2.buildpathFAT);
1704 *G.os2.buildpathHPFS = '\0';
1705 } else if (G.os2.renamed_fullpath) /* pathcomp = valid data */
1706 strcpy(G.os2.buildpathHPFS, pathcomp);
1707 else if (G.os2.rootlen > 0)
1708 strcpy(G.os2.buildpathHPFS, G.os2.rootpath);
1710 *G.os2.buildpathHPFS = '\0';
1711 G.os2.endHPFS = G.os2.buildpathHPFS;
1712 G.os2.endFAT = G.os2.buildpathFAT;
1713 while ((*G.os2.endFAT = *G.os2.endHPFS) != '\0') {
1714 ++G.os2.endFAT;
1715 ++G.os2.endHPFS;
1717 Trace((stderr, "[%s]\n", FnFilter1(G.os2.buildpathHPFS)));
1737 G.os2.rootlen = 0;
1740 if (G.os2.rootlen > 0) /* rootpath was already set, nothing to do */
1742 if ((G.os2.rootlen = strlen(pathcomp)) > 0) {
1746 if ((tmproot = (char *)malloc(G.os2.rootlen+3)) == (char *)NULL) {
1747 G.os2.rootlen = 0;
1753 if (tmproot[G.os2.rootlen-1] == '/') {
1754 tmproot[--G.os2.rootlen] = '\0';
1757 if (has_drive && (G.os2.rootlen == 2)) {
1760 } else if (G.os2.rootlen > 0) { /* need not check "x:." and "x:/" */
1771 G.os2.rootlen = 0;
1781 G.os2.rootlen = 0;
1789 tmproot[G.os2.rootlen++] = '.';
1790 tmproot[G.os2.rootlen++] = '/';
1791 tmproot[G.os2.rootlen] = '\0';
1792 if ((G.os2.rootpath = realloc(tmproot, G.os2.rootlen+1)) == NULL) {
1794 G.os2.rootlen = 0;
1797 Trace((stderr, "rootpath now = [%s]\n", FnFilter1(G.os2.rootpath)));
1809 if (G.os2.rootlen > 0) {
1810 free(G.os2.rootpath);
1811 G.os2.rootlen = 0;
2073 if (G.os2.longnameEA) {
2077 SetLongNameEA(G.filename, G.os2.lastpathcomp);
2079 free(G.os2.lastpathcomp);
2403 G.os2.nLastDrive = (USHORT)(-1);
2406 G.os2.rexx_mes = "0";