TYPEDEF: alien.c-types:float type-2
-: indirect ( x y ptr -- z )
+: indirect ( x y ptr -- z )
type-3 { type-2 type-2 } cdecl alien-indirect ;
{ } [
<PRIVATE
SYMBOL: lit-dict
-SYMBOL: dist-dict
+SYMBOL: dist-dict
SYMBOL: lit-vec
! LZ77 compression
:: create-pair ( ind seq -- array )
ind seq longest-prefix :> ( start end )
end ind - :> n
- n 3 <
+ n 3 <
[ ind seq nth ]
[ n ind start - 2array ]
if ;
: sum-vec ( vec -- n )
- [ dup array? [ first ] [ drop 1 ] if ] map-sum ;
+ [ dup array? [ first ] [ drop 1 ] if ] map-sum ;
:: compress-lz77 ( seq -- vec )
0 seq create-pair seq length <vector> ?push [ dup sum-vec seq length < ] [ dup sum-vec seq create-pair swap ?push ] while ;
{ [ dup 4097 < ] [ [ 2049 - 1024 /i 22 + ] [ 2049 - 1024 mod 10 <bits> >bit-array ] bi 2array ] }
{ [ dup 8193 < ] [ [ 4097 - 2048 /i 24 + ] [ 4097 - 2048 mod 11 <bits> >bit-array ] bi 2array ] }
{ [ dup 16385 < ] [ [ 8193 - 4096 /i 26 + ] [ 8193 - 4096 mod 12 <bits> >bit-array ] bi 2array ] }
- [ [ 8193 - 4096 /i 28 + ] [ 8193 - 4096 mod 13 <bits> >bit-array ] bi 2array ]
+ [ [ 8193 - 4096 /i 28 + ] [ 8193 - 4096 mod 13 <bits> >bit-array ] bi 2array ]
}
cond ;
-
+
! Words for transforming our vector of (length, distance) pairs and bytes into literals using above table
: pair-to-code ( pr -- code )
[ first length-to-code ] [ second dist-to-code ] bi 2array ;
: vec-to-lits ( vec -- vec )
- [ dup array? [ pair-to-code ] [ ] if ] map ;
+ [ dup array? [ pair-to-code ] [ ] if ] map ;
! Words for using the fixed Huffman code to map literals to bit arrays
! This is the table in section 3.2.6
-: (lit-to-bits) ( lit -- bitarr )
+: (lit-to-bits) ( lit -- bitarr )
{
{ [ dup 144 < ] [ 48 + 8 <bits> >bit-array reverse ] }
{ [ dup 256 < ] [ 144 - 400 + 9 <bits> >bit-array reverse ] }
: lit-to-bits ( lit -- bits )
dup array? [ [ first (lit-to-bits) ] [ second ] bi 2array ] [ (lit-to-bits) ] if ;
-
+
: pair-to-bits ( l,d -- bits )
[ first lit-to-bits ] [ second dist-to-bits ] bi 2array ;
[ dup array? [ pair-to-bits ] [ (lit-to-bits) ] if ] map ;
-! fixed huffman compression function
+! fixed huffman compression function
: (compress-fixed) ( bytes -- bits )
compress-lz77 vec-to-lits vec-to-bits ;
! Use the given dictionary to replace the element with its code
-:: replace-one ( ele code-dict -- new-ele )
+:: replace-one ( ele code-dict -- new-ele )
ele array? [ ele first code-dict at ele second 2array ] [ ele code-dict at ] if ;
! replace both elements of a length distance pair with their codes
-: replace-pair ( pair -- new-pair )
+: replace-pair ( pair -- new-pair )
[ first lit-dict get replace-one ] [ second dist-dict get replace-one ] bi 2array ;
-
+
! Replace all vector elements with their codes
: vec-to-codes ( vec -- new-vec )
[ dup array? [ replace-pair ] [ lit-dict get replace-one ] if ] map ;
: dist-code-lens ( -- len-seq )
31 [0..b] [ dist-dict get at length ] map [ zero? ] trim-tail ;
-:: replace-0-single ( m len-seq -- new-len-seq )
+:: replace-0-single ( m len-seq -- new-len-seq )
m 11 < [ len-seq m 0 <array> 17 m 3 - 3 <bits> >bit-array 2array 1array replace ]
- [ len-seq m 0 <array> 18 m 11 - 7 <bits> >bit-array 2array 1array replace ]
+ [ len-seq m 0 <array> 18 m 11 - 7 <bits> >bit-array 2array 1array replace ]
if ;
:: replace-0-range ( range len-seq -- new-len-seq )
2 139 (a..b) swap replace-0-range ;
:: replace-runs ( n len-seq -- new-len-seq )
- len-seq 7 n <array> { n { 16 ?{ t t } } } replace
- 6 n <array> { n { 16 ?{ f t } } } replace
- 5 n <array> { n { 16 ?{ t f } } } replace
+ len-seq 7 n <array> { n { 16 ?{ t t } } } replace
+ 6 n <array> { n { 16 ?{ f t } } } replace
+ 5 n <array> { n { 16 ?{ t f } } } replace
4 n <array> { n { 16 ?{ f f } } } replace ;
:: replace-all-runs ( range len-seq -- new-len-seq )
: run-free-dist ( -- len-seq )
0 31 [a..b] dist-code-lens replace-0 replace-all-runs ;
-
+
: run-free-codes ( -- len-seq )
run-free-lit run-free-dist append ;
: clen-bits ( -- bit-arr )
clen-seq [ 3 <bits> >bit-array ] map ;
-
+
: h-lit ( -- bit-arr )
lit-code-lens length 257 - 5 <bits> >bit-array ;
{ compressed-data vector } ;
! Compresses a block with dynamic huffman compression, outputting a nested array structure
-: (compress-dynamic) ( lit-seq -- bit-arr-seq )
- [ dup compress-lz77 vec-to-lits { 256 } append lit-vec set
- lit-vec get build-dicts
- dist-dict set
+: (compress-dynamic) ( lit-seq -- bit-arr-seq )
+ [ dup compress-lz77 vec-to-lits { 256 } append lit-vec set
+ lit-vec get build-dicts
+ dist-dict set
lit-dict set
- lit-code-lens supremum 16 < clen-seq supremum 8 < and
- [ drop dynamic-headers clen-bits compressed-lens
+ lit-code-lens supremum 16 < clen-seq supremum 8 < and
+ [ drop dynamic-headers clen-bits compressed-lens
lit-vec get vec-to-codes deflate-block boa ]
- [ halves [ (compress-dynamic) ] bi@ 2array ] if
+ [ halves [ (compress-dynamic) ] bi@ 2array ] if
] with-scope ;
-
+
: flatten-single ( ele -- bits )
dup array? [ concat ] when ;
: flatten-lens ( compressed-lens -- bits )
- [ flatten-single ] map concat ;
+ [ flatten-single ] map concat ;
-: flatten-pair ( pair -- bits )
- dup array? [ [ first flatten-single ] [ second flatten-single ] bi append ] when ;
+: flatten-pair ( pair -- bits )
+ dup array? [ [ first flatten-single ] [ second flatten-single ] bi append ] when ;
-: flatten-block ( bit-arr-seq -- byte-array )
+: flatten-block ( bit-arr-seq -- byte-array )
{ [ headers>> ] [ clen>> concat ] [ compressed-lens>> flatten-lens ] [ compressed-data>> [ flatten-pair ] map concat ] } cleave 4array concat ;
-: flatten-blocks ( blocks -- byte-array )
- [ flatten-block ] map unclip-last [ [ ?{ f } prepend ] map ] dip ?{ t } prepend suffix concat ;
+: flatten-blocks ( blocks -- byte-array )
+ [ flatten-block ] map unclip-last [ [ ?{ f } prepend ] map ] dip ?{ t } prepend suffix concat ;
PRIVATE>
-
+
: compress-dynamic ( byte-array -- byte-array )
(compress-dynamic) [ deflate-block? ] deep-filter flatten-blocks underlying>> gzip-header prepend B{ 0 0 } append ;
: gen-leaves ( lit-seq -- leaves )
[ huffman-tree new swap >>code ] map ;
-: build-leaf-table ( leaves -- )
+: build-leaf-table ( leaves -- )
dup empty? [ drop ] [ dup first leaf-table get inc-at rest build-leaf-table ] if ;
: insert-leaves ( -- ) leaf-table get unzip swap zip node-heap get heap-push-all ;
: read-until-terminated ( data -- data )
[ dup 8 swap bs:read 0 = ] [ ] until ;
-:: interpret-flag ( flg data -- )
+:: interpret-flag ( flg data -- )
27 data bs:seek
flg first 1 = [ 8 data bs:read data bs:seek ] when
flg second 1 = [ data read-until-terminated drop ] when
! LDRAA, LDRAB: Load Register, with pointer authentication.
! ARMv8.3
-ARM-INSTRUCTION: LDRAAoff-encode ( 11 111 0 00 0 S 1 imm9 0 1 Rn Rt -- )
-ARM-INSTRUCTION: LDRAApre-encode ( 11 111 0 00 0 S 1 imm9 1 1 Rn Rt -- )
-ARM-INSTRUCTION: LDRABoff-encode ( 11 111 0 00 1 S 1 imm9 0 1 Rn Rt -- )
-ARM-INSTRUCTION: LDRABpre-encode ( 11 111 0 00 1 S 1 imm9 1 1 Rn Rt -- )
+ARM-INSTRUCTION: LDRAAoff-encode ( 11 111 0 00 0 S 1 imm9 0 1 Rn Rt -- )
+ARM-INSTRUCTION: LDRAApre-encode ( 11 111 0 00 0 S 1 imm9 1 1 Rn Rt -- )
+ARM-INSTRUCTION: LDRABoff-encode ( 11 111 0 00 1 S 1 imm9 0 1 Rn Rt -- )
+ARM-INSTRUCTION: LDRABpre-encode ( 11 111 0 00 1 S 1 imm9 1 1 Rn Rt -- )
! LDRB (immediate): Load Register Byte (immediate).
ARM-INSTRUCTION: LDRBpost-encode ( 00 111 0 00 01 0 imm9 01 Rn Rt -- )
ARM-INSTRUCTION: LDRHuoff-encode ( 01 111 0 01 01 imm12 Rn Rt -- )
! LDRH (register): Load Register Halfword (register).
-ARM-INSTRUCTION: LDRHr-encode ( 01 111 0 00 01 1 Rm option3 S 10 Rn Rt -- )
+ARM-INSTRUCTION: LDRHr-encode ( 01 111 0 00 01 1 Rm option3 S 10 Rn Rt -- )
! LDRSB (immediate): Load Register Signed Byte (immediate).
ARM-INSTRUCTION: LDRSBpost32-encode ( 00 111 0 00 11 0 imm9 01 Rn Rt -- )
: parameter-names&types ( callable -- names types )
[ [ parameter-c-type ] map ] [ [ parameter-name ] map ] bi ;
-: def-function ( function -- )
+: def-function ( function -- )
{
[ return>> return-c-type ]
[ identifier>> ]
[ drop "in" >>direction "none" >>transfer-ownership ]
} cleave ;
-:: def-method ( method type -- )
+:: def-method ( method type -- )
method {
[ return>> return-c-type ]
[ identifier>> ]
files files-free files-available
name-max flags id ;
-HOOK: new-file-system-info os ( -- file-system-info )
+HOOK: new-file-system-info os ( -- file-system-info )
M: unix new-file-system-info unix-file-system-info new ;
{ CHAR: t [ "rue" pick json-expect t suffix! ] }
{ CHAR: f [ "alse" pick json-expect f suffix! ] }
{ CHAR: n [ "ull" pick json-expect json-null suffix! ] }
- [ pick json-number [ suffix! ] dip [ scan ] when* ]
+ [ pick json-number [ suffix! ] dip [ scan ] when* ]
} case ;
: json-read-input ( stream -- objects )
json-depth get zero? [ json-error ] unless
] with-variable ;
-: get-json ( objects -- obj )
+: get-json ( objects -- obj )
dup length 1 = [ first ] [ json-error ] if ;
PRIVATE>
M: string stream-json-print
CHAR: \" over stream-write1 swap [
{
- { CHAR: \" [ "\\\"" over stream-write ] }
+ { CHAR: \" [ "\\\"" over stream-write ] }
{ CHAR: \\ [ "\\\\" over stream-write ] }
{ CHAR: / [
json-escape-slashes? get
MIXIN: list
GENERIC: car ( cons -- car )
GENERIC: cdr ( cons -- cdr )
-GENERIC: nil? ( object -- ? )
+GENERIC: nil? ( object -- ? )
TUPLE: cons-state { car read-only } { cdr read-only } ;
<PRIVATE
-: trim-points ( p seq -- from to seq )
+: trim-points ( p seq -- from to seq )
[ length [ * >integer ] keep over - ] keep ;
PRIVATE>
GL-FUNCTION: void glBindAttribLocation { glBindAttribLocationARB } ( GLuint program, GLuint index, GLstring name )
GL-FUNCTION: void glBlendEquationSeparate { glBlendEquationSeparateEXT } ( GLenum modeRGB, GLenum modeAlpha )
GL-FUNCTION: void glCompileShader { glCompileShaderARB } ( GLuint shader )
-GL-FUNCTION: GLuint glCreateProgram { glCreateProgramObjectARB } ( )
+GL-FUNCTION: GLuint glCreateProgram { glCreateProgramObjectARB } ( )
GL-FUNCTION: GLuint glCreateShader { glCreateShaderObjectARB } ( GLenum type )
GL-FUNCTION: void glDeleteProgram { glDeleteObjectARB } ( GLuint program )
GL-FUNCTION: void glDeleteShader { glDeleteObjectARB } ( GLuint shader )
FUNCTION: int BIO_puts ( BIO* bio, c-string buf )
-FUNCTION: ulong ERR_get_error ( )
+FUNCTION: ulong ERR_get_error ( )
FUNCTION: void ERR_clear_error ( )
FUNCTION: c-string ERR_error_string ( ulong e, void* buf )
-FUNCTION: void* BIO_f_buffer ( )
+FUNCTION: void* BIO_f_buffer ( )
! ===============================================
! evp.h
! ------------------------------------------------------------------------------
! API < 1.1.0, removed in new versions
! ------------------------------------------------------------------------------
-FUNCTION: void OpenSSL_add_all_ciphers ( )
-FUNCTION: void OpenSSL_add_all_digests ( )
+FUNCTION: void OpenSSL_add_all_ciphers ( )
+FUNCTION: void OpenSSL_add_all_digests ( )
FUNCTION: EVP_MD_CTX* EVP_MD_CTX_create ( )
FUNCTION: void EVP_MD_CTX_destroy ( EVP_MD_CTX* ctx )
! ------------------------------------------------------------------------------
! Clean them up before exiting
-FUNCTION: void EVP_cleanup ( )
+FUNCTION: void EVP_cleanup ( )
FUNCTION: EVP_MD* EVP_get_digestbyname ( c-string name )
! API < 1.1.0, removed in new versions
! ------------------------------------------------------------------------------
! Initialization functions
-FUNCTION: int SSL_library_init ( )
+FUNCTION: int SSL_library_init ( )
! Maps OpenSSL errors to strings
-FUNCTION: void SSL_load_error_strings ( )
+FUNCTION: void SSL_load_error_strings ( )
! ------------------------------------------------------------------------------
! Sets the default SSL version
-FUNCTION: ssl-method SSLv2_client_method ( )
-FUNCTION: ssl-method SSLv23_client_method ( )
-FUNCTION: ssl-method SSLv23_server_method ( )
-FUNCTION: ssl-method SSLv23_method ( ) ! SSLv3 but can rollback to v2
-FUNCTION: ssl-method SSLv3_client_method ( )
-FUNCTION: ssl-method SSLv3_server_method ( )
-FUNCTION: ssl-method SSLv3_method ( )
-FUNCTION: ssl-method TLSv1_client_method ( )
-FUNCTION: ssl-method TLSv1_server_method ( )
-FUNCTION: ssl-method TLSv1_method ( )
-FUNCTION: ssl-method TLSv1_1_method ( )
-FUNCTION: ssl-method TLSv1_2_method ( )
+FUNCTION: ssl-method SSLv2_client_method ( )
+FUNCTION: ssl-method SSLv23_client_method ( )
+FUNCTION: ssl-method SSLv23_server_method ( )
+FUNCTION: ssl-method SSLv23_method ( ) ! SSLv3 but can rollback to v2
+FUNCTION: ssl-method SSLv3_client_method ( )
+FUNCTION: ssl-method SSLv3_server_method ( )
+FUNCTION: ssl-method SSLv3_method ( )
+FUNCTION: ssl-method TLSv1_client_method ( )
+FUNCTION: ssl-method TLSv1_server_method ( )
+FUNCTION: ssl-method TLSv1_method ( )
+FUNCTION: ssl-method TLSv1_1_method ( )
+FUNCTION: ssl-method TLSv1_2_method ( )
CONSTANT: DTLS1_VERSION_MAJOR 0xfe
CONSTANT: SSL3_VERSION_MAJOR 0x03
FUNCTION: void SSL_SESSION_free ( SSL_SESSION* ses )
FUNCTION: void RAND_seed ( void* buf, int num )
-FUNCTION: void* BIO_f_ssl ( )
+FUNCTION: void* BIO_f_ssl ( )
! ------------------------------------------------------------------------------
! SSL
: test-root ( root -- ) "" vocabs-to-load test-vocabs ;
-: refresh-and-test ( prefix -- ) to-refresh [ do-refresh ] keepdd test-vocabs ;
+: refresh-and-test ( prefix -- ) to-refresh [ do-refresh ] keepdd test-vocabs ;
: refresh-and-test-all ( -- ) "" refresh-and-test ;
<PRIVATE
-:: next-item ( menu dir -- )
+:: next-item ( menu dir -- )
menu [ items>> ] [ control-value ] bi :> ( items curr )
curr [
items length :> max
}
FUNCTION: int inotify_init ( )
-FUNCTION: int inotify_add_watch ( int fd, c-string name, uint mask )
+FUNCTION: int inotify_add_watch ( int fd, c-string name, uint mask )
FUNCTION: int inotify_rm_watch ( int fd, uint wd )
HRESULT GetVertexShaderConstantF ( UINT StartRegister, float* pConstantData, UINT Vector4fCount )
HRESULT SetVertexShaderConstantI ( UINT StartRegister, int* pConstantData, UINT Vector4iCount )
HRESULT GetVertexShaderConstantI ( UINT StartRegister, int* pConstantData, UINT Vector4iCount )
- HRESULT SetVertexShaderConstantB ( UINT StartRegister, BOOL* pConstantData, UINT BoolCount )
+ HRESULT SetVertexShaderConstantB ( UINT StartRegister, BOOL* pConstantData, UINT BoolCount )
HRESULT GetVertexShaderConstantB ( UINT StartRegister, BOOL* pConstantData, UINT BoolCount )
HRESULT SetStreamSource ( UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride )
HRESULT GetStreamSource ( UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* pOffsetInBytes, UINT* pStride )
HRESULT GetPixelShaderConstantF ( UINT StartRegister, float* pConstantData, UINT Vector4fCount )
HRESULT SetPixelShaderConstantI ( UINT StartRegister, int* pConstantData, UINT Vector4iCount )
HRESULT GetPixelShaderConstantI ( UINT StartRegister, int* pConstantData, UINT Vector4iCount )
- HRESULT SetPixelShaderConstantB ( UINT StartRegister, BOOL* pConstantData, UINT BoolCount )
+ HRESULT SetPixelShaderConstantB ( UINT StartRegister, BOOL* pConstantData, UINT BoolCount )
HRESULT GetPixelShaderConstantB ( UINT StartRegister, BOOL* pConstantData, UINT BoolCount )
HRESULT DrawRectPatch ( UINT Handle, float* pNumSegs, D3DRECTPATCH_INFO* pRectPatchInfo )
HRESULT DrawTriPatch ( UINT Handle, float* pNumSegs, D3DTRIPATCH_INFO* pTriPatchInfo )
FUNCTION: HRESULT Direct3DCreate9Ex ( UINT SDKVersion, IDirect3D9Ex** out )
COM-INTERFACE: IDirect3D9Ex IDirect3D9 {02177241-69FC-400C-8FF1-93A44DF6861D}
- UINT GetAdapterModeCountEx ( UINT Adapter, D3DDISPLAYMODEFILTER* pFilter )
+ UINT GetAdapterModeCountEx ( UINT Adapter, D3DDISPLAYMODEFILTER* pFilter )
HRESULT EnumAdapterModesEx ( UINT Adapter, D3DDISPLAYMODEFILTER* pFilter, UINT Mode, D3DDISPLAYMODEEX* pMode )
HRESULT GetAdapterDisplayModeEx ( UINT Adapter, D3DDISPLAYMODEEX* pMode, D3DDISPLAYROTATION* pRotation )
HRESULT CreateDeviceEx ( UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, D3DDISPLAYMODEEX* pFullscreenDisplayMode, IDirect3DDevice9Ex** ppReturnedDeviceInterface )
UINT VertexCount,
UINT FaceCount,
UINT Options,
- ID3DX10Mesh** ppMesh )
+ ID3DX10Mesh** ppMesh )
CONSTANT: D3DX10_MESHOPT_COMPACT 0x01000000
CONSTANT: D3DX10_MESHOPT_ATTR_SORT 0x02000000
UINT GetNumVertices ( )
UINT GetNumBones ( )
UINT GetMaxBoneInfluences ( )
- HRESULT AddVertices ( UINT Count )
+ HRESULT AddVertices ( UINT Count )
HRESULT RemapVertices ( UINT NewVertexCount, UINT* pVertexRemap )
HRESULT AddBones ( UINT Count )
HRESULT RemoveBone ( UINT Index )
HRESULT Pop ( )
HRESULT Push ( )
HRESULT LoadIdentity ( )
- HRESULT LoadMatrix ( D3DXMATRIX* pM )
- HRESULT MultMatrix ( D3DXMATRIX* pM )
- HRESULT MultMatrixLocal ( D3DXMATRIX* pM )
+ HRESULT LoadMatrix ( D3DXMATRIX* pM )
+ HRESULT MultMatrix ( D3DXMATRIX* pM )
+ HRESULT MultMatrixLocal ( D3DXMATRIX* pM )
HRESULT RotateAxis ( D3DXVECTOR3* pV, FLOAT Angle )
HRESULT RotateAxisLocal ( D3DXVECTOR3* pV, FLOAT Angle )
HRESULT RotateYawPitchRoll ( FLOAT Yaw, FLOAT Pitch, FLOAT Roll )
HRESULT RotateYawPitchRollLocal ( FLOAT Yaw, FLOAT Pitch, FLOAT Roll )
HRESULT Scale ( FLOAT x, FLOAT y, FLOAT z )
HRESULT ScaleLocal ( FLOAT x, FLOAT y, FLOAT z )
- HRESULT Translate ( FLOAT x, FLOAT y, FLOAT z )
+ HRESULT Translate ( FLOAT x, FLOAT y, FLOAT z )
HRESULT TranslateLocal ( FLOAT x, FLOAT y, FLOAT z )
D3DXMATRIX* GetTop ( ) ;
: XACT_CUESTATE_PAUSED ( -- z ) XACT_STATE_PAUSED ; inline
COM-INTERFACE: IXACT3Cue f {00000000-0000-0000-0000-000000000000}
- HRESULT Play ( )
+ HRESULT Play ( )
HRESULT Stop ( DWORD dwFlags )
HRESULT GetState ( DWORD* pdwState )
- HRESULT Destroy ( )
+ HRESULT Destroy ( )
HRESULT SetMatrixCoefficients ( UINT32 uSrcChannelCount, UINT32 uDstChannelCount, float* pMatrixCoefficients )
XACTVARIABLEINDEX GetVariableIndex ( PCSTR szFriendlyName )
HRESULT SetVariable ( XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue )
HRESULT GetRendererDetails ( XACTINDEX nRendererIndex, LPXACT_RENDERER_DETAILS pRendererDetails )
HRESULT GetFinalMixFormat ( WAVEFORMATEXTENSIBLE* pFinalMixFormat )
HRESULT Initialize ( XACT_RUNTIME_PARAMETERS* pParams )
- HRESULT ShutDown ( )
- HRESULT DoWork ( )
+ HRESULT ShutDown ( )
+ HRESULT DoWork ( )
HRESULT CreateSoundBank ( void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, IXACT3SoundBank** ppSoundBank )
HRESULT CreateInMemoryWaveBank ( void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, IXACT3WaveBank** ppWaveBank )
HRESULT CreateStreamingWaveBank ( XACT_WAVEBANK_STREAMING_PARAMETERS* pParms, IXACT3WaveBank** ppWaveBank )
UINT32 Flags
UINT32 DeviceIndex,
XAUDIO2_EFFECT_CHAIN* pEffectChain )
- HRESULT StartEngine ( )
- void StopEngine ( )
+ HRESULT StartEngine ( )
+ void StopEngine ( )
HRESULT CommitChanges ( UINT32 OperationSet )
void GetPerformanceData ( XAUDIO2_PERFORMANCE_DATA* pPerfData )
void SetDebugConfiguration ( XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration, void* pReserved ) ;
UINT32 SourceChannels,
UINT32 DestinationChannels,
FLOAT* pLevelMatrix,
- UINT32 OperationSet )
+ UINT32 OperationSet )
void GetOutputMatrix (
IXAudio2Voice* pDestinationVoice,
UINT32 SourceChannels,
UINT32 DestinationChannels,
FLOAT* pLevelMatrix )
- void DestroyVoice ( ) ;
+ void DestroyVoice ( ) ;
COM-INTERFACE: IXAudio2SourceVoice IXAudio2Voice {00000000-0000-0000-0000-000000000000}
HRESULT Start ( UINT32 Flags, UINT32 OperationSet )
COM-INTERFACE: IXAudio2MasteringVoice IXAudio2Voice {00000000-0000-0000-0000-000000000000} ;
COM-INTERFACE: IXAudio2EngineCallback f {00000000-0000-0000-0000-000000000000}
- void OnProcessingPassStart ( )
- void OnProcessingPassEnd ( )
+ void OnProcessingPassStart ( )
+ void OnProcessingPassEnd ( )
void OnCriticalError ( HRESULT Error ) ;
COM-INTERFACE: IXAudio2VoiceCallback f {00000000-0000-0000-0000-000000000000}
void OnVoiceProcessingPassStart ( UINT32 BytesRequired )
- void OnVoiceProcessingPassEnd ( )
- void OnStreamEnd ( )
+ void OnVoiceProcessingPassEnd ( )
+ void OnStreamEnd ( )
void OnBufferStart ( void* pBufferContext )
void OnBufferEnd ( void* pBufferContext )
void OnLoopEnd ( void* pBufferContext )
windows.types ;
IN: windows.processes
-: with-open-process ( access 1/0 processid quot -- )
+: with-open-process ( access 1/0 processid quot -- )
[ OpenProcess dup win32-error=0/f ] dip
'[ _ <win32-handle> &dispose @ ] with-destructors ; inline
[ ] >>resumecc
exitcc>> continue-with ;
-: coreset ( v -- )
+: coreset ( v -- )
current-coro get dup
originalcc>> >>resumecc
exitcc>> continue-with ;
:: find-all-rows ( board quot -- index row )
board cells>> [ quot find swap drop ] find-all ; inline
-: is-empty? ( cell -- ? )
+: is-empty? ( cell -- ? )
{ } = ;
: cell-contains? ( cell object -- ? )
LIBRARY: glfw
-FUNCTION: void* glfwGetCurrentContext ( )
+FUNCTION: void* glfwGetCurrentContext ( )
FUNCTION: void glfwMakeContextCurrent ( void* window )
TYPEDEF: char[37] uuid_string_t
-FUNCTION: int mbr_uuid_to_string ( uuid_t uu, c-string string )
+FUNCTION: int mbr_uuid_to_string ( uuid_t uu, c-string string )
[ key>> make-string ]
[ value>> make-string ] 2tri ldcache-entry boa ;
-: parse ( -- entries )
+: parse ( -- entries )
! Read the old header and jump past it.
HeaderOld read-struct
[
stack name unmatched-closing-tag-error
] if* ;
-: lex-html ( stack n string -- stack n' string )
+: lex-html ( stack n string -- stack n' string )
"<" slice-til-either {
{ CHAR: < [
1 split-slice-back [ >string f like [ reach push ] when* ] dip
get-nonce [ "nonce" set-cmd-opt ] [ ] bi
calculate-key-digest "key" set-cmd-opt ; inline
-: perform-authentication ( -- )
+: perform-authentication ( -- )
authenticate-cmd make-cmd
build-auth-cmd send-cmd
check-ok [ drop ] [ throw ] if ; inline
[ split-host-str <inet> f <mdb-node> >>remote ] when* drop
] 2bi ;
-: check-node ( mdb node -- )
+: check-node ( mdb node -- )
[ <mdb-connection> &dispose ] dip
[ [ open-connection ] [ 3drop f ] recover ] keep swap
[ [ get-ismaster eval-ismaster-result ] with-connection ] [ drop ] if* ;
CONSTANT: width 256
CONSTANT: height 256
-: <nehe2-gadget> ( -- gadget )
+: <nehe2-gadget> ( -- gadget )
nehe2-gadget new ;
M: nehe2-gadget draw-gadget* ( gadget -- )
CONSTANT: width 256
CONSTANT: height 256
-: <nehe3-gadget> ( -- gadget )
+: <nehe3-gadget> ( -- gadget )
nehe3-gadget new ;
M: nehe3-gadget draw-gadget* ( gadget -- )
CONSTANT: height 256
: redraw-interval ( -- dt ) 10 milliseconds ;
-: <nehe4-gadget> ( -- gadget )
+: <nehe4-gadget> ( -- gadget )
nehe4-gadget new
0.0 >>rtri
0.0 >>rquad ;
CONSTANT: height 256
: redraw-interval ( -- dt ) 10 milliseconds ;
-: <nehe5-gadget> ( -- gadget )
+: <nehe5-gadget> ( -- gadget )
nehe5-gadget new
0.0 >>rtri
0.0 >>rquad ;
SQL-HANDLE-STMT swap SQLFreeHandle
succeeded? [ "odbc-free-statement failed" throw ] unless ;
-: odbc-execute ( statement -- )
+: odbc-execute ( statement -- )
SQLExecute succeeded? [ "odbc-execute failed" throw ] unless ;
: odbc-next-row ( statement -- bool )
FUNCTION: ALint alGetInteger ( ALenum param )
FUNCTION: ALfloat alGetFloat ( ALenum param )
FUNCTION: ALdouble alGetDouble ( ALenum param )
-FUNCTION: ALenum alGetError ( )
+FUNCTION: ALenum alGetError ( )
FUNCTION: ALboolean alIsExtensionPresent ( ALchar* extname )
FUNCTION: void* alGetProcAddress ( ALchar* fname )
FUNCTION: ALenum alGetEnumValue ( ALchar* ename )
FUNCTION: cl_int clGetDeviceIDs ( cl_platform_id platform, cl_device_type device_type, cl_uint num_entries, cl_device_id* devices, cl_uint* num_devices )
FUNCTION: cl_int clGetDeviceInfo ( cl_device_id device, cl_device_info param_name, size_t param_value_size, void* param_value, size_t* param_value_size_ret )
CALLBACK: void cl_create_context_cb ( char* a, void* b, size_t s, void* c )
-FUNCTION: cl_context clCreateContext ( cl_context_properties* properties, cl_uint num_devices, cl_device_id* devices, cl_create_context_cb pfn_notify, void* user_data, cl_int* errcode_ret )
+FUNCTION: cl_context clCreateContext ( cl_context_properties* properties, cl_uint num_devices, cl_device_id* devices, cl_create_context_cb pfn_notify, void* user_data, cl_int* errcode_ret )
FUNCTION: cl_context clCreateContextFromType ( cl_context_properties* properties, cl_device_type device_type, cl_create_context_cb pfn_notify, void* user_data, cl_int* errcode_ret )
FUNCTION: cl_int clRetainContext ( cl_context context )
FUNCTION: cl_int clReleaseContext ( cl_context context )
FUNCTION: cl_int clGetSamplerInfo ( cl_sampler sampler, cl_sampler_info param_name, size_t param_value_size, void* param_value, size_t* param_value_size_ret )
FUNCTION: cl_program clCreateProgramWithSource ( cl_context context, cl_uint count, char** strings, size_t* lengths, cl_int* errcode_ret )
FUNCTION: cl_program clCreateProgramWithBinary ( cl_context context, cl_uint num_devices, cl_device_id* device_list, size_t* lengths, char** binaries, cl_int* binary_status, cl_int* errcode_ret )
-FUNCTION: cl_int clRetainProgram ( cl_program program )
-FUNCTION: cl_int clReleaseProgram ( cl_program program )
+FUNCTION: cl_int clRetainProgram ( cl_program program )
+FUNCTION: cl_int clReleaseProgram ( cl_program program )
CALLBACK: void cl_build_program_cb ( cl_program program, void* user_data )
FUNCTION: cl_int clBuildProgram ( cl_program program, cl_uint num_devices, cl_device_id* device_list, char* options, cl_build_program_cb pfn_notify, void* user_data )
FUNCTION: cl_int clUnloadCompiler ( )
FUNCTION: cl_int clGetKernelWorkGroupInfo ( cl_kernel kernel, cl_device_id device, cl_kernel_work_group_info param_name, size_t param_value_size, void* param_value, size_t* param_value_size_ret )
FUNCTION: cl_int clWaitForEvents ( cl_uint num_events, cl_event* event_list )
FUNCTION: cl_int clGetEventInfo ( cl_event event, cl_event_info param_name, size_t param_value_size, void* param_value, size_t* param_value_size_ret )
-FUNCTION: cl_int clRetainEvent ( cl_event event )
-FUNCTION: cl_int clReleaseEvent ( cl_event event )
+FUNCTION: cl_int clRetainEvent ( cl_event event )
+FUNCTION: cl_int clReleaseEvent ( cl_event event )
FUNCTION: cl_int clGetEventProfilingInfo ( cl_event event, cl_profiling_info param_name, size_t param_value_size, void* param_value, size_t* param_value_size_ret )
FUNCTION: cl_int clFlush ( cl_command_queue command_queue )
FUNCTION: cl_int clFinish ( cl_command_queue command_queue )
FUNCTION: cl_int clEnqueueWriteImage ( cl_command_queue command_queue, cl_mem image, cl_bool blocking_write, size_t** origin, size_t** region, size_t input_row_pitch, size_t input_slice_pitch, void* ptr, cl_uint num_events_in_wait_list, cl_event* event_wait_list, cl_event* event )
FUNCTION: cl_int clEnqueueCopyImage ( cl_command_queue command_queue, cl_mem src_image, cl_mem dst_image, size_t** src_origin, size_t** dst_origin, size_t** region, cl_uint num_events_in_wait_list, cl_event* event_wait_list, cl_event* event )
FUNCTION: cl_int clEnqueueCopyImageToBuffer ( cl_command_queue command_queue, cl_mem src_image, cl_mem dst_buffer, size_t** src_origin, size_t** region, size_t dst_offset, cl_uint num_events_in_wait_list, cl_event* event_wait_list, cl_event* event )
-FUNCTION: cl_int clEnqueueCopyBufferToImage ( cl_command_queue command_queue, cl_mem src_buffer, cl_mem dst_image, size_t src_offset, size_t** dst_origin, size_t** region, cl_uint num_events_in_wait_list, cl_event* event_wait_list, cl_event* event )
-FUNCTION: void* clEnqueueMapBuffer ( cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_map, cl_map_flags map_flags, size_t offset, size_t cb, cl_uint num_events_in_wait_list, cl_event* event_wait_list, cl_event* event, cl_int* errcode_ret )
+FUNCTION: cl_int clEnqueueCopyBufferToImage ( cl_command_queue command_queue, cl_mem src_buffer, cl_mem dst_image, size_t src_offset, size_t** dst_origin, size_t** region, cl_uint num_events_in_wait_list, cl_event* event_wait_list, cl_event* event )
+FUNCTION: void* clEnqueueMapBuffer ( cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_map, cl_map_flags map_flags, size_t offset, size_t cb, cl_uint num_events_in_wait_list, cl_event* event_wait_list, cl_event* event, cl_int* errcode_ret )
FUNCTION: void* clEnqueueMapImage ( cl_command_queue command_queue, cl_mem image, cl_bool blocking_map, cl_map_flags map_flags, size_t** origin, size_t** region, size_t* image_row_pitch, size_t* image_slice_pitch, cl_uint num_events_in_wait_list, cl_event* event_wait_list, cl_event* event, cl_int* errcode_ret )
-FUNCTION: cl_int clEnqueueUnmapMemObject ( cl_command_queue command_queue, cl_mem memobj, void* mapped_ptr, cl_uint num_events_in_wait_list, cl_event* event_wait_list, cl_event* event )
-FUNCTION: cl_int clEnqueueNDRangeKernel ( cl_command_queue command_queue, cl_kernel kernel, cl_uint work_dim, size_t* global_work_offset, size_t* global_work_size, size_t* local_work_size, cl_uint num_events_in_wait_list, cl_event* event_wait_list, cl_event* event )
+FUNCTION: cl_int clEnqueueUnmapMemObject ( cl_command_queue command_queue, cl_mem memobj, void* mapped_ptr, cl_uint num_events_in_wait_list, cl_event* event_wait_list, cl_event* event )
+FUNCTION: cl_int clEnqueueNDRangeKernel ( cl_command_queue command_queue, cl_kernel kernel, cl_uint work_dim, size_t* global_work_offset, size_t* global_work_size, size_t* local_work_size, cl_uint num_events_in_wait_list, cl_event* event_wait_list, cl_event* event )
CALLBACK: void cl_enqueue_task_cb ( void* args )
FUNCTION: cl_int clEnqueueTask ( cl_command_queue command_queue, cl_kernel kernel, cl_uint num_events_in_wait_list, cl_event* event_wait_list, cl_event* event )
FUNCTION: cl_int clEnqueueNativeKernel ( cl_command_queue command_queue, cl_enqueue_task_cb user_func, void* args, size_t cb_args, cl_uint num_mem_objects, cl_mem* mem_list, void** args_mem_loc, cl_uint num_events_in_wait_list, cl_event* event_wait_list, cl_event* event )
! Bytes
FUNCTION: c-string PyBytes_AsString ( PyObject* string )
-FUNCTION: PyObject* PyBytes_FromStringAndSize ( c-string v, Py_ssize_t size )
+FUNCTION: PyObject* PyBytes_FromStringAndSize ( c-string v, Py_ssize_t size )
! Strings
FUNCTION: c-string PyUnicode_AsUTF8 ( PyObject* unicode )
-FUNCTION: PyObject* PyUnicode_FromStringAndSize ( c-string v, Py_ssize_t size )
+FUNCTION: PyObject* PyUnicode_FromStringAndSize ( c-string v, Py_ssize_t size )
FUNCTION: PyObject* PyUnicode_FromString ( c-string v )
! Ints
FUNCTION-ALIAS: get-time double GetTime ( ) ! Get elapsed time in seconds since InitWindow()
! Misc. functions
-FUNCTION-ALIAS: get-random-value int GetRandomValue ( int min, int max ) ! Get a random value between min and max (both included)
+FUNCTION-ALIAS: get-random-value int GetRandomValue ( int min, int max ) ! Get a random value between min and max (both included)
FUNCTION-ALIAS: set-random-seed void SetRandomSeed ( uint seed ) ! Set the seed for the random number generator
-FUNCTION-ALIAS: take-screenshot void TakeScreenshot ( c-string fileName ) ! Takes a screenshot of current screen (filename extension defines format)
+FUNCTION-ALIAS: take-screenshot void TakeScreenshot ( c-string fileName ) ! Takes a screenshot of current screen (filename extension defines format)
FUNCTION-ALIAS: set-config-flags void SetConfigFlags ( uint flags ) ! Setup init configuration flags (view FLAGS)
-! FUNCTION: void TraceLog ( int logLevel, c-string text, ... ) ! Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)
+! FUNCTION: void TraceLog ( int logLevel, c-string text, ... ) ! Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)
FUNCTION-ALIAS: set-trace-log-level void SetTraceLogLevel ( int logLevel ) ! Set the current threshold (minimum) log level
FUNCTION-ALIAS: mem-alloc void* MemAlloc ( int size ) ! Internal memory allocator
FUNCTION-ALIAS: mem-realloc void* MemRealloc ( void* ptr, int size ) ! Internal memory reallocator
: hgetall ( key -- ) 1array "HGETALL" write-command ;
: hincrby ( integer field key -- )
3array "HINCRBY" write-command ;
-: hincrbyfloat ( float field key -- )
+: hincrbyfloat ( float field key -- )
3array "HINCRBYFLOAT" write-command ;
: hkeys ( key -- ) 1array "HKEYS" write-command ;
: hlen ( key -- ) 1array "HLEN" write-command ;
-: hmget ( seq key -- ) prefix reverse "HMGET" write-command ;
+: hmget ( seq key -- ) prefix reverse "HMGET" write-command ;
: hmset ( assoc key -- )
[
>alist concat reverse
: redis-hget ( field key -- response ) hget flush read-response ;
: redis-hgetall ( key -- response ) hgetall flush read-response ;
: redis-hincrby ( integer field key -- response ) hincrby flush read-response ;
-: redis-hincrbyfloat ( float field key -- response ) hincrbyfloat flush read-response ;
+: redis-hincrbyfloat ( float field key -- response ) hincrbyfloat flush read-response ;
: redis-hkeys ( key -- response ) hkeys flush read-response ;
: redis-hlen ( key -- response ) hlen flush read-response ;
: redis-hmget ( seq key -- response ) hmget flush read-response ;
CONSTANT: SOUND-WALK4 7
CONSTANT: SOUND-UFO-HIT 8
-: init-sound ( index cpu filename -- )
+: init-sound ( index cpu filename -- )
absolute-path swapd [ sounds>> nth AL_BUFFER ] dip
create-buffer-from-wav set-source-param ;
: coin-down ( cpu -- )
[ 1 bitor ] change-port1 drop ;
-: coin-up ( cpu -- )
+: coin-up ( cpu -- )
[ 255 1 - bitand ] change-port1 drop ;
: player1-down ( cpu -- )
: (collect-with-previous) ( quot into -- quot' )
[ [ keep ] dip [ set-nth-unsafe ] keepdd ] 2curry ; inline
-: collect-with-previous ( n quot into -- )
+: collect-with-previous ( n quot into -- )
(collect-with-previous) each-integer-with-previous ; inline
: map-integers-with ( ... len quot: ( ... prev i -- ... elt ) exemplar -- ... newseq )