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