Added PC files from Jim Ahlstrom.

This commit is contained in:
Guido van Rossum 1996-06-28 19:12:06 +00:00
parent c012547142
commit 1bc716f2fc
33 changed files with 17716 additions and 21 deletions

67
PC/utils/makesrc.c Executable file
View file

@ -0,0 +1,67 @@
#include <stdio.h>
#include <direct.h>
#include <string.h>
/* Copy files from source directories to ./src changing
file names and #include names to 8x3 lower case */
char *usage = "You must be in the \"pc\" directory.\n";
char *list[] = {"..\\Include", "..\\Modules", "..\\Objects", "..\\Parser", "..\\Python", ".", 0};
main()
{
DIR *dpath;
struct dirent *dir;
int len;
char **plist;
char *pt1, *pt2, *name;
char dest_path[256], src_path[256], buf256[256];
FILE *fpin, *fpout;
for (plist = list; *plist; plist++){
if ((dpath = opendir(*plist)) == NULL){
printf(usage);
return 1;
}
while (dir = readdir(dpath)){
name = dir->d_name;
len = strlen(name);
if (len > 2 && name[len - 2] == '.' &&
(name[len - 1] == 'c' || name[len - 1] == 'h')){
strcpy(buf256, name);
if (len > 10){
buf256[8] = '.';
buf256[9] = name[len - 1];
buf256[10] = 0;
}
strlwr(buf256);
strncpy(src_path, *plist, 256);
strncat(src_path, "\\", 256);
strncat(src_path, name, 256);
strncpy(dest_path, ".\\src\\", 256);
strncat(dest_path, buf256, 256);
printf("Copying %-30s to %s\n", src_path, dest_path);
fpin = fopen(src_path, "r");
fpout = fopen(dest_path, "w");
while (fgets(buf256, 256, fpin)){
if (!strncmp(buf256, "#include", 8)){
strlwr(buf256);
if ((pt1 = strstr(buf256, "\"")) &&
(pt2 = strstr(buf256, ".")) &&
(*(pt2 + 1) == 'h') &&
(pt2 - pt1 > 9)){
for (pt1 += 9; *pt2; pt1++, pt2++)
*pt1 = *pt2;
*pt1 = 0;
}
}
fputs(buf256, fpout);
}
fclose(fpin);
fclose(fpout);
}
}
closedir(dpath);
}
return 0;
}

3
PC/utils/makesrc.lk1 Executable file
View file

@ -0,0 +1,3 @@
NAME makesrc
FIL makesrc.obj

24
PC/utils/makesrc.mk1 Executable file
View file

@ -0,0 +1,24 @@
!define BLANK ""
n:\python\python-1.4b0b\pc\utils\makesrc.obj : n:\python\python-1.4b0b\pc\ut&
ils\makesrc.c .AUTODEPEND
@n:
cd n:\python\python-1.4b0b\pc\utils
*wcc386 makesrc.c -i=C:\WATCOM\h;C:\WATCOM\h\nt -w4 -e25 -ei -zp4 -zq -otex&
an -d1 -5r -bt=nt -mf
n:\python\python-1.4b0b\pc\utils\makesrc.exe : n:\python\python-1.4b0b\pc\ut&
ils\makesrc.obj .AUTODEPEND
@n:
cd n:\python\python-1.4b0b\pc\utils
@%write makesrc.lk1 NAME makesrc
@%append makesrc.lk1 FIL makesrc.obj
@%append makesrc.lk1
!ifneq BLANK ""
*wlib -q -n -b makesrc.imp
@%append makesrc.lk1 LIBR makesrc.imp
!endif
*wlink SYS nt op m op st=20k op maxe=25 op q op symf @makesrc.lk1
!ifneq BLANK ""
wrc -q -ad makesrc.exe
!endif

185
PC/utils/makesrc.tgt Executable file
View file

@ -0,0 +1,185 @@
40
targetIdent
0
MProject
1
MComponent
0
2
WString
4
NEXE
3
WString
5
nc2en
1
0
0
4
MCommand
0
5
MCommand
0
6
MItem
11
makesrc.exe
7
WString
4
NEXE
8
WVList
2
9
MVState
10
WString
7
WINLINK
11
WString
11
?????Stack:
1
12
WString
3
20k
0
13
MVState
14
WString
7
WINLINK
15
WString
11
?????Stack:
0
16
WString
3
20k
0
17
WVList
0
-1
1
1
0
18
WPickList
2
19
MItem
3
*.c
20
WString
4
COBJ
21
WVList
6
22
MCState
23
WString
3
WCC
24
WString
31
?????Force enums to be type int
1
1
25
MRState
26
WString
3
WCC
27
WString
20
?????Pack structures
1
0
28
MRState
29
WString
3
WCC
30
WString
21
?????4 byte alignment
1
1
31
MCState
32
WString
3
WCC
33
WString
31
?????Force enums to be type int
0
1
34
MRState
35
WString
3
WCC
36
WString
20
?????Pack structures
0
0
37
MRState
38
WString
3
WCC
39
WString
21
?????4 byte alignment
0
1
40
WVList
0
-1
1
1
0
41
MItem
9
makesrc.c
42
WString
4
COBJ
43
WVList
0
44
WVList
0
19
1
1
0

3
PC/utils/utils.mk Executable file
View file

@ -0,0 +1,3 @@
project : n:\python\python-1.4b0b\pc\utils\makesrc.exe .SYMBOLIC
!include n:\python\python-1.4b0b\pc\utils\makesrc.mk1

43
PC/utils/utils.wpj Executable file
View file

@ -0,0 +1,43 @@
40
projectIdent
0
VpeMain
1
WRect
0
0
9920
8704
2
MProject
3
MCommand
0
4
MCommand
0
1
5
WFileName
11
makesrc.tgt
6
WVList
1
7
VComponent
8
WRect
332
324
5670
4215
0
0
9
WFileName
11
makesrc.tgt
0
1
7