summaryrefslogtreecommitdiffstats
path: root/PC/utils
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-06-28 19:12:06 (GMT)
committerGuido van Rossum <guido@python.org>1996-06-28 19:12:06 (GMT)
commit1bc716f2fc2aeb4ef4481089727450eb7357f696 (patch)
treea725dce1097dd3344a0c2cf9c17cc899bd21e658 /PC/utils
parentc012547142cfa91192f562ea0204fcf6f5275708 (diff)
downloadcpython-1bc716f2fc2aeb4ef4481089727450eb7357f696.zip
cpython-1bc716f2fc2aeb4ef4481089727450eb7357f696.tar.gz
cpython-1bc716f2fc2aeb4ef4481089727450eb7357f696.tar.bz2
Added PC files from Jim Ahlstrom.
Diffstat (limited to 'PC/utils')
-rwxr-xr-xPC/utils/makesrc.c67
-rwxr-xr-xPC/utils/makesrc.lk13
-rwxr-xr-xPC/utils/makesrc.mk124
-rwxr-xr-xPC/utils/makesrc.tgt185
-rwxr-xr-xPC/utils/utils.mk3
-rwxr-xr-xPC/utils/utils.wpj43
6 files changed, 325 insertions, 0 deletions
diff --git a/PC/utils/makesrc.c b/PC/utils/makesrc.c
new file mode 100755
index 0000000..883b4d8
--- /dev/null
+++ b/PC/utils/makesrc.c
@@ -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;
+ }
diff --git a/PC/utils/makesrc.lk1 b/PC/utils/makesrc.lk1
new file mode 100755
index 0000000..a1759fc
--- /dev/null
+++ b/PC/utils/makesrc.lk1
@@ -0,0 +1,3 @@
+NAME makesrc
+FIL makesrc.obj
+
diff --git a/PC/utils/makesrc.mk1 b/PC/utils/makesrc.mk1
new file mode 100755
index 0000000..c722c37
--- /dev/null
+++ b/PC/utils/makesrc.mk1
@@ -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
+
diff --git a/PC/utils/makesrc.tgt b/PC/utils/makesrc.tgt
new file mode 100755
index 0000000..f35173c
--- /dev/null
+++ b/PC/utils/makesrc.tgt
@@ -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
diff --git a/PC/utils/utils.mk b/PC/utils/utils.mk
new file mode 100755
index 0000000..033c92c
--- /dev/null
+++ b/PC/utils/utils.mk
@@ -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
diff --git a/PC/utils/utils.wpj b/PC/utils/utils.wpj
new file mode 100755
index 0000000..5bbff04
--- /dev/null
+++ b/PC/utils/utils.wpj
@@ -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