summaryrefslogtreecommitdiffstats
path: root/Mac/Modules
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2003-01-09 23:37:37 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2003-01-09 23:37:37 (GMT)
commitb2fcd086c723116d59efe22d5ee44595dade36ed (patch)
tree0fc226c8c464e06508ea68c7a0e1befe011feb69 /Mac/Modules
parentc1a9cab8f05403ebf7a8812e69de8bdb3fa1080b (diff)
downloadcpython-b2fcd086c723116d59efe22d5ee44595dade36ed.zip
cpython-b2fcd086c723116d59efe22d5ee44595dade36ed.tar.gz
cpython-b2fcd086c723116d59efe22d5ee44595dade36ed.tar.bz2
Started on implementing support for FSCatalogInfo. Doesn't work yet, don't
try it.
Diffstat (limited to 'Mac/Modules')
-rw-r--r--Mac/Modules/file/filescan.py13
-rw-r--r--Mac/Modules/file/filesupport.py49
2 files changed, 60 insertions, 2 deletions
diff --git a/Mac/Modules/file/filescan.py b/Mac/Modules/file/filescan.py
index 4b6b70e..a7963c2 100644
--- a/Mac/Modules/file/filescan.py
+++ b/Mac/Modules/file/filescan.py
@@ -134,8 +134,6 @@ class MyScanner(Scanner_OSX):
"CatPositionRec", # State variable, not too difficult
- "FSCatalogInfo", # Lots of fields, difficult struct
- "FSCatalogInfo_ptr", # Lots of fields, difficult struct
"FSIterator", # Should become an object
"FSForkInfo", # Lots of fields, difficult struct
"FSSearchParams", # Also catsearch stuff
@@ -180,6 +178,17 @@ class MyScanner(Scanner_OSX):
([('FSRef_ptr', 'fromFile', 'InMode')],
[('OptFSRefPtr', 'fromFile', 'InMode')]),
+
+ # FSCatalogInfo input handling
+ ([('FSCatalogInfoBitmap', 'whichInfo', 'InMode'),
+ ('FSCatalogInfo_ptr', 'catalogInfo', 'InMode')],
+ [('FSCatalogInfoAndBitmap_in', 'catalogInfo', 'InMode')]),
+
+ # FSCatalogInfo output handling
+ ([('FSCatalogInfoBitmap', 'whichInfo', 'InMode'),
+ ('FSCatalogInfo', 'catalogInfo', 'OutMode')],
+ [('FSCatalogInfoAndBitmap_out', 'catalogInfo', 'InOutMode')]),
+
]
diff --git a/Mac/Modules/file/filesupport.py b/Mac/Modules/file/filesupport.py
index 7ba0b47..122ef0e 100644
--- a/Mac/Modules/file/filesupport.py
+++ b/Mac/Modules/file/filesupport.py
@@ -50,6 +50,53 @@ class OptionalFSxxxType(OpaqueByValueType):
def declare(self, name):
Output("%s %s__buf__;", self.typeName, name)
Output("%s *%s = &%s__buf__;", self.typeName, name, name)
+
+class FSCatalogInfoAndBitmapType(InputOnlyType):
+
+ def __init__(self):
+ InputOnlyType.__init__(self, "BUG", "BUG")
+
+ def declare(self, name):
+ Output("PyObject *%s__object;", name)
+ Output("FSCatalogInfoBitname %s__bitmap;", name)
+ Output("FSCatalogInfo %s;", name)
+
+ def getargsFormat(self):
+ return "lO"
+
+ def getargsArgs(self, name):
+ return "%s__bitmap, %s__object"%(name, name)
+
+ def getargsCheck(self, name):
+ Output("convert_FSCatalogInfo(%s__object, %s__bitmap, %s);", name, name, name)
+
+ def passOutput(self, name):
+ return "%s__bitmap, %s"% (name, name)
+
+ def mkvalueFormat(self):
+ return "O"
+
+ def mkvalueArgs(self, name):
+ return "%s__object" % (name)
+
+ def xxxxmkvalueCheck(self, name):
+ Output("%s__object = new_FSCatalogInfo(%s__bitmap, %s);", name, name)
+
+class FSCatalogInfoAndBitmap_inType(FSCatalogInfoAndBitmapType, InputOnlyMixIn):
+
+ def xxxxmkvalueCheck(self, name):
+ pass
+
+class FSCatalogInfoAndBitmap_outType(FSCatalogInfoAndBitmapType):
+
+ def getargsFormat(self):
+ return "l"
+
+ def getargsArgs(self, name):
+ return "%s__bitmap" % name
+
+ def getargsCheck(self, name):
+ pass
FInfo = OpaqueType("FInfo", "FInfo")
FInfo_ptr = OpaqueType("FInfo", "FInfo")
@@ -60,6 +107,8 @@ OptFSSpecPtr = OptionalFSxxxType("FSSpec", "BUG", "myPyMac_GetOptFSSpecPtr")
FSRef = OpaqueType("FSRef", "FSRef")
FSRef_ptr = OpaqueType("FSRef", "FSRef")
OptFSRefPtr = OptionalFSxxxType("FSRef", "BUG", "myPyMac_GetOptFSRefPtr")
+FSCatalogInfoAndBitmap_in = FSCatalogInfoAndBitmap_inType()
+FSCatalogInfoAndBitmap_out = FSCatalogInfoAndBitmap_outType()
# To be done:
#CatPositionRec