Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
69561f2c
Commit
69561f2c
authored
Dec 31, 2001
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for the Carbon scrap manager (finally).
parent
a5548e7c
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
314 additions
and
75 deletions
+314
-75
Mac/Modules/scrap/_Scrapmodule.c
Mac/Modules/scrap/_Scrapmodule.c
+289
-73
Mac/Modules/scrap/scrapscan.py
Mac/Modules/scrap/scrapscan.py
+11
-2
Mac/Modules/scrap/scrapsupport.py
Mac/Modules/scrap/scrapsupport.py
+14
-0
No files found.
Mac/Modules/scrap/_Scrapmodule.c
View file @
69561f2c
This diff is collapsed.
Click to expand it.
Mac/Modules/scrap/scrapscan.py
View file @
69561f2c
...
...
@@ -5,7 +5,10 @@
import
sys
import
os
BGENDIR
=
os
.
path
.
join
(
sys
.
prefix
,
':Tools:bgen:bgen'
)
if
os
.
sep
==
':'
:
BGENDIR
=
os
.
path
.
join
(
sys
.
prefix
,
':Tools:bgen:bgen'
)
else
:
BGENDIR
=
"../../../Tools/bgen/bgen"
sys
.
path
.
append
(
BGENDIR
)
from
scantools
import
Scanner
from
bgenlocations
import
TOOLBOXDIR
...
...
@@ -29,10 +32,16 @@ class MyScanner(Scanner):
def
destination
(
self
,
type
,
name
,
arglist
):
classname
=
"Function"
listname
=
"functions"
if
arglist
:
t
,
n
,
m
=
arglist
[
0
]
if
t
==
'ScrapRef'
and
m
==
"InMode"
:
classname
=
"Method"
listname
=
"methods"
return
classname
,
listname
def
makeblacklistnames
(
self
):
return
[
"GetScrapFlavorInfoList"
,
]
def
makegreylist
(
self
):
...
...
@@ -50,7 +59,7 @@ class MyScanner(Scanner):
def
makeblacklisttypes
(
self
):
return
[
"ScrapRef"
,
# For now -- This is the Carbon scrap main object
'ScrapPromiseKeeperUPP'
,
]
def
makerepairinstructions
(
self
):
...
...
Mac/Modules/scrap/scrapsupport.py
View file @
69561f2c
...
...
@@ -11,15 +11,19 @@ import string
# Declarations that change for each manager
MACHEADERFILE
=
'Scrap.h'
# The Apple header file
MODNAME
=
'_Scrap'
# The name of the module
OBJECTNAME
=
'Scrap'
# The basic name of the objects used here
# The following is *usually* unchanged but may still require tuning
MODPREFIX
=
'Scrap'
# The prefix for module-wide routines
OBJECTTYPE
=
OBJECTNAME
+
'Ref'
# The C type used to represent them
OBJECTPREFIX
=
MODPREFIX
+
'Obj'
# The prefix for object methods
INPUTFILE
=
string
.
lower
(
MODPREFIX
)
+
'gen.py'
# The file generated by the scanner
OUTPUTFILE
=
'@'
+
MODNAME
+
"module.c"
# The file generated by this program
from
macsupport
import
*
# Create the type objects
ScrapRef
=
OpaqueByValueType
(
OBJECTTYPE
,
OBJECTPREFIX
)
includestuff
=
includestuff
+
"""
#ifdef WITHOUT_FRAMEWORKS
...
...
@@ -44,21 +48,31 @@ SCRRec_New(itself)
ScrapStuffPtr
=
OpaqueByValueType
(
'ScrapStuffPtr'
,
'SCRRec'
)
ScrapFlavorType
=
OSTypeType
(
'ScrapFlavorType'
)
ScrapFlavorFlags
=
Type
(
'ScrapFlavorFlags'
,
'l'
)
#ScrapFlavorInfo = OpaqueType('ScrapFlavorInfo', 'ScrapFlavorInfo')
putscrapbuffer
=
FixedInputBufferType
(
'void *'
)
class
MyObjectDefinition
(
GlobalObjectDefinition
):
pass
# Create the generator groups and link them
module
=
MacModule
(
MODNAME
,
MODPREFIX
,
includestuff
,
finalstuff
,
initstuff
)
object
=
MyObjectDefinition
(
OBJECTNAME
,
OBJECTPREFIX
,
OBJECTTYPE
)
module
.
addobject
(
object
)
# Create the generator classes used to populate the lists
Function
=
OSErrFunctionGenerator
Method
=
OSErrMethodGenerator
# Create and populate the lists
functions
=
[]
methods
=
[]
execfile
(
INPUTFILE
)
# add the populated lists to the generator groups
# (in a different wordl the scan program would generate this)
for
f
in
functions
:
module
.
add
(
f
)
for
f
in
methods
:
object
.
add
(
f
)
# generate output (open the output file as late as possible)
SetOutputFileName
(
OUTPUTFILE
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment