コード例 #1
0
ファイル: fcntl-module.c プロジェクト: GalaxyTab4/workbench
#define I SLANG_INT_TYPE
static SLang_Intrin_Fun_Type Fcntl_Intrinsics [] =
{
   MAKE_INTRINSIC_1("fcntl_getfd", fcntl_getfd, I, F),
   MAKE_INTRINSIC_2("fcntl_setfd", fcntl_setfd, I, F, I),
   MAKE_INTRINSIC_1("fcntl_getfl", fcntl_getfl, I, F),
   MAKE_INTRINSIC_2("fcntl_setfl", fcntl_setfl, I, F, I),

   SLANG_END_INTRIN_FUN_TABLE
};
#undef I
#undef F

static SLang_IConstant_Type Fcntl_Consts [] =
{
   MAKE_ICONSTANT("FD_CLOEXEC", FD_CLOEXEC),
   SLANG_END_ICONST_TABLE
};

int init_fcntl_module_ns (char *ns_name)
{
   SLang_NameSpace_Type *ns;
   
   ns = SLns_create_namespace (ns_name);
   if (ns == NULL)
     return -1;

   if ((-1 == SLns_add_intrin_fun_table (ns, Fcntl_Intrinsics, "__FCNTL__"))
       || (-1 == SLns_add_iconstant_table (ns, Fcntl_Consts, NULL)))
     return -1;
コード例 #2
0
ファイル: onig-module.c プロジェクト: balagopalraj/clearlinux
   return (char *)onig_version ();
}

static void get_encodings (void)
{
   get_onig_names ((Name_Map_Type *)Encoding_Table_Map);
}

static void get_syntaxes (void)
{
   get_onig_names ((Name_Map_Type *) Syntax_Table_Map);
}

static SLang_IConstant_Type Onig_Consts [] =
{
   MAKE_ICONSTANT ("ONIG_OPTION_DEFAULT", ONIG_OPTION_DEFAULT),
   MAKE_ICONSTANT ("ONIG_OPTION_NONE", ONIG_OPTION_NONE),
   MAKE_ICONSTANT ("ONIG_OPTION_SINGLELINE", ONIG_OPTION_SINGLELINE),
   MAKE_ICONSTANT ("ONIG_OPTION_MULTILINE", ONIG_OPTION_MULTILINE),
   MAKE_ICONSTANT ("ONIG_OPTION_IGNORECASE", ONIG_OPTION_IGNORECASE),
   MAKE_ICONSTANT ("ONIG_OPTION_EXTEND", ONIG_OPTION_EXTEND),
   MAKE_ICONSTANT ("ONIG_OPTION_FIND_LONGEST", ONIG_OPTION_FIND_LONGEST),
   MAKE_ICONSTANT ("ONIG_OPTION_FIND_NOT_EMPTY", ONIG_OPTION_FIND_NOT_EMPTY),
   MAKE_ICONSTANT ("ONIG_OPTION_NEGATE_SINGLELINE", ONIG_OPTION_NEGATE_SINGLELINE),
   MAKE_ICONSTANT ("ONIG_OPTION_DONT_CAPTURE_GROUP", ONIG_OPTION_DONT_CAPTURE_GROUP),
   MAKE_ICONSTANT ("ONIG_OPTION_CAPTURE_GROUP", ONIG_OPTION_CAPTURE_GROUP),

   SLANG_END_ICONST_TABLE
};

#define DUMMY_ONIG_TYPE 0
コード例 #3
0
ファイル: hooks.c プロジェクト: hankem/jed
   the_return:
   SLang_free_slstring (hook);
   SLang_free_array (at);
}

static SLang_Intrin_Fun_Type Hooks_Intrinsics [] =
{
   MAKE_INTRINSIC_0("add_to_hook", add_hook_cmd, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_0("append_to_hook", append_hook_cmd, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_0("remove_from_hook", remove_hook_cmd, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_0("_jed_run_hooks", run_hooks_cmd, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_0(NULL, NULL, 0)
};

static SLang_IConstant_Type Hook_IConstants [] =
{
   MAKE_ICONSTANT("JED_HOOKS_RUN_ALL", JED_HOOKS_RUN_ALL),
   MAKE_ICONSTANT("JED_HOOKS_RUN_UNTIL_NON_0", JED_HOOKS_RUN_UNTIL_NON_0),
   MAKE_ICONSTANT("JED_HOOKS_RUN_UNTIL_0", JED_HOOKS_RUN_UNTIL_0),
   SLANG_END_ICONST_TABLE
};

int jed_init_user_hooks (void)
{
   if ((-1 == SLadd_intrin_fun_table (Hooks_Intrinsics, NULL))
       || (-1 == SLadd_iconstant_table (Hook_IConstants, NULL)))
     return -1;

   return 0;
}
コード例 #4
0
   MAKE_VARIABLE("_isis_version_string", &Pivs, SLANG_STRING_TYPE, 1),
   MAKE_VARIABLE("_isis_version", &Isis_Version, SLANG_UINT_TYPE, 1),
   MAKE_VARIABLE("_isis_srcdir", &Isis_Srcdir, SLANG_STRING_TYPE, 1),
   MAKE_VARIABLE("_isis_install_prefix", &Install_Prefix, SLANG_STRING_TYPE, 1),
   MAKE_VARIABLE("_isis_install_prefix_sans_subdir", &Install_Prefix_Input, SLANG_STRING_TYPE, 1),
   MAKE_VARIABLE("Isis_Batch_Mode", &Isis_Batch_Mode, SLANG_INT_TYPE, 1),
   MAKE_VARIABLE("Isis_Silent_Errors", &Isis_Silent_Errors, SLANG_INT_TYPE, 0),
   MAKE_VARIABLE("Isis_Verbose", &Isis_Verbose, SLANG_INT_TYPE, 0),
   MAKE_VARIABLE("Isis_Load_File_Verbose_Mask", &Isis_Load_File_Verbose_Mask, SLANG_INT_TYPE, 0),
   MAKE_VARIABLE("Isis_Trace", &Isis_Trace, SLANG_INT_TYPE, 0),   
   SLANG_END_INTRIN_VAR_TABLE
};

static SLang_IConstant_Type Misc_Intrin_Const [] =
{
   MAKE_ICONSTANT("_INFO", INFO),
   MAKE_ICONSTANT("_WARN", WARN),
   MAKE_ICONSTANT("_FAIL", FAIL),
   MAKE_ICONSTANT("_FATAL", FATAL),
   MAKE_ICONSTANT("_INT_MAX", INT_MAX),
   SLANG_END_ICONST_TABLE
};

#undef V
#undef I
#undef F
#undef D
#undef S
#undef U

/*}}}*/
コード例 #5
0
ファイル: crypto-module.c プロジェクト: amitschang/slcrypto
  MAKE_INTRINSIC_0("base64_encode",sl_base64_encode,SLANG_VOID_TYPE),
  MAKE_INTRINSIC_0("base64_decode",sl_base64_decode,SLANG_VOID_TYPE),
  MAKE_INTRINSIC_0("ssl_server",sl_ssl_server,SLANG_VOID_TYPE),
  MAKE_INTRINSIC_0("ssl_client",sl_ssl_client,SLANG_VOID_TYPE),
  MAKE_INTRINSIC_0("ssl_connect",sl_ssl_connect,SLANG_VOID_TYPE),
  MAKE_INTRINSIC_0("ssl_handshake",sl_ssl_handshake,SLANG_VOID_TYPE),
  MAKE_INTRINSIC_0("ssl_read",sl_ssl_read,SLANG_VOID_TYPE),
  MAKE_INTRINSIC_0("ssl_write",sl_ssl_write,SLANG_VOID_TYPE),
  MAKE_INTRINSIC_0("ssl_verify",sl_ssl_verify,SLANG_VOID_TYPE),
  MAKE_INTRINSIC_0("ssl_cert",sl_ssl_get_cert,SLANG_VOID_TYPE),
  SLANG_END_INTRIN_FUN_TABLE
};

static SLang_IConstant_Type Module_IConstants [] =
  {
    MAKE_ICONSTANT("SSL_FILETYPE_ASN1",SSL_FILETYPE_ASN1),
    MAKE_ICONSTANT("SSL_FILETYPE_PEM",SSL_FILETYPE_PEM),
    MAKE_ICONSTANT("SSL_PROTO_SSL2",SSL_PROTO_SSL2),
    MAKE_ICONSTANT("SSL_PROTO_SSL3",SSL_PROTO_SSL3),
    MAKE_ICONSTANT("SSL_PROTO_TLS1",SSL_PROTO_TLS1),
    MAKE_ICONSTANT("SSL_PROTO_SSL23",SSL_PROTO_SSL23),
    MAKE_ICONSTANT("SSL_PROTO_ANY",SSL_PROTO_ANY),
    SLANG_END_ICONST_TABLE
  };

SLANG_MODULE(crypto);
int init_crypto_module_ns (char *ns_name){
  SLang_NameSpace_Type *ns = SLns_create_namespace(ns_name);
  if (ns == NULL)
    return -1;
  
コード例 #6
0
ファイル: csv-module.c プロジェクト: balagopalraj/clearlinux
     SLang_free_mmt (mmt);
}

#define DUMMY_CSV_TYPE ((SLtype)-1)
static SLang_Intrin_Fun_Type Module_Intrinsics [] =
{
   MAKE_INTRINSIC_0("_csv_decoder_new", new_csv_decoder_intrin, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_0("_csv_decode_row", decode_csv_row_intrin, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_0("_csv_encoder_new", new_csv_encoder_intrin, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_0("_csv_encode_row", encode_csv_row_intrin, SLANG_VOID_TYPE),
   SLANG_END_INTRIN_FUN_TABLE
};

static SLang_IConstant_Type Module_Constants [] =
{
   MAKE_ICONSTANT("CSV_SKIP_BLANK_ROWS", CSV_SKIP_BLANK_ROWS),
   MAKE_ICONSTANT("CSV_STOP_BLANK_ROWS", CSV_STOP_ON_BLANK_ROWS),
   MAKE_ICONSTANT("CSV_QUOTE_SOME", CSV_QUOTE_SOME),
   MAKE_ICONSTANT("CSV_QUOTE_ALL", CSV_QUOTE_ALL),
   SLANG_END_ICONST_TABLE
};

static void destroy_csv (SLtype type, VOID_STAR f)
{
   (void) type;
   free_csv_type ((CSV_Type *)f);
}

static int register_csv_type (void)
{
   SLang_Class_Type *cl;
コード例 #7
0
ファイル: slposio.c プロジェクト: balagopalraj/clearlinux
#endif
   SLANG_END_INTRIN_FUN_TABLE
};
#undef I
#undef V
#undef F
#undef B
#undef R
#undef S
#undef L
#undef U

static SLang_IConstant_Type PosixIO_Consts [] =
{
#ifdef O_RDONLY
   MAKE_ICONSTANT("O_RDONLY", O_RDONLY),
#endif
#ifdef O_WRONLY
   MAKE_ICONSTANT("O_WRONLY", O_WRONLY),
#endif
#ifdef O_RDWR
   MAKE_ICONSTANT("O_RDWR", O_RDWR),
#endif
#ifdef O_APPEND
   MAKE_ICONSTANT("O_APPEND", O_APPEND),
#endif
#ifdef O_CREAT
   MAKE_ICONSTANT("O_CREAT", O_CREAT),
#endif
#ifdef O_EXCL
   MAKE_ICONSTANT("O_EXCL", O_EXCL),
コード例 #8
0
#define I SLANG_INT_TYPE
static SLang_Intrin_Fun_Type Fcntl_Intrinsics [] =
{
   MAKE_INTRINSIC_0("fcntl_getfd", fcntl_getfd, I),
   MAKE_INTRINSIC_1("fcntl_setfd", fcntl_setfd, I, I),
   MAKE_INTRINSIC_0("fcntl_getfl", fcntl_getfl, I),
   MAKE_INTRINSIC_1("fcntl_setfl", fcntl_setfl, I, I),

   SLANG_END_INTRIN_FUN_TABLE
};
#undef I
#undef F

static SLang_IConstant_Type Fcntl_Consts [] =
{
   MAKE_ICONSTANT("FD_CLOEXEC", FD_CLOEXEC),
#ifndef O_ACCMODE
# define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
#endif
   MAKE_ICONSTANT("O_ACCMODE", O_ACCMODE),
   SLANG_END_ICONST_TABLE
};

int init_fcntl_module_ns (char *ns_name)
{
   SLang_NameSpace_Type *ns;

   ns = SLns_create_namespace (ns_name);
   if (ns == NULL)
     return -1;
コード例 #9
0
    MAKE_INTRINSIC_2("termios_set_cflag", termios_set_cflag, V, T, I),
    MAKE_INTRINSIC_2("termios_set_lflag", termios_set_lflag, V, T, I),
    MAKE_INTRINSIC_0("termios_set_cc", termios_set_cc, V),

    SLANG_END_INTRIN_FUN_TABLE
};
#undef T
#undef I
#undef F
#undef V
#undef U

static SLang_IConstant_Type Termios_Consts [] =
{
#ifdef BRKINT
    MAKE_ICONSTANT("BRKINT", BRKINT),
#endif
#ifdef CLOCAL
    MAKE_ICONSTANT("CLOCAL", CLOCAL),
#endif
#ifdef CREAD
    MAKE_ICONSTANT("CREAD", CREAD),
#endif
#ifdef CS5
    MAKE_ICONSTANT("CS5", CS5),
#endif
#ifdef CS6
    MAKE_ICONSTANT("CS6", CS6),
#endif
#ifdef CS7
    MAKE_ICONSTANT("CS7", CS7),
コード例 #10
0
ファイル: fork-module.c プロジェクト: ebichu/dd-wrt
   
   f0 = SLfile_create_fd ("*pipe*", fds[0]);
   f1 = SLfile_create_fd ("*pipe*", fds[1]);
   if ((NULL != f0) && (NULL != f1))
     {
	/* Ignore errors and allow the free_fd routines to clean up */
	(void) SLfile_push_fd (f0);
	(void) SLfile_push_fd (f1);
     }
   SLfile_free_fd (f1);
   SLfile_free_fd (f0);
}

static SLang_IConstant_Type Module_IConstants [] =
{
   MAKE_ICONSTANT("WNOHANG", WNOHANG),
   MAKE_ICONSTANT("WUNTRACED", WUNTRACED),
   MAKE_ICONSTANT("WCONTINUED", WCONTINUED),
   SLANG_END_ICONST_TABLE
};

static SLang_Intrin_Fun_Type Module_Intrinsics [] =
{
   MAKE_INTRINSIC_0("fork", fork_intrinsic, SLANG_INT_TYPE),
   MAKE_INTRINSIC_2("waitpid", waitpid_intrinsic, SLANG_VOID_TYPE, SLANG_INT_TYPE, SLANG_INT_TYPE),
   MAKE_INTRINSIC_0("execv", execv_intrin, SLANG_INT_TYPE),
   MAKE_INTRINSIC_0("execvp", execvp_intrin, SLANG_INT_TYPE),
   MAKE_INTRINSIC_0("execve", execve_intrin, SLANG_INT_TYPE),
   MAKE_INTRINSIC_0("pipe", pipe_intrin, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_1("_exit", _exit_intrin, SLANG_VOID_TYPE, SLANG_INT_TYPE),
   SLANG_END_INTRIN_FUN_TABLE
コード例 #11
0
#ifdef HAVE_SETPRIORITY
   MAKE_INTRINSIC_III("setpriority", setpriority_intrin, SLANG_INT_TYPE),
#endif
#ifdef HAVE_GETPRIORITY
   MAKE_INTRINSIC_II("getpriority", getpriority_intrin, SLANG_VOID_TYPE),
#endif
#ifdef HAVE_GETRUSAGE
   MAKE_INTRINSIC_0("getrusage", getrusage_intrin, SLANG_VOID_TYPE),
#endif
   SLANG_END_INTRIN_FUN_TABLE
};

static SLang_IConstant_Type Const_Table [] =
{
#ifdef PRIO_PROCESS
   MAKE_ICONSTANT("PRIO_PROCESS", PRIO_PROCESS),
#endif
#ifdef PRIO_PGRP
   MAKE_ICONSTANT("PRIO_PGRP", PRIO_PGRP),
#endif
#ifdef PRIO_USER
   MAKE_ICONSTANT("PRIO_USER", PRIO_USER),
#endif
#ifdef RUSAGE_SELF
   MAKE_ICONSTANT("RUSAGE_SELF", RUSAGE_SELF),
#endif
#ifdef RUSAGE_CHILDREN
   MAKE_ICONSTANT("RUSAGE_CHILDREN", RUSAGE_CHILDREN),
#endif
#ifdef RUSAGE_THREAD
   MAKE_ICONSTANT("RUSAGE_THREAD", RUSAGE_THREAD),
コード例 #12
0
ファイル: slmath.c プロジェクト: GalaxyTab4/workbench
   MAKE_INTRINSIC_0("atan2", atan2_fun, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_0("_min", min_fun, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_0("_max", max_fun, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_0("_diff", diff_fun, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_0("feqs", feqs_fun, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_0("fneqs", fneqs_fun, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_0("flteqs", fleqs_fun, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_0("fgteqs", fgeqs_fun, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_0("fpu_clear_except_bits", fpu_clear_except_bits, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_1("fpu_test_except_bits", fpu_test_except_bits, _pSLANG_LONG_TYPE, _pSLANG_LONG_TYPE),
   SLANG_END_INTRIN_FUN_TABLE
};

static SLang_IConstant_Type IConsts [] = 
{
   MAKE_ICONSTANT("FE_DIVBYZERO", SL_FE_DIVBYZERO),
   MAKE_ICONSTANT("FE_INVALID", SL_FE_INVALID),
   MAKE_ICONSTANT("FE_OVERFLOW", SL_FE_OVERFLOW),
   MAKE_ICONSTANT("FE_UNDERFLOW", SL_FE_UNDERFLOW),
   MAKE_ICONSTANT("FE_INEXACT", SL_FE_INEXACT),
   MAKE_ICONSTANT("FE_ALL_EXCEPT", SL_FE_ALLEXCEPT),
   SLANG_END_ICONST_TABLE
};

static int add_nan_and_inf (void)
{
   if ((-1 == SLns_add_dconstant (NULL, "_NaN", _pSLang_NaN))
       || (-1 == SLns_add_dconstant (NULL, "_Inf", _pSLang_Inf)))
     return -1;
   
   SLfpu_clear_except_bits ();
コード例 #13
0
ファイル: template.c プロジェクト: Distrotech/slang
/* Define intrinsics here */

static SLang_Intrin_Fun_Type Module_Intrinsics [] =
{
   SLANG_END_INTRIN_FUN_TABLE
};

static SLang_Intrin_Var_Type Module_Variables [] =
{
   MAKE_VARIABLE("_<MODULE-NAME>_module_version_string", &Module_Version_String, SLANG_STRING_TYPE, 1),
   SLANG_END_INTRIN_VAR_TABLE
};

static SLang_IConstant_Type Module_Constants [] =
{
   MAKE_ICONSTANT("_<MODULE-NAME>_module_version", MODULE_VERSION_NUMBER),
   SLANG_END_ICONST_TABLE
};

int init_<MODULE-NAME>_module_ns (char *ns_name)
{
   SLang_NameSpace_Type *ns = SLns_create_namespace (ns_name);
   if (ns == NULL)
     return -1;

   if ((-1 == SLns_add_intrin_fun_table (ns, Module_Intrinsics, NULL))
       || (-1 == SLns_add_intrin_var_table (ns, Module_Variables, NULL))
       || (-1 == SLns_add_iconstant_table (ns, Module_Constants, NULL)))
     return -1;

   return 0;
コード例 #14
0
ファイル: png-module.c プロジェクト: Distrotech/slang
   MAKE_INTRINSIC_0("png_read", read_intrin, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_0("png_read_flipped", read_flipped_intrin, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_0("png_write", write_intrin, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_0("png_write_flipped", write_flipped_intrin, SLANG_VOID_TYPE),
   SLANG_END_INTRIN_FUN_TABLE
};

static SLang_Intrin_Var_Type Module_Variables [] =
{
   MAKE_VARIABLE("_png_module_version_string", &Module_Version_String, SLANG_STRING_TYPE, 1),
   SLANG_END_INTRIN_VAR_TABLE
};

static SLang_IConstant_Type Module_IConstants [] =
{
   MAKE_ICONSTANT("PNG_COLOR_TYPE_GRAY", PNG_COLOR_TYPE_GRAY),
   MAKE_ICONSTANT("PNG_COLOR_TYPE_GRAY_ALPHA", PNG_COLOR_TYPE_GRAY_ALPHA),
   MAKE_ICONSTANT("PNG_COLOR_TYPE_RGB", PNG_COLOR_TYPE_RGB),
   MAKE_ICONSTANT("PNG_COLOR_TYPE_RGBA", PNG_COLOR_TYPE_RGBA),

   MAKE_ICONSTANT("_png_module_version", MODULE_VERSION_NUMBER),
   SLANG_END_ICONST_TABLE
};

int init_png_module_ns (char *ns_name)
{
   unsigned short x;

   SLang_NameSpace_Type *ns = SLns_create_namespace (ns_name);
   if (ns == NULL)
     return -1;
コード例 #15
0
ファイル: slsmg-module.c プロジェクト: GalaxyTab4/workbench
   MAKE_INTRINSIC_4("slsmg_draw_box", smg_draw_box, SLANG_VOID_TYPE,I,I,I,I),
   MAKE_INTRINSIC_0("slsmg_get_column", smg_get_column, SLANG_INT_TYPE),
   MAKE_INTRINSIC_0("slsmg_get_row", smg_get_row, SLANG_INT_TYPE),
   MAKE_INTRINSIC_I("slsmg_forward", smg_forward, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_5("slsmg_set_color_in_region", smg_set_color_in_region, SLANG_VOID_TYPE, I, I, I, I, I),

   MAKE_INTRINSIC_ISS("slsmg_define_color", smg_define_color, SLANG_VOID_TYPE),
#ifndef IBMPC_SYSTEM
   MAKE_INTRINSIC_S("slsmg_write_to_status_line", smg_write_to_status_line, SLANG_VOID_TYPE),
#endif
   SLANG_END_INTRIN_FUN_TABLE
};

static SLang_IConstant_Type Smg_Constants [] =
{
   MAKE_ICONSTANT("SLSMG_NEWLINE_IGNORED", SLSMG_NEWLINE_IGNORED),
   MAKE_ICONSTANT("SLSMG_NEWLINE_MOVES", SLSMG_NEWLINE_MOVES),
   MAKE_ICONSTANT("SLSMG_NEWLINE_SCROLLS", SLSMG_NEWLINE_SCROLLS),
   MAKE_ICONSTANT("SLSMG_NEWLINE_PRINTABLE", SLSMG_NEWLINE_PRINTABLE),

   MAKE_ICONSTANT("SLSMG_HLINE_CHAR", SLSMG_HLINE_CHAR),
   MAKE_ICONSTANT("SLSMG_VLINE_CHAR", SLSMG_VLINE_CHAR),
   MAKE_ICONSTANT("SLSMG_ULCORN_CHAR", SLSMG_ULCORN_CHAR),
   MAKE_ICONSTANT("SLSMG_URCORN_CHAR", SLSMG_URCORN_CHAR),
   MAKE_ICONSTANT("SLSMG_LLCORN_CHAR", SLSMG_LLCORN_CHAR),
   MAKE_ICONSTANT("SLSMG_LRCORN_CHAR", SLSMG_LRCORN_CHAR),
   MAKE_ICONSTANT("SLSMG_CKBRD_CHAR", SLSMG_CKBRD_CHAR),
   MAKE_ICONSTANT("SLSMG_RTEE_CHAR", SLSMG_RTEE_CHAR),
   MAKE_ICONSTANT("SLSMG_LTEE_CHAR", SLSMG_LTEE_CHAR),
   MAKE_ICONSTANT("SLSMG_UTEE_CHAR", SLSMG_UTEE_CHAR),
   MAKE_ICONSTANT("SLSMG_DTEE_CHAR", SLSMG_DTEE_CHAR),
コード例 #16
0
ファイル: slsig.c プロジェクト: Distrotech/slang
	  goto free_and_return;
     }

free_and_return:
   if (value_ref != NULL)
     SLang_free_ref (value_ref);
   if (interval_ref != NULL)
     SLang_free_ref (interval_ref);
}
# endif
#endif

static SLang_IConstant_Type IConsts [] =
{
#ifdef SLANG_POSIX_SIGNALS
   MAKE_ICONSTANT("SIG_BLOCK", SIG_BLOCK),
   MAKE_ICONSTANT("SIG_UNBLOCK", SIG_UNBLOCK),
   MAKE_ICONSTANT("SIG_SETMASK", SIG_SETMASK),
#endif
   MAKE_ICONSTANT("SIG_IGN", SIG_IGN_CONSTANT),
   MAKE_ICONSTANT("SIG_DFL", SIG_DFL_CONSTANT),
   MAKE_ICONSTANT("SIG_APP", SIG_APP_CONSTANT),
#ifdef ITIMER_REAL
   MAKE_ICONSTANT("ITIMER_REAL", ITIMER_REAL),
#endif
#ifdef ITIMER_VIRTUAL
   MAKE_ICONSTANT("ITIMER_VIRTUAL", ITIMER_VIRTUAL),
#endif
#ifdef ITIMER_PROF
   MAKE_ICONSTANT("ITIMER_PROF", ITIMER_PROF),
#endif
コード例 #17
0
ファイル: socket-module.c プロジェクト: hankem/S-Lang
   MAKE_INTRINSIC_0("connect", connect_intrin, V),
   MAKE_INTRINSIC_0("bind", bind_intrin, V),
   MAKE_INTRINSIC_2("listen", listen_intrin, V, F, I),
   MAKE_INTRINSIC_0("accept", accept_intrin, V),
   MAKE_INTRINSIC_0("getsockopt", getsockopt_intrin, V),
   MAKE_INTRINSIC_0("setsockopt", setsockopt_intrin, V),
   SLANG_END_INTRIN_FUN_TABLE
};
#undef F
#undef V
#undef I

static SLang_IConstant_Type Module_IConstants [] =
{
#ifdef SOCK_STREAM
   MAKE_ICONSTANT("SOCK_STREAM", SOCK_STREAM),
#endif
#ifdef SOCK_DGRAM
   MAKE_ICONSTANT("SOCK_DGRAM", SOCK_DGRAM),
#endif
#ifdef SOCK_RAW
   MAKE_ICONSTANT("SOCK_RAW", SOCK_RAW),
#endif
#ifdef SOCK_RDM
   MAKE_ICONSTANT("SOCK_RDM", SOCK_RDM),
#endif
#ifdef SOCK_SEQPACKET
   MAKE_ICONSTANT("SOCK_SEQPACKET", SOCK_SEQPACKET),
#endif
#ifdef SOCK_PACKET
   MAKE_ICONSTANT("SOCK_PACKET", SOCK_PACKET),
コード例 #18
0
ファイル: slproc.c プロジェクト: DrakXtools/drakx
#ifdef HAVE_KILLPG
   MAKE_INTRINSIC_II("killpg", killpg_cmd, SLANG_INT_TYPE),
#endif
#ifdef HAVE_SETPRIORITY
   MAKE_INTRINSIC_III("setpriority", setpriority_intrin, SLANG_INT_TYPE),
#endif
#ifdef HAVE_GETPRIORITY
   MAKE_INTRINSIC_II("getpriority", getpriority_intrin, SLANG_VOID_TYPE),
#endif
   SLANG_END_INTRIN_FUN_TABLE
};

static SLang_IConstant_Type Const_Table [] =
{
#ifdef PRIO_PROCESS
   MAKE_ICONSTANT("PRIO_PROCESS", PRIO_PROCESS),
#endif
#ifdef PRIO_PGRP
   MAKE_ICONSTANT("PRIO_PGRP", PRIO_PGRP),
#endif
#ifdef PRIO_USER
   MAKE_ICONSTANT("PRIO_USER", PRIO_USER),
#endif
   SLANG_END_ICONST_TABLE
};

int SLang_init_posix_process (void)
{
   if ((-1 == SLadd_intrin_fun_table (Process_Name_Table, "__POSIX_PROCESS__"))
       || (-1 == SLadd_iconstant_table (Const_Table, NULL))
       || (-1 == _pSLerrno_init ()))
コード例 #19
0
ファイル: pgplot-module.c プロジェクト: hankem/ISIS
};

#undef V
#undef I
#undef S
#undef D

static SLang_Intrin_Var_Type Module_Variables [] =
{
   MAKE_VARIABLE("_pgplot_module_version_string", &Module_Version_String, SLANG_STRING_TYPE, 1),
   SLANG_END_INTRIN_VAR_TABLE
};

static SLang_IConstant_Type Module_IConstants [] =
{
   MAKE_ICONSTANT("_pgplot_module_version", MODULE_VERSION_NUMBER),
   SLANG_END_ICONST_TABLE
};

static int setenv_pgplot_dir (void)
{
   static char *pgplot_dir;

   if (NULL != getenv ("PGPLOT_DIR"))
     return 0;

   pgplot_dir = "PGPLOT_DIR=" PGPLOTDIR;
   if (-1 == putenv (pgplot_dir))
     {
        fprintf (stderr, "Failed setting PGPLOT_DIR environment variable: %s\n", pgplot_dir);
        return -1;