00001 #pragma once
00002 #ifndef SEAP_COMMAND_H
00003 #define SEAP_COMMAND_H
00004
00005 #include <stdint.h>
00006 #include <stdarg.h>
00007 #include <seap-debug.h>
00008 #include <sexp-types.h>
00009 #include <seap-types.h>
00010
00011 #ifdef __cplusplus
00012 extern "C" {
00013 #endif
00014
00015 typedef SEXP_t * (*SEAP_cmdfn_t) (SEXP_t *, void *);
00016
00017 typedef uint16_t SEAP_cmdcode_t;
00018 typedef uint16_t SEAP_cmdid_t;
00019 typedef uint8_t SEAP_cmdtype_t;
00020
00021 #define SEAP_CMDTYPE_SYNC 1
00022 #define SEAP_CMDTYPE_ASYNC 2
00023
00024 #define SEAP_CMDREG_LOCAL 0x00000001
00025 #define SEAP_CMDREG_USEARG 0x00000002
00026 #define SEAP_CMDREG_THREAD 0x00000004
00027
00028 int SEAP_cmd_register (SEAP_CTX_t *ctx, SEAP_cmdcode_t code, uint32_t flags, SEAP_cmdfn_t func, ...);
00029 int SEAP_cmd_unregister (SEAP_CTX_t *ctx, SEAP_cmdcode_t code);
00030
00031 SEXP_t *SEAP_cmd_exec (SEAP_CTX_t *ctx,
00032 int sd,
00033 uint32_t flags,
00034 SEAP_cmdcode_t code,
00035 SEXP_t *args,
00036 SEAP_cmdtype_t type,
00037 SEAP_cmdfn_t func,
00038 void *funcarg);
00039
00040 #ifdef __cplusplus
00041 }
00042 #endif
00043
00044 #endif