SCP: Add optional per line multiplexer log files to periodic flushing

This commit is contained in:
Mark Pizzolato 2020-10-20 02:47:33 -07:00
parent 4a41021be9
commit c8a8cca7a3
3 changed files with 15 additions and 0 deletions

1
scp.c
View file

@ -8378,6 +8378,7 @@ for (i = 1; (dptr = sim_devices[i]) != NULL; i++) { /* flush attached files
}
}
}
tmxr_flush_log_files ();
}
t_stat

View file

@ -4276,6 +4276,19 @@ else {
return SCPE_OK;
}
t_stat tmxr_flush_log_files (void)
{
int i, j;
for (i=0; i<tmxr_open_device_count; ++i) {
TMXR *mp = tmxr_open_devices[i];
for (j=0; j<mp->lines; ++j)
if (mp->ldsc[j].txlog)
fflush (mp->ldsc[j].txlog);
}
return SCPE_OK;
}
/* Close a master listening socket.

View file

@ -297,6 +297,7 @@ t_stat tmxr_show_summ (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
t_stat tmxr_show_cstat (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
t_stat tmxr_show_lines (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
t_stat tmxr_show_open_devices (FILE* st, DEVICE *dptr, UNIT* uptr, int32 val, CONST char* desc);
t_stat tmxr_flush_log_files (void);
t_stat tmxr_activate (UNIT *uptr, int32 interval);
t_stat tmxr_activate_abs (UNIT *uptr, int32 interval);
t_stat tmxr_activate_after (UNIT *uptr, uint32 usecs_walltime);