diff --git a/actions.c b/actions.c index cd54687..f013a20 100644 --- a/actions.c +++ b/actions.c @@ -52,9 +52,9 @@ #if defined(X3270_FT) /*[*/ #include "ftc.h" #endif /*]*/ -#if defined(X3270_DISPLAY) /*[*/ -#include "keypadc.h" -#endif /*]*/ +// #if defined(X3270_DISPLAY) +// #include "keypadc.h" +//#endif #if defined(X3270_DISPLAY) || defined(C3270) || defined(WC3270) /*[*/ #include "screenc.h" #endif /*]*/ diff --git a/ansi.c b/ansi.c index 0edae4f..f8dc50a 100644 --- a/ansi.c +++ b/ansi.c @@ -44,7 +44,7 @@ #endif /*]*/ #include "appres.h" -#include "ctlr.h" +// #include "ctlr.h" #if defined(X3270_DBCS) /*[*/ #include "3270ds.h" #endif /*]*/ @@ -714,8 +714,7 @@ ansi_erase_in_display(int nn, int ig2 unused) ctlr_aclear(0, h3270.cursor_addr + 1, 1); break; case 2: /* all (without moving cursor) */ - if (h3270.cursor_addr == 0 && !h3270.is_altbuffer) - scroll_save(h3270.rows, True); +// if (h3270.cursor_addr == 0 && !h3270.is_altbuffer) scroll_save(h3270.rows, True); ctlr_aclear(0, h3270.rows * h3270.cols, 1); break; } @@ -1663,9 +1662,10 @@ ansi_scroll(void) held_wrap = False; /* Save the top line */ - if (scroll_top == 1 && scroll_bottom == h3270.rows) { - if (!h3270.is_altbuffer) - scroll_save(1, False); + if (scroll_top == 1 && scroll_bottom == h3270.rows) + { +// if (!h3270.is_altbuffer) +// scroll_save(1, False); ctlr_scroll(); return; } @@ -1720,7 +1720,7 @@ ansi_process(unsigned int c) c &= 0xff; ansi_ch = c; - scroll_to_bottom(); +// scroll_to_bottom(); #if defined(X3270_TRACE) /*[*/ if (toggled(SCREEN_TRACE)) diff --git a/childc.h b/childc.h index ed73fd5..b3dd5ab 100644 --- a/childc.h +++ b/childc.h @@ -17,10 +17,12 @@ * Global declarations for child.c. */ -#if defined(X3270_DISPLAY) || defined(C3270) /*[*/ +/* +#if defined(X3270_DISPLAY) || defined(C3270) LIB3270_INTERNAL int fork_child(void); LIB3270_INTERNAL void child_ignore_output(void); -#else /*][*/ +#else #define fork_child() fork() #define child_ignore_output() -#endif /*]*/ +#endif +*/ diff --git a/ctlr.c b/ctlr.c index f3a0793..0185f3a 100644 --- a/ctlr.c +++ b/ctlr.c @@ -42,7 +42,7 @@ #include #include "3270ds.h" #include "appres.h" -#include "ctlr.h" +// #include "ctlr.h" #include "screen.h" #include "resources.h" @@ -503,7 +503,7 @@ process_ds(unsigned char *buf, int buflen) if (!buflen) return PDS_OKAY_NO_OUTPUT; - scroll_to_bottom(); +// scroll_to_bottom(); trace_ds("< "); @@ -2329,7 +2329,7 @@ ctlr_clear(H3270 *session, Boolean can_snap) if (can_snap && !trace_skipping && toggled(SCREEN_TRACE)) trace_screen(); #endif /*]*/ - scroll_save(session->maxROWS, ever_3270 ? False : True); +// scroll_save(session->maxROWS, ever_3270 ? False : True); } #if defined(X3270_TRACE) /*[*/ trace_skipping = False; @@ -2389,7 +2389,7 @@ ctlr_add(int baddr, unsigned char c, unsigned char cs) if (toggled(SCREEN_TRACE)) trace_screen(); #endif /*]*/ - scroll_save(session->maxROWS, False); +// scroll_save(session->maxROWS, False); trace_primed = False; } /* diff --git a/ctlr.h b/ctlr.h index e3e52af..6548621 100644 --- a/ctlr.h +++ b/ctlr.h @@ -17,5 +17,7 @@ * External declarations for ctlr.c data structures. */ + #warning Deprecated ctlr.h, please remove it + // extern int buffer_addr; /**< buffer address */ // extern struct ea *ea_buf; /**< 3270 device buffer */ diff --git a/dialogc.h b/dialogc.h index 6a9aa40..320f12e 100644 --- a/dialogc.h +++ b/dialogc.h @@ -16,3 +16,5 @@ * dialogc.h * Empty definitions for dialog.c. */ + +#warning deprecated dialogc.h diff --git a/ft.c b/ft.c index ec02637..eae9493 100644 --- a/ft.c +++ b/ft.c @@ -43,7 +43,7 @@ #include "ft_cutc.h" #include "ft_dftc.h" #include "ftc.h" -#include "dialogc.h" +// #include "dialogc.h" #include "hostc.h" #if defined(C3270) || defined(WC3270) #include "icmdc.h" diff --git a/ft_cut.c b/ft_cut.c index 3ed1cb4..f37a219 100644 --- a/ft_cut.c +++ b/ft_cut.c @@ -44,7 +44,7 @@ // #include #include "appres.h" -#include "ctlr.h" +// #include "ctlr.h" #include "3270ds.h" #include "actionsc.h" diff --git a/keypadc.h b/keypadc.h index 175f27e..14d1ea3 100644 --- a/keypadc.h +++ b/keypadc.h @@ -17,17 +17,14 @@ * Global declarations for keypad.c. */ -LIB3270_INTERNAL Boolean keypad_changed; - -#if defined(X3270_KEYPAD) /*[*/ +// LIB3270_INTERNAL Boolean keypad_changed; +/* +#if defined(X3270_KEYPAD) -LIB3270_INTERNAL enum kp_placement { - kp_right, kp_left, kp_bottom, kp_integral, kp_inside_right -} kp_placement; +LIB3270_INTERNAL enum kp_placement { kp_right, kp_left, kp_bottom, kp_integral, kp_inside_right } kp_placement; LIB3270_INTERNAL void keypad_first_up(void); -LIB3270_INTERNAL Widget keypad_init(Widget container, Dimension voffset, - Dimension screen_width, Boolean floating, Boolean vert); +LIB3270_INTERNAL Widget keypad_init(Widget container, Dimension voffset, Dimension screen_width, Boolean floating, Boolean vert); LIB3270_INTERNAL void keypad_move(void); LIB3270_INTERNAL void keypad_placement_init(void); LIB3270_INTERNAL void keypad_popup_init(void); @@ -37,7 +34,7 @@ LIB3270_INTERNAL void keypad_set_temp_keymap(XtTranslations trans); LIB3270_INTERNAL void keypad_shift(void); LIB3270_INTERNAL Dimension min_keypad_width(void); -#else /*][*/ +#else #define keypad_qheight() 0 #define min_keypad_width() 0 @@ -50,4 +47,5 @@ LIB3270_INTERNAL Dimension min_keypad_width(void); #define keypad_set_temp_keymap(n) #define keypad_shift() -#endif /*]*/ +#endif +*/ diff --git a/kybd.c b/kybd.c index 2fed494..04b3d85 100644 --- a/kybd.c +++ b/kybd.c @@ -49,7 +49,7 @@ #include #include "3270ds.h" #include "appres.h" -#include "ctlr.h" +// #include "ctlr.h" #include "resources.h" #include "actionsc.h" @@ -58,7 +58,7 @@ #include "ctlrc.h" #include "ftc.h" #include "hostc.h" -#include "keypadc.h" +// #include "keypadc.h" #include "kybdc.h" #include "popupsc.h" #include "printc.h" @@ -232,7 +232,7 @@ static int enq_chk(void) else { ta_head = ta; - status_typeahead(True); + status_typeahead(&h3270,True); } ta_tail = ta; @@ -263,7 +263,7 @@ static void enq_ta(XtActionProc fn, char *parm1, char *parm2) ta_tail->next = ta; else { ta_head = ta; - status_typeahead(True); + status_typeahead(&h3270,True); } ta_tail = ta; @@ -282,7 +282,7 @@ Boolean run_ta(void) if ((ta_head = ta->next) == (struct ta *)NULL) { ta_tail = (struct ta *)NULL; - status_typeahead(False); + status_typeahead(&h3270,False); } switch(ta->type) @@ -337,7 +337,7 @@ flush_ta(void) any = True; } ta_head = ta_tail = (struct ta *) NULL; - status_typeahead(False); + status_typeahead(&h3270,False); return any; } diff --git a/objects.h b/objects.h index 11c8990..c0ce6bd 100644 --- a/objects.h +++ b/objects.h @@ -17,10 +17,10 @@ * x3270 object names. */ -#define ObjConfirmButton "confirmButton" -#define ObjConfirm2Button "confirm2Button" -#define ObjCancelButton "cancelButton" +// #define ObjConfirmButton "confirmButton" +// #define ObjConfirm2Button "confirm2Button" +// #define ObjCancelButton "cancelButton" #define ObjDialog "dialog" -#define ObjSmallLabel "smallLabel" +// #define ObjSmallLabel "smallLabel" #define ObjNameLabel "nameLabel" #define ObjDataLabel "dataLabel" diff --git a/paste.c b/paste.c index 81487dd..9d2109b 100644 --- a/paste.c +++ b/paste.c @@ -47,7 +47,7 @@ #include #include "3270ds.h" #include "appres.h" -#include "ctlr.h" +// #include "ctlr.h" #include "resources.h" #include "actionsc.h" @@ -56,7 +56,7 @@ #include "ctlrc.h" #include "ftc.h" #include "hostc.h" -#include "keypadc.h" +// #include "keypadc.h" #include "kybdc.h" #include "popupsc.h" #include "printc.h" diff --git a/print.c b/print.c index 93cb123..53fe28f 100644 --- a/print.c +++ b/print.c @@ -39,7 +39,7 @@ #include "appres.h" #include "3270ds.h" -#include "ctlr.h" +// #include "ctlr.h" #include "ctlrc.h" #include "tablesc.h" diff --git a/printer.c b/printer.c index 1396aff..78de4e4 100644 --- a/printer.c +++ b/printer.c @@ -54,7 +54,7 @@ #include "appres.h" #include "objects.h" #include "resources.h" -#include "ctlr.h" +// #include "ctlr.h" #include "charsetc.h" #include "ctlrc.h" diff --git a/savec.h b/savec.h index f38a6a7..5aa4bf6 100644 --- a/savec.h +++ b/savec.h @@ -14,6 +14,9 @@ /* Non-display version of savec.h */ +/* + #define save_yourself() LIB3270_INTERNAL char *command_string; +*/ diff --git a/screen.c b/screen.c index 581aba9..5530784 100644 --- a/screen.c +++ b/screen.c @@ -40,7 +40,7 @@ #include "appres.h" #include "3270ds.h" #include "resources.h" -#include "ctlr.h" +// #include "ctlr.h" #include "actionsc.h" #include "ctlrc.h" @@ -708,7 +708,7 @@ LIB3270_EXPORT void lib3270_set_popup_handler(int (*handler)(H3270 *, LIB3270_NO popup_handler = handler ? handler : logpopup; } -LIB3270_EXPORT lib3270_popup_dialog(H3270 *session, LIB3270_NOTIFY id , const char *title, const char *message, const char *fmt, ...) +LIB3270_EXPORT void lib3270_popup_dialog(H3270 *session, LIB3270_NOTIFY id , const char *title, const char *message, const char *fmt, ...) { va_list args; diff --git a/screen.h b/screen.h index 4214aa6..7c2dafc 100644 --- a/screen.h +++ b/screen.h @@ -14,9 +14,9 @@ /* Non-display version of screen.h */ -#define SELECTED(baddr) False +// #define SELECTED(baddr) False LIB3270_INTERNAL int *char_width, *char_height; -LIB3270_INTERNAL Boolean screen_has_changes; +// LIB3270_INTERNAL Boolean screen_has_changes; // LIB3270_INTERNAL void screen_update(H3270 *session, int bstart, int bend); diff --git a/scrollc.h b/scrollc.h index 6a54525..4cfb82e 100644 --- a/scrollc.h +++ b/scrollc.h @@ -14,5 +14,5 @@ /* Non-display version of scrollc.h */ -#define scroll_save(n, trim_blanks) -#define scroll_to_bottom() +// #define scroll_save(n, trim_blanks) +// #define scroll_to_bottom() diff --git a/selection.c b/selection.c index 88d328a..20d4505 100644 --- a/selection.c +++ b/selection.c @@ -28,7 +28,7 @@ */ #include "globals.h" - #include "ctlr.h" +// #include "ctlr.h" #include "appres.h" #include #include @@ -347,3 +347,45 @@ LIB3270_EXPORT char * lib3270_get_selected(H3270 *hSession) return realloc(ret,sz+1); } +LIB3270_EXPORT int lib3270_move_selection(H3270 *hSession, LIB3270_DIRECTION dir) +{ + if(!hSession->selected || hSession->select.begin == hSession->select.end) + return ENOENT; + + switch(dir) + { + case LIB3270_DIR_UP: + if(hSession->select.begin <= hSession->cols) + return EINVAL; + hSession->select.begin -= hSession->cols; + hSession->select.end -= hSession->cols; + break; + + case LIB3270_DIR_DOWN: + if(hSession->select.end >= (hSession->cols * (hSession->rows-1))) + return EINVAL; + hSession->select.begin += hSession->cols; + hSession->select.end += hSession->cols; + break; + + case LIB3270_DIR_LEFT: + if( (hSession->select.begin % hSession->cols) < 1) + return EINVAL; + hSession->select.begin--; + hSession->select.end--; + break; + + case LIB3270_DIR_RIGHT: + if( (hSession->select.end % hSession->cols) >= hSession->cols) + return EINVAL; + hSession->select.begin++; + hSession->select.end++; + break; + + default: + return -1; + } + + update_selection(hSession); + return 0; +} diff --git a/sf.c b/sf.c index c4d0f9a..f79eaa4 100644 --- a/sf.c +++ b/sf.c @@ -45,7 +45,7 @@ #include "3270ds.h" #include "appres.h" #include "screen.h" -#include "ctlr.h" +// #include "ctlr.h" #include "resources.h" #include "charsetc.h" diff --git a/statusc.h b/statusc.h index d683223..633cd0a 100644 --- a/statusc.h +++ b/statusc.h @@ -34,7 +34,7 @@ LIB3270_INTERNAL void status_changed(H3270 *session, LIB3270_STATUS id); LIB3270_INTERNAL void set_status(H3270 *session, OIA_FLAG id, Boolean on); -#define status_typeahead(on) set_status(NULL,OIA_FLAG_TYPEAHEAD,on) +#define status_typeahead(h,on) set_status(h,OIA_FLAG_TYPEAHEAD,on) #define status_kybdlock() status_changed(NULL,LIB3270_STATUS_KYBDLOCK) #define status_syswait() status_changed(NULL,LIB3270_STATUS_SYSWAIT) #define status_minus() status_changed(NULL,LIB3270_STATUS_MINUS) diff --git a/trace_ds.c b/trace_ds.c index 83ee48b..a99ccf3 100644 --- a/trace_ds.c +++ b/trace_ds.c @@ -56,7 +56,7 @@ #include "appres.h" #include "objects.h" #include "resources.h" -#include "ctlr.h" +// #include "ctlr.h" #include "charsetc.h" #include "childc.h" @@ -422,7 +422,7 @@ create_tracefile_header(const char *mode) clk = time((time_t *)0); wtrace("Trace %s %s", mode, ctime(&clk)); wtrace(" Version: %s\n", build); - save_yourself(); +// save_yourself(); // wtrace(" Command: %s\n", command_string); wtrace(" Model %s", h3270.model_name); wtrace(", %s display", appres.mono ? "monochrome" : "color"); -- libgit2 0.21.2