home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume27 / dmake / part11 < prev    next >
Encoding:
Text File  |  1992-01-29  |  40.0 KB  |  1,140 lines

  1. Newsgroups: comp.sources.misc
  2. From: dvadura@plg.waterloo.edu (Dennis Vadura)
  3. Subject:  REPOST: v27i112:  dmake - dmake Version 3.8, Part11/41
  4. Message-ID: <1992Jan29.215812.17274@sparky.imd.sterling.com>
  5. X-Md4-Signature: 8471aae0fdee3e9726bad1179d4765b7
  6. Date: Wed, 29 Jan 1992 21:58:12 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: dvadura@plg.waterloo.edu (Dennis Vadura)
  10. Posting-number: Volume 27, Issue 112
  11. Archive-name: dmake/part11
  12. Environment: Atari-ST, Coherent, Mac, MSDOS, OS/2, UNIX
  13. Supersedes: dmake: Volume 19, Issue 22-58
  14.  
  15. ---- Cut Here and feed the following to sh ----
  16. # this is dmake.shar.11 (part 11 of a multipart archive)
  17. # do not concatenate these parts, unpack them in order with /bin/sh
  18. # file dmake/mac/directry.c continued
  19. #
  20. if test ! -r _shar_seq_.tmp; then
  21.     echo 'Please unpack part 1 first!'
  22.     exit 1
  23. fi
  24. (read Scheck
  25.  if test "$Scheck" != 11; then
  26.     echo Please unpack part "$Scheck" next!
  27.     exit 1
  28.  else
  29.     exit 0
  30.  fi
  31. ) < _shar_seq_.tmp || exit 1
  32. if test -f _shar_wnt_.tmp; then
  33. sed 's/^X//' << 'SHAR_EOF' >> 'dmake/mac/directry.c' &&
  34. -- 
  35. --      This program is distributed in the hope that it will be useful,
  36. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  37. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  38. --      GNU General Public License for more details.
  39. -- 
  40. --      You should have received a copy of the GNU General Public License
  41. --      along with this program;  if not, write to the Free Software
  42. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  43. --
  44. -- LOG
  45. --     $Log: directry.c,v $
  46. X * Revision 1.1  1992/01/24  03:29:45  dvadura
  47. X * dmake Version 3.8, Initial revision
  48. X *
  49. */
  50. X
  51. #include <Errors.h>
  52. #include <Files.h>
  53. #include <OSUtils.h>
  54. #include <StdLib.h>
  55. #include <Strings.h>
  56. #include <SysEqu.h>
  57. #include "extern.h"
  58. X
  59. X
  60. X
  61. /*
  62. X * Implementation of stat function for dmake on the mac.
  63. X *
  64. X * Many fields aren't filled in, and the times are seconds from 1/1//1904,
  65. X * but it should be enough for dmake (I think we only need st_mtime and
  66. X * st_mode's S_IFDIR set correctly).
  67. X */
  68. PUBLIC int stat(pPath, pStat)
  69. char *pPath;
  70. struct stat *pStat;
  71. {
  72. X    CInfoPBRec infoPB;
  73. X    OSErr err;
  74. X    int retVal;
  75. X
  76. X    pPath = Unix2MacFName (pPath);
  77. X
  78. X    infoPB.hFileInfo.ioCompletion = NULL;
  79. X    infoPB.hFileInfo.ioNamePtr = c2pstr (pPath);
  80. X    infoPB.hFileInfo.ioVRefNum = 0;
  81. X    infoPB.hFileInfo.ioFDirIndex = 0;
  82. X    infoPB.hFileInfo.ioDirID = 0;
  83. X    err = PBGetCatInfo(&infoPB, FALSE);
  84. X    p2cstr ((StringPtr) pPath);
  85. X
  86. X    if (err == noErr) {
  87. X        pStat->st_mtime = (time_t) infoPB.hFileInfo.ioFlMdDat;
  88. X        pStat->st_ctime = (time_t) infoPB.hFileInfo.ioFlCrDat;
  89. X        pStat->st_mode = S_IREAD | S_IEXEC;
  90. X
  91. X        /* If it is a directory ... */
  92. X        if (infoPB.hFileInfo.ioFlAttrib & 0x10) {
  93. X            pStat->st_size = infoPB.dirInfo.ioDrNmFls;
  94. X            pStat->st_mode |= S_IFDIR;
  95. X        } else {
  96. X            pStat->st_size = infoPB.hFileInfo.ioFlLgLen;
  97. X            pStat->st_mode |= S_IFREG;
  98. X        } /* if ... else */
  99. X
  100. X        /* If it is writeable */
  101. X        if ((infoPB.hFileInfo.ioFlAttrib & 0x1) == 0) {
  102. X            pStat->st_mode |= S_IWRITE;
  103. X        } /* if */
  104. X        
  105. X        retVal = 0;
  106. X
  107. X    } else {
  108. X        retVal = -1;
  109. X    } /* if ... else */
  110. X
  111. X    return (retVal);
  112. } /* PUBLIC int stat () */
  113. X
  114. X
  115. X
  116. /*
  117. X * Return the current working directory, or NULL if there is an error.
  118. X */
  119. PUBLIC char *getcwd (char *pPath, size_t pathSize) {
  120. X    DirInfo dirInfo;
  121. X    OSErr err;
  122. X    Str255 dirName;
  123. X    char *pBeginName;
  124. X    char *pC;
  125. X    size_t len;
  126. X    size_t spaceForColon;
  127. X
  128. X    pPath = Unix2MacFName (pPath);
  129. X
  130. X    /* Set up the info for the PBGetCatInfo() calls */
  131. X    dirInfo.ioCompletion = NULL;
  132. X    dirInfo.ioNamePtr = dirName;
  133. X    dirInfo.ioVRefNum = 0;
  134. X    dirInfo.ioFDirIndex = -1;
  135. X    dirInfo.ioDrDirID = 0;
  136. X    pBeginName = pPath + pathSize - 1;
  137. X    spaceForColon = 0;  /* Make sure we don't have an end colon on the name */
  138. X
  139. X    /*
  140. X     * Keep going up the directory path until the end is reached or an error
  141. X     * occurs.  Ideally, we would check for errors at every level and stop
  142. X     * when we received an fnfErr (File Not Found), but it appears that there
  143. X     * are some problems with network volumes.  (During testing, I received
  144. X     * a paramErr (No Default Volume) beyond the top level.)  Thus, to keep it
  145. X     * simple, I assume any error past the first directory indicates we have
  146. X     * seen all directories.
  147. X     */
  148. X    while (TRUE) {
  149. X        err = PBGetCatInfo ((CInfoPBPtr) &dirInfo, FALSE);
  150. X        len = ((size_t)(unsigned char) dirName[0]);
  151. X        if ((err == noErr) && (len < pBeginName - pPath)) {
  152. X            p2cstr (dirName);
  153. X            pBeginName -= len + spaceForColon;
  154. X            strcpy (pBeginName, dirName);
  155. X            /* Note that strcpy() adds the '\0' at the end of
  156. X               the first directory for us */
  157. X            if (spaceForColon == 1) {
  158. X                pBeginName[len] = ':';
  159. X            } else {
  160. X                /* The end of the string shouldn't have a ':' */
  161. X                spaceForColon = 1;
  162. X            } /* if */
  163. X
  164. X            /* Set up for the next call to PBGetCatInfo() with
  165. X               the parent's directory ID */
  166. X            dirInfo.ioDrDirID = dirInfo.ioDrParID;
  167. X
  168. X        } else if (spaceForColon == 1) {
  169. X            /* We got past the top-level directory */
  170. X            break;
  171. X
  172. X        } else {
  173. X            /* We either have an error when looking at the first directory
  174. X               or have run out of room. */
  175. X            return (NULL);
  176. X        } /* if ... elses */
  177. X    } /* while */
  178. X
  179. X    /* Now copy the directory string to the beginning of the path string.
  180. X       (It's possible the directory already starts at the beginning of the
  181. X       string, but this is unlikely and doesn't hurt anything if it does,
  182. X       so we don't bother to check for it.) */
  183. X    pC = pPath;
  184. X    while ((*(pC++) = *(pBeginName++)) != '\0')
  185. X        ;
  186. X
  187. X    return (pPath);
  188. } /* PUBLIC char *getcwd () */
  189. X
  190. X
  191. X
  192. /*
  193. X * Change the directory to a new default directory.
  194. X *
  195. X * Return 0 if successful, or -1 if there is an error.
  196. X */
  197. PUBLIC int chdir (char *pPath) {
  198. X    WDPBRec WDPB;
  199. X    VolumeParam vParam;
  200. X    OSErr err;
  201. X    int result;
  202. X    char *pC;
  203. X    char c;
  204. X
  205. X    pPath = Unix2MacFName (pPath);
  206. X
  207. X    /* Set up the directory */
  208. X    c2pstr (pPath);
  209. X    WDPB.ioCompletion = NULL;
  210. X    WDPB.ioNamePtr = pPath;
  211. X    WDPB.ioVRefNum = 0;
  212. X    WDPB.ioWDProcID = 0;
  213. X    WDPB.ioWDDirID = 0;
  214. X    err = PBOpenWD (&WDPB, FALSE);
  215. X    /* Restore path to a C-type string in case the caller wants
  216. X       to use it after this call. */
  217. X    p2cstr (pPath);
  218. X    if (err != noErr) {
  219. X        return (-1);
  220. X    } /* if */
  221. X
  222. X    /* Set up the volume if necessary */
  223. X    if (*pPath != ':') {
  224. X        for (pC = pPath + 1; (*pC != ':') && (*pC != '\0'); ++pC)
  225. X            ;
  226. X        c = *pC;
  227. X        *pC = '\0';
  228. X        vParam.ioCompletion = NULL;
  229. X        vParam.ioNamePtr = c2pstr (pPath);
  230. X        vParam.ioVRefNum = WDPB.ioVRefNum;
  231. X        err = PBSetVol ((ParmBlkPtr) &vParam, FALSE);
  232. X        p2cstr (pPath);
  233. X        *pC = c;
  234. X        result = ((err == noErr) ? 0 : -1);
  235. X
  236. X    } else {
  237. X        result = 0;
  238. X    } /* if ... else */
  239. X    
  240. X    return (result);
  241. } /* PUBLIC int chdir () */
  242. X
  243. X
  244. X
  245. /*
  246. X * Change the modification time for the file to the current time.
  247. X *
  248. X * The normal version of utime can set the modification time to any
  249. X * time, this function aborts the function if this is tried.
  250. X *
  251. X * We return 0 if the modification time was updated and -1 if there
  252. X * was an error.
  253. X */
  254. PUBLIC int utime (char *pPath, time_t *pTimes) {
  255. X    CInfoPBRec infoPB;
  256. X    OSErr err;
  257. X
  258. X    pPath = Unix2MacFName (pPath);
  259. X
  260. X    if (pTimes != NULL) {
  261. X        Fatal ("SUBROUTINE SHORTCOMING: utime cannot take a utimbuf struct");
  262. X    } /* if */
  263. X
  264. X    /* Get the old info */
  265. X    infoPB.hFileInfo.ioCompletion = NULL;
  266. X    infoPB.hFileInfo.ioNamePtr = c2pstr (pPath);
  267. X    infoPB.hFileInfo.ioVRefNum = 0;
  268. X    infoPB.hFileInfo.ioFDirIndex = 0;
  269. X    infoPB.hFileInfo.ioDirID = 0;
  270. X    err = PBGetCatInfo (&infoPB, FALSE);
  271. X    if (err != noErr) {
  272. X        p2cstr ((StringPtr) pPath);
  273. X        return (-1);
  274. X    } /* if */
  275. X
  276. X    /* Change the modification time and set the new info */
  277. X    GetDateTime (&(infoPB.hFileInfo.ioFlMdDat));
  278. X    infoPB.hFileInfo.ioDirID = 0;
  279. X    err = PBSetCatInfo (&infoPB, FALSE);
  280. X    p2cstr ((StringPtr) pPath);
  281. X    return ((err == noErr) ? 0 : -1);
  282. } /* PUBLIC int utime () */
  283. SHAR_EOF
  284. chmod 0640 dmake/mac/directry.c ||
  285. echo 'restore of dmake/mac/directry.c failed'
  286. Wc_c="`wc -c < 'dmake/mac/directry.c'`"
  287. test 8195 -eq "$Wc_c" ||
  288.     echo 'dmake/mac/directry.c: original size 8195, current size' "$Wc_c"
  289. rm -f _shar_wnt_.tmp
  290. fi
  291. # ============= dmake/mac/dompwmak ==============
  292. if test -f 'dmake/mac/dompwmak' -a X"$1" != X"-c"; then
  293.     echo 'x - skipping dmake/mac/dompwmak (File already exists)'
  294.     rm -f _shar_wnt_.tmp
  295. else
  296. > _shar_wnt_.tmp
  297. sed 's/^X//' << 'SHAR_EOF' > 'dmake/mac/dompwmak' &&
  298. newfolder objects
  299. c -I. -I :mac -d _MPW -s infer -sym off -o :objects:infer.c.o infer.c
  300. c -I. -I :mac -d _MPW -s make -sym off -o :objects:make.c.o make.c
  301. c -I. -I :mac -d _MPW -s stat -sym off -o :objects:stat.c.o stat.c
  302. c -I. -I :mac -d _MPW -s expand -sym off -o :objects:expand.c.o expand.c
  303. c -I. -I :mac -d _MPW -s dmstring -sym off -o :objects:dmstring.c.o dmstring.c
  304. c -I. -I :mac -d _MPW -s hash -sym off -o :objects:hash.c.o hash.c
  305. c -I. -I :mac -d _MPW -s dag -sym off -o :objects:dag.c.o dag.c
  306. c -I. -I :mac -d _MPW -s dmake -sym off -o :objects:dmake.c.o dmake.c
  307. c -I. -I :mac -d _MPW -s path -sym off -o :objects:path.c.o path.c
  308. c -I. -I :mac -d _MPW -s imacs -sym off -o :objects:imacs.c.o imacs.c
  309. c -I. -I :mac -d _MPW -s sysintf -sym off -o :objects:sysintf.c.o sysintf.c
  310. c -I. -I :mac -d _MPW -s parse -sym off -o :objects:parse.c.o parse.c
  311. c -I. -I :mac -d _MPW -s getinp -sym off -o :objects:getinp.c.o getinp.c
  312. c -I. -I :mac -d _MPW -s quit -sym off -o :objects:quit.c.o quit.c
  313. c -I. -I :mac -d _MPW -s state -sym off -o :objects:state.c.o state.c
  314. c -I. -I :mac -d _MPW -s basename -sym off -o :objects:basename.c.o basename.c
  315. c -I. -I :mac -d _MPW -s dmdump -sym off -o :objects:dmdump.c.o dmdump.c
  316. c -I. -I :mac -d _MPW -s macparse -sym off -o :objects:macparse.c.o macparse.c
  317. c -I. -I :mac -d _MPW -s rulparse -sym off -o :objects:rulparse.c.o rulparse.c
  318. c -I. -I :mac -d _MPW -s percent -sym off -o :objects:percent.c.o percent.c
  319. c -I. -I :mac -d _MPW -s function -sym off -o :objects:function.c.o function.c
  320. duplicate -y :mac:arlib.c arlib.c
  321. c -I. -I :mac -d _MPW -s arlib -sym off -o :objects:arlib.c.o arlib.c
  322. delete arlib.c
  323. duplicate -y :mac:bogus.c bogus.c
  324. c -I. -I :mac -d _MPW -s bogus -sym off -o :objects:bogus.c.o bogus.c
  325. delete bogus.c
  326. duplicate -y :mac:dirbrk.c dirbrk.c
  327. c -I. -I :mac -d _MPW -s dirbrk -sym off -o :objects:dirbrk.c.o dirbrk.c
  328. delete dirbrk.c
  329. duplicate -y :mac:directry.c directry.c
  330. c -I. -I :mac -d _MPW -s directry -sym off -o :objects:directry.c.o directry.c
  331. delete directry.c
  332. duplicate -y :mac:environ.c environ.c
  333. c -I. -I :mac -d _MPW -s environ -sym off -o :objects:environ.c.o environ.c
  334. delete environ.c
  335. duplicate -y :mac:main.c main.c
  336. c -I. -I :mac -d _MPW -s main -sym off -o :objects:main.c.o main.c
  337. delete main.c
  338. duplicate -y :mac:rmprq.c rmprq.c
  339. c -I. -I :mac -d _MPW -s rmprq -sym off -o :objects:rmprq.c.o rmprq.c
  340. delete rmprq.c
  341. duplicate -y :mac:ruletab.c ruletab.c
  342. c -I. -I :mac -d _MPW -s ruletab -sym off -o :objects:ruletab.c.o ruletab.c
  343. delete ruletab.c
  344. duplicate -y :mac:tempnam.c tempnam.c
  345. c -I. -I :mac -d _MPW -s tempnam -sym off -o :objects:tempnam.c.o tempnam.c
  346. delete tempnam.c
  347. duplicate -y :mac:tomacfil.c tomacfil.c
  348. c -I. -I :mac -d _MPW -s tomacfil -sym off -o :objects:tomacfil.c.o tomacfil.c
  349. delete tomacfil.c
  350. link -w -c 'MPS ' -t MPST -sym off -o dmake  :objects:infer.c.o :objects:make.c.o :objects:stat.c.o :objects:expand.c.o :objects:dmstring.c.o :objects:hash.c.o :objects:dag.c.o :objects:dmake.c.o :objects:path.c.o :objects:imacs.c.o :objects:sysintf.c.o :objects:parse.c.o :objects:getinp.c.o :objects:quit.c.o :objects:state.c.o :objects:basename.c.o :objects:dmdump.c.o :objects:macparse.c.o :objects:rulparse.c.o :objects:percent.c.o :objects:function.c.o :objects:arlib.c.o :objects:bogus.c.o :objects:dirbrk.c.o :objects:directry.c.o :objects:environ.c.o :objects:main.c.o :objects:rmprq.c.o :objects:ruletab.c.o :objects:tempnam.c.o :objects:tomacfil.c.o "Micah:MPW:Libraries:CLibraries:CSANELib.o" "Micah:MPW:Libraries:CLibraries:Math.o"               "Micah:MPW:Libraries:CLibraries:StdCLib.o" "Micah:MPW:Libraries:Libraries:Runtime.o"               "Micah:MPW:Libraries:Libraries:Interface.o" "Micah:MPW:Libraries:Libraries:Toollibs.o" 
  351. duplicate :mac:startup.mk startup.mk
  352. SHAR_EOF
  353. chmod 0640 dmake/mac/dompwmak ||
  354. echo 'restore of dmake/mac/dompwmak failed'
  355. Wc_c="`wc -c < 'dmake/mac/dompwmak'`"
  356. test 3778 -eq "$Wc_c" ||
  357.     echo 'dmake/mac/dompwmak: original size 3778, current size' "$Wc_c"
  358. rm -f _shar_wnt_.tmp
  359. fi
  360. # ============= dmake/mac/environ.c ==============
  361. if test -f 'dmake/mac/environ.c' -a X"$1" != X"-c"; then
  362.     echo 'x - skipping dmake/mac/environ.c (File already exists)'
  363.     rm -f _shar_wnt_.tmp
  364. else
  365. > _shar_wnt_.tmp
  366. sed 's/^X//' << 'SHAR_EOF' > 'dmake/mac/environ.c' &&
  367. /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/mac/environ.c,v 1.1 1992/01/24 03:29:46 dvadura Exp $
  368. -- SYNOPSIS -- Set up and free for environ
  369. --
  370. -- DESCRIPTION
  371. --  This file contains routines that will fill in and dispose of the
  372. --  list of environmental variables in the environ global variable.
  373. --
  374. -- AUTHOR
  375. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  376. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  377. --
  378. --
  379. -- COPYRIGHT
  380. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  381. -- 
  382. --      This program is free software; you can redistribute it and/or
  383. --      modify it under the terms of the GNU General Public License
  384. --      (version 1), as published by the Free Software Foundation, and
  385. --      found in the file 'LICENSE' included with this distribution.
  386. -- 
  387. --      This program is distributed in the hope that it will be useful,
  388. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  389. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  390. --      GNU General Public License for more details.
  391. -- 
  392. --      You should have received a copy of the GNU General Public License
  393. --      along with this program;  if not, write to the Free Software
  394. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  395. --
  396. -- LOG
  397. --     $Log: environ.c,v $
  398. X * Revision 1.1  1992/01/24  03:29:46  dvadura
  399. X * dmake Version 3.8, Initial revision
  400. X *
  401. */
  402. X
  403. #include "extern.h"
  404. X
  405. /* The char used to replace the equal signs in environmental variable names. */
  406. const char kEqualReplace = '_';
  407. X
  408. /* Maximum size of a "name=value" environmental string, including the ending '\0'.
  409. X   Larger environmental variables will be clipped before dmake sees them.
  410. X   (Caution: When I tested the program, the Mac or dmake trashed memory
  411. X    when environmental variables of >4K were read in.  I looked around a bit
  412. X    and couldn't find out the exact cause, so I simply made this variable.
  413. X    The memory trashing may be related to the value for MAXLINELENGTH.) */
  414. const int kMaxEnvLen = 1024;
  415. X
  416. X
  417. /* The list of environmental variables in the form "name=value".
  418. X   (Once make_env() has been called.) */
  419. char **environ = NULL;
  420. X
  421. /* Characters replaced during make_env() */
  422. struct ReplaceChar {
  423. X    char *fpPos;
  424. X    char fC;
  425. X    struct ReplaceChar *fpNext;
  426. }; /* struct ReplaceChar */
  427. struct ReplaceChar *gpReplaceList = NULL;
  428. X
  429. X
  430. void AddReplace (char *pReplacePos);
  431. X
  432. X
  433. X
  434. /*
  435. X * Set up the environmental variables in a format used by
  436. X * the environ global variable.
  437. X *
  438. X * environ has already been set to main's envp argument when
  439. X * this suboroutine is called.  We assume that envp is a copy
  440. X * MPW makes for this process' use alone, so we can modify it
  441. X * below.
  442. X */
  443. PUBLIC void make_env () {
  444. X    char **ppCurEnv;
  445. X    char *pCurPos;
  446. #if 0
  447. X    char **ppMacEnv;
  448. X    char *pMacPos;
  449. X
  450. X    if (!gMECalled) {
  451. X        gMECalled = TRUE;
  452. X
  453. environ = MALLOC (1, char *);
  454. *environ = NULL;
  455. #endif
  456. #if 0
  457. {
  458. X    int numenv;
  459. X    int len;
  460. X    int firstnil;
  461. X
  462. X    numenv = 1;
  463. X    ppMacEnv = environ;
  464. X    while (*(ppMacEnv++) != NULL) {
  465. X        ++numenv;
  466. X    } /* while */
  467. X
  468. X    ppMacEnv = environ;
  469. X    if ((environ = MALLOC (numenv, char *)) == NULL) {
  470. X        No_ram ();
  471. X    } /* if */
  472. X
  473. numenv = 80;
  474. X    for (ppCurEnv = environ; (numenv-- > 0) && (*ppMacEnv != NULL); ++ppCurEnv, ++ppMacEnv) {
  475. X        pMacPos = *ppMacEnv;
  476. X        len = strlen (pMacPos) + 1;
  477. X        len += strlen (pMacPos + len) + 1;
  478. #define MAXLEN 4098
  479. if (len > MAXLEN) len = MAXLEN;
  480. X        if ((*ppCurEnv = MALLOC (len, char)) == NULL) {
  481. X            No_ram ();
  482. X        } /* if */
  483. X
  484. X        firstnil = TRUE;
  485. X        for (pCurPos = *ppCurEnv; ((pCurPos - *ppCurEnv) < MAXLEN - 1); ++pCurPos, ++pMacPos) {
  486. X            if (*pMacPos == '=') {
  487. X                *pCurPos = gEqualReplace;
  488. X
  489. X            } else if (*pMacPos == '\0') {
  490. X                if (firstnil) {
  491. X                    *pCurPos = '=';
  492. X                    firstnil = FALSE;
  493. X                } else {
  494. X                    *pCurPos = *pMacPos;
  495. X                    break;
  496. X                } /* if ... else */
  497. X
  498. X            } else {
  499. X                *pCurPos = *pMacPos;
  500. X            } /* if ... elses */
  501. X        } /* for */
  502. firstnil = FALSE;
  503. X    } /* for */
  504. X    *ppCurEnv = NULL;
  505. }
  506. #endif
  507. {
  508. X        int firstnil;
  509. X
  510. X        /* Get rid of any equal signs in any environmental name, and put
  511. X           equal signs between the names and their values */
  512. X        for (ppCurEnv = environ; *ppCurEnv != NULL; ++ppCurEnv) {
  513. X
  514. X            firstnil = TRUE;
  515. X            for (pCurPos = *ppCurEnv;
  516. X                 ((pCurPos - *ppCurEnv < kMaxEnvLen - 1) &&
  517. X                  ((*pCurPos != '\0') || !firstnil));
  518. X                 ++pCurPos) {
  519. X                if (*pCurPos == '=') {
  520. X                    AddReplace (pCurPos);
  521. X                    *pCurPos = kEqualReplace;
  522. X
  523. X                } else if (*pCurPos == '\0') {
  524. X                    AddReplace (pCurPos);
  525. X                    *pCurPos = '=';
  526. X                    firstnil = FALSE;
  527. X                } /* if ... else if */
  528. X            } /* for */
  529. X
  530. X            /* If the environtmental variable was too large ... */
  531. X            if (*pCurPos != '\0') {
  532. X                AddReplace (pCurPos);
  533. X                *pCurPos = '\0';
  534. X                if (firstnil) {
  535. X                    AddReplace (--pCurPos);
  536. X                    *pCurPos = '=';
  537. X                } /* if */
  538. X            } /* if */
  539. X        } /* for */
  540. }
  541. #if 0
  542. X    } /* if */
  543. #endif
  544. } /* PUBLIC void make_env () */
  545. X
  546. X
  547. /*
  548. X * The character at pReplacePos is about to be replaced.  Remember the
  549. X * old value so we can restore it when we're done.
  550. X */
  551. void AddReplace (char *pReplacePos) {
  552. X    struct ReplaceChar *pReplaceChar;
  553. X
  554. X    if ((pReplaceChar = MALLOC (1, struct ReplaceChar)) == NULL) {
  555. X        No_ram ();
  556. X    } /* if */
  557. X    pReplaceChar->fpPos = pReplacePos;
  558. X    pReplaceChar->fC = *pReplacePos;
  559. X    pReplaceChar->fpNext = gpReplaceList;
  560. X    gpReplaceList = pReplaceChar;
  561. } /* void AddReplace () */
  562. X
  563. X
  564. /*
  565. X * Restore the old environmental variables to the way they looked before
  566. X * the make_env() call, on the unlikely chance that something else will look
  567. X * at our copy of the environmental variables during the program execution.
  568. X * 
  569. X */
  570. PUBLIC void free_env () {
  571. X    struct ReplaceChar *pReplaceChar;
  572. X
  573. X    while (gpReplaceList != NULL) {
  574. X        pReplaceChar = gpReplaceList;
  575. X        gpReplaceList = pReplaceChar->fpNext;
  576. X
  577. X        *(pReplaceChar->fpPos) = pReplaceChar->fC;
  578. X
  579. X        FREE (pReplaceChar);
  580. X    } /* while */
  581. X
  582. #if 0
  583. X    char **ppCurEnv;
  584. X    char *pCurPos;
  585. X
  586. X    if (!gFECalled) {
  587. X        gFECalled = TRUE;
  588. X
  589. //FREE (environ);
  590. environ = NULL;
  591. #endif
  592. #if 0
  593. X        /* Restore the environment list to what it was before we
  594. X           read it in. */
  595. X        for (ppCurEnv = environ; *ppCurEnv != NULL; ++ppCurEnv) {
  596. X            for (pCurPos = *ppCurEnv; *pCurPos != '='; ++pCurPos)
  597. X                ;
  598. X            *pCurPos = '\0';
  599. X        } /* for */
  600. X    } /* if */
  601. #endif
  602. } /* PUBLIC void free_env () */
  603. SHAR_EOF
  604. chmod 0640 dmake/mac/environ.c ||
  605. echo 'restore of dmake/mac/environ.c failed'
  606. Wc_c="`wc -c < 'dmake/mac/environ.c'`"
  607. test 6935 -eq "$Wc_c" ||
  608.     echo 'dmake/mac/environ.c: original size 6935, current size' "$Wc_c"
  609. rm -f _shar_wnt_.tmp
  610. fi
  611. # ============= dmake/mac/eold.c ==============
  612. if test -f 'dmake/mac/eold.c' -a X"$1" != X"-c"; then
  613.     echo 'x - skipping dmake/mac/eold.c (File already exists)'
  614.     rm -f _shar_wnt_.tmp
  615. else
  616. > _shar_wnt_.tmp
  617. sed 's/^X//' << 'SHAR_EOF' > 'dmake/mac/eold.c' &&
  618. /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/mac/eold.c,v 1.1 1992/01/24 03:29:47 dvadura Exp $
  619. -- SYNOPSIS -- Set up and free for environ
  620. --
  621. -- DESCRIPTION
  622. --  This file contains routines that will fill in and dispose of the
  623. --  list of environmental variables in the environ global variable.
  624. --
  625. -- AUTHOR
  626. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  627. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  628. --
  629. --
  630. -- COPYRIGHT
  631. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  632. -- 
  633. --      This program is free software; you can redistribute it and/or
  634. --      modify it under the terms of the GNU General Public License
  635. --      (version 1), as published by the Free Software Foundation, and
  636. --      found in the file 'LICENSE' included with this distribution.
  637. -- 
  638. --      This program is distributed in the hope that it will be useful,
  639. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  640. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  641. --      GNU General Public License for more details.
  642. -- 
  643. --      You should have received a copy of the GNU General Public License
  644. --      along with this program;  if not, write to the Free Software
  645. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  646. --
  647. -- LOG
  648. --     $Log: eold.c,v $
  649. X * Revision 1.1  1992/01/24  03:29:47  dvadura
  650. X * dmake Version 3.8, Initial revision
  651. X *
  652. */
  653. X
  654. #include "extern.h"
  655. X
  656. X
  657. /*
  658. X * Keep track of any environmental variables that have '='s in their
  659. X * name.
  660. X */
  661. struct EqualPos {
  662. X    char *fpPos;
  663. X    struct equalsign *fpNext;
  664. } /* struct EqualPos */
  665. X
  666. struct EqualPos *gpEqualList;
  667. X
  668. /*
  669. X * The character used to replae the equal signs.
  670. X */
  671. const char gEqualReplace = '_';
  672. X
  673. X
  674. X
  675. /*
  676. X * Set up the environmental variables in a format used by
  677. X * the environ global variable.
  678. X *
  679. X * environ has already been set to main's envp argument when
  680. X * this suboroutine is called.
  681. X */
  682. void main_env () {
  683. X    char **ppCurEnv;
  684. X    char *pCurPos;
  685. X    struct equalpos *pNewEqual;
  686. X
  687. X    gpEqualList = NULL;
  688. X
  689. X    for (ppCurEnv = environ; *ppCurEnv != NULL; ++ppCurEnv) {
  690. X        for (pCurPos = *ppCurEnv; *pCurPos != '\0'; ++pCurPos) {
  691. X            if (*pCurPos == '=') {
  692. X                if ((pNewEqual =
  693. X                     (struct EqualPos *) malloc (sizeof (struct EqualPos))) ==
  694. X                    NULL) {
  695. X                    fputs ("Out of Memory", stderr);
  696. X                    exit (EXIT_FAILURE);
  697. X                } /* if */
  698. X                pNewEqual->fpPos = pCurPos;
  699. X                pNewEqual->fpNext = gpEqualList;
  700. X                gpEqualList = pNewEqual;
  701. X                
  702. X                *pCurPos = gEqualReplace;
  703. X            } /* if */
  704. X        } /* for */
  705. X
  706. X        *pCurPos = '=';
  707. X    } /* for */
  708. } /* void main_env () */
  709. X
  710. X
  711. X
  712. /*
  713. X * Reset the environmental variables so they look like they did
  714. X * before the main_env() call.
  715. X *
  716. X * environ has already been set to main's envp argument when
  717. X * this suboroutine is called.
  718. X */
  719. void main_env () {
  720. X    char **ppCurEnv;
  721. X    char *pCurPos;
  722. X    struct equalpos *pNewEqual;
  723. X
  724. X    gpEqualList = NULL;
  725. X
  726. X    for (ppCurEnv = environ; *ppCurEnv != NULL; ++ppCurEnv) {
  727. X        for (pCurPos = *ppCurEnv; *pCurPos != '\0'; ++pCurPos) {
  728. X            if (*pCurPos == '=') {
  729. X                if ((pNewEqual =
  730. X                     (struct EqualPos *) malloc (sizeof (struct EqualPos))) ==
  731. X                    NULL) {
  732. X                    fputs ("Out of Memory", stderr);
  733. X                    exit (EXIT_FAILURE);
  734. X                } /* if */
  735. X                pNewEqual->fpPos = pCurPos;
  736. X                pNewEqual->fpNext = gpEqualList;
  737. X                gpEqualList = pNewEqual;
  738. X                
  739. X                *pCurPos = gEqualReplace;
  740. X            } /* if */
  741. X        } /* for */
  742. X
  743. X        *pCurPos = '=';
  744. X    } /* for */
  745. } /* void main_env () */
  746. SHAR_EOF
  747. chmod 0640 dmake/mac/eold.c ||
  748. echo 'restore of dmake/mac/eold.c failed'
  749. Wc_c="`wc -c < 'dmake/mac/eold.c'`"
  750. test 3810 -eq "$Wc_c" ||
  751.     echo 'dmake/mac/eold.c: original size 3810, current size' "$Wc_c"
  752. rm -f _shar_wnt_.tmp
  753. fi
  754. # ============= dmake/mac/main.c ==============
  755. if test -f 'dmake/mac/main.c' -a X"$1" != X"-c"; then
  756.     echo 'x - skipping dmake/mac/main.c (File already exists)'
  757.     rm -f _shar_wnt_.tmp
  758. else
  759. > _shar_wnt_.tmp
  760. sed 's/^X//' << 'SHAR_EOF' > 'dmake/mac/main.c' &&
  761. /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/mac/main.c,v 1.1 1992/01/24 03:29:48 dvadura Exp $
  762. -- SYNOPSIS -- The real main function
  763. --
  764. -- DESCRIPTION
  765. --  In order to get the third argument to main(), which is a list of
  766. --  environmental variables, we have #defined main to dmakemain,
  767. --  and put the real main here.
  768. --
  769. --  The environmental variables are placed in the environ global variable
  770. --  and set up for processing by dmake in make_env().
  771. --
  772. -- AUTHOR
  773. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  774. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  775. --
  776. --
  777. -- COPYRIGHT
  778. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  779. -- 
  780. --      This program is free software; you can redistribute it and/or
  781. --      modify it under the terms of the GNU General Public License
  782. --      (version 1), as published by the Free Software Foundation, and
  783. --      found in the file 'LICENSE' included with this distribution.
  784. -- 
  785. --      This program is distributed in the hope that it will be useful,
  786. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  787. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  788. --      GNU General Public License for more details.
  789. -- 
  790. --      You should have received a copy of the GNU General Public License
  791. --      along with this program;  if not, write to the Free Software
  792. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  793. --
  794. -- LOG
  795. --     $Log: main.c,v $
  796. X * Revision 1.1  1992/01/24  03:29:48  dvadura
  797. X * dmake Version 3.8, Initial revision
  798. X *
  799. */
  800. X
  801. #include "extern.h"
  802. X
  803. X
  804. X
  805. /*
  806. X * Put envp in environ and call dmake's main().
  807. X */
  808. #undef main
  809. void main (int argc, char *argv[], char *envp[]) {
  810. X    environ = envp;
  811. X    dmakemain (argc, argv);
  812. } /* void main () */
  813. SHAR_EOF
  814. chmod 0640 dmake/mac/main.c ||
  815. echo 'restore of dmake/mac/main.c failed'
  816. Wc_c="`wc -c < 'dmake/mac/main.c'`"
  817. test 1780 -eq "$Wc_c" ||
  818.     echo 'dmake/mac/main.c: original size 1780, current size' "$Wc_c"
  819. rm -f _shar_wnt_.tmp
  820. fi
  821. # ============= dmake/mac/make.sh ==============
  822. if test -f 'dmake/mac/make.sh' -a X"$1" != X"-c"; then
  823.     echo 'x - skipping dmake/mac/make.sh (File already exists)'
  824.     rm -f _shar_wnt_.tmp
  825. else
  826. > _shar_wnt_.tmp
  827. sed 's/^X//' << 'SHAR_EOF' > 'dmake/mac/make.sh' &&
  828. newfolder objects
  829. c -I. -I :mac -d _MPW -s infer -sym off -o :objects:infer.c.o infer.c
  830. c -I. -I :mac -d _MPW -s make -sym off -o :objects:make.c.o make.c
  831. c -I. -I :mac -d _MPW -s stat -sym off -o :objects:stat.c.o stat.c
  832. c -I. -I :mac -d _MPW -s expand -sym off -o :objects:expand.c.o expand.c
  833. c -I. -I :mac -d _MPW -s dmstring -sym off -o :objects:dmstring.c.o dmstring.c
  834. c -I. -I :mac -d _MPW -s hash -sym off -o :objects:hash.c.o hash.c
  835. c -I. -I :mac -d _MPW -s dag -sym off -o :objects:dag.c.o dag.c
  836. c -I. -I :mac -d _MPW -s dmake -sym off -o :objects:dmake.c.o dmake.c
  837. c -I. -I :mac -d _MPW -s path -sym off -o :objects:path.c.o path.c
  838. c -I. -I :mac -d _MPW -s imacs -sym off -o :objects:imacs.c.o imacs.c
  839. c -I. -I :mac -d _MPW -s sysintf -sym off -o :objects:sysintf.c.o sysintf.c
  840. c -I. -I :mac -d _MPW -s parse -sym off -o :objects:parse.c.o parse.c
  841. c -I. -I :mac -d _MPW -s getinp -sym off -o :objects:getinp.c.o getinp.c
  842. c -I. -I :mac -d _MPW -s quit -sym off -o :objects:quit.c.o quit.c
  843. c -I. -I :mac -d _MPW -s state -sym off -o :objects:state.c.o state.c
  844. c -I. -I :mac -d _MPW -s basename -sym off -o :objects:basename.c.o basename.c
  845. c -I. -I :mac -d _MPW -s dmdump -sym off -o :objects:dmdump.c.o dmdump.c
  846. c -I. -I :mac -d _MPW -s macparse -sym off -o :objects:macparse.c.o macparse.c
  847. c -I. -I :mac -d _MPW -s rulparse -sym off -o :objects:rulparse.c.o rulparse.c
  848. c -I. -I :mac -d _MPW -s percent -sym off -o :objects:percent.c.o percent.c
  849. c -I. -I :mac -d _MPW -s function -sym off -o :objects:function.c.o function.c
  850. c -I. -I :mac -d _MPW -s arlib -sym off -o :objects:arlib.c.o :mac:arlib.c
  851. c -I. -I :mac -d _MPW -s bogus -sym off -o :objects:bogus.c.o :mac:bogus.c
  852. c -I. -I :mac -d _MPW -s dirbrk -sym off -o :objects:dirbrk.c.o :mac:dirbrk.c
  853. c -I. -I :mac -d _MPW -s directry -sym off -o :objects:directry.c.o :mac:directry.c
  854. c -I. -I :mac -d _MPW -s environ -sym off -o :objects:environ.c.o :mac:environ.c
  855. c -I. -I :mac -d _MPW -s main -sym off -o :objects:main.c.o :mac:main.c
  856. c -I. -I :mac -d _MPW -s rmprq -sym off -o :objects:rmprq.c.o :mac:rmprq.c
  857. c -I. -I :mac -d _MPW -s ruletab -sym off -o :objects:ruletab.c.o :mac:ruletab.c
  858. c -I. -I :mac -d _MPW -s tempnam -sym off -o :objects:tempnam.c.o :mac:tempnam.c
  859. c -I. -I :mac -d _MPW -s tomacfil -sym off -o :objects:tomacfil.c.o :mac:tomacfil.c
  860. link -w -c 'MPS ' -t MPST -sym off -o dmake  :objects:infer.c.o :objects:make.c.o :objects:stat.c.o :objects:expand.c.o :objects:dmstring.c.o :objects:hash.c.o :objects:dag.c.o :objects:dmake.c.o :objects:path.c.o :objects:imacs.c.o :objects:sysintf.c.o :objects:parse.c.o :objects:getinp.c.o :objects:quit.c.o :objects:state.c.o :objects:basename.c.o :objects:dmdump.c.o :objects:macparse.c.o :objects:rulparse.c.o :objects:percent.c.o :objects:function.c.o :objects:arlib.c.o :objects:bogus.c.o :objects:dirbrk.c.o :objects:directry.c.o :objects:environ.c.o :objects:main.c.o :objects:rmprq.c.o :objects:ruletab.c.o :objects:tempnam.c.o :objects:tomacfil.c.o "CSANELib.o" "Math.o"               "StdCLib.o" "Runtime.o"               "Interface.o" "Toollibs.o" 
  861. duplicate :mac:startup.mk startup.mk
  862. SHAR_EOF
  863. chmod 0640 dmake/mac/make.sh ||
  864. echo 'restore of dmake/mac/make.sh failed'
  865. Wc_c="`wc -c < 'dmake/mac/make.sh'`"
  866. test 3119 -eq "$Wc_c" ||
  867.     echo 'dmake/mac/make.sh: original size 3119, current size' "$Wc_c"
  868. rm -f _shar_wnt_.tmp
  869. fi
  870. # ============= dmake/mac/public.h ==============
  871. if test -f 'dmake/mac/public.h' -a X"$1" != X"-c"; then
  872.     echo 'x - skipping dmake/mac/public.h (File already exists)'
  873.     rm -f _shar_wnt_.tmp
  874. else
  875. > _shar_wnt_.tmp
  876. sed 's/^X//' << 'SHAR_EOF' > 'dmake/mac/public.h' &&
  877. /* RCS      -- $Header$
  878. -- WARNING  -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
  879. --
  880. -- SYNOPSIS -- Local functions exported to be visible by others.
  881. --
  882. -- DESCRIPTION
  883. --      This file is generated by 'genpub'.  Function declarations
  884. --      that appear in this file are extracted by 'genpub' from
  885. --      source files.  Any function in the source file whose definition
  886. --      appears like:
  887. --
  888. --          PUBLIC return_type
  889. --          function( arg_list );
  890. --          type_expr1 arg1;
  891. --          ...
  892. --
  893. --      has its definition extracted and a line of the form:
  894. --
  895. --          return_type function ANSI((type_expr1,type_expr2,...));
  896. --
  897. --      entered into the output file.
  898. --
  899. -- AUTHOR
  900. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  901. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  902. --
  903. -- COPYRIGHT
  904. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  905. -- 
  906. --      This program is free software; you can redistribute it and/or
  907. --      modify it under the terms of the GNU General Public License
  908. --      (version 1), as published by the Free Software Foundation, and
  909. --      found in the file 'LICENSE' included with this distribution.
  910. -- 
  911. --      This program is distributed in the hope that it will be useful,
  912. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  913. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  914. --      GNU General Public License for more details.
  915. -- 
  916. --      You should have received a copy of the GNU General Public License
  917. --      along with this program;  if not, write to the Free Software
  918. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  919. --
  920. -- LOG
  921. --     $Log$
  922. */
  923. X
  924. #ifndef _DMAKE_PUBLIC_h
  925. #define _DMAKE_PUBLIC_h
  926. X
  927. void Infer_recipe ANSI((CELLPTR, CELLPTR));
  928. int Make_targets ANSI(());
  929. int Exec_commands ANSI((CELLPTR));
  930. void Pop_dir ANSI((int));
  931. void Append_line ANSI((char *, int, FILE *, char *, int, int));
  932. void Stat_target ANSI((CELLPTR, int));
  933. char * Expand ANSI((char *));
  934. char * Apply_edit ANSI((char *, char *, char *, int, int));
  935. void Map_esc ANSI((char *));
  936. char* Apply_modifiers ANSI((int, char *));
  937. char* Tokenize ANSI((char *, char *));
  938. char * _strjoin ANSI((char *, char *, int, int));
  939. char * _stradd ANSI((char *, char *, int));
  940. char * _strapp ANSI((char *, char *));
  941. char * _strdup ANSI((char *));
  942. char * _strdup2 ANSI((char *));
  943. char * _strpbrk ANSI((char *, char *));
  944. char * _strspn ANSI((char *, char *));
  945. char * _strstr ANSI((char *, char *));
  946. char * _substr ANSI((char *, char *));
  947. uint16 Hash ANSI((char *, uint32 *));
  948. HASHPTR Get_name ANSI((char *, HASHPTR *, int));
  949. HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
  950. HASHPTR Def_macro ANSI((char *, char *, int));
  951. CELLPTR Def_cell ANSI((char *));
  952. LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
  953. void Clear_prerequisites ANSI((CELLPTR));
  954. int Test_circle ANSI((CELLPTR, int));
  955. STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
  956. t_attr Rcp_attribute ANSI((char *));
  957. FILE * Openfile ANSI((char *, int, int));
  958. FILE * Closefile ANSI(());
  959. FILE * Search_file ANSI((char *, char **));
  960. char * Filename ANSI(());
  961. void No_ram ANSI(());
  962. int Usage ANSI((int));
  963. int Version ANSI(());
  964. char * Get_suffix ANSI((char *));
  965. char * Build_path ANSI((char *, char *));
  966. void Make_rules ANSI(());
  967. void Create_macro_vars ANSI(());
  968. time_t Do_stat ANSI((char *, char *, char **));
  969. int Do_touch ANSI((char *, char *, char **));
  970. void Void_lib_cache ANSI((char *, char *));
  971. time_t Do_time ANSI(());
  972. int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int));
  973. char ** Pack_argv ANSI((int, int, char *));
  974. char * Read_env_string ANSI((char *));
  975. int Write_env_string ANSI((char *, char *));
  976. void ReadEnvironment ANSI(());
  977. void Catch_signals ANSI((void (*)()));
  978. void Clear_signals ANSI(());
  979. void Prolog ANSI((int, char* []));
  980. void Epilog ANSI((int));
  981. char * Get_current_dir ANSI(());
  982. int Set_dir ANSI((char*));
  983. char Get_switch_char ANSI(());
  984. FILE* Get_temp ANSI((char **, char *, int));
  985. FILE * Start_temp ANSI((char *, CELLPTR, char **));
  986. void Open_temp_error ANSI((char *, char *));
  987. void Link_temp ANSI((CELLPTR, FILE *, char *));
  988. void Close_temp ANSI((CELLPTR, FILE *));
  989. void Unlink_temp_files ANSI((CELLPTR));
  990. void Handle_result ANSI((int, int, int, CELLPTR));
  991. void Update_time_stamp ANSI((CELLPTR));
  992. int Remove_file ANSI((char *));
  993. void Parse ANSI((FILE *));
  994. int Get_line ANSI((char *, FILE *));
  995. char * Do_comment ANSI((char *, char **, int));
  996. char * Get_token ANSI((TKSTRPTR, char *, int));
  997. void Quit ANSI(());
  998. void Read_state ANSI(());
  999. void Write_state ANSI(());
  1000. int Check_state ANSI((CELLPTR, STRINGPTR *, int));
  1001. char* basename ANSI((char *));
  1002. void Dump ANSI(());
  1003. void Dump_recipe ANSI((STRINGPTR));
  1004. int Parse_macro ANSI((char *, int));
  1005. int Macro_op ANSI((char *));
  1006. int Parse_rule_def ANSI((int *));
  1007. int Rule_op ANSI((char *));
  1008. void Add_recipe_to_list ANSI((char *, int, int));
  1009. void Bind_rules_to_targets ANSI((int));
  1010. int Set_group_attributes ANSI((char *));
  1011. DFALINKPTR Match_dfa ANSI((char *));
  1012. void Check_circle_dfa ANSI(());
  1013. void Add_nfa ANSI((char *));
  1014. char * Exec_function ANSI((char *));
  1015. time_t seek_arch ANSI(());
  1016. void tzset ();
  1017. int putenv ANSI((char * /* pEnvString */));
  1018. int Wait_for_child ANSI((int /* abort_flg */, int /* pid */));
  1019. int If_root_path ANSI((char *));
  1020. int stat ANSI((char *, struct stat *));
  1021. void make_env ();
  1022. void free_env ();
  1023. void Remove_prq ANSI((CELLPTR));
  1024. char *tempnam ANSI((char * /* pDir */, char * pPrefix));
  1025. char *Unix2MacFName ANSI((char *pUnixName));
  1026. X
  1027. #endif
  1028. SHAR_EOF
  1029. chmod 0640 dmake/mac/public.h ||
  1030. echo 'restore of dmake/mac/public.h failed'
  1031. Wc_c="`wc -c < 'dmake/mac/public.h'`"
  1032. test 5509 -eq "$Wc_c" ||
  1033.     echo 'dmake/mac/public.h: original size 5509, current size' "$Wc_c"
  1034. rm -f _shar_wnt_.tmp
  1035. fi
  1036. # ============= dmake/mac/rmprq.c ==============
  1037. if test -f 'dmake/mac/rmprq.c' -a X"$1" != X"-c"; then
  1038.     echo 'x - skipping dmake/mac/rmprq.c (File already exists)'
  1039.     rm -f _shar_wnt_.tmp
  1040. else
  1041. > _shar_wnt_.tmp
  1042. sed 's/^X//' << 'SHAR_EOF' > 'dmake/mac/rmprq.c' &&
  1043. /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/mac/rmprq.c,v 1.1 1992/01/24 03:29:48 dvadura Exp $
  1044. -- SYNOPSIS -- remove prerequisites code.
  1045. -- 
  1046. -- DESCRIPTION
  1047. --  This code is different for The Mac and for UNIX and parallel make
  1048. --  architectures since the parallel case requires the rm's to be
  1049. --  run in parallel, whereas The Mac guarantees to run them sequentially.
  1050. -- 
  1051. -- AUTHOR
  1052. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  1053. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  1054. --
  1055. -- COPYRIGHT
  1056. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  1057. -- 
  1058. --      This program is free software; you can redistribute it and/or
  1059. --      modify it under the terms of the GNU General Public License
  1060. --      (version 1), as published by the Free Software Foundation, and
  1061. --      found in the file 'LICENSE' included with this distribution.
  1062. -- 
  1063. --      This program is distributed in the hope that it will be useful,
  1064. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  1065. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1066. --      GNU General Public License for more details.
  1067. -- 
  1068. --      You should have received a copy of the GNU General Public License
  1069. --      along with this program;  if not, write to the Free Software
  1070. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1071. --
  1072. -- LOG
  1073. --     $Log: rmprq.c,v $
  1074. X * Revision 1.1  1992/01/24  03:29:48  dvadura
  1075. X * dmake Version 3.8, Initial revision
  1076. X *
  1077. */
  1078. X
  1079. #include "extern.h"
  1080. X
  1081. PUBLIC void
  1082. Remove_prq( tcp )
  1083. CELLPTR tcp;
  1084. {
  1085. X   tcp->ce_flag &= ~(F_MADE|F_VISITED);
  1086. X   tcp->ce_time  = 0L;
  1087. X
  1088. X   Make( tcp, NIL(LINK), NIL(CELL) );
  1089. }
  1090. SHAR_EOF
  1091. chmod 0640 dmake/mac/rmprq.c ||
  1092. echo 'restore of dmake/mac/rmprq.c failed'
  1093. Wc_c="`wc -c < 'dmake/mac/rmprq.c'`"
  1094. test 1658 -eq "$Wc_c" ||
  1095.     echo 'dmake/mac/rmprq.c: original size 1658, current size' "$Wc_c"
  1096. rm -f _shar_wnt_.tmp
  1097. fi
  1098. # ============= dmake/mac/ruletab.c ==============
  1099. if test -f 'dmake/mac/ruletab.c' -a X"$1" != X"-c"; then
  1100.     echo 'x - skipping dmake/mac/ruletab.c (File already exists)'
  1101.     rm -f _shar_wnt_.tmp
  1102. else
  1103. > _shar_wnt_.tmp
  1104. sed 's/^X//' << 'SHAR_EOF' > 'dmake/mac/ruletab.c' &&
  1105. /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/mac/ruletab.c,v 1.1 1992/01/24 03:29:49 dvadura Exp $
  1106. -- SYNOPSIS -- Default initial configuration of dmake.
  1107. -- 
  1108. -- DESCRIPTION
  1109. --  Define here the initial set of rules that are defined before
  1110. --  dmake performs any processing.
  1111. --
  1112. -- AUTHOR
  1113. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  1114. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  1115. --
  1116. -- COPYRIGHT
  1117. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  1118. -- 
  1119. --      This program is free software; you can redistribute it and/or
  1120. --      modify it under the terms of the GNU General Public License
  1121. --      (version 1), as published by the Free Software Foundation, and
  1122. --      found in the file 'LICENSE' included with this distribution.
  1123. -- 
  1124. --      This program is distributed in the hope that it will be useful,
  1125. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  1126. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1127. --      GNU General Public License for more details.
  1128. -- 
  1129. --      You should have received a copy of the GNU General Public License
  1130. --      along with this program;  if not, write to the Free Software
  1131. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1132. SHAR_EOF
  1133. true || echo 'restore of dmake/mac/ruletab.c failed'
  1134. fi
  1135. echo 'End of part 11, continue with part 12'
  1136. echo 12 > _shar_seq_.tmp
  1137. exit 0
  1138. exit 0 # Just in case...
  1139. exit 0 # Just in case...
  1140.