Scippy

SCIP

Solving Constraint Integer Programs

dialog.c File Reference

Detailed Description

methods for user interface dialog

Author
Tobias Achterberg

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.

Functions

static SCIP_RETCODE readLine (SCIP_DIALOGHDLR *dialoghdlr, const char *prompt, SCIP_Bool *endoffile)
 
static SCIP_RETCODE addHistory (const char *s)
 
static int getHistoryLength (void)
 
static SCIP_RETCODE removeHistory (int pos)
 
static SCIP_RETCODE writeHistory (const char *filename)
 
static void linelistFree (SCIP_LINELIST **linelist)
 
static void linelistFreeAll (SCIP_LINELIST **linelist)
 
static SCIP_RETCODE readInputLine (SCIP_DIALOGHDLR *dialoghdlr, const char *prompt, SCIP_Bool *endoffile)
 
SCIP_RETCODE SCIPdialogCopyInclude (SCIP_DIALOG *dialog, SCIP_SET *set)
 
SCIP_RETCODE SCIPdialoghdlrCreate (SCIP_SET *set, SCIP_DIALOGHDLR **dialoghdlr)
 
SCIP_RETCODE SCIPdialoghdlrFree (SCIP *scip, SCIP_DIALOGHDLR **dialoghdlr)
 
SCIP_RETCODE SCIPdialoghdlrExec (SCIP_DIALOGHDLR *dialoghdlr, SCIP_SET *set)
 
SCIP_RETCODE SCIPdialoghdlrSetRoot (SCIP *scip, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog)
 
SCIP_DIALOGSCIPdialoghdlrGetRoot (SCIP_DIALOGHDLR *dialoghdlr)
 
void SCIPdialoghdlrClearBuffer (SCIP_DIALOGHDLR *dialoghdlr)
 
SCIP_Bool SCIPdialoghdlrIsBufferEmpty (SCIP_DIALOGHDLR *dialoghdlr)
 
SCIP_RETCODE SCIPdialoghdlrGetLine (SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, const char *prompt, char **inputline, SCIP_Bool *endoffile)
 
SCIP_RETCODE SCIPdialoghdlrGetWord (SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, const char *prompt, char **inputword, SCIP_Bool *endoffile)
 
SCIP_RETCODE SCIPdialoghdlrAddInputLine (SCIP_DIALOGHDLR *dialoghdlr, const char *inputline)
 
SCIP_RETCODE SCIPdialoghdlrAddHistory (SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, const char *command, SCIP_Bool escapecommand)
 
static SCIP_RETCODE ensureSubdialogMem (SCIP_DIALOG *dialog, SCIP_SET *set, int num)
 
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)
 
static SCIP_RETCODE dialogFree (SCIP *scip, SCIP_DIALOG **dialog)
 
void SCIPdialogCapture (SCIP_DIALOG *dialog)
 
SCIP_RETCODE SCIPdialogRelease (SCIP *scip, SCIP_DIALOG **dialog)
 
SCIP_RETCODE SCIPdialogExec (SCIP_DIALOG *dialog, SCIP_SET *set, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG **nextdialog)
 
static SCIP_DECL_SORTPTRCOMP (dialogComp)
 
SCIP_RETCODE SCIPdialogAddEntry (SCIP_DIALOG *dialog, SCIP_SET *set, SCIP_DIALOG *subdialog)
 
SCIP_Bool SCIPdialogHasEntry (SCIP_DIALOG *dialog, const char *entryname)
 
int SCIPdialogFindEntry (SCIP_DIALOG *dialog, const char *entryname, SCIP_DIALOG **subdialog)
 
SCIP_RETCODE SCIPdialogDisplayMenu (SCIP_DIALOG *dialog, SCIP *scip)
 
SCIP_RETCODE SCIPdialogDisplayMenuEntry (SCIP_DIALOG *dialog, SCIP *scip)
 
SCIP_RETCODE SCIPdialogDisplayCompletions (SCIP_DIALOG *dialog, SCIP *scip, const char *entryname)
 
void SCIPdialogGetPath (SCIP_DIALOG *dialog, const char sepchar, char *path)
 
const char * SCIPdialogGetName (SCIP_DIALOG *dialog)
 
const char * SCIPdialogGetDesc (SCIP_DIALOG *dialog)
 
SCIP_Bool SCIPdialogIsSubmenu (SCIP_DIALOG *dialog)
 
SCIP_DIALOGSCIPdialogGetParent (SCIP_DIALOG *dialog)
 
SCIP_DIALOG ** SCIPdialogGetSubdialogs (SCIP_DIALOG *dialog)
 
int SCIPdialogGetNSubdialogs (SCIP_DIALOG *dialog)
 
SCIP_DIALOGDATASCIPdialogGetData (SCIP_DIALOG *dialog)
 
void SCIPdialogSetData (SCIP_DIALOG *dialog, SCIP_DIALOGDATA *dialogdata)
 
SCIP_RETCODE SCIPdialogWriteHistory (const char *filename)
 

Function Documentation

static SCIP_RETCODE readLine ( SCIP_DIALOGHDLR dialoghdlr,
const char *  prompt,
SCIP_Bool endoffile 
)
static

reads a line of input from stdin

Parameters
dialoghdlrdialog handler
promptprompt to display
endoffilepointer 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, NULL, SCIP_OKAY, and TRUE.

Referenced by readInputLine().

static SCIP_RETCODE addHistory ( const char *  s)
static

puts the given string on the command history

Parameters
sstring to add to the command history

Definition at line 189 of file dialog.c.

References SCIP_OKAY.

Referenced by SCIPdialoghdlrAddHistory().

static int getHistoryLength ( void  )
static

returns the current length of the history list

Definition at line 199 of file dialog.c.

Referenced by SCIPdialoghdlrAddHistory().

static SCIP_RETCODE removeHistory ( int  pos)
static

removes a single element from the history list

Parameters
poslist position of history entry to remove

Definition at line 208 of file dialog.c.

References SCIP_OKAY.

Referenced by SCIPdialoghdlrAddHistory().

static SCIP_RETCODE writeHistory ( const char *  filename)
static

writes command history into file of the specified name

Parameters
filenamename of file to (over)write history to

Definition at line 219 of file dialog.c.

References SCIP_OKAY.

Referenced by SCIPdialogWriteHistory().

static void linelistFree ( SCIP_LINELIST **  linelist)
static

frees a single linelist entry, but not its successors

Parameters
linelistpointer to line list

Definition at line 231 of file dialog.c.

References BMSfreeMemory, BMSfreeMemoryArray, and NULL.

Referenced by linelistFreeAll(), and readInputLine().

static void linelistFreeAll ( SCIP_LINELIST **  linelist)
static

frees a linelist entry and all of its successors

Parameters
linelistpointer to line list

Definition at line 243 of file dialog.c.

References linelistFree(), SCIP_Linelist::nextline, and NULL.

Referenced by SCIPdialoghdlrFree().

static SCIP_RETCODE readInputLine ( SCIP_DIALOGHDLR dialoghdlr,
const char *  prompt,
SCIP_Bool endoffile 
)
static

reads a line of input from stdin or from the stored input lines in the input list

Parameters
dialoghdlrdialog handler
promptprompt to display
endoffilepointer 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, NULL, 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

Parameters
dialogdialog
setSCIP_SET of SCIP to copy to

Definition at line 310 of file dialog.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and SCIPdialogGetName().

Referenced by SCIPsetCopyPlugins().

SCIP_RETCODE SCIPdialoghdlrCreate ( SCIP_SET set,
SCIP_DIALOGHDLR **  dialoghdlr 
)

creates a dialog handler

Parameters
setglobal SCIP settings
dialoghdlrpointer to store dialog handler

Definition at line 328 of file dialog.c.

References BMSallocMemory, BMSallocMemoryArray, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPdialoghdlrClearBuffer(), SCIPsetIncludeExternalCode(), and SCIPsnprintf().

Referenced by SCIPcreate().

SCIP_RETCODE SCIPdialoghdlrFree ( SCIP scip,
SCIP_DIALOGHDLR **  dialoghdlr 
)

frees a dialog handler and it's dialog tree

Parameters
scipSCIP data structure
dialoghdlrpointer to dialog handler

Definition at line 358 of file dialog.c.

References BMSfreeMemory, BMSfreeMemoryArray, linelistFreeAll(), NULL, 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

Parameters
dialoghdlrdialog handler
setglobal SCIP settings

Definition at line 374 of file dialog.c.

References SCIP_Dialoghdlr::buffer, SCIP_Dialoghdlr::bufferpos, NULL, 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

Parameters
scipSCIP data structure
dialoghdlrdialog handler
dialogdialog to be the root

Definition at line 402 of file dialog.c.

References NULL, SCIP_Dialoghdlr::rootdialog, SCIP_CALL, SCIP_OKAY, SCIPdialogCapture(), and SCIPdialogRelease().

Referenced by SCIPdialoghdlrFree(), and SCIPsetRootDialog().

SCIP_DIALOG* SCIPdialoghdlrGetRoot ( SCIP_DIALOGHDLR dialoghdlr)

returns the root dialog of the dialog handler

Parameters
dialoghdlrdialog handler

Definition at line 425 of file dialog.c.

References NULL, and SCIP_Dialoghdlr::rootdialog.

Referenced by dialogExecMenu(), SCIP_DECL_DIALOGEXEC(), SCIPaddDialogEntry(), and SCIPgetRootDialog().

void SCIPdialoghdlrClearBuffer ( SCIP_DIALOGHDLR dialoghdlr)

clears the input command buffer of the dialog handler

Parameters
dialoghdlrdialog handler

Definition at line 435 of file dialog.c.

References SCIP_Dialoghdlr::buffer, SCIP_Dialoghdlr::bufferpos, and NULL.

Referenced by dialogExecMenu(), SCIP_DECL_DIALOGEXEC(), SCIPdialoghdlrCreate(), SCIPdialoghdlrExec(), SCIPdialoghdlrGetLine(), SCIPdialoghdlrGetWord(), and writeProblem().

SCIP_Bool SCIPdialoghdlrIsBufferEmpty ( SCIP_DIALOGHDLR dialoghdlr)

returns TRUE iff input command buffer is empty

Parameters
dialoghdlrdialog handler

Definition at line 446 of file dialog.c.

References SCIP_Dialoghdlr::buffer, SCIP_Dialoghdlr::bufferpos, SCIP_Dialoghdlr::buffersize, and NULL.

Referenced by SCIP_DECL_DIALOGEXEC(), SCIPdialoghdlrGetLine(), and SCIPdialoghdlrGetWord().

SCIP_RETCODE SCIPdialoghdlrGetLine ( SCIP_DIALOGHDLR dialoghdlr,
SCIP_DIALOG dialog,
const char *  prompt,
char **  inputline,
SCIP_Bool endoffile 
)

returns the next line in the handler's command buffer; if the buffer is empty, displays the given prompt or the current dialog's path and asks the user for further input; the user must not free or modify the returned string

Parameters
dialoghdlrdialog handler
dialogcurrent dialog
promptprompt to display, or NULL to display the current dialog's path
inputlinepointer to store the complete line in the handler's command buffer
endoffilepointer to store whether the end of the input file was reached

Definition at line 459 of file dialog.c.

References SCIP_Dialoghdlr::buffer, SCIP_Dialoghdlr::bufferpos, SCIP_Dialoghdlr::buffersize, FALSE, NULL, readInputLine(), SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPdialogGetPath(), SCIPdialoghdlrAddHistory(), SCIPdialoghdlrClearBuffer(), SCIPdialoghdlrIsBufferEmpty(), SCIPsnprintf(), and TRUE.

Referenced by SCIP_DECL_DIALOGEXEC().

SCIP_RETCODE SCIPdialoghdlrGetWord ( SCIP_DIALOGHDLR dialoghdlr,
SCIP_DIALOG dialog,
const char *  prompt,
char **  inputword,
SCIP_Bool endoffile 
)

returns the next word in the handler's command buffer; if the buffer is empty, displays the given prompt or the current dialog's path and asks the user for further input; the user must not free or modify the returned string

Parameters
dialoghdlrdialog handler
dialogcurrent dialog
promptprompt to display, or NULL to display the current dialog's path
inputwordpointer to store the next word in the handler's command buffer
endoffilepointer to store whether the end of the input file was reached

Definition at line 536 of file dialog.c.

References SCIP_Dialoghdlr::buffer, SCIP_Dialoghdlr::bufferpos, SCIP_Dialoghdlr::buffersize, FALSE, NULL, readInputLine(), SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPdebugMessage, SCIPdialogGetPath(), SCIPdialoghdlrAddHistory(), SCIPdialoghdlrClearBuffer(), SCIPdialoghdlrIsBufferEmpty(), and SCIPsnprintf().

Referenced by dialogExecMenu(), SCIP_DECL_DIALOGEXEC(), and writeProblem().

SCIP_RETCODE SCIPdialoghdlrAddInputLine ( SCIP_DIALOGHDLR dialoghdlr,
const char *  inputline 
)

adds a single line of input to the dialog handler which is treated as if the user entered the command line

Parameters
dialoghdlrdialog handler
inputlineinput line to add

Definition at line 687 of file dialog.c.

References BMSallocMemory, BMSduplicateMemoryArray, SCIP_Linelist::inputline, SCIP_Dialoghdlr::inputlistptr, SCIP_Linelist::nextline, NULL, SCIP_ALLOC, and SCIP_OKAY.

Referenced by SCIPaddDialogInputLine().

SCIP_RETCODE SCIPdialoghdlrAddHistory ( SCIP_DIALOGHDLR dialoghdlr,
SCIP_DIALOG dialog,
const char *  command,
SCIP_Bool  escapecommand 
)

adds a command to the command history of the dialog handler; if a dialog is given, the command is preceeded by the dialog's command path; if no command is given, only the path to the dialog is added to the command history

Parameters
dialoghdlrdialog handler
dialogcurrent dialog, or NULL
commandcommand string to add to the command history, or NULL
escapecommandshould special characters in command be prefixed by an escape char?

Definition at line 711 of file dialog.c.

References addHistory(), getHistoryLength(), SCIP_Dialog::name, SCIP_Dialoghdlr::nprotectedhistelems, NULL, SCIP_Dialog::parent, removeHistory(), SCIP_Dialoghdlr::rootdialog, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPescapeString(), and SCIPsnprintf().

Referenced by SCIP_DECL_DIALOGEXEC(), SCIPaddDialogHistoryLine(), SCIPdialoghdlrGetLine(), SCIPdialoghdlrGetWord(), and writeProblem().

static SCIP_RETCODE ensureSubdialogMem ( SCIP_DIALOG dialog,
SCIP_SET set,
int  num 
)
static

ensures, that sub-dialogs array can store at least the given number of sub-dialogs

Parameters
dialogdialog
setglobal SCIP settings
numminimal storage size for sub-dialogs

Definition at line 788 of file dialog.c.

References BMSreallocMemoryArray, NULL, 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

Parameters
dialogpointer to store the dialog
namename of dialog: command name appearing in parent's dialog menu
descdescription of dialog used if description output method is NULL
issubmenuis the dialog a sub-menu?
dialogdatauser defined dialog data

Definition at line 810 of file dialog.c.

References BMSallocMemory, BMSduplicateMemoryArray, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPdialogCapture().

Referenced by SCIPincludeDialog().

static SCIP_RETCODE dialogFree ( SCIP scip,
SCIP_DIALOG **  dialog 
)
static

frees dialog and all of its sub-dialogs

Parameters
scipSCIP data structure
dialogpointer to dialog

Definition at line 855 of file dialog.c.

References BMSfreeMemory, BMSfreeMemoryArrayNull, NULL, SCIP_CALL, SCIP_OKAY, and SCIPdialogRelease().

Referenced by SCIPdialogRelease().

void SCIPdialogCapture ( SCIP_DIALOG dialog)

captures a dialog

Parameters
dialogdialog

Definition at line 887 of file dialog.c.

References NULL, and SCIP_Dialog::nuses.

Referenced by SCIPcaptureDialog(), SCIPdialogAddEntry(), SCIPdialogCreate(), and SCIPdialoghdlrSetRoot().

SCIP_RETCODE SCIPdialogRelease ( SCIP scip,
SCIP_DIALOG **  dialog 
)

releases a dialog

Parameters
scipSCIP data structure
dialogpointer to dialog

Definition at line 897 of file dialog.c.

References dialogFree(), NULL, 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

Parameters
dialogdialog
setglobal SCIP settings
dialoghdlrdialog handler
nextdialogpointer to store the next dialog to process

Definition at line 914 of file dialog.c.

References NULL, SCIP_CALL, and SCIP_OKAY.

Referenced by SCIPdialoghdlrExec().

static SCIP_DECL_SORTPTRCOMP ( dialogComp  )
static

comparison method for sorting dialogs w.r.t. to their name

Definition at line 933 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

Parameters
dialogdialog
setglobal SCIP settings
subdialogsub-dialog to add as menu entry in dialog

Definition at line 939 of file dialog.c.

References ensureSubdialogMem(), SCIP_Dialog::nsubdialogs, NULL, SCIP_Dialog::parent, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIPdialogCapture(), SCIPdialogGetName(), SCIPdialogHasEntry(), SCIPerrorMessage, SCIPsortedvecInsertPtr(), and SCIP_Dialog::subdialogs.

Referenced by SCIPaddDialogEntry().

SCIP_Bool SCIPdialogHasEntry ( SCIP_DIALOG dialog,
const char *  entryname 
)

returns TRUE iff a dialog entry matching exactly the given name is existing in the given dialog

Parameters
dialogdialog
entrynamename of the dialog entry to find

Definition at line 970 of file dialog.c.

References FALSE, NULL, SCIPdialogGetName(), SCIPdialogGetNSubdialogs(), SCIPdialogGetSubdialogs(), and TRUE.

Referenced by addFixParamDialog(), addSetParamDialog(), createCountDialog(), createEmphasisSubmenu(), SCIPdialogAddEntry(), SCIPincludeConshdlrSuperindicator(), SCIPincludeDialogDefault(), SCIPincludeDialogDefaultFix(), SCIPincludeDialogDefaultSet(), and SCIPincludeObjDialog().

int SCIPdialogFindEntry ( SCIP_DIALOG dialog,
const char *  entryname,
SCIP_DIALOG **  subdialog 
)

searches the dialog for entries corresponding to the given name; If a complete match is found, the entry is returned as "subdialog" and the return value is 1. If no dialog entry completely matches the given "entryname", the number of entries with names beginning with "entryname" is returned. If this number is 1, the single match is returned as "subdialog". Otherwise, "subdialog" is set to NULL.

Parameters
dialogdialog
entrynamename of the dialog entry to find
subdialogpointer to store the found dialog entry

Definition at line 1003 of file dialog.c.

References NULL, SCIPdialogGetName(), SCIPdialogGetNSubdialogs(), and SCIPdialogGetSubdialogs().

Referenced by addFixParamDialog(), addSetParamDialog(), createCountDialog(), createEmphasisSubmenu(), dialogExecMenu(), SCIPincludeConshdlrSuperindicator(), SCIPincludeDialogDefault(), SCIPincludeDialogDefaultFix(), and SCIPincludeDialogDefaultSet().

SCIP_RETCODE SCIPdialogDisplayMenu ( SCIP_DIALOG dialog,
SCIP scip 
)

displays the dialog's menu

Parameters
dialogdialog
scipSCIP data structure

Definition at line 1047 of file dialog.c.

References SCIP_Dialog::nsubdialogs, NULL, SCIP_CALL, SCIP_OKAY, SCIPdialogDisplayMenuEntry(), SCIPdialogIsSubmenu(), SCIPdialogMessage(), and SCIP_Dialog::subdialogs.

Referenced by SCIP_DECL_DIALOGEXEC().

SCIP_RETCODE SCIPdialogDisplayMenuEntry ( SCIP_DIALOG dialog,
SCIP scip 
)

displays the entry for the dialog in it's parent's menu

Parameters
dialogdialog
scipSCIP data structure

Definition at line 1081 of file dialog.c.

References SCIP_Dialog::desc, SCIP_Dialog::issubmenu, SCIP_Dialog::name, NULL, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPdialogMessage(), and SCIPsnprintf().

Referenced by SCIPdialogDisplayCompletions(), and SCIPdialogDisplayMenu().

SCIP_RETCODE SCIPdialogDisplayCompletions ( SCIP_DIALOG dialog,
SCIP scip,
const char *  entryname 
)

displays all dialog entries with names starting with the given "entryname"

Parameters
dialogdialog
scipSCIP data structure
entrynamename of the dialog entry to find

Definition at line 1115 of file dialog.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPdialogDisplayMenuEntry(), SCIPdialogGetName(), SCIPdialogGetNSubdialogs(), and SCIPdialogGetSubdialogs().

Referenced by dialogExecMenu().

void SCIPdialogGetPath ( SCIP_DIALOG dialog,
const char  sepchar,
char *  path 
)

gets the name of the current path in the dialog tree, separated by the given character

Parameters
dialogdialog
sepcharseparation character to insert in path
pathstring buffer to store the path

Definition at line 1146 of file dialog.c.

References SCIP_Dialog::name, NULL, SCIP_Dialog::parent, SCIP_MAXSTRLEN, and SCIPsnprintf().

Referenced by SCIPdialoghdlrGetLine(), and SCIPdialoghdlrGetWord().

const char* SCIPdialogGetName ( SCIP_DIALOG dialog)

gets the command name of the dialog

Parameters
dialogdialog

Definition at line 1170 of file dialog.c.

References SCIP_Dialog::name, and NULL.

Referenced by SCIP_DECL_SORTPTRCOMP(), SCIPdialogAddEntry(), SCIPdialogCopyInclude(), SCIPdialogDisplayCompletions(), SCIPdialogFindEntry(), and SCIPdialogHasEntry().

const char* SCIPdialogGetDesc ( SCIP_DIALOG dialog)

gets the description of the dialog

Parameters
dialogdialog

Definition at line 1180 of file dialog.c.

References SCIP_Dialog::desc, and NULL.

SCIP_Bool SCIPdialogIsSubmenu ( SCIP_DIALOG dialog)

returns whether the dialog is a sub menu

Parameters
dialogdialog

Definition at line 1190 of file dialog.c.

References SCIP_Dialog::issubmenu, and NULL.

Referenced by SCIPdialogDisplayMenu().

SCIP_DIALOG* SCIPdialogGetParent ( SCIP_DIALOG dialog)

gets the parent dialog of the given dialog

Parameters
dialogdialog

Definition at line 1200 of file dialog.c.

References NULL, and SCIP_Dialog::parent.

Referenced by dialogExecMenu(), and SCIP_DECL_DIALOGEXEC().

SCIP_DIALOG** SCIPdialogGetSubdialogs ( SCIP_DIALOG dialog)

gets the array of sub-dialogs associated with the given dialog

Parameters
dialogdialog

Definition at line 1210 of file dialog.c.

References NULL, and SCIP_Dialog::subdialogs.

Referenced by SCIPdialogDisplayCompletions(), SCIPdialogFindEntry(), and SCIPdialogHasEntry().

int SCIPdialogGetNSubdialogs ( SCIP_DIALOG dialog)

gets the number of sub-dialogs associated with the given dialog

Parameters
dialogdialog

Definition at line 1220 of file dialog.c.

References SCIP_Dialog::nsubdialogs, and NULL.

Referenced by SCIPdialogDisplayCompletions(), SCIPdialogFindEntry(), and SCIPdialogHasEntry().

SCIP_DIALOGDATA* SCIPdialogGetData ( SCIP_DIALOG dialog)

gets the user defined data associated with the given dialog

Parameters
dialogdialog

Definition at line 1230 of file dialog.c.

References SCIP_Dialog::dialogdata, and NULL.

Referenced by SCIP_DECL_DIALOGCOPY(), SCIP_DECL_DIALOGDESC(), SCIP_DECL_DIALOGEXEC(), and SCIP_DECL_DIALOGFREE().

void SCIPdialogSetData ( SCIP_DIALOG dialog,
SCIP_DIALOGDATA dialogdata 
)

sets user data of dialog; user has to free old data in advance!

Parameters
dialogdialog
dialogdatanew dialog user data

Definition at line 1240 of file dialog.c.

References SCIP_Dialog::dialogdata, and NULL.

Referenced by SCIP_DECL_DIALOGFREE().

SCIP_RETCODE SCIPdialogWriteHistory ( const char *  filename)

writes command history to specified filename

Parameters
filenamefile name for (over)writing history

Definition at line 1251 of file dialog.c.

References writeHistory().

Referenced by SCIP_DECL_DIALOGEXEC().