void populateContext_Hoisting(static_context* sctx) { const char* zorba_op_ns = static_context::ZORBA_OP_NS; DECL(sctx, zop_hoist, (createQName(zorba_op_ns, "", "hoist"), GENV_TYPESYSTEM.ITEM_TYPE_STAR, GENV_TYPESYSTEM.ITEM_TYPE_STAR)); DECL(sctx, zop_unhoist, (createQName(zorba_op_ns, "", "unhoist"), GENV_TYPESYSTEM.ITEM_TYPE_STAR, GENV_TYPESYSTEM.ITEM_TYPE_STAR)); }
void populate_context_accessors_impl(static_context* sctx) { DECL(sctx, fn_name_func, (createQName(static_context::W3C_FN_NS, "", "name"), GENV_TYPESYSTEM.STRING_TYPE_ONE)); DECL(sctx, fn_name_func, (createQName(static_context::W3C_FN_NS, "", "name"), GENV_TYPESYSTEM.ANY_NODE_TYPE_QUESTION, GENV_TYPESYSTEM.STRING_TYPE_ONE)); DECL_WITH_KIND(sctx, fn_data_3_0, (createQName("http://www.w3.org/2005/xpath-functions","","data"), GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR), FunctionConsts::FN_DATA_0); }
void populateContext_Constructors(static_context* sctx) { const char* zorba_op_ns = static_context::ZORBA_OP_NS; DECL(sctx, op_enclosed_expr, (createQName(zorba_op_ns, "", "enclosed-expr"), GENV_TYPESYSTEM.ITEM_TYPE_STAR, GENV_TYPESYSTEM.ITEM_TYPE_STAR)); }
/* Test a simple peek. */ static int single_peek(void) { ne_socket *sock; DECL(hello, STR); CALL(begin(&sock, serve_sstring, &hello)); CALL(peek_expect(sock, STR, strlen(STR))); return finish(sock, 0); }
static int small_writes(void) { ne_socket *sock; DECL(str, "This\nIs\nSome\nText.\n"); CALL(begin(&sock, serve_expect, &str)); WRITEL("This\n"); WRITEL("Is\n"); WRITEL("Some\n"); WRITEL("Text.\n"); return finish(sock, 1); }
/* readline which needs multiple read() calls. */ static int line_chunked(void) { ne_socket *sock; DECL(oneline, "this is a line\n"); CALL(begin(&sock, serve_sstring_slowly, &oneline)); LINE("this is a line\n"); return finish(sock, 1); }
/* check that empty lines are handled correctly. */ static int line_empty(void) { ne_socket *sock; DECL(oneline, "\n\na\n\n"); CALL(begin(&sock, serve_sstring, &oneline)); LINE("\n"); LINE("\n"); LINE("a\n"); LINE("\n"); return finish(sock, 1); }
static int line_simple(void) { ne_socket *sock; DECL(oneline, STR "\n" STR2 "\n"); CALL(begin(&sock, serve_sstring, &oneline)); LINE(STR "\n"); LINE(STR2 "\n"); return finish(sock, 1); }
/* Test a simple read. */ static int single_read(void) { ne_socket *sock; DECL(hello, STR); CALL(begin(&sock, serve_sstring, &hello)); CALL(read_expect(sock, STR, strlen(STR))); CALL(expect_close(sock)); CALL(good_close(sock)); return await_server(); }
/******************************************************************************* *** FUNCTION COMPOUND() ******************************************************************************* *** DESCRIPTION : Processes COMPOUND grammar rule. *** *** COMPOUND -> { DECL STAT_LIST RET_STAT } ******************************************************************************/ void RecursiveParser::COMPOUND(int & offset) { match(Global::lbracet); DECL(offset); STAT_LIST(); RET_STAT(); symtab->deleteDepth(depth); match(Global::rbracet); }
static int line_toolong(void) { ne_socket *sock; ssize_t ret; DECL(oneline, "AAAAAA\n"); CALL(begin(&sock, serve_sstring, &oneline)); ret = ne_sock_readline(sock, buffer, 5); ONV(ret != NE_SOCK_ERROR, ("readline should fail on long line: %" NE_FMT_SSIZE_T, ret)); reap_server(); ne_sock_close(sock); return OK; }
/* readline()s mingled with other operations: buffering tests. */ static int line_mingle(void) { ne_socket *sock; DECL(oneline, "alpha\nbeta\ndelta\ngamma\n"); CALL(begin(&sock, serve_sstring, &oneline)); READ("a"); LINE("lpha\n"); READ("beta"); LINE("\n"); PEEK("d"); PEEK("delt"); LINE("delta\n"); READ("gam"); LINE("ma\n"); return finish(sock, 1); }
/* Read more bytes than were written. */ static int larger_read(void) { ne_socket *sock; ssize_t nb; DECL(hello, STR); CALL(begin(&sock, serve_sstring, &hello)); nb = ne_sock_read(sock, buffer, hello.len + 10); ONV(nb != (ssize_t)hello.len, ("read gave too many bytes (%" NE_FMT_SSIZE_T ")", nb)); ONN("read gave wrong data", memcmp(buffer, hello.data, hello.len)); return finish(sock, 1); }
/* Test lots of 1-byte reads. */ static int small_reads(void) { ne_socket *sock; char *pnt; DECL(hello, STR); CALL(begin(&sock, serve_sstring, &hello)); /* read the string byte-by-byte. */ for (pnt = hello.data; *pnt; pnt++) { CALL(read_expect(sock, pnt, 1)); } return finish(sock, 1); }
static int line_closure(void) { ne_socket *sock; ssize_t ret; DECL(oneline, STR "\n" "foobar"); CALL(begin(&sock, serve_sstring, &oneline)); LINE(STR "\n"); ret = ne_sock_readline(sock, buffer, BUFSIZ); ONV(ret != NE_SOCK_CLOSED, ("readline got %" NE_FMT_SSIZE_T " not EOF: %s", ret, ne_sock_error(sock))); return finish(sock, 0); }
ParseTree* Parser::DECL_SEQ() { ParseTree* retTree = new ParseTree(); (*retTree).setToken((*parser).get()); (*retTree).SetLeaf1(DECL()->getLeaf()); if((*parser).get().token == INT) { (*retTree).SetLeaf2(DECL_SEQ()->getLeaf()); (*retTree).setAlt(2); return retTree; } (*retTree).setAlt(1); return retTree; }
/******************************************************************************* *** FUNCTION IDLIST() ******************************************************************************* *** DESCRIPTION : Processes IDLIST grammar rule. *** *** IDLIST -> idt IDTAIL ; DECL ******************************************************************************/ void RecursiveParser::IDLIST(VarType & type, int & offset) { EntryPtr ptr; checkduplicate(global->Lexeme, depth); symtab->insert(global->Lexeme, global->Token, depth); ptr = symtab->lookup(global->Lexeme); ptr->TypeOfEntry = varEntry; ptr->var.TypeOfVariable = type; ptr->var.Offset = offset; ptr->var.size = typesize(type); getsize(type, offset); match(Global::idt); IDTAIL(type, offset); match(Global::semicolont); DECL(offset); }
/* Stress out the read buffer handling a little. */ static int read_and_peek(void) { ne_socket *sock; DECL(hello, STR); CALL(begin(&sock, serve_sstring, &hello)); PEEK("Hello"); PEEK("Hell"); PEEK(STR); READ("He"); PEEK("llo, "); READ("l"); PEEK("lo, World."); READ("lo, Worl"); PEEK("d."); PEEK("d"); READ("d."); return finish(sock, 1); }
/******************************************************************************* *** FUNCTION DECL() ******************************************************************************* *** DESCRIPTION : Processes DECL grammar rule. *** *** DECL -> TYPE IDLIST | *** const idt = num ; DECL | *** e ******************************************************************************/ void RecursiveParser::DECL(int & offset) { EntryPtr ptr; VarType type; if (global->Token == Global::intt || global->Token == Global::floatt || global->Token == Global::chart) { TYPE(type); IDLIST(type, offset); } else if (global->Token == Global::constt) { match(Global::constt); checkduplicate(global->Lexeme, depth); symtab->insert(global->Lexeme, global->Token, depth); ptr = symtab->lookup(global->Lexeme); ptr->TypeOfEntry = constEntry; match(Global::idt); match(Global::assignopt); if (lex->isFloat) { ptr->constant.TypeOfConstant = floatType; ptr->constant.ValueR = global->ValueR; } else { ptr->constant.TypeOfConstant = intType; ptr->constant.Value = global->Value; } match(Global::numt); match(Global::semicolont); DECL(offset); } else return; }
void populate_context_booleans_impl(static_context* sctx) { const char* xquery_op_ns = static_context::XQUERY_OP_NS; const char* fn_ns = static_context::W3C_FN_NS; // Boolean DECL(sctx, fn_true, (createQName(fn_ns, "", "true"), GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE)); DECL(sctx, fn_false, (createQName(fn_ns, "", "false"), GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE)); DECL(sctx, fn_boolean, (createQName(fn_ns, "", "boolean"), GENV_TYPESYSTEM.ITEM_TYPE_STAR, GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE)); DECL(sctx, fn_not, (createQName(fn_ns, "", "not"), GENV_TYPESYSTEM.ITEM_TYPE_STAR, GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE)); // Logic DECL(sctx, op_and, (createQName(xquery_op_ns, "", "and"), GENV_TYPESYSTEM.ITEM_TYPE_STAR, true, GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE)); DECL(sctx, op_or, (createQName(xquery_op_ns, "", "or"), GENV_TYPESYSTEM.ITEM_TYPE_STAR, true, GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE)); }
default: SET_VTABLE1(ALnull, effect); break; } effect->type = type; } #include "AL/efx-presets.h" #define DECL(x) { #x, EFX_REVERB_PRESET_##x } static const struct { const char name[32]; EFXEAXREVERBPROPERTIES props; } reverblist[] = { DECL(GENERIC), DECL(PADDEDCELL), DECL(ROOM), DECL(BATHROOM), DECL(LIVINGROOM), DECL(STONEROOM), DECL(AUDITORIUM), DECL(CONCERTHALL), DECL(CAVE), DECL(ARENA), DECL(HANGAR), DECL(CARPETEDHALLWAY), DECL(HALLWAY), DECL(STONECORRIDOR), DECL(ALLEY), DECL(FOREST),
void populateContext_Comparison(static_context* sctx) { const char* zorba_ns = static_context::ZORBA_OP_NS; // General Comparison; DECL(sctx, op_equal, (createQName(zorba_ns, "", "equal"), GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE)); DECL(sctx, op_not_equal, (createQName(zorba_ns, "", "not-equal"), GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE)); DECL(sctx, op_greater, (createQName(zorba_ns, "", "greater"), GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE)); DECL(sctx, op_greater_equal, (createQName(zorba_ns, "", "greater-equal"), GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE)); DECL(sctx, op_less, (createQName(zorba_ns, "", "less"), GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE)); DECL(sctx, op_less_equal, (createQName(zorba_ns, "", "less-equal"), GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE)); // Value Comparison #define DECL_TYPED_VAL( sctx, op, name, type, xqt ) \ DECL(sctx, op_value_##op##_##type, \ (createQName (zorba_ns, "", "value-" name "-" #type), \ GENV_TYPESYSTEM.xqt##_TYPE_QUESTION, \ GENV_TYPESYSTEM.xqt##_TYPE_QUESTION, \ GENV_TYPESYSTEM.BOOLEAN_TYPE_QUESTION)) #define DECL_ALL_VAL( sctx, op, name ) \ DECL(sctx, op_value_##op, \ (createQName (zorba_ns, "", "value-" name), \ GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, \ GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, \ GENV_TYPESYSTEM.BOOLEAN_TYPE_QUESTION)); \ \ DECL_TYPED_VAL( sctx, op, name, double, DOUBLE ); \ DECL_TYPED_VAL( sctx, op, name, float, FLOAT ); \ DECL_TYPED_VAL( sctx, op, name, decimal, DECIMAL ); \ DECL_TYPED_VAL( sctx, op, name, integer, INTEGER ); \ DECL_TYPED_VAL( sctx, op, name, string, STRING ) DECL_ALL_VAL(sctx, equal, "equal"); DECL_ALL_VAL(sctx, not_equal, "not-equal"); DECL_ALL_VAL(sctx, less, "less"); DECL_ALL_VAL(sctx, greater, "greater"); DECL_ALL_VAL(sctx, less_equal, "less-equal"); DECL_ALL_VAL(sctx, greater_equal, "greater-equal"); #undef DECL_ALL_VAL #undef DECL_TYPED_VAL // Atomic Values Equivalent comparing function // http://www.w3.org/TR/xquery-11/#dt-equivalence-two-atomic-values DECL(sctx, op_atomic_values_equivalent, (createQName(zorba_ns, "", "atomic-values-equivalent"), GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE)); }
}; #define DECL(device) \ { NULL, MUI_TYPE_RADIO, "Drive" #device "Type", drive_type_strings_ ## device, drive_type_values_ ## device, NULL }, \ { NULL, MUI_TYPE_RADIO, "Drive" #device "ExtendImagePolicy", drive_extend_strings, drive_extend_values, NULL }, \ { NULL, MUI_TYPE_RADIO, "Drive" #device "IdleMethod", drive_idle_strings, drive_idle_values, NULL }, \ { NULL, MUI_TYPE_CHECK, "Drive" #device "RAM2000", NULL, NULL, NULL }, \ { NULL, MUI_TYPE_CHECK, "Drive" #device "RAM4000", NULL, NULL, NULL }, \ { NULL, MUI_TYPE_CHECK, "Drive" #device "RAM6000", NULL, NULL, NULL }, \ { NULL, MUI_TYPE_CHECK, "Drive" #device "RAM8000", NULL, NULL, NULL }, \ { NULL, MUI_TYPE_CHECK, "Drive" #device "RAMA000", NULL, NULL, NULL }, \ { NULL, MUI_TYPE_CHECK, "Drive" #device "ParallelCable", NULL, NULL, NULL }, #define DECL_NUM (9) static ui_to_from_t ui_to_from[] = { DECL(8) DECL(9) DECL(10) DECL(11) UI_END }; static APTR build_gui(void) { static char **drive_type_strings[4] = { drive_type_strings_8, drive_type_strings_9, drive_type_strings_10, drive_type_strings_11 }; APTR window, page; ui_to_from_t *data; int num; window = RegisterObject, MUIA_Register_Titles, drive_number_strings, End;
void PrefAgent::create_ui() { // Create main preferences window. XmStringLocalized mtfstring; String string; int decorations=MWM_DECOR_BORDER | MWM_DECOR_RESIZEH | MWM_DECOR_TITLE | MWM_DECOR_MENU; f_shell = WTopLevelShell (window_system().toplevel(), WPopup, "preferences"); window_system().register_shell(&f_shell); string = CATGETS(Set_PrefAgent, 1, "Dtinfo: Preferences"); XtVaSetValues((Widget)f_shell, XmNtitle, string, XmNmwmDecorations, decorations, NULL); DECL (WXmForm, form, f_shell, "form"); DECLMC(WXmOptionMenu, options, form, "options"); DECLC (WXmPulldownMenu, options_menu, form, "options_menu"); mtfstring = CATGETS(Set_AgentLabel, 186, "Preferences for"); XtVaSetValues(options, XmNlabelString, (XmString)mtfstring, NULL); ASSNM (WXmPushButton, f_ok, form, "ok"); ASSNM (WXmPushButton, f_apply, form, "apply"); ASSNM (WXmPushButton, f_reset, form, "reset"); DECLM (WXmPushButton, cancel, form, "cancel"); DECLM (WXmPushButton, help, form, "help"); mtfstring = CATGETS(Set_AgentLabel, 161, "OK"); XtVaSetValues(f_ok, XmNlabelString, (XmString)mtfstring, NULL); mtfstring = CATGETS(Set_AgentLabel, 201, "Apply"); XtVaSetValues(f_apply, XmNlabelString, (XmString)mtfstring, NULL); mtfstring = CATGETS(Set_AgentLabel, 202, "Reset"); XtVaSetValues(f_reset, XmNlabelString, (XmString)mtfstring, NULL); mtfstring = CATGETS(Set_AgentLabel, 162, "Cancel"); XtVaSetValues(cancel, XmNlabelString, (XmString)mtfstring, NULL); mtfstring = CATGETS(Set_AgentLabel, 48, "Help"); XtVaSetValues(help, XmNlabelString, (XmString)mtfstring, NULL); SET_CALLBACK (f_ok,Activate,ok); SET_CALLBACK (f_apply,Activate,apply); SET_CALLBACK (f_reset,Activate,reset); SET_CALLBACK (cancel,Activate,cancel); help_agent().add_activate_help (help, (char*)"preferences_help"); DECLM (WXmFrame, frame, form, "frame"); DECL (WXmForm, container, frame, "container"); // Create browsing preferences. DECLM (WXmPushButton, browse, options_menu, "browse"); DECL (WXmForm, browse_form, container, "browse_prefs"); DECLM (WXmLabel, browse_label, browse_form, "browse_label"); DECLM (WXmPushButton, get_browse_geo, browse_form, "get_browse_geo"); ASSNM (WXmTextField, f_browse_geo, browse_form, "browse_geo"); DECLM (WXmLabel, fs_label, browse_form, "fs_label"); DECL (WXmForm, fs_form, browse_form, "fs_form"); ASSNM (WXmTextField, f_fs_field, fs_form, "scale_field"); DECLM (WXmArrowButton, scale_up, fs_form, "scale_up"); DECLM (WXmArrowButton, scale_down, fs_form, "scale_down"); DECLM (WXmLabel, lock_label, browse_form, "lock_label"); ASSNM (WXmToggleButton, f_lock_toggle, browse_form, "lock_toggle"); mtfstring = CATGETS(Set_AgentLabel, 187, "Browsing"); XtVaSetValues(browse, XmNlabelString, (XmString)mtfstring, NULL); mtfstring = CATGETS(Set_AgentLabel, 190, "Browser Geometry"); XtVaSetValues(browse_label, XmNlabelString, (XmString)mtfstring, NULL); mtfstring = CATGETS(Set_AgentLabel, 270, "..."); XtVaSetValues(get_browse_geo, XmNlabelString, (XmString)mtfstring, NULL); mtfstring = CATGETS(Set_AgentLabel, 192, "Font Scale"); XtVaSetValues(fs_label, XmNlabelString, (XmString)mtfstring, NULL); mtfstring = CATGETS(Set_AgentLabel, 193, "Pin Window"); XtVaSetValues(lock_label, XmNlabelString, (XmString)mtfstring, NULL); mtfstring = CATGETS(Set_AgentLabel, 194, "File a Bug"); XtVaSetValues(f_lock_toggle, XmNlabelString, (XmString)mtfstring, NULL); Dimension height; ChangeData *inc, *dec; // Assume that the fields are taller than the labels. If the user // changes the font resources and violates this assumtion he's screwed // and that's the way we like it. height = f_fs_field.Height(); browse_label.Height (height); fs_label.Height (height); scale_up.Height (height/2); scale_down.Height (height/2); f_lock_toggle.LabelType (XmPIXMAP); lock_label.Height (height); fs_form.Manage(); browse_form.Manage(); f_top_panel = browse_form; SET_CALLBACK_D (browse,Activate,switch_to_window,(Widget)browse_form); SET_CALLBACK_D (get_browse_geo,Activate,get_geometry,(Widget)f_browse_geo); SET_CALLBACK (f_browse_geo,ValueChanged,something_changed); SET_CALLBACK (f_fs_field,ValueChanged,something_changed); SET_CALLBACK (f_lock_toggle,ValueChanged,something_changed); SET_CALLBACK (f_lock_toggle,ValueChanged,lock_toggle); inc = new ChangeData(f_fs_field, scale_up, scale_down, 1, 5); dec = new ChangeData(f_fs_field, scale_up, scale_down, -1, -2); SET_CALLBACK_D (scale_up,Activate,change_cb,inc); SET_CALLBACK_D (scale_up,Arm,arm_arrow,inc); SET_CALLBACK (scale_up,Disarm,disarm_arrow); SET_CALLBACK_D (scale_down,Activate,change_cb,dec); SET_CALLBACK_D (scale_down,Arm,arm_arrow,dec); SET_CALLBACK (scale_down,Disarm,disarm_arrow); // Create map window preferences DECLM (WXmPushButton, map, options_menu, "map"); DECLM (WXmForm, map_form, container, "map_prefs"); DECLM (WXmLabel, map_label, map_form, "map_label"); DECLM (WXmPushButton, get_map_geo, map_form, "get_map_geo"); ASSNM (WXmTextField, f_map_geo, map_form, "map_geo"); DECLM (WXmLabel, update_label, map_form, "update_label"); ASSNM (WXmToggleButton, f_update_toggle, map_form, "update_toggle"); mtfstring = CATGETS(Set_AgentLabel, 188, "Map"); XtVaSetValues(map, XmNlabelString, (XmString)mtfstring, NULL); mtfstring = CATGETS(Set_AgentLabel, 195, "Map Geometry"); XtVaSetValues(map_label, XmNlabelString, (XmString)mtfstring, NULL); mtfstring = CATGETS(Set_AgentLabel, 270, "..."); XtVaSetValues(get_map_geo, XmNlabelString, (XmString)mtfstring, NULL); mtfstring = CATGETS(Set_AgentLabel, 196, "Auto Update"); XtVaSetValues(update_label, XmNlabelString, (XmString)mtfstring, NULL); mtfstring = CATGETS(Set_AgentLabel, 194, "File a Bug"); XtVaSetValues(f_update_toggle, XmNlabelString, (XmString)mtfstring, NULL); height = f_map_geo.Height(); map_label.Height (height); update_label.Height (height); SET_CALLBACK_D (get_map_geo,Activate,get_geometry,(Widget)f_map_geo); SET_CALLBACK_D (map,Activate,switch_to_window,(Widget)map_form); SET_CALLBACK (f_map_geo,ValueChanged,something_changed); SET_CALLBACK (f_update_toggle,ValueChanged,something_changed); SET_CALLBACK (f_update_toggle,ValueChanged,update_toggle); map_form.Manage(); // Create history preferences DECLM (WXmPushButton, history, options_menu, "history"); mtfstring = CATGETS(Set_AgentLabel, 260, "History"); XtVaSetValues(history, XmNlabelString, (XmString)mtfstring, NULL); DECL (WXmForm, hist_form, container, "history_prefs"); DECLM (WXmLabel, nh_label, hist_form, "nh_label"); DECL (WXmForm, nh_form, hist_form, "nh_form"); ASSNM (WXmTextField, f_nh_field, nh_form, "nh_field"); DECLM (WXmArrowButton, nh_up, nh_form, "nh_up"); DECLM (WXmArrowButton, nh_down, nh_form, "nh_down"); DECLM (WXmLabel, sh_label, hist_form, "sh_label"); DECL (WXmForm, sh_form, hist_form, "sh_form"); ASSNM (WXmTextField, f_sh_field, sh_form, "sh_field"); DECLM (WXmArrowButton, sh_up, sh_form, "sh_up"); DECLM (WXmArrowButton, sh_down, sh_form, "sh_down"); mtfstring = CATGETS(Set_AgentLabel, 197, "Section History Size"); XtVaSetValues(nh_label, XmNlabelString, (XmString)mtfstring, NULL); mtfstring = CATGETS(Set_AgentLabel, 198, "Search History Size"); XtVaSetValues(sh_label, XmNlabelString, (XmString)mtfstring, NULL); height = f_nh_field.Height(); nh_label.Height (height); nh_up.Height (height/2); nh_down.Height (height/2); height = f_sh_field.Height(); sh_label.Height (height); sh_up.Height (height/2); sh_down.Height (height/2); nh_form.Manage(); sh_form.Manage(); hist_form.Manage(); SET_CALLBACK_D (history,Activate,switch_to_window,(Widget)hist_form); SET_CALLBACK (f_nh_field,ValueChanged,something_changed); SET_CALLBACK (f_sh_field,ValueChanged,something_changed); inc = new ChangeData (f_nh_field, nh_up, nh_down, 10, 1000); dec = new ChangeData (f_nh_field, nh_up, nh_down, -10, 10); SET_CALLBACK_D (nh_up,Activate,change_cb,inc); SET_CALLBACK_D (nh_up,Arm,arm_arrow,inc); SET_CALLBACK (nh_up,Disarm,disarm_arrow); SET_CALLBACK_D (nh_down,Activate,change_cb,dec); SET_CALLBACK_D (nh_down,Arm,arm_arrow,dec); SET_CALLBACK (nh_down,Disarm,disarm_arrow); inc = new ChangeData (f_sh_field, sh_up, sh_down, 10, 1000); dec = new ChangeData (f_sh_field, sh_up, sh_down, -10, 10); SET_CALLBACK_D (sh_up,Activate,change_cb,inc); SET_CALLBACK_D (sh_up,Arm,arm_arrow,inc); SET_CALLBACK (sh_up,Disarm,disarm_arrow); SET_CALLBACK_D (sh_down,Activate,change_cb,dec); SET_CALLBACK_D (sh_down,Arm,arm_arrow,dec); SET_CALLBACK (sh_down,Disarm,disarm_arrow); // Create Search preferences. DECLM (WXmPushButton, search, options_menu, "search"); mtfstring = CATGETS(Set_AgentLabel, 189, "Searching"); XtVaSetValues(search, XmNlabelString, (XmString)mtfstring, NULL); DECL (WXmForm, search_form, container, "search_prefs"); DECLM (WXmLabel, max_hits_label, search_form, "max_hits"); DECL (WXmForm, hits_form, search_form, "hits_form"); ASSNM (WXmTextField, f_max_hits_field, hits_form, "hits_field"); DECLM (WXmArrowButton, hits_up, hits_form, "hits_up"); DECLM (WXmArrowButton, hits_down, hits_form, "hits_down"); DECLM (WXmLabel, adisplay_label, search_form, "adisplay_label"); ASSNM (WXmToggleButton, f_adisplay_toggle, search_form, "adisplay_toggle"); mtfstring = CATGETS(Set_AgentLabel, 199, "Maximum Search Hits"); XtVaSetValues(max_hits_label, XmNlabelString, (XmString)mtfstring, NULL); mtfstring = CATGETS(Set_AgentLabel, 200, "Auto Display First Hit"); XtVaSetValues(adisplay_label, XmNlabelString, (XmString)mtfstring, NULL); mtfstring = CATGETS(Set_AgentLabel, 194, "File a Bug"); XtVaSetValues(f_adisplay_toggle, XmNlabelString, (XmString)mtfstring, NULL); height = f_max_hits_field.Height(); max_hits_label.Height (height); hits_up.Height (height/2); hits_down.Height (height/2); adisplay_label.Height (height); hits_form.Manage(); search_form.Manage(); SET_CALLBACK_D (search,Activate,switch_to_window,(Widget)search_form); SET_CALLBACK (f_max_hits_field,ValueChanged,something_changed); inc = new ChangeData (f_max_hits_field, hits_up, hits_down, 10, 500); dec = new ChangeData (f_max_hits_field, hits_up, hits_down, -10, 10); SET_CALLBACK_D (hits_up,Activate,change_cb,inc); SET_CALLBACK_D (hits_up,Arm,arm_arrow,inc); SET_CALLBACK (hits_up,Disarm,disarm_arrow); SET_CALLBACK_D (hits_down,Activate,change_cb,dec); SET_CALLBACK_D (hits_down,Arm,arm_arrow,dec); SET_CALLBACK (hits_down,Disarm,disarm_arrow); SET_CALLBACK (f_adisplay_toggle,ValueChanged,something_changed); SET_CALLBACK (f_adisplay_toggle,ValueChanged,adisplay_toggle); /* -------- node history size, search history size -------- */ options.SubMenuId (options_menu); container.Manage(); form.DefaultButton (f_ok); form.ShadowThickness (0); form.Manage(); f_shell.Realize(); Dimension width; f_shell.Get (WArgList (XmNheight, (XtArgVal) &height, XmNwidth, &width, NULL)); f_shell.Set (WArgList (XmNminHeight, height, XmNmaxHeight, height, XmNminWidth, width, XmNmaxWidth, width, NULL)); map_form.Unmanage(); hist_form.Unmanage(); search_form.Unmanage(); // Values get displayed when reset() is called on dialog display. init_values(); }
#define CMD_HELP 0x1000 #define CMD_VERSION 0x1001 #define CMD_DIR 0x4007 #define CMD_MISSINGOK 0x4008 int wrapper_exit_code = 255; static vc_uts_type const UTS_MAPPING[7] = { vcVHI_CONTEXT, vcVHI_SYSNAME, vcVHI_NODENAME, vcVHI_RELEASE, vcVHI_VERSION, vcVHI_MACHINE, vcVHI_DOMAINNAME }; #define DECL(UTS) [vcVHI_ ## UTS] = #UTS static char const * const UTS_STRINGS[] = { DECL(CONTEXT), DECL(SYSNAME), DECL(NODENAME), DECL(RELEASE), DECL(VERSION), DECL(MACHINE), DECL(DOMAINNAME) }; struct Tag { bool is_set; char const * value; }; struct Arguments { struct Tag tags[DIM_OF(UTS_MAPPING)]; xid_t xid; bool do_set; char const * dir; bool is_missingok;
#ifdef HAVE_CONFIG_H # include <config.h> #endif #include "vserver.h" #include "internal.h" #include <lib_internal/util-dimof.h> #include <string.h> #include <strings.h> #include <assert.h> #define DECL(STR, VAL) { STR, sizeof(STR)-1, VAL } static struct Mapping_uint64 const VALUES[] = { DECL("lock", VC_NXF_INFO_LOCK), DECL("private", VC_NXF_INFO_PRIVATE), DECL("single_ip", VC_NXF_SINGLE_IP), DECL("lback_remap", VC_NXF_LBACK_REMAP), DECL("remap_lback", VC_NXF_LBACK_REMAP), DECL("lback_allow", VC_NXF_LBACK_ALLOW), DECL("hide_netif", VC_NXF_HIDE_NETIF), DECL("hide_lback", VC_NXF_HIDE_LBACK), DECL("state_setup", VC_NXF_STATE_SETUP), DECL("state_admin", VC_NXF_STATE_ADMIN), DECL("sc_helper", VC_NXF_SC_HELPER), DECL("persistent", VC_NXF_PERSISTENT),
}; #define DECL(device) \ { NULL, MUI_TYPE_RADIO, "Drive" #device "Type", drive_type_strings_ ## device, drive_type_values_ ## device }, \ { NULL, MUI_TYPE_RADIO, "Drive" #device "ExtendImagePolicy", drive_extend_strings, drive_extend_values }, \ { NULL, MUI_TYPE_RADIO, "Drive" #device "IdleMethod", drive_idle_strings, drive_idle_values }, \ { NULL, MUI_TYPE_CHECK, "Drive" #device "RAM2000", NULL, NULL }, \ { NULL, MUI_TYPE_CHECK, "Drive" #device "RAM4000", NULL, NULL }, \ { NULL, MUI_TYPE_CHECK, "Drive" #device "RAM6000", NULL, NULL }, \ { NULL, MUI_TYPE_CHECK, "Drive" #device "RAM8000", NULL, NULL }, \ { NULL, MUI_TYPE_CHECK, "Drive" #device "RAMA000", NULL, NULL }, \ { NULL, MUI_TYPE_CHECK, "Drive" #device "ParallelCable", NULL, NULL }, #define DECL_NUM (9) static ui_to_from_t ui_to_from[] = { DECL(8) DECL(9) DECL(10) DECL(11) UI_END /* mandatory */ }; static APTR build_gui(void) { static char **drive_type_strings[4] = { drive_type_strings_8, drive_type_strings_9, drive_type_strings_10, drive_type_strings_11 }; APTR window, page; ui_to_from_t *data; int num; window = RegisterObject, MUIA_Register_Titles, drive_number_strings,
void populate_context_sequences_impl(static_context* sctx) { const char* xquery_op_ns = static_context::XQUERY_OP_NS; const char* zorba_op_ns = static_context::ZORBA_OP_NS; const char* fn_ns = static_context::W3C_FN_NS; DECL(sctx, fn_unordered, (createQName(fn_ns, "", "unordered"), GENV_TYPESYSTEM.ITEM_TYPE_STAR, GENV_TYPESYSTEM.ITEM_TYPE_STAR)); DECL(sctx, fn_exactly_one, (createQName(fn_ns, "", "exactly-one"), GENV_TYPESYSTEM.ITEM_TYPE_STAR, GENV_TYPESYSTEM.ITEM_TYPE_ONE)); DECL(sctx, fn_exactly_one_noraise, (createQName(zorba_op_ns, "", "exactly-one-noraise"), GENV_TYPESYSTEM.ITEM_TYPE_STAR, GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE)); DECL(sctx, fn_union, (createQName(xquery_op_ns,"","union"), GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR, GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR, GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR)); DECL(sctx, fn_intersect, (createQName(xquery_op_ns,"","intersect"), GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR, GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR, GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR)); DECL(sctx, fn_except, (createQName(xquery_op_ns,"","except"), GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR, GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR, GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR)); DECL(sctx, fn_max, (createQName(fn_ns,"","max"), GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION)); DECL(sctx, fn_max, (createQName(fn_ns,"","max"), GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, GENV_TYPESYSTEM.STRING_TYPE_ONE, GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION)); DECL(sctx, fn_min, (createQName(fn_ns,"","min"), GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION)); DECL(sctx, fn_min, (createQName(fn_ns,"","min"), GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, GENV_TYPESYSTEM.STRING_TYPE_ONE, GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION)); DECL(sctx, fn_head, (createQName(fn_ns,"","head"), GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION)); DECL(sctx, fn_tail, (createQName(fn_ns,"","tail"), GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR)); }
namespace UMC { // alpha table Ipp8u ALPHA_TABLE[52] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 5, 6, 7, 8, 9, 10, 12, 13, 15, 17, 20, 22, 25, 28, 32, 36, 40, 45, 50, 56, 63, 71, 80, 90, 101,113,127,144,162,182, 203,226,255,255 }; // beta table Ipp8u BETA_TABLE[52] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18 }; // clipping table Ipp8u CLIP_TAB[52][5] = { { 0, 0, 0, 0, 0},{ 0, 0, 0, 0, 0},{ 0, 0, 0, 0, 0},{ 0, 0, 0, 0, 0},{ 0, 0, 0, 0, 0},{ 0, 0, 0, 0, 0},{ 0, 0, 0, 0, 0},{ 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0},{ 0, 0, 0, 0, 0},{ 0, 0, 0, 0, 0},{ 0, 0, 0, 0, 0},{ 0, 0, 0, 0, 0},{ 0, 0, 0, 0, 0},{ 0, 0, 0, 0, 0},{ 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0},{ 0, 0, 0, 1, 1},{ 0, 0, 0, 1, 1},{ 0, 0, 0, 1, 1},{ 0, 0, 0, 1, 1},{ 0, 0, 1, 1, 1},{ 0, 0, 1, 1, 1},{ 0, 1, 1, 1, 1}, { 0, 1, 1, 1, 1},{ 0, 1, 1, 1, 1},{ 0, 1, 1, 1, 1},{ 0, 1, 1, 2, 2},{ 0, 1, 1, 2, 2},{ 0, 1, 1, 2, 2},{ 0, 1, 1, 2, 2},{ 0, 1, 2, 3, 3}, { 0, 1, 2, 3, 3},{ 0, 2, 2, 3, 3},{ 0, 2, 2, 4, 4},{ 0, 2, 3, 4, 4},{ 0, 2, 3, 4, 4},{ 0, 3, 3, 5, 5},{ 0, 3, 4, 6, 6},{ 0, 3, 4, 6, 6}, { 0, 4, 5, 7, 7},{ 0, 4, 5, 8, 8},{ 0, 4, 6, 9, 9},{ 0, 5, 7,10,10},{ 0, 6, 8,11,11},{ 0, 6, 8,13,13},{ 0, 7,10,14,14},{ 0, 8,11,16,16}, { 0, 9,12,18,18},{ 0,10,13,20,20},{ 0,11,15,23,23},{ 0,13,17,25,25} }; // chroma scaling QP table Ipp8u QP_SCALE_CR[52] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 34, 35, 35, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39, 39 }; // masks for external blocks pair "coded bits" Ipp32u EXTERNAL_BLOCK_MASK[NUMBER_OF_DIRECTION][2][4] = { // block mask for vertical deblocking { {2 << 0, 2 << 2, 2 << 8, 2 << 10}, {2 << 5, 2 << 7, 2 << 13,2 << 15} }, // block mask for horizontal deblocking { {2 << 0, 2 << 1, 2 << 4, 2 << 5}, {2 << 10,2 << 11,2 << 14,2 << 15} } }; #define DECL(prev, cur) (2 << (prev) | 2 << (cur)) // masks for internal blocks pair "coded bits" Ipp32u INTERNAL_BLOCKS_MASK[NUMBER_OF_DIRECTION][12] = { // blocks pair-mask for vertical deblocking { DECL(0, 1), DECL(2, 3), DECL(8, 9), DECL(10, 11), DECL(1, 4), DECL(3, 6), DECL(9, 12), DECL(11, 14), DECL(4, 5), DECL(6, 7), DECL(12, 13),DECL(14, 15) }, // blocks pair-mask for horizontal deblocking { DECL(0, 2), DECL(1, 3), DECL(4, 6), DECL(5, 7), DECL(2, 8), DECL(3, 9), DECL(6, 12), DECL(7, 13), DECL(8, 10), DECL(9, 11), DECL(12, 14),DECL(13, 15) } }; #undef DECL // implement array of IPP optimized luma deblocking functions #if defined(_WIN32_WCE) && defined(_M_IX86) && defined(__stdcall) #define _IPP_STDCALL_CDECL #undef __stdcall #endif // defined(_WIN32_WCE) && defined(_M_IX86) && defined(__stdcall) IppStatus ( *(IppDeblocking[])) (Ipp8u *, Ipp32s, Ipp8u *, Ipp8u *, Ipp8u *, Ipp8u *, Ipp32s ) = { &(FilterDeblockingLuma_VerEdge), &(FilterDeblockingLuma_HorEdge), &(FilterDeblockingChroma_VerEdge), &(FilterDeblockingChroma_HorEdge), &(FilterDeblockingChroma422_VerEdge), &(FilterDeblockingChroma422_HorEdge), &(FilterDeblockingChroma444_VerEdge), &(FilterDeblockingChroma444_HorEdge), &(FilterDeblockingLuma_VerEdge_MBAFF), &(FilterDeblockingChroma_VerEdge_MBAFF) }; IppStatus ( *(IppDeblocking16u[])) (Ipp16u *, Ipp32s, Ipp8u *, Ipp8u *, Ipp8u *, Ipp8u *, Ipp32s ) = { &(FilterDeblockingLuma_VerEdge), &(FilterDeblockingLuma_HorEdge), &(FilterDeblockingChroma_VerEdge), &(FilterDeblockingChroma_HorEdge), &(FilterDeblockingChroma422_VerEdge), &(FilterDeblockingChroma422_HorEdge), &(FilterDeblockingChroma444_VerEdge), &(FilterDeblockingChroma444_HorEdge), &(FilterDeblockingLuma_VerEdge_MBAFF), &(FilterDeblockingChroma_VerEdge_MBAFF) }; #if defined(_IPP_STDCALL_CDECL) #undef _IPP_STDCALL_CDECL #define __stdcall __cdecl #endif // defined(_IPP_STDCALL_CDECL) } // namespace UMC
#ifdef HAVE_CONFIG_H # include <config.h> #endif #include "vserver.h" #include "internal.h" #include <lib_internal/util-dimof.h> #include <linux/personality.h> #define DECL(VAL) { #VAL, sizeof(#VAL)-1, (VAL) } static struct Mapping_uint32 const VALUES[] = { #if HAVE_DECL_MMAP_PAGE_ZERO DECL(MMAP_PAGE_ZERO), #endif #if HAVE_DECL_ADDR_LIMIT_32BIT DECL(ADDR_LIMIT_32BIT), #endif #if HAVE_DECL_SHORT_INODE DECL(SHORT_INODE), #endif #if HAVE_DECL_WHOLE_SECONDS DECL(WHOLE_SECONDS), #endif #if HAVE_DECL_STICKY_TIMEOUTS