守望者--AIR技术交流

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
热搜: ANE FlasCC 炼金术
查看: 2454|回复: 1
打印 上一主题 下一主题

[文档资料] AVM2.h API文档

[复制链接]
  • TA的每日心情
    擦汗
    2018-4-10 15:18
  • 签到天数: 447 天

    [LV.9]以坛为家II

    1742

    主题

    2094

    帖子

    13万

    积分

    超级版主

    Rank: 18Rank: 18Rank: 18Rank: 18Rank: 18

    威望
    562
    贡献
    29
    金币
    52693
    钢镚
    1422

    开源英雄守望者

    跳转到指定楼层
    楼主
    发表于 2014-12-30 00:24:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    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

    1. #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.
    __avm2_apply

    1. #define __avm2_apply(function, arguments, size)
    复制代码
    Invokes function with a copy of the parameters described by arguments and size.
    Parameters:
    • 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

    1. #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

    1. #define __builtin_va_arg_pack
    复制代码
    Error. Not supported in FlasCC.
    __builtin_va_arg_pack_len

    1. #define __builtin_va_arg_pack_len
    复制代码
    Error. Not supported in FlasCC.
    __builtin_apply_args

    1. <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
    1. __builtin_apply_args
    复制代码
    __builtin_apply

    1. <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
    1. __builtin_apply
    复制代码
    __builtin_return

    1. <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
    1. __builtin_return
    复制代码
    avm2_locked_id

    1. 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

    1. 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

    1. 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

    1. 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

    1. 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

    1. 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

    1. 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

    1. 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

    1. 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

    1. int avm2_is_ui_worker();
    复制代码
    Returns non-zero if running on the UI Worker.
    avm2_wait_for_ui_frame

    1. 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

    1. void avm2_self_lock();
    复制代码
    Lock this thread to this Worker -- recursive OK.
    avm2_self_unlock

    1. void avm2_self_unlock();
    复制代码
    Unlock this thread.
    avm2_self_msleep

    1. 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

    1. 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

    1. 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.



    相关链接:

    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
    收藏收藏1 分享分享 支持支持1 反对反对 微信
    守望者AIR技术交流社区(www.airmyth.com)
    回复

    使用道具 举报

  • TA的每日心情
    郁闷
    2016-8-19 16:08
  • 签到天数: 7 天

    [LV.3]偶尔看看II

    4

    主题

    31

    帖子

    2628

    积分

    少尉

    Rank: 6Rank: 6

    威望
    0
    贡献
    8
    金币
    320
    钢镚
    25
    沙发
    发表于 2015-1-11 14:53:40 | 只看该作者
    太好了...
    我是一个兵
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    
    关闭

    站长推荐上一条 /4 下一条

    QQ|手机版|Archiver|网站地图|小黑屋|守望者 ( 京ICP备14061876号

    GMT+8, 2024-4-19 18:59 , Processed in 0.052367 second(s), 29 queries .

    守望者AIR

    守望者AIR技术交流社区

    本站成立于 2014年12月31日

    快速回复 返回顶部 返回列表