Plan 9 from Bell Labs’s /usr/web/sources/contrib/de0u/root/sys/src/cmd/squeak/Cross/plugins/Mpeg3Plugin/JMMMpegPluginBuffer.1.cs

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


'From Squeak3.8 of ''5 May 2005'' [latest update: #6665] on 26 February 2006 at 1:16:10 pm'!

!Mpeg3Plugin methodsFor: 'primitives' stamp: 'JMM 1/20/2006 19:07'!
primitiveMPEG3CheckSig: path
	| result sz storage |

	"int mpeg3_check_sig(char *path)"
	self var: #storage declareC: 'char storage[1024] '.
	self primitive: 'primitiveMPEG3CheckSig'
		parameters: #(String).
	sz _ interpreterProxy byteSizeOf: path cPtrAsOop.
	self cCode: 'sqFilenameFromStringOpen(storage, path, sz)'.
	self cCode: 'result = mpeg3_check_sig(storage)'.
	^result asOop: Boolean
! !

!Mpeg3Plugin methodsFor: 'primitives' stamp: 'JMM 1/20/2006 18:38'!
primitiveMPEG3OpenABuffer: path size: size
	| mpeg3Oop index |

	self var: #index declareC: 'mpeg3_t ** index'.
	self primitive: 'primitiveMPEG3OpenABuffer'
		parameters: #(String SmallInteger).
	mpeg3Oop := interpreterProxy instantiateClass: interpreterProxy classByteArray
					indexableSize: 4.	
	index := self cCoerce: (interpreterProxy firstIndexableField: mpeg3Oop)
						to: 'mpeg3_t **'.
	self cCode: '*index = mpeg3_open(path,size); makeFileEntry(*index)'.
	^mpeg3Oop.
! !

!Mpeg3Plugin methodsFor: 'primitives' stamp: 'JMM 1/20/2006 19:11'!
primitiveMPEG3Open: path
	| mpeg3Oop index sz storage |

	"mpeg3_t* mpeg3_open(char *path)"
	self var: #index declareC: 'mpeg3_t ** index'.
	self var: #storage declareC: 'char storage[1024]'.
	self primitive: 'primitiveMPEG3Open'
		parameters: #(String).
	sz := interpreterProxy byteSizeOf: path cPtrAsOop.
	self cCode: 'sqFilenameFromStringOpen(storage, path, sz)'.
	mpeg3Oop := interpreterProxy instantiateClass: interpreterProxy classByteArray
					indexableSize: 4.
	index := self cCoerce: (interpreterProxy firstIndexableField: mpeg3Oop)
						to: 'mpeg3_t **'.
	self cCode: '*index = mpeg3_open(storage,0); makeFileEntry(*index)'.
	^mpeg3Oop.
! !


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.