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
fa968ac3
Commit
fa968ac3
authored
Sep 30, 1999
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patches by Jack Jansen: new type OptionalInBuffer allows
passing either a string/input buffer or None.
parent
8bd73827
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
Tools/bgen/bgen/bgenBuffer.py
Tools/bgen/bgen/bgenBuffer.py
+13
-1
Tools/bgen/bgen/macsupport.py
Tools/bgen/bgen/macsupport.py
+1
-0
No files found.
Tools/bgen/bgen/bgenBuffer.py
View file @
fa968ac3
...
@@ -108,6 +108,14 @@ class OutputOnlyBufferMixIn(OutputOnlyMixIn):
...
@@ -108,6 +108,14 @@ class OutputOnlyBufferMixIn(OutputOnlyMixIn):
def
declareInputBuffer
(
self
,
name
):
def
declareInputBuffer
(
self
,
name
):
pass
pass
class
OptionalInputBufferMixIn
:
"""Add to input buffers if the buffer may be omitted: pass None in Python
and the C code will get a NULL pointer and zero size"""
def
getargsFormat
(
self
):
return
"z#"
class
FixedInputBufferType
(
InputOnlyBufferMixIn
,
FixedInputOutputBufferType
):
class
FixedInputBufferType
(
InputOnlyBufferMixIn
,
FixedInputOutputBufferType
):
...
@@ -119,6 +127,8 @@ class FixedInputBufferType(InputOnlyBufferMixIn, FixedInputOutputBufferType):
...
@@ -119,6 +127,8 @@ class FixedInputBufferType(InputOnlyBufferMixIn, FixedInputOutputBufferType):
def
passInput
(
self
,
name
):
def
passInput
(
self
,
name
):
return
"%s__in__"
%
name
return
"%s__in__"
%
name
class
OptionalFixedInputBufferType
(
OptionalInputBufferMixIn
,
FixedInputBufferType
):
pass
class
FixedOutputBufferType
(
OutputOnlyBufferMixIn
,
FixedInputOutputBufferType
):
class
FixedOutputBufferType
(
OutputOnlyBufferMixIn
,
FixedInputOutputBufferType
):
...
@@ -147,7 +157,9 @@ class VarInputBufferType(FixedInputBufferType):
...
@@ -147,7 +157,9 @@ class VarInputBufferType(FixedInputBufferType):
def
passInput
(
self
,
name
):
def
passInput
(
self
,
name
):
return
"%s__in__, %s__len__"
%
(
name
,
name
)
return
"%s__in__, %s__len__"
%
(
name
,
name
)
class
OptionalVarInputBufferType
(
OptionalInputBufferMixIn
,
VarInputBufferType
):
pass
# ----- PART 2: Structure buffers -----
# ----- PART 2: Structure buffers -----
...
...
Tools/bgen/bgen/macsupport.py
View file @
fa968ac3
...
@@ -84,6 +84,7 @@ OSStatus = OSErrType("OSStatus", 'l')
...
@@ -84,6 +84,7 @@ OSStatus = OSErrType("OSStatus", 'l')
# Various buffer types
# Various buffer types
InBuffer
=
VarInputBufferType
(
'char'
,
'long'
,
'l'
)
# (buf, len)
InBuffer
=
VarInputBufferType
(
'char'
,
'long'
,
'l'
)
# (buf, len)
OptionalInBuffer
=
OptionalVarInputBufferType
(
'char'
,
'long'
,
'l'
)
# (buf, len)
InOutBuffer
=
HeapInputOutputBufferType
(
'char'
,
'long'
,
'l'
)
# (inbuf, outbuf, len)
InOutBuffer
=
HeapInputOutputBufferType
(
'char'
,
'long'
,
'l'
)
# (inbuf, outbuf, len)
VarInOutBuffer
=
VarHeapInputOutputBufferType
(
'char'
,
'long'
,
'l'
)
# (inbuf, outbuf, &len)
VarInOutBuffer
=
VarHeapInputOutputBufferType
(
'char'
,
'long'
,
'l'
)
# (inbuf, outbuf, &len)
...
...
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