diff --git a/api.h b/api.h index 3b7fd74..eebb3c4 100644 --- a/api.h +++ b/api.h @@ -383,7 +383,8 @@ const char *description; }; - LOCAL_EXTERN int Register3270ScreenCallbacks(const struct lib3270_screen_callbacks *cbk); + // LOCAL_EXTERN int Register3270ScreenCallbacks(const struct lib3270_screen_callbacks *cbk); + LOCAL_EXTERN void ring_bell(void); #define new_3270_session(m) lib3270_session_new(m) @@ -395,8 +396,23 @@ LOCAL_EXTERN void show_3270_popup_dialog(H3270 *session, PW3270_DIALOG type, const char *title, const char *msg, const char *fmt, ...); /* Set/Get screen contents */ - LOCAL_EXTERN int find_field_attribute(H3270 *session, int baddr); - LOCAL_EXTERN int find_field_length(H3270 *session, int baddr); + #define find_field_attribute(s,a) lib3270_field_addr(s,a) + #define find_field_length(s,a) find_field_length(s,a) + + /** + * Find the buffer address of the field attribute for a given buffer address. + * + * @param h Session handle. + * @param addr Buffer address of the field. + * + * @return field address or -1 if the screen isn't formatted. + * + */ + LIB3270_EXPORT int lib3270_field_addr(H3270 *h, int baddr); + + LIB3270_EXPORT int lib3270_field_length(H3270 *session, int baddr); + + LOCAL_EXTERN unsigned char get_field_attribute(H3270 *session, int baddr); LOCAL_EXTERN int screen_read(char *dest, int baddr, int count); LOCAL_EXTERN void Input_String(const unsigned char *str); diff --git a/ctlr.c b/ctlr.c index 4ddb39b..7dde932 100644 --- a/ctlr.c +++ b/ctlr.c @@ -320,11 +320,7 @@ static void ctlr_connect(H3270 *session, int ignored unused, void *dunno) -/* - * Find the buffer address of the field attribute for a given buffer address. - * Returns -1 if the screen isn't formatted. - */ -int find_field_attribute(H3270 *h, int baddr) +LIB3270_EXPORT int lib3270_field_addr(H3270 *h, int baddr) { int sbaddr; @@ -334,18 +330,20 @@ int find_field_attribute(H3270 *h, int baddr) return -1; sbaddr = baddr; - do { + do + { if (ea_buf[baddr].fa) return baddr; DEC_BA(baddr); } while (baddr != sbaddr); + return -1; } /* * Get Field width */ -int find_field_length(H3270 *h, int baddr) +int lib3270_field_length(H3270 *h, int baddr) { int saddr; int addr; diff --git a/lib3270.cbp b/lib3270.cbp index 0f891c7..3875529 100644 --- a/lib3270.cbp +++ b/lib3270.cbp @@ -7,8 +7,8 @@