Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernel: refactor InitSystem #5899

Merged
merged 6 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/sysfiles.c
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ UInt SyIsIntr ( void )

/****************************************************************************
**
*F getwindowsize() . . . . . . . get screen size from termcap or TIOCGWINSZ
*F InitWindowSize() . . . . . . . get screen size from termcap or TIOCGWINSZ
**
** For UNIX we install 'syWindowChangeIntr' to answer 'SIGWINCH'.
*/
Expand All @@ -1069,7 +1069,7 @@ void syWindowChangeIntr ( int signr )

#endif // TIOCGWINSZ

void getwindowsize( void )
void InitWindowSize(void)
{
// it might be that SyNrRows, SyNrCols have been set by the user with -x, -y
// otherwise they are zero
Expand Down Expand Up @@ -3232,7 +3232,10 @@ void InitSysFiles(void)
setbuf(stdin, (char *)0);
setbuf(stdout, (char *)0);
setbuf(stderr, (char *)0);
}

void InitReadline(void)
{
#ifdef HAVE_LIBREADLINE
// don't use readline if in Window mode (e.g. for XGAP)
if (SyWindow)
Expand Down
7 changes: 5 additions & 2 deletions src/sysfiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,11 +434,11 @@ char SyFileType(const Char * path);

/****************************************************************************
**
*F void getwindowsize( void ) . probe the OS for the window size and
*F void InitWindowSize( void ) . probe the OS for the window size and
** set SyNrRows and SyNrCols accordingly
*/

void getwindowsize(void);
void InitWindowSize(void);

/****************************************************************************
**
Expand Down Expand Up @@ -484,6 +484,9 @@ void * SyMemmove(void * dst, const void * src, size_t size);
// initialization.
void InitSysFiles(void);

//
void InitReadline(void);

/****************************************************************************
**
*F InitInfoSysFiles() . . . . . . . . . . . . . . . table of init functions
Expand Down
14 changes: 11 additions & 3 deletions src/sysopt.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ extern const char * SyCompileMagic1;
*/
extern Int SyDebugLoading;


/****************************************************************************
**
*F SyDotGapPath()
*/
const Char * SyDotGapPath(void);


/****************************************************************************
**
*V SyLineEdit . . . . . . . . . . . . . . . . . . . . support line editing
Expand All @@ -65,6 +67,7 @@ const Char * SyDotGapPath(void);
*/
extern UInt SyLineEdit;


/****************************************************************************
**
*V SyUseReadline . . . . . . . . . . . . . . . . . . support line editing
Expand All @@ -73,6 +76,7 @@ extern UInt SyLineEdit;
*/
extern UInt SyUseReadline;


/****************************************************************************
**
*V SyNrCols . . . . . . . . . . . . . . . . . . length of the output lines
Expand All @@ -85,11 +89,12 @@ extern UInt SyUseReadline;
** 'Pr' uses this to decide where to insert a <newline> on the output lines.
** 'SyRead' uses it to decide when to start scrolling the echoed input line.
**
** Put in this package because the command line processing takes place here.
** See also InitWindowSize().
*/
extern UInt SyNrCols;
extern UInt SyNrColsLocked;


/****************************************************************************
**
*V SyNrRows . . . . . . . . . . . . . . . . . number of lines on the screen
Expand All @@ -99,7 +104,7 @@ extern UInt SyNrColsLocked;
** Per default this is 24, which is the usual size of terminal screens.
** It can be changed with the '-y' option for larger terminals or printers.
**
** 'SyHelp' uses this to decide where to stop with '-- <space> for more --'.
** See also InitWindowSize().
*/
extern UInt SyNrRows;
extern UInt SyNrRowsLocked;
Expand All @@ -109,7 +114,7 @@ extern UInt SyNrRowsLocked;
**
*V SyQuiet . . . . . . . . . . . . . . . . . . . . . . . . . suppress prompt
**
** 'SyQuit' determines whether GAP should print the prompt and the banner.
** 'SyQuiet' determines whether GAP should print the prompt and the banner.
**
** Per default its false, i.e. GAP prints the prompt and the nice banner.
** It can be changed by the '-q' option to have GAP operate in silent mode.
Expand All @@ -120,6 +125,7 @@ extern UInt SyNrRowsLocked;
*/
extern UInt SyQuiet;


/****************************************************************************
**
*V SyQuitOnBreak . . . . . . . . . . exit GAP instead of entering break loop
Expand All @@ -133,6 +139,7 @@ extern UInt SyQuiet;
*/
extern UInt SyQuitOnBreak;


/****************************************************************************
**
*V SyRestoring . . . . . . . . . . . . . . . . . . . . restoring a workspace
Expand All @@ -146,6 +153,7 @@ extern UInt SyQuitOnBreak;
extern Char * SyRestoring;
#endif


/****************************************************************************
**
*V SyInitializing set to 1 during library init
Expand Down
Loading
Loading