From: Frank Schlottmann-G. <fs...@us...> - 2000-11-27 09:26:26
|
Update of /cvsroot/firebird/interbase/gpre In directory slayer.i.sourceforge.net:/tmp/cvs-serv12584/interbase/gpre Modified Files: form.c form_trn.c gpre.h par.c Log Message: Fixed bugs in gpre to handle PYXIS forms and allow edit.e and fred.e to go through gpre without errors (and correct result). This is a partial fix until all PYXIS datatypes are adjusted in frm_trn.c removed some compiler warnings too Index: form.c =================================================================== RCS file: /cvsroot/firebird/interbase/gpre/form.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** form.c 2000/08/03 20:44:01 1.1.1.1 --- form.c 2000/11/27 09:26:13 1.2 *************** *** 20,23 **** --- 20,34 ---- * All Rights Reserved. * Contributor(s): ______________________________________. + * $Log$ + * Revision 1.2 2000/11/27 09:26:13 fsg + * Fixed bugs in gpre to handle PYXIS forms + * and allow edit.e and fred.e to go through + * gpre without errors (and correct result). + * + * This is a partial fix until all + * PYXIS datatypes are adjusted in frm_trn.c + * + * removed some compiler warnings too + * */ *************** *** 59,63 **** USHORT l; ! for (p = name; *p = UPPER (*string); string++, p++) ; --- 70,74 ---- USHORT l; ! for (p = name; (*p = UPPER (*string)); string++, p++) ; *************** *** 75,79 **** if (!(handle = PYXIS_find_field (object, name))) return NULL; - /* Make field block and decrypt data type */ --- 86,89 ---- *************** *** 134,138 **** return NULL; ! for (p = name; *p = UPPER (*string); string++, p++) ; --- 144,148 ---- return NULL; ! for (p = name; (*p = UPPER (*string)); string++, p++) ; *************** *** 156,160 **** if (!form->form_object) return NULL; ! form->form_dbb = dbb; form->form_next = dbb->dbb_forms; --- 166,170 ---- if (!form->form_object) return NULL; ! /*PYXIS_print(form->form_object,0);*/ form->form_dbb = dbb; form->form_next = dbb->dbb_forms; *************** *** 163,167 **** /* Make up form block, etc */ ! form->form_name = symbol = MSC_symbol (SYM_form, name, l, form); HSH_insert (symbol); --- 173,177 ---- /* Make up form block, etc */ ! form->form_name = symbol = MSC_symbol (SYM_form, name, l,(CTX) form); HSH_insert (symbol); Index: form_trn.c =================================================================== RCS file: /cvsroot/firebird/interbase/gpre/form_trn.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** form_trn.c 2000/08/03 20:44:01 1.1.1.1 --- form_trn.c 2000/11/27 09:26:13 1.2 *************** *** 20,29 **** --- 20,88 ---- * All Rights Reserved. * Contributor(s): ______________________________________. + * $Log$ + * Revision 1.2 2000/11/27 09:26:13 fsg + * Fixed bugs in gpre to handle PYXIS forms + * and allow edit.e and fred.e to go through + * gpre without errors (and correct result). + * + * This is a partial fix until all + * PYXIS datatypes are adjusted in frm_trn.c + * + * removed some compiler warnings too + * */ #include "../jrd/common.h" #include "../jrd/gds.h" + + /* + The datatypes from dsc.h + can't be used with + PYXIS forms + FSG 26.Nov.2000 #include "../jrd/dsc.h" + + */ #include "../gpre/form__proto.h" + + + + /* + I have figured out some of the + PYXIS datatypes + + The following seem to be right + FSG 26.Nov.2000 + */ + + #define dtype_null 0 + #define dtype_text 1 + #define dtype_cstring 2 + #define dtype_varying 3 + #define dtype_short 4 + #define dtype_long 5 + #define dtype_blob 10 + + + /* FIX ME the following are + from dsc.h and are + probably wrong + FSG 26.Nov.2000 + */ + + #define dtype_packed 6 + #define dtype_byte 7 + #define dtype_real 11 + #define dtype_double 12 + #define dtype_d_float 13 + #define dtype_sql_date 14 + #define dtype_sql_time 15 + #define dtype_timestamp 16 + #define dtype_quad 17 + #define dtype_array 18 + #define dtype_int64 19 + + + extern USHORT MET_get_dtype (USHORT, USHORT, USHORT *); Index: gpre.h =================================================================== RCS file: /cvsroot/firebird/interbase/gpre/gpre.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** gpre.h 2000/11/16 15:54:29 1.2 --- gpre.h 2000/11/27 09:26:13 1.3 *************** *** 21,24 **** --- 21,34 ---- * Contributor(s): ______________________________________. * $Log$ + * Revision 1.3 2000/11/27 09:26:13 fsg + * Fixed bugs in gpre to handle PYXIS forms + * and allow edit.e and fred.e to go through + * gpre without errors (and correct result). + * + * This is a partial fix until all + * PYXIS datatypes are adjusted in frm_trn.c + * + * removed some compiler warnings too + * * Revision 1.2 2000/11/16 15:54:29 fsg * Added new switch -verbose to gpre that will dump *************** *** 930,934 **** #define PRV_references 32 /* reference privilege */ #define PRV_grant_option 64 /* privilege to grant privileges being granted */ ! #define PRV_all 128 /* all privileges being granted/revoked /* Ready block */ --- 940,944 ---- #define PRV_references 32 /* reference privilege */ #define PRV_grant_option 64 /* privilege to grant privileges being granted */ ! #define PRV_all 128 /* all privileges being granted/revoked */ /* Ready block */ Index: par.c =================================================================== RCS file: /cvsroot/firebird/interbase/gpre/par.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** par.c 2000/08/03 20:44:07 1.1.1.1 --- par.c 2000/11/27 09:26:13 1.2 *************** *** 20,23 **** --- 20,34 ---- * All Rights Reserved. * Contributor(s): ______________________________________. + * $Log$ + * Revision 1.2 2000/11/27 09:26:13 fsg + * Fixed bugs in gpre to handle PYXIS forms + * and allow edit.e and fred.e to go through + * gpre without errors (and correct result). + * + * This is a partial fix until all + * PYXIS datatypes are adjusted in frm_trn.c + * + * removed some compiler warnings too + * */ *************** *** 285,288 **** --- 296,300 ---- sw_sql = FALSE; return action; + default: break; } *************** *** 336,339 **** --- 348,352 ---- cur_statement = NULL; return par_menu_entree_att(); + default: break; } } *************** *** 691,695 **** *--ptr = (NOD) POP (&stack); ! PUSH (action, &events); if (!sql) --- 704,708 ---- *--ptr = (NOD) POP (&stack); ! PUSH ( action, &events); if (!sql) *************** *** 814,818 **** cur_routine = MAKE_ACTION (NULL_PTR, ACT_routine); cur_routine->act_flags |= ACT_main; ! PUSH (cur_routine, &routine_stack); routine_decl = TRUE; --- 827,831 ---- cur_routine = MAKE_ACTION (NULL_PTR, ACT_routine); cur_routine->act_flags |= ACT_main; ! PUSH ( (NOD) cur_routine, &routine_stack); routine_decl = TRUE; *************** *** 1156,1160 **** while (TRUE) { ! if (symbol = MSC_find_symbol (token.tok_symbol, SYM_database)) { db = (DBB) symbol->sym_object; --- 1169,1173 ---- while (TRUE) { ! if ((symbol = MSC_find_symbol (token.tok_symbol, SYM_database))) { db = (DBB) symbol->sym_object; *************** *** 1491,1495 **** case lan_cxx: do { ! PUSH (PAR_native_value (FALSE, FALSE), &based_on->bas_variables); } while (MATCH (KW_COMMA)); /* --- 1504,1508 ---- case lan_cxx: do { ! PUSH ( (NOD) PAR_native_value (FALSE, FALSE), &based_on->bas_variables); } while (MATCH (KW_COMMA)); /* *************** *** 1536,1539 **** --- 1549,1553 ---- based_on->bas_variables = hold; } + default: break; } *************** *** 2017,2021 **** item->nod_arg [0] = MSC_unary (nod_value, change); item->nod_arg [1] = MSC_unary (nod_field, change); ! PUSH (item, &stack); count++; --- 2031,2035 ---- item->nod_arg [0] = MSC_unary (nod_value, change); item->nod_arg [1] = MSC_unary (nod_field, change); ! PUSH ( (NOD) item, &stack); count++; *************** *** 2032,2036 **** item->nod_arg [0] = MSC_unary (nod_value, flag); item->nod_arg [1] = MSC_unary (nod_field, flag); ! PUSH (item, &stack); count++; } --- 2046,2050 ---- item->nod_arg [0] = MSC_unary (nod_value, flag); item->nod_arg [1] = MSC_unary (nod_field, flag); ! PUSH ( (NOD) item, &stack); count++; } *************** *** 2169,2173 **** item->nod_arg [0] = MSC_unary (nod_field, change); item->nod_arg [1] = MSC_unary (nod_value, change); ! PUSH (item, &stack); count++; } --- 2183,2187 ---- item->nod_arg [0] = MSC_unary (nod_field, change); item->nod_arg [1] = MSC_unary (nod_value, change); ! PUSH ( (NOD) item, &stack); count++; } *************** *** 2181,2185 **** *--ptr = (NOD) POP (&stack); } ! if (context = request->req_contexts) HSH_remove (context->ctx_symbol); --- 2195,2199 ---- *--ptr = (NOD) POP (&stack); } ! if ((context = request->req_contexts)) HSH_remove (context->ctx_symbol); *************** *** 2307,2311 **** action = MAKE_ACTION (request, ACT_s_fetch); ! PUSH (action, &cur_fetch); return action; --- 2321,2325 ---- action = MAKE_ACTION (request, ACT_s_fetch); ! PUSH ( (NOD) action, &cur_fetch); return action; *************** *** 2419,2423 **** action = MAKE_ACTION (request, ACT_for); ! PUSH (action, &cur_for); request->req_rse = rec_expr; --- 2433,2437 ---- action = MAKE_ACTION (request, ACT_for); ! PUSH ( (NOD) action, &cur_for); request->req_rse = rec_expr; *************** *** 2455,2459 **** SYM symbol; ! if (symbol = MSC_find_symbol (token.tok_symbol, type)) { ADVANCE_TOKEN; --- 2469,2473 ---- SYM symbol; ! if ((symbol = MSC_find_symbol (token.tok_symbol, type))) { ADVANCE_TOKEN; *************** *** 2486,2494 **** if (!(context = par_form_menu(SYM_form_map))) if (!(context = par_form_menu (SYM_menu))) return NULL; else return par_menu_display (context); ! request = context->ctx_request; action = MAKE_ACTION (NULL_PTR, ACT_form_display); --- 2500,2509 ---- if (!(context = par_form_menu(SYM_form_map))) + { if (!(context = par_form_menu (SYM_menu))) return NULL; else return par_menu_display (context); ! } request = context->ctx_request; action = MAKE_ACTION (NULL_PTR, ACT_form_display); *************** *** 2615,2619 **** reference = EXP_post_field (field, request->req_contexts, FALSE); reference->ref_friend = parent; ! PUSH (reference, stack); if (!MATCH (KW_COMMA)) break; --- 2630,2634 ---- reference = EXP_post_field (field, request->req_contexts, FALSE); reference->ref_friend = parent; ! PUSH ( (NOD) reference, stack); if (!MATCH (KW_COMMA)) break; *************** *** 2676,2679 **** --- 2691,2695 ---- PAR_error ("no database for operation"); + if ((dbb_symbol = token.tok_symbol) && dbb_symbol->sym_type == SYM_database) *************** *** 2686,2690 **** } else for (dbb = isc_databases; dbb; dbb = dbb->dbb_next) ! if (form = FORM_lookup_form (dbb, token.tok_string)) break; --- 2702,2706 ---- } else for (dbb = isc_databases; dbb; dbb = dbb->dbb_next) ! if ((form = FORM_lookup_form (dbb, token.tok_string))) break; *************** *** 2694,2704 **** SYNTAX_ERROR ("form name"); ADVANCE_TOKEN; /* Set up various data structures */ request->req_form = form; ! if (request->req_form_handle = form_handle) request->req_flags |= REQ_exp_form_handle; --- 2710,2726 ---- SYNTAX_ERROR ("form name"); + /* If we do it here, we will miss + the next identifier + FSG 26.Nov.2000 + ADVANCE_TOKEN; + */ + /* Set up various data structures */ request->req_form = form; ! if ((request->req_form_handle = form_handle)) request->req_flags |= REQ_exp_form_handle; *************** *** 2709,2713 **** symbol->sym_object = context; HSH_insert (symbol); ! PUSH (request, &cur_form); return MAKE_ACTION (request, ACT_form_for); --- 2731,2741 ---- symbol->sym_object = context; HSH_insert (symbol); ! PUSH ( (NOD) request, &cur_form); ! ! /* Do it here to get the next one right ! FSG 26.Nov.2000 ! */ ! ! ADVANCE_TOKEN; return MAKE_ACTION (request, ACT_form_for); *************** *** 2807,2815 **** if (!(context = par_form_menu (SYM_form_map))) if (!(context = par_form_menu (SYM_menu))) SYNTAX_ERROR ("form context or menu context"); else return par_menu_item_for (symbol, context, type); ! symbol->sym_type = SYM_form_map; --- 2835,2844 ---- if (!(context = par_form_menu (SYM_form_map))) + { if (!(context = par_form_menu (SYM_menu))) SYNTAX_ERROR ("form context or menu context"); else return par_menu_item_for (symbol, context, type); ! } symbol->sym_type = SYM_form_map; *************** *** 2845,2849 **** HSH_insert (symbol); action = MAKE_ACTION (request, type); ! PUSH (action, &cur_item); /* If this is a FOR_ITEM, generate an index variable */ --- 2874,2878 ---- HSH_insert (symbol); action = MAKE_ACTION (request, type); ! PUSH ( (NOD) action, &cur_item); /* If this is a FOR_ITEM, generate an index variable */ *************** *** 2961,2965 **** sw_pyxis = TRUE; request = MAKE_REQUEST (REQ_menu); ! PUSH (request, &cur_menu); action = MAKE_ACTION (request, ACT_menu); --- 2990,2994 ---- sw_pyxis = TRUE; request = MAKE_REQUEST (REQ_menu); ! PUSH ( (NOD) request, &cur_menu); action = MAKE_ACTION (request, ACT_menu); *************** *** 3136,3140 **** symbol->sym_object = context; HSH_insert (symbol); ! PUSH (request, &cur_menu); action = MAKE_ACTION (request, ACT_menu_for); --- 3165,3169 ---- symbol->sym_object = context; HSH_insert (symbol); ! PUSH ( (NOD) request, &cur_menu); action = MAKE_ACTION (request, ACT_menu_for); *************** *** 3179,3183 **** HSH_insert (symbol); action = MAKE_ACTION (request, type); ! PUSH (action, &cur_item); entree = (ENTREE) ALLOC (sizeof (struct entree)); --- 3208,3212 ---- HSH_insert (symbol); action = MAKE_ACTION (request, type); ! PUSH ( (NOD) action, &cur_item); entree = (ENTREE) ALLOC (sizeof (struct entree)); *************** *** 3211,3215 **** modify = (UPD) ALLOC (UPD_LEN); ! PUSH (modify, &cur_modify); /* If the next token isn't a context variable, we can't continue */ --- 3240,3244 ---- modify = (UPD) ALLOC (UPD_LEN); ! PUSH ( (NOD) modify, &cur_modify); /* If the next token isn't a context variable, we can't continue */ *************** *** 3295,3299 **** action->act_object = (REF) cur_statement; ! PUSH (action, &cur_error); if (cur_statement->act_pair) --- 3324,3328 ---- action->act_object = (REF) cur_statement; ! PUSH ( (NOD) action, &cur_error); if (cur_statement->act_pair) *************** *** 3423,3427 **** if (act_op == ACT_blob_for) ! PUSH (action, &cur_for); /* Need to eat the semicolon if present */ --- 3452,3456 ---- if (act_op == ACT_blob_for) ! PUSH ( (NOD) action, &cur_for); /* Need to eat the semicolon if present */ *************** *** 3514,3518 **** if (!(action->act_flags & ACT_decl)) { ! PUSH (cur_routine, &routine_stack); cur_routine = action; } --- 3543,3547 ---- if (!(action->act_flags & ACT_decl)) { ! PUSH ( (NOD) cur_routine, &routine_stack); cur_routine = action; } *************** *** 3539,3547 **** if (!SINGLE_QUOTED(token.tok_type)) SYNTAX_ERROR ("quoted string"); - string = (TEXT*) ALLOC (token.tok_length + 1); COPY (token.tok_string , token.tok_length , string); - ADVANCE_TOKEN; return string; } --- 3568,3579 ---- if (!SINGLE_QUOTED(token.tok_type)) SYNTAX_ERROR ("quoted string"); string = (TEXT*) ALLOC (token.tok_length + 1); COPY (token.tok_string , token.tok_length , string); + /* Adjust size to include quotes + FSG 26.Nov.2000 + */ + token.tok_length=token.tok_length+2; + ADVANCE_TOKEN; return string; } *************** *** 3811,3816 **** /* both actions go on the cur_store stack, the store topmost */ ! PUSH (action, &cur_store); ! PUSH (begin_action, &cur_store); return action; } --- 3843,3848 ---- /* both actions go on the cur_store stack, the store topmost */ ! PUSH ( (NOD) action, &cur_store); ! PUSH ( (NOD) begin_action, &cur_store); return action; } *************** *** 3958,3962 **** par_options (request, FALSE); action = MAKE_ACTION (request, ACT_store); ! PUSH (action, &cur_store); context = EXP_context (request, NULL_PTR); --- 3990,3994 ---- par_options (request, FALSE); action = MAKE_ACTION (request, ACT_store); ! PUSH ( (NOD) action, &cur_store); context = EXP_context (request, NULL_PTR); |