summaryrefslogtreecommitdiff
path: root/lib/jtty/jtty_mod.f90
diff options
context:
space:
mode:
Diffstat (limited to 'lib/jtty/jtty_mod.f90')
-rw-r--r--lib/jtty/jtty_mod.f9013
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/jtty/jtty_mod.f90 b/lib/jtty/jtty_mod.f90
index 7ff25b5b..e043552f 100644
--- a/lib/jtty/jtty_mod.f90
+++ b/lib/jtty/jtty_mod.f90
@@ -8,7 +8,7 @@ module jtty_mod
contains
-subroutine pack_jtty(message,c32,nframes,exchange_profile)
+subroutine pack_jtty(message,c32,nframes,exchange_profile,frame_starts,is_final)
! Input: character*80 message !JTTY message, as it appears to a user
! Output: character*34 c32 !34-bit payload: 32 bits of existing
@@ -19,6 +19,10 @@ subroutine pack_jtty(message,c32,nframes,exchange_profile)
! !uses as a free extra check beyond
! !the CRC.
! integer nframes !Frames in this message (max = 16)
+! integer frame_starts(MAX_FRAMES), optional
+! !1-indexed start column of each frame's source text in the normalized message (a structured atom's span runs through its trailing separator space).
+! integer is_final, optional
+! !0/1; suppresses the "last frame of message" flag even on the final frame when 0 (absent means final, the existing behavior).
!
! Minimize frames after alphabet and exchange-profile normalization.
@@ -27,6 +31,8 @@ subroutine pack_jtty(message,c32,nframes,exchange_profile)
character*80 message,msg
character*34 c32(MAX_FRAMES)
integer, intent(in), optional :: exchange_profile
+ integer, intent(out), optional :: frame_starts(MAX_FRAMES)
+ integer, intent(in), optional :: is_final
integer, parameter :: INF=999
type(jtty_source_atom) :: choice(80),atoms(MAX_FRAMES)
integer :: dp(81),successor(80),n,ipos,inext,natoms,nframes,profile
@@ -75,9 +81,10 @@ subroutine pack_jtty(message,c32,nframes,exchange_profile)
do while(ipos.le.n)
natoms=natoms+1
atoms(natoms)=choice(ipos)
+ if(present(frame_starts)) frame_starts(natoms)=ipos
ipos=successor(ipos)
enddo
- call pack_jtty_atoms(atoms,natoms,c32,nframes,valid)
+ call pack_jtty_atoms(atoms,natoms,c32,nframes,valid,is_final)
if(.not.valid) then
c32=''
nframes=-1
@@ -238,7 +245,7 @@ contains
if(nwords.lt.2 .or. length.lt.2 .or. length.gt.3) return
call decimal_value(words(1)(1:length-1),value,numeric)
if(.not.numeric) return
- section_index=pack77_arrl_section_index(trim(words(2)))
+ section_index=pack77_arrl_section_index(words(2))
call offer(jtty_class_section_atom(value,words(1)(length:length),section_index))
end subroutine try_compact