Trying again to check it in. Changes to:

- Use Universal Headers as input
- Change addpack calls to not depend on Guido's disklayout
- Checkge testprograms to use new names for some functions
This commit is contained in:
Jack Jansen 1995-06-06 12:55:40 +00:00
parent c7cfb95559
commit ae8a68f40c
16 changed files with 466 additions and 284 deletions

View file

@ -68,9 +68,9 @@ class FixedInputOutputBufferType(InputOnlyType):
self.size)
Output("goto %s__error__;", name)
OutRbrace()
self.transferSize()
self.transferSize(name)
def transferSize():
def transferSize(self, name):
Output("%s__len__ = %s__in_len__;", name, name)
def passOutput(self, name):
@ -174,7 +174,7 @@ class StructInputOutputBufferType(FixedInputOutputBufferType):
def getargsArgs(self, name):
return "(char **)&%s__in__, &%s__in_len__" % (name, name)
def transferSize(self):
def transferSize(self, name):
pass
def passInput(self, name):

View file

@ -32,11 +32,15 @@ ResType = OSTypeType("ResType")
# Handles (always resources in our case)
Handle = OpaqueByValueType("Handle", "ResObj")
MenuHandle = OpaqueByValueType("MenuHandle", "MenuObj")
MenuRef = MenuHandle
ControlHandle = OpaqueByValueType("ControlHandle", "CtlObj")
ControlRef = ControlHandle
# Windows and Dialogs
WindowPtr = OpaqueByValueType("WindowPtr", "WinObj")
WindowRef = WindowPtr
DialogPtr = OpaqueByValueType("DialogPtr", "DlgObj")
DialogRef = DialogPtr
ExistingWindowPtr = OpaqueByValueType("WindowPtr", "WinObj_WhichWindow", "BUG")
ExistingDialogPtr = OpaqueByValueType("DialogPtr", "WinObj_WhichWindow", "BUG")
@ -137,8 +141,8 @@ class MacModule(Module):
_SetOutputFileName = SetOutputFileName # Save original
def SetOutputFileName(file = None):
"Set the output file name and set its creator&type to KAHL&TEXT"
"Set the output file name and set its creator&type to MPCC&TEXT"
_SetOutputFileName(file)
if file:
import MacOS
MacOS.SetCreatorAndType(file, 'KAHL', 'TEXT')
MacOS.SetCreatorAndType(file, 'MPCC', 'TEXT')

View file

@ -27,8 +27,10 @@ except ImportError:
MacOS = None
# Default preferences
CREATOR = 'KAHL' # My favorite text editor on the Mac
INCLUDEDIR = "D:Development:THINK C:Mac #includes:Apple #includes:"
#CREATOR = 'KAHL' # Guido's favorite text editor on the Mac
#INCLUDEDIR = "D:Development:THINK C:Mac #includes:Apple #includes:"
CREATOR = 'MPCC' # Jack's favorite text editor on the Mac
INCLUDEDIR = "Moes:CW5 GOLD Ä:Metrowerks C/C++ Ä:Headers Ä:Universal Headers 2.0a3 Ä:"
Error = "scantools.Error"
@ -203,9 +205,9 @@ class Scanner:
self.includepath = [':', INCLUDEDIR]
def initpatterns(self):
self.head_pat = "^pascal[ \t]+" # XXX Mac specific!
self.head_pat = "^extern pascal[ \t]+" # XXX Mac specific!
self.tail_pat = "[;={}]"
self.type_pat = "pascal[ \t\n]+\(<type>[a-zA-Z0-9_]+\)[ \t\n]+"
self.type_pat = "pascal[ \t\n]+\(<type>[a-zA-Z0-9_ \t]*[a-zA-Z0-9_]\)[ \t\n]+"
self.name_pat = "\(<name>[a-zA-Z0-9_]+\)[ \t\n]*"
self.args_pat = "(\(<args>\([^(;=)]+\|([^(;=)]*)\)*\))"
self.whole_pat = self.type_pat + self.name_pat + self.args_pat