Commit 20153f18deabb13f18c31bfa48f4fa1fea20956e
1 parent
a75072d6
Exists in
master
and in
5 other branches
Incluindo mecanismo para conferir se uma coordenada está protegida
Showing
2 changed files
with
20 additions
and
0 deletions
Show diff stats
src/include/lib3270.h
@@ -935,6 +935,13 @@ | @@ -935,6 +935,13 @@ | ||
935 | LIB3270_EXPORT int lib3270_get_next_unprotected(H3270 *hSession, int baddr0); | 935 | LIB3270_EXPORT int lib3270_get_next_unprotected(H3270 *hSession, int baddr0); |
936 | 936 | ||
937 | /** | 937 | /** |
938 | + * @brief Check if the screen position is unprotected. | ||
939 | + * | ||
940 | + */ | ||
941 | + LIB3270_EXPORT int lib3270_get_is_protected(H3270 *hSession, int baddr0); | ||
942 | + | ||
943 | + | ||
944 | + /** | ||
938 | * Get address of the first blank. | 945 | * Get address of the first blank. |
939 | * | 946 | * |
940 | * Get address of the first blank after the last nonblank in the | 947 | * Get address of the first blank after the last nonblank in the |
src/lib3270/ctlr.c
@@ -612,6 +612,19 @@ LIB3270_EXPORT int lib3270_get_next_unprotected(H3270 *hSession, int baddr0) | @@ -612,6 +612,19 @@ LIB3270_EXPORT int lib3270_get_next_unprotected(H3270 *hSession, int baddr0) | ||
612 | return 0; | 612 | return 0; |
613 | } | 613 | } |
614 | 614 | ||
615 | +LIB3270_EXPORT int lib3270_get_is_protected(H3270 *hSession, int baddr) | ||
616 | +{ | ||
617 | + CHECK_SESSION_HANDLE(hSession); | ||
618 | + | ||
619 | + if(baddr < 0) | ||
620 | + baddr = hSession->cursor_addr; | ||
621 | + | ||
622 | + int faddr = find_field_attribute(hSession,baddr); | ||
623 | + | ||
624 | + return FA_IS_PROTECTED(hSession->ea_buf[faddr].fa); | ||
625 | +} | ||
626 | + | ||
627 | + | ||
615 | /** | 628 | /** |
616 | * Perform an erase command, which may include changing the (virtual) screen size. | 629 | * Perform an erase command, which may include changing the (virtual) screen size. |
617 | * | 630 | * |