methods for user interface dialog
Definition in file dialog.c.
#include <assert.h>
#include <string.h>
#include <ctype.h>
#include "scip/scip.h"
#include "scip/def.h"
#include "blockmemshell/memory.h"
#include "scip/set.h"
#include "scip/pub_misc.h"
#include "scip/dialog.h"
#include "scip/struct_dialog.h"
Go to the source code of this file.
|
static |
reads a line of input from stdin
dialoghdlr | dialog handler |
prompt | prompt to display |
endoffile | pointer to store whether the end of the input file was reached |
Definition at line 148 of file dialog.c.
References SCIP_Dialoghdlr::buffer, SCIP_Dialoghdlr::bufferpos, SCIP_Dialoghdlr::buffersize, FALSE, SCIP_OKAY, and TRUE.
Referenced by readInputLine().
|
static |
puts the given string on the command history
s | string to add to the command history |
Definition at line 189 of file dialog.c.
References SCIP_OKAY.
Referenced by SCIPdialoghdlrAddHistory().
|
static |
returns the current length of the history list
Definition at line 199 of file dialog.c.
Referenced by SCIPdialoghdlrAddHistory().
|
static |
removes a single element from the history list
pos | list position of history entry to remove |
Definition at line 208 of file dialog.c.
References SCIP_OKAY.
Referenced by SCIPdialoghdlrAddHistory().
|
static |
writes command history into file of the specified name
filename | name of file to (over)write history to |
Definition at line 219 of file dialog.c.
References SCIP_OKAY.
Referenced by SCIPdialogWriteHistory().
|
static |
frees a single linelist entry, but not its successors
linelist | pointer to line list |
Definition at line 231 of file dialog.c.
References BMSfreeMemory, and BMSfreeMemoryArray.
Referenced by linelistFreeAll(), and readInputLine().
|
static |
frees a linelist entry and all of its successors
linelist | pointer to line list |
Definition at line 243 of file dialog.c.
References linelistFree(), and SCIP_Linelist::nextline.
Referenced by SCIPdialoghdlrFree().
|
static |
reads a line of input from stdin or from the stored input lines in the input list
dialoghdlr | dialog handler |
prompt | prompt to display |
endoffile | pointer to store whether the end of the input file was reached |
Definition at line 261 of file dialog.c.
References SCIP_Dialoghdlr::buffer, SCIP_Dialoghdlr::bufferpos, SCIP_Dialoghdlr::buffersize, FALSE, SCIP_Linelist::inputline, SCIP_Dialoghdlr::inputlist, SCIP_Dialoghdlr::inputlistptr, linelistFree(), SCIP_Linelist::nextline, readLine(), SCIP_CALL, and SCIP_OKAY.
Referenced by SCIPdialoghdlrGetLine(), and SCIPdialoghdlrGetWord().
SCIP_RETCODE SCIPdialogCopyInclude | ( | SCIP_DIALOG * | dialog, |
SCIP_SET * | set | ||
) |
copies the given dialog to a new scip
dialog | dialog |
set | SCIP_SET of SCIP to copy to |
Definition at line 310 of file dialog.c.
References SCIP_CALL, SCIP_OKAY, SCIPdialogGetName(), and SCIPsetDebugMsg.
SCIP_RETCODE SCIPdialoghdlrCreate | ( | SCIP_SET * | set, |
SCIP_DIALOGHDLR ** | dialoghdlr | ||
) |
creates a dialog handler
set | global SCIP settings |
dialoghdlr | pointer to store dialog handler |
Definition at line 328 of file dialog.c.
References BMSallocMemory, BMSallocMemoryArray, SCIP_ALLOC, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPdialoghdlrClearBuffer(), SCIPsetIncludeExternalCode(), and SCIPsnprintf().
Referenced by doScipCreate().
SCIP_RETCODE SCIPdialoghdlrFree | ( | SCIP * | scip, |
SCIP_DIALOGHDLR ** | dialoghdlr | ||
) |
frees a dialog handler and it's dialog tree
scip | SCIP data structure |
dialoghdlr | pointer to dialog handler |
Definition at line 358 of file dialog.c.
References BMSfreeMemory, BMSfreeMemoryArray, linelistFreeAll(), SCIP_CALL, SCIP_OKAY, and SCIPdialoghdlrSetRoot().
Referenced by SCIPfree().
SCIP_RETCODE SCIPdialoghdlrExec | ( | SCIP_DIALOGHDLR * | dialoghdlr, |
SCIP_SET * | set | ||
) |
executes the root dialog of the dialog handler
dialoghdlr | dialog handler |
set | global SCIP settings |
Definition at line 376 of file dialog.c.
References SCIP_Dialoghdlr::buffer, SCIP_Dialoghdlr::bufferpos, SCIP_Dialoghdlr::rootdialog, SCIP_CALL, SCIP_OKAY, SCIPdialogExec(), and SCIPdialoghdlrClearBuffer().
Referenced by SCIPstartInteraction().
SCIP_RETCODE SCIPdialoghdlrSetRoot | ( | SCIP * | scip, |
SCIP_DIALOGHDLR * | dialoghdlr, | ||
SCIP_DIALOG * | dialog | ||
) |
makes given dialog the root dialog of dialog handler; captures dialog and releases former root dialog
scip | SCIP data structure |
dialoghdlr | dialog handler |
dialog | dialog to be the root |
Definition at line 404 of file dialog.c.
References SCIP_Dialoghdlr::rootdialog, SCIP_CALL, SCIP_OKAY, SCIPdialogCapture(), and SCIPdialogRelease().
Referenced by SCIPdialoghdlrFree(), and SCIPsetRootDialog().
|
static |
ensures, that sub-dialogs array can store at least the given number of sub-dialogs
dialog | dialog |
set | global SCIP settings |
num | minimal storage size for sub-dialogs |
Definition at line 795 of file dialog.c.
References BMSreallocMemoryArray, SCIP_ALLOC, SCIP_OKAY, SCIPsetCalcMemGrowSize(), SCIP_Dialog::subdialogs, and SCIP_Dialog::subdialogssize.
Referenced by SCIPdialogAddEntry().
SCIP_RETCODE SCIPdialogCreate | ( | SCIP_DIALOG ** | dialog, |
SCIP_DECL_DIALOGCOPY((*dialogcopy)) | , | ||
SCIP_DECL_DIALOGEXEC((*dialogexec)) | , | ||
SCIP_DECL_DIALOGDESC((*dialogdesc)) | , | ||
SCIP_DECL_DIALOGFREE((*dialogfree)) | , | ||
const char * | name, | ||
const char * | desc, | ||
SCIP_Bool | issubmenu, | ||
SCIP_DIALOGDATA * | dialogdata | ||
) |
creates and captures a user interface dialog
dialog | pointer to store the dialog |
name | name of dialog: command name appearing in parent's dialog menu |
desc | description of dialog used if description output method is NULL |
issubmenu | is the dialog a sub-menu? |
dialogdata | user defined dialog data |
Definition at line 817 of file dialog.c.
References BMSallocMemory, BMSduplicateMemoryArray, BMSfreeMemory, BMSfreeMemoryArrayNull, SCIP_ALLOC, SCIP_ALLOC_TERMINATE, SCIP_OKAY, and SCIPdialogCapture().
Referenced by SCIPincludeDialog().
|
static |
frees dialog and all of its sub-dialogs
scip | SCIP data structure |
dialog | pointer to dialog |
Definition at line 873 of file dialog.c.
References BMSfreeMemory, BMSfreeMemoryArrayNull, SCIP_CALL, SCIP_OKAY, and SCIPdialogRelease().
Referenced by SCIPdialogRelease().
void SCIPdialogCapture | ( | SCIP_DIALOG * | dialog | ) |
captures a dialog
dialog | dialog |
Definition at line 905 of file dialog.c.
References SCIP_Dialog::nuses.
Referenced by SCIPcaptureDialog(), SCIPdialogAddEntry(), SCIPdialogCreate(), and SCIPdialoghdlrSetRoot().
SCIP_RETCODE SCIPdialogRelease | ( | SCIP * | scip, |
SCIP_DIALOG ** | dialog | ||
) |
releases a dialog
scip | SCIP data structure |
dialog | pointer to dialog |
Definition at line 915 of file dialog.c.
References dialogFree(), SCIP_CALL, and SCIP_OKAY.
Referenced by dialogFree(), SCIPdialoghdlrSetRoot(), and SCIPreleaseDialog().
SCIP_RETCODE SCIPdialogExec | ( | SCIP_DIALOG * | dialog, |
SCIP_SET * | set, | ||
SCIP_DIALOGHDLR * | dialoghdlr, | ||
SCIP_DIALOG ** | nextdialog | ||
) |
executes dialog
dialog | dialog |
set | global SCIP settings |
dialoghdlr | dialog handler |
nextdialog | pointer to store the next dialog to process |
Definition at line 932 of file dialog.c.
References SCIP_CALL, and SCIP_OKAY.
Referenced by SCIPdialoghdlrExec().
|
static |
comparison method for sorting dialogs w.r.t. to their name
Definition at line 951 of file dialog.c.
References SCIPdialogGetName().
SCIP_RETCODE SCIPdialogAddEntry | ( | SCIP_DIALOG * | dialog, |
SCIP_SET * | set, | ||
SCIP_DIALOG * | subdialog | ||
) |
adds a sub-dialog to the given dialog as menu entry and captures the sub-dialog
dialog | dialog |
set | global SCIP settings |
subdialog | sub-dialog to add as menu entry in dialog |
Definition at line 957 of file dialog.c.
References ensureSubdialogMem(), SCIP_Dialog::nsubdialogs, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIPdialogCapture(), SCIPdialogGetName(), SCIPdialogHasEntry(), SCIPerrorMessage, SCIPsortedvecInsertPtr(), and SCIP_Dialog::subdialogs.
Referenced by SCIPaddDialogEntry().