Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

In the ydb source code, what do these ... files do?

36 views
Skip to first unread message

Kevin Toppenberg

unread,
Feb 8, 2025, 7:21:39 PMFeb 8
to Everything MUMPS
In the ydb source code, what do the GTMDefinedTypesInit* files do?

For example, if I search for ttio_struct in the code base, I find hits here:

.../sr_aarch64/GTMDefinedTypesInitDebug.m
.../sr_aarch64/GTMDefinedTypesInitRelease.m
.../sr_armv6l/GTMDefinedTypesInitDebug.m
.../compile/YDB/sr_armv6l/GTMDefinedTypesInitRelease.m
.../compile/YDB/sr_armv7l/GTMDefinedTypesInitDebug.m
.../compile/YDB/sr_armv7l/GTMDefinedTypesInitRelease.m

All are mumps code, and seems to be recreating data structures from the source code. 

Set gtmtypes("d_tt_struct")="struct"
Set gtmtypes("d_tt_struct",0)=49
Set gtmtypes("d_tt_struct","len")=288
Set gtmtypes("d_tt_struct",1,"name")="d_tt_struct.in_buf_sz"
Set gtmtypes("d_tt_struct",1,"off")=0
Set gtmtypes("d_tt_struct",1,"len")=4
Set gtmtypes("d_tt_struct",1,"type")="uint32_t"
...
Set gtmtypfldindx("d_tt_struct","mask_term.mask")=8
Set gtmtypes("d_tt_struct",8,"dim")=8
Set gtmtypes("d_tt_struct",9,"name")="d_tt_struct.fildes"
Set gtmtypes("d_tt_struct",9,"off")=52
Set gtmtypes("d_tt_struct",9,"len")=4
Set gtmtypes("d_tt_struct",9,"type")="int"
Set gtmtypfldindx("d_tt_struct","fildes")=9
Set gtmtypes("d_tt_struct",10,"name")="d_tt_struct.ttio_struct"
Set gtmtypes("d_tt_struct",10,"off")=56
Set gtmtypes("d_tt_struct",10,"len")=8
Set gtmtypes("d_tt_struct",10,"type")="addr"
Set gtmtypfldindx("d_tt_struct","ttio_struct")=10

typedef struct
{
uint4 in_buf_sz; /* size of read buffer */
/* unsigned short   pg_width;    width of output page */
uint4 ext_cap;
io_terminator enbld_outofbands; /* enabled out-of-band chars */
uint4 term_ctrl;              /* //kt NOTE: often used as variable 'mask', different from mask_term below.  This stores part of YDB's IO state */
io_termmask mask_term; /* //kt NOTE: This stores part of YDB's IO state */
int fildes;
struct termios *ttio_struct; /* //kt NOTE: This will be treated as a COMPILED state, ready to send to TTY IO system.  It is not the master state itself. */
struct termios *initial_ttio_struct; /* tty io struct to hold state of device before opened. //kt added */
tt_interrupt tt_state_save; /* in case job interrupt */
boolean_t mupintr; /* read was interrupted */
char *ttybuff; /* buffer for tty */
volatile char *tbuffp; /* next open space in buffer */
recall_ctxt_t *recall_array; /* if EDITING enabled, this points to MAX_RECALL-sized array of
 * previously input strings.
 */
int recall_index; /* Offset into circular "recall_array" pointing one past
 * to most recent input.
 */
volatile boolean_t timer_set; /* text flush timer is set */
volatile boolean_t write_active; /* we are in write -- postpone flush by timer */
boolean_t canonical; /* //kt doc.  canonical means tty system provides simple line editing (e.g. delete)*/
boolean_t echo; /* //kt ADDED to allow canonical and echo modes to be independently specified */
boolean_t hostsync; /* //kt ADDED to store hostsync state */
boolean_t ttsync; /* //kt ADDED to store ttsync state */
boolean_t discard_lf; /* UTF8 mode - previous char was CR so ignore following LF */
boolean_t default_mask_term; /* mask_term is the default */
boolean_t done_1st_read; /* UTF8 mode - check for BOM if not */
pid_t setterm_done_by; /* if non-zero, points to pid that did "setterm";
 * used to later invoke "resetterm" if needed.
 */
}d_tt_struct;

The reason I am asking is that I have added an additional variable to the above struct, "initial_ttio_struct".  I have adjusted the c code to initialize memory for this properly, but it looks like maybe I need to adjust the m code as well?

It looks like the mumps code is spelling out the byte sizes of all the parts.  So if I have inserted a variable, everything will be shifted. 

Questions:
  • Can someone help me understand how this system works?  And what its purpose is?
  • Can someone confirm that the "len" nodes are indeed bytes?
Thanks,
Kevin

Kevin Toppenberg

unread,
Feb 8, 2025, 7:53:42 PMFeb 8
to Everything MUMPS
As an additional insight, I have compared these files between the different architectures, and there are differences ... presumably due to differing byte sizes of integers etc

So surely these files have to be computer generated, via some compilation process, right??

Kevin

Sam Habiel

unread,
Feb 8, 2025, 8:23:07 PMFeb 8
to Kevin Toppenberg, Everything MUMPS
Yes there are generated. I don’t remember the details. 

--
You received this message because you are subscribed to the Google Groups "Everything MUMPS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to everythingmum...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/everythingmumps/ddda74fc-1631-4982-9eef-4c6057e2b4e5n%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Whitten

unread,
Feb 8, 2025, 9:09:29 PMFeb 8
to Sam Habiel, Kevin Toppenberg, Everything MUMPS
Kevin,
could you share the different files and architectures you found?

Also did you do a grep to find out if the various m files are named in any other files ?

Thanks,
Dave Whitten
713-870-3834


Kevin Toppenberg

unread,
Feb 9, 2025, 10:50:51 AMFeb 9
to Everything MUMPS
Sam -- Thanks.  At some point I will need to regenerate them when my changes are complete.   Anyone else I should ask to figure out how to generate them?

Dave -- If you go here: https://github.com/YottaDB/YDB  and look for a search button, just to the left of the [ <> Code v ] button, and type in "GTMDefinedTypes", it will show the approx 7 files in the codebase.   I haven't done the grep.

Kevin
Reply all
Reply to author
Forward
0 new messages