破晓 发表于 2014-12-30 00:24:43

AVM2.h API文档

Adobe Flash C++ Compiler (FlasCC)
A complete BSD-like C/C++ development environment with a GCC based cross-compiler capable of targeting the Adobe Flash Runtime.
C/C++ API ReferenceAVM2.h
The AVM2.h header file contains various low-level FlasCC-specific utility functions and macros.
FunctionDescription
__avm2_apply_args
#define __avm2_apply_args()Returns a pointer to data describing how to perform a call with the same arguments as were passed to the current function.For more information, see http://tigcc.ticalc.org/doc/gnuexts.html#SEC67
__avm2_apply
#define __avm2_apply(function, arguments, size)Invokes function with a copy of the parameters described by arguments and size.For more information, see http://tigcc.ticalc.org/doc/gnuexts.html#SEC67Parameters:
[*]function - The function to be invoked.
[*]arguments - The arguments to be passed. This should be the value returned by __avm2_apply_args().
[*]size - The number of bytes in the stack argument data.

__avm2_return
#define __avm2_return(result)Returns the value described by result from the containing function.Parameters:
[*]result - The value returned by __avm2_apply.

__builtin_va_arg_pack
#define __builtin_va_arg_packError. Not supported in FlasCC.
__builtin_va_arg_pack_len
#define __builtin_va_arg_pack_lenError. Not supported in FlasCC.
__builtin_apply_args
<span style="color: rgb(221, 17, 68); font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; line-height: 20px; white-space: nowrap; background-color: rgb(247, 247, 249);">__avm2_apply_args</span>overrides__builtin_apply_argsFor more information, see http://tigcc.ticalc.org/doc/gnuexts.html#SEC67.
__builtin_apply
<span style="color: rgb(221, 17, 68); font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; line-height: 20px; white-space: nowrap; background-color: rgb(247, 247, 249);">__avm2_apply</span>overrides__builtin_applyFor more information, see http://tigcc.ticalc.org/doc/gnuexts.html#SEC67.
__builtin_return
<span style="color: rgb(221, 17, 68); font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; line-height: 20px; white-space: nowrap; background-color: rgb(247, 247, 249);">__avm2_return</span>overrides__builtin_returnFor more information, see http://tigcc.ticalc.org/doc/gnuexts.html#SEC67.
avm2_locked_id
unsigned avm2_locked_id(unsigned *mtx);Returns the id of the lock owner. Low-level concurrency primitives -- expect hangs or worse if not used properly. Non-recursive mutexes.Parameters:
[*]mtx - ID of lock owner or 0.

avm2_lock
void avm2_lock(unsigned *mtx);Low-level concurrency primitives -- expect hangs or worse if not used properly. Non-recursive mutexes.Parameters:
[*]mtx - lock with thread id.

avm2_lock_id
void avm2_lock_id(unsigned *mtx, unsigned id);Low-level concurrency primitives -- expect hangs or worse if not used properly. Non-recursive mutexes.Parameters:
[*]mtx - lock with any non-0 value.
[*]id - lock owner id.

avm2_unlock
void avm2_unlock(unsigned *mtx);Super low-level concurrency primitives -- expect hangs or worse if not used properly. Non-recursive mutexes.Parameters:
[*]mtx - unlock.

Address token-based conditions
avm2_msleep
int avm2_msleep(void *addr, unsigned *mtx, int timo);Waits for addr to be woken for timo milliseconds (or forever if timo==0). Releases mutex on entry, re-acquired before return 0 on timeout, non-zero on wake.Parameters:
[*]addr - Sleep on address.
[*]mtx - Must be locked on entry.
[*]timo - Number of milliseconds this function waits for addr to be woken (forever if timo==0).

avm2_wake
int avm2_wake(void *addr);Wake any threads msleeping on addr, returns non-zero if a thread was woken.Parameters:
[*]addr - Address pointing to sleeping threads.
Example Usage:See the 09_pthreads sample
avm2_wake_one
int avm2_wake_one(void *addr);Wake zero (if none msleeping on addr) or one threads msleeping on addr, returns non-zero if any thread was woken.Parameters:
[*]addr - Address pointing to sleeping threads.

avm2_thr_impersonate
void *avm2_thr_impersonate(long tid, void *(*proc)(void *), void *arg);Call proc(arg) while impersonating the thread specified by tid.Parameters:
[*]tid - Long containing the thread to impersonate.
[*]proc - The function pointer.
[*]arg - The data to pass to the function pointer.

avm2_ui_thunk
void *avm2_ui_thunk(void *(*proc)(void *), void *arg);Call proc(arg) on the UI Worker as calling thread.Parameters:
[*]proc - The function pointer.
[*]arg - The data to pass to the function pointer.

avm2_is_ui_worker
int avm2_is_ui_worker();Returns non-zero if running on the UI Worker.
avm2_wait_for_ui_frame
int avm2_wait_for_ui_frame(int timo);Wait for a frame event or until timeout. Returns 0 on timeout.Parameters:
[*]timo - A timeout interval, in milliseconds.

avm2_self_lock
void avm2_self_lock();Lock this thread to this Worker -- recursive OK.
avm2_self_unlock
void avm2_self_unlock();Unlock this thread.
avm2_self_msleep
int avm2_self_msleep(void *addr, int timo);Works like avm2_msleep with mtx being "self" -- "self" must be locked using avm2_self_lock.Parameters:
[*]addr - Sleep on address.
[*]timo - Number of milliseconds this function waits for addr to be woken (forever if timo==0).
Example Usage:See the 09_pthreads sample
avm2_tramp_alloc
void *avm2_tramp_alloc(void *funPtr, int sret, void *arg0, void *arg1);Trampoline support. For more information, see sdk/usr/share/avm2_tramp.cpp.Parameters:
[*]funPtr - Function pointer.
[*]sret - Size of the structure return type for POD or the negative size of the structure for non-POD. Must be zero for a non-structure return type.
[*]arg0 - First argument.
[*]arg1 - Second argument.

avm2_tramp_free
void avm2_tramp_free(void *trampFunPtr);Trampoline support. For more information, see sdk/usr/share/avm2_tramp.cpp.Parameters:
[*]trampFunPtr - Function pointer to be freed.




相关链接:

[*]AS3.h header file reference
[*]AS3++.h header file reference
[*]AVM2.h header file reference
[*]Flash++.h examples
[*]FlasCC API Reference
[*]Reference Guide

我是一个兵 发表于 2015-1-11 14:53:40

:lol太好了...
页: [1]
查看完整版本: AVM2.h API文档