summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/cf/cfscan.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-06-28 22:08:26 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-06-28 22:08:26 (GMT)
commit7becc91fefacaffc403b0cb47178a3d817843cad (patch)
tree5b94ba45ad25bcba3c48264efada40ea59d0f2a3 /Mac/Modules/cf/cfscan.py
parent1319abf745f3e3de7e087d856f957173a765fb86 (diff)
downloadcpython-7becc91fefacaffc403b0cb47178a3d817843cad.zip
cpython-7becc91fefacaffc403b0cb47178a3d817843cad.tar.gz
cpython-7becc91fefacaffc403b0cb47178a3d817843cad.tar.bz2
Added CFURL support, and got base chaining to really work.
Diffstat (limited to 'Mac/Modules/cf/cfscan.py')
-rw-r--r--Mac/Modules/cf/cfscan.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/Mac/Modules/cf/cfscan.py b/Mac/Modules/cf/cfscan.py
index a4dab2d..2d11867 100644
--- a/Mac/Modules/cf/cfscan.py
+++ b/Mac/Modules/cf/cfscan.py
@@ -13,7 +13,8 @@ OBJECTS = ("CFTypeRef",
"CFArrayRef", "CFMutableArrayRef",
"CFDataRef", "CFMutableDataRef",
"CFDictionaryRef", "CFMutableDictionaryRef",
- "CFStringRef", "CFMutableStringRef",
+ "CFStringRef", "CFMutableStringRef",
+ "CFURLRef",
)
# ADD object typenames here
@@ -35,7 +36,7 @@ def main():
"CFString.h",
## "CFStringEncodingExt.h",
## "CFTimeZone.h",
-## "CFURL.h",
+ "CFURL.h",
]
output = SHORT + "gen.py"
defsoutput = TOOLBOXDIR + LONG + ".py"
@@ -81,7 +82,10 @@ class MyScanner(Scanner_OSX):
"CFStringGetPascalString", # Use the C-string methods.
"CFStringGetPascalStringPtr", # TBD automatically
"CFStringGetCStringPtr",
- "CFStringGetCharactersPtr",
+ "CFStringGetCharactersPtr",
+ # OSX only, to be done
+ "CFURLCreateWithFileSystemPath",
+ "CFURLCreateStringWithFileSystemPath",
]
def makegreylist(self):
@@ -104,10 +108,18 @@ class MyScanner(Scanner_OSX):
def makerepairinstructions(self):
return [
+ # Buffers in CF seem to be passed as UInt8 * normally.
([("UInt8_ptr", "*", "InMode"), ("CFIndex", "*", "InMode")],
[("UcharInBuffer", "*", "*")]),
+
+ # Some functions return a const char *. Don't worry, we won't modify it.
([("const_char_ptr", "*", "ReturnMode")],
[("return_stringptr", "*", "*")]),
+
+ # base URLs are optional (pass None for NULL)
+ ([("CFURLRef", "baseURL", "InMode")],
+ [("OptionalCFURLRef", "*", "*")]),
+
]
if __name__ == "__main__":