8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 23:23:04 +01:00

Add special action to be used in dyn_def.cpp.

This commit is contained in:
brodsom 2003-07-02 18:58:41 +00:00
parent 1608cdd0aa
commit 2ab0bde05d
6 changed files with 69 additions and 40 deletions

View File

@ -19,7 +19,7 @@
* *
* All Rights Reserved. * All Rights Reserved.
* Contributor(s): ______________________________________. * Contributor(s): ______________________________________.
* $Id: gpre.h,v 1.32 2003-07-02 12:57:41 brodsom Exp $ * $Id: gpre.h,v 1.33 2003-07-02 18:58:41 brodsom Exp $
* Revision 1.3 2000/11/27 09:26:13 fsg * Revision 1.3 2000/11/27 09:26:13 fsg
* Fixed bugs in gpre to handle PYXIS forms * Fixed bugs in gpre to handle PYXIS forms
* and allow edit.e and fred.e to go through * and allow edit.e and fred.e to go through
@ -236,6 +236,7 @@ typedef enum act_t {
ACT_endfor, ACT_endfor,
ACT_endmodify, ACT_endmodify,
ACT_endstore, ACT_endstore,
ACT_endstore_special,
ACT_erase, ACT_erase,
ACT_event_init, ACT_event_init,
ACT_event_wait, ACT_event_wait,

View File

@ -153,6 +153,7 @@
#endif #endif
{"END_MODIFY", KW_END_MODIFY}, {"END_MODIFY", KW_END_MODIFY},
{"END_STORE", KW_END_STORE}, {"END_STORE", KW_END_STORE},
{"END_STORE_SPECIAL", KW_END_STORE_SPECIAL},
{"END_STREAM", KW_END_STREAM}, {"END_STREAM", KW_END_STREAM},
#ifdef PYXIS #ifdef PYXIS
{"ENTREE_LENGTH", KW_ENTREE_LENGTH}, {"ENTREE_LENGTH", KW_ENTREE_LENGTH},

View File

@ -25,7 +25,7 @@
// //
//____________________________________________________________ //____________________________________________________________
// //
// $Id: int.cpp,v 1.12 2003-03-27 17:15:44 brodsom Exp $ // $Id: int.cpp,v 1.13 2003-07-02 18:58:41 brodsom Exp $
// //
#include "firebird.h" #include "firebird.h"
@ -48,7 +48,7 @@ static int gen_blr(int *, int, TEXT *);
static void gen_compile(GPRE_REQ, int); static void gen_compile(GPRE_REQ, int);
static void gen_database(ACT, int); static void gen_database(ACT, int);
static void gen_emodify(ACT, int); static void gen_emodify(ACT, int);
static void gen_estore(ACT, int); static void gen_estore(ACT, int, bool);
static void gen_endfor(ACT, int); static void gen_endfor(ACT, int);
static void gen_erase(ACT, int); static void gen_erase(ACT, int);
static void gen_for(ACT, int); static void gen_for(ACT, int);
@ -60,8 +60,8 @@ static void gen_routine(ACT, int);
static void gen_s_end(ACT, int); static void gen_s_end(ACT, int);
static void gen_s_fetch(ACT, int); static void gen_s_fetch(ACT, int);
static void gen_s_start(ACT, int); static void gen_s_start(ACT, int);
static void gen_send(GPRE_REQ, POR, int); static void gen_send(GPRE_REQ, POR, int, bool);
static void gen_start(GPRE_REQ, POR, int); static void gen_start(GPRE_REQ, POR, int, bool);
static void gen_type(ACT, int); static void gen_type(ACT, int);
static void gen_variable(ACT, int); static void gen_variable(ACT, int);
static void make_port(POR, int); static void make_port(POR, int);
@ -113,7 +113,10 @@ void INT_action( ACT action, int column)
gen_emodify(action, column); gen_emodify(action, column);
break; break;
case ACT_endstore: case ACT_endstore:
gen_estore(action, column); gen_estore(action, column, false);
break;
case ACT_endstore_special:
gen_estore(action, column, true);
break; break;
case ACT_erase: case ACT_erase:
gen_erase(action, column); gen_erase(action, column);
@ -349,7 +352,7 @@ static void gen_emodify( ACT action, int column)
gen_name(s1, reference), gen_name(s2, source)); gen_name(s1, reference), gen_name(s2, source));
} }
gen_send(action->act_request, modify->upd_port, column); gen_send(action->act_request, modify->upd_port, column, false);
} }
@ -358,14 +361,14 @@ static void gen_emodify( ACT action, int column)
// Generate substitution text for END_STORE. // Generate substitution text for END_STORE.
// //
static void gen_estore( ACT action, int column) static void gen_estore( ACT action, int column, bool special)
{ {
GPRE_REQ request; GPRE_REQ request;
request = action->act_request; request = action->act_request;
align(column); align(column);
gen_compile(request, column); gen_compile(request, column);
gen_start(request, request->req_primary, column); gen_start(request, request->req_primary, column, special);
} }
@ -382,7 +385,7 @@ static void gen_endfor( ACT action, int column)
column += INDENT; column += INDENT;
if (request->req_sync) if (request->req_sync)
gen_send(request, request->req_sync, column); gen_send(request, request->req_sync, column, false);
END; END;
} }
@ -398,7 +401,7 @@ static void gen_erase( ACT action, int column)
UPD erase; UPD erase;
erase = (UPD) action->act_object; erase = (UPD) action->act_object;
gen_send(erase->upd_request, erase->upd_port, column); gen_send(erase->upd_request, erase->upd_port, column, false);
} }
@ -561,7 +564,7 @@ static void gen_s_fetch( ACT action, int column)
request = action->act_request; request = action->act_request;
if (request->req_sync) if (request->req_sync)
gen_send(request, request->req_sync, column); gen_send(request, request->req_sync, column, false);
gen_receive(action->act_request, request->req_primary); gen_receive(action->act_request, request->req_primary);
} }
@ -584,7 +587,7 @@ static void gen_s_start( ACT action, int column)
if (port = request->req_vport) if (port = request->req_vport)
asgn_from(port->por_references, column); asgn_from(port->por_references, column);
gen_start(request, port, column); gen_start(request, port, column, false);
} }
@ -593,9 +596,17 @@ static void gen_s_start( ACT action, int column)
// Generate a send or receive call for a port. // Generate a send or receive call for a port.
// //
static void gen_send( GPRE_REQ request, POR port, int column) static void gen_send( GPRE_REQ request, POR port, int column, bool special)
{ {
if (special) {
align(column);
ib_fprintf(out_file, "if (ignore_perm)");
align(column);
ib_fprintf(out_file, "\t((JRD_REQ)request)->req_flags |= req_ignore_perm;");
}
align(column); align(column);
ib_fprintf(out_file, "EXE_send (tdbb, (JRD_REQ)%s, %d, %d, (UCHAR*)&jrd_%d);", ib_fprintf(out_file, "EXE_send (tdbb, (JRD_REQ)%s, %d, %d, (UCHAR*)&jrd_%d);",
request->req_handle, request->req_handle,
port->por_msg_number, port->por_length, port->por_ident); port->por_msg_number, port->por_length, port->por_ident);
@ -607,7 +618,7 @@ static void gen_send( GPRE_REQ request, POR port, int column)
// Generate a START. // Generate a START.
// //
static void gen_start( GPRE_REQ request, POR port, int column) static void gen_start( GPRE_REQ request, POR port, int column, bool special)
{ {
align(column); align(column);
@ -615,7 +626,7 @@ static void gen_start( GPRE_REQ request, POR port, int column)
request->req_handle, request->req_trans); request->req_handle, request->req_trans);
if (port) if (port)
gen_send(request, port, column); gen_send(request, port, column, special);
} }
@ -627,7 +638,7 @@ static void gen_start( GPRE_REQ request, POR port, int column)
static void gen_type( ACT action, int column) static void gen_type( ACT action, int column)
{ {
printa(column, "%ld", action->act_object); printa(column, "%ld", (SLONG) action->act_object);
} }

View File

@ -25,7 +25,7 @@
// //
//____________________________________________________________ //____________________________________________________________
// //
// $Id: int_cxx.cpp,v 1.10 2003-03-27 17:15:43 brodsom Exp $ // $Id: int_cxx.cpp,v 1.11 2003-07-02 18:58:41 brodsom Exp $
// //
#include "firebird.h" #include "firebird.h"
@ -48,7 +48,7 @@ static int gen_blr(int *, int, TEXT *);
static void gen_compile(GPRE_REQ, int); static void gen_compile(GPRE_REQ, int);
static void gen_database(ACT, int); static void gen_database(ACT, int);
static void gen_emodify(ACT, int); static void gen_emodify(ACT, int);
static void gen_estore(ACT, int); static void gen_estore(ACT, int, bool);
static void gen_endfor(ACT, int); static void gen_endfor(ACT, int);
static void gen_erase(ACT, int); static void gen_erase(ACT, int);
static void gen_for(ACT, int); static void gen_for(ACT, int);
@ -60,8 +60,8 @@ static void gen_routine(ACT, int);
static void gen_s_end(ACT, int); static void gen_s_end(ACT, int);
static void gen_s_fetch(ACT, int); static void gen_s_fetch(ACT, int);
static void gen_s_start(ACT, int); static void gen_s_start(ACT, int);
static void gen_send(GPRE_REQ, POR, int); static void gen_send(GPRE_REQ, POR, int, bool);
static void gen_start(GPRE_REQ, POR, int); static void gen_start(GPRE_REQ, POR, int, bool);
static void gen_type(ACT, int); static void gen_type(ACT, int);
static void gen_variable(ACT, int); static void gen_variable(ACT, int);
static void make_port(POR, int); static void make_port(POR, int);
@ -113,7 +113,10 @@ void INT_CXX_action( ACT action, int column)
gen_emodify(action, column); gen_emodify(action, column);
break; break;
case ACT_endstore: case ACT_endstore:
gen_estore(action, column); gen_estore(action, column,false);
break;
case ACT_endstore_special:
gen_estore(action, column,true);
break; break;
case ACT_erase: case ACT_erase:
gen_erase(action, column); gen_erase(action, column);
@ -355,7 +358,7 @@ static void gen_emodify( ACT action, int column)
gen_name(s1, reference), gen_name(s2, source)); gen_name(s1, reference), gen_name(s2, source));
} }
gen_send(action->act_request, modify->upd_port, column); gen_send(action->act_request, modify->upd_port, column, false);
} }
@ -364,14 +367,14 @@ static void gen_emodify( ACT action, int column)
// Generate substitution text for END_STORE. // Generate substitution text for END_STORE.
// //
static void gen_estore( ACT action, int column) static void gen_estore( ACT action, int column, bool special)
{ {
GPRE_REQ request; GPRE_REQ request;
request = action->act_request; request = action->act_request;
align(column); align(column);
gen_compile(request, column); gen_compile(request, column);
gen_start(request, request->req_primary, column); gen_start(request, request->req_primary, column, special);
} }
@ -388,7 +391,7 @@ static void gen_endfor( ACT action, int column)
column += INDENT; column += INDENT;
if (request->req_sync) if (request->req_sync)
gen_send(request, request->req_sync, column); gen_send(request, request->req_sync, column, false);
END; END;
} }
@ -404,7 +407,7 @@ static void gen_erase( ACT action, int column)
UPD erase; UPD erase;
erase = (UPD) action->act_object; erase = (UPD) action->act_object;
gen_send(erase->upd_request, erase->upd_port, column); gen_send(erase->upd_request, erase->upd_port, column, false);
} }
@ -536,8 +539,8 @@ static void gen_routine( ACT action, int column)
POR port; POR port;
for (request = (GPRE_REQ) action->act_object; request; for (request = (GPRE_REQ) action->act_object; request;
request = request->req_routine) for (port = request->req_ports; port; request = request->req_routine)
port = port->por_next) for (port = request->req_ports; port; port = port->por_next)
make_port(port, column + INDENT); make_port(port, column + INDENT);
} }
@ -567,7 +570,7 @@ static void gen_s_fetch( ACT action, int column)
request = action->act_request; request = action->act_request;
if (request->req_sync) if (request->req_sync)
gen_send(request, request->req_sync, column); gen_send(request, request->req_sync, column, false);
gen_receive(action->act_request, request->req_primary); gen_receive(action->act_request, request->req_primary);
} }
@ -590,7 +593,7 @@ static void gen_s_start( ACT action, int column)
if (port = request->req_vport) if (port = request->req_vport)
asgn_from(port->por_references, column); asgn_from(port->por_references, column);
gen_start(request, port, column); gen_start(request, port, column, false);
} }
@ -599,9 +602,16 @@ static void gen_s_start( ACT action, int column)
// Generate a send or receive call for a port. // Generate a send or receive call for a port.
// //
static void gen_send( GPRE_REQ request, POR port, int column) static void gen_send( GPRE_REQ request, POR port, int column, bool special)
{ {
if (special) {
align(column);
ib_fprintf(out_file, "if (ignore_perm)");
align(column);
ib_fprintf(out_file, "\t((JRD_REQ)request)->req_flags |= req_ignore_perm;");
}
align(column); align(column);
ib_fprintf(out_file, "EXE_send (tdbb, (JRD_REQ)%s, %d, %d, (UCHAR*)&jrd_%d);", ib_fprintf(out_file, "EXE_send (tdbb, (JRD_REQ)%s, %d, %d, (UCHAR*)&jrd_%d);",
request->req_handle, request->req_handle,
port->por_msg_number, port->por_length, port->por_ident); port->por_msg_number, port->por_length, port->por_ident);
@ -613,7 +623,7 @@ static void gen_send( GPRE_REQ request, POR port, int column)
// Generate a START. // Generate a START.
// //
static void gen_start( GPRE_REQ request, POR port, int column) static void gen_start( GPRE_REQ request, POR port, int column, bool special)
{ {
align(column); align(column);
@ -621,7 +631,7 @@ static void gen_start( GPRE_REQ request, POR port, int column)
request->req_handle, request->req_trans); request->req_handle, request->req_trans);
if (port) if (port)
gen_send(request, port, column); gen_send(request, port, column, special);
} }

View File

@ -20,7 +20,7 @@
// //
// All Rights Reserved. // All Rights Reserved.
// Contributor(s): ______________________________________. // Contributor(s): ______________________________________.
// $Id: par.cpp,v 1.19 2003-07-02 12:57:41 brodsom Exp $ // $Id: par.cpp,v 1.20 2003-07-02 18:58:41 brodsom Exp $
// Revision 1.2 2000/11/27 09:26:13 fsg // Revision 1.2 2000/11/27 09:26:13 fsg
// Fixed bugs in gpre to handle PYXIS forms // Fixed bugs in gpre to handle PYXIS forms
// and allow edit.e and fred.e to go through // and allow edit.e and fred.e to go through
@ -37,7 +37,7 @@
// //
//____________________________________________________________ //____________________________________________________________
// //
// $Id: par.cpp,v 1.19 2003-07-02 12:57:41 brodsom Exp $ // $Id: par.cpp,v 1.20 2003-07-02 18:58:41 brodsom Exp $
// //
#include "firebird.h" #include "firebird.h"
@ -93,7 +93,7 @@ static ACT par_end_menu();
#endif #endif
static ACT par_end_modify(); static ACT par_end_modify();
static ACT par_end_stream(); static ACT par_end_stream();
static ACT par_end_store(); static ACT par_end_store(bool);
#ifdef PYXIS #ifdef PYXIS
static ACT par_entree(); static ACT par_entree();
#endif #endif
@ -281,7 +281,9 @@ ACT PAR_action(TEXT* base_dir)
case KW_END_STREAM: case KW_END_STREAM:
return cur_statement = par_end_stream(); return cur_statement = par_end_stream();
case KW_END_STORE: case KW_END_STORE:
return cur_statement = par_end_store(); return cur_statement = par_end_store(false);
case KW_END_STORE_SPECIAL:
return cur_statement = par_end_store(true);
#ifdef PYXIS #ifdef PYXIS
case KW_MENU_ENTREE: case KW_MENU_ENTREE:
return par_entree(); return par_entree();
@ -2022,7 +2024,7 @@ static ACT par_end_stream()
// Process an END_STORE. // Process an END_STORE.
// //
static ACT par_end_store() static ACT par_end_store(bool special)
{ {
ACT begin_action, action2, action; ACT begin_action, action2, action;
GPRE_REQ request; GPRE_REQ request;
@ -2110,7 +2112,10 @@ static ACT par_end_store()
if ((context = request->req_contexts)) if ((context = request->req_contexts))
HSH_remove(context->ctx_symbol); HSH_remove(context->ctx_symbol);
action = MAKE_ACTION(request, ACT_endstore); if (special)
action = MAKE_ACTION(request, ACT_endstore_special);
else
action = MAKE_ACTION(request, ACT_endstore);
begin_action->act_pair = action; begin_action->act_pair = action;
action->act_pair = begin_action; action->act_pair = begin_action;
return action; return action;

View File

@ -63,6 +63,7 @@ KW_start_actions,
#endif #endif
KW_END_MODIFY, KW_END_MODIFY,
KW_END_STORE, KW_END_STORE,
KW_END_STORE_SPECIAL,
KW_END_STREAM, KW_END_STREAM,
KW_ERASE, KW_ERASE,
KW_ESCAPE, KW_ESCAPE,