Returns the last character of the last keys sequence which called Smac.
For instance, only one function is defined to blink {,(
and
[
, it calls last\_
key to know if you have typed a }
,
a )
, or a ]
.
If nth is negative writes No Match in the mini buffer,
else highlights the nth character if it is visible,
else writes Match '<the char>' at line <the line> pos <nth>.
This function is used by the Cmode (§5.24 page ) when you press
},)
and ]
keys to indicate corresponding {,(
and
[
position. Obviously its visibility effect is obtained when blink is called, not when the current Smac execution is finished.
Executes sh -c cmd in a sub-shell and inserts the result in a Shell window. All the characters produced by the command cmd in the stdout are inserted starting at the current position. To get the characters produced in stdout and stderr:
char * cmd_shell_to_string(char * cmd)
Executes sh -c cmd in a sub-shell and returns a new allocated string containing all the characters produced by the command cmd in the stdout or stderr.
ATTENTION Be careful, the string is allocated each time the function is called, use free() to release it.
Returns a new allocated string containing the absolute filename selected by a file selector, or 0 if you cancel the selection.
ATTENTION Be careful, the string is allocated each time the function is called, use free() to release it.
char * select_from_list(char * title)
Displays the Xcoral List Box with given items (look at the next two functions) and the given title. Returns the item chosen with a mouse click, or 0 if cancelled.
void add_list_item(char * item)
Adds item to the items list. There is no check to verify that items are different.
Empties the items list.
void display_message(char * msg)
void display_message(char * msg, char * title)
void display_message(char * msg, char * title, int flag)
Writes msg in the Xcoral Messages Box. If title is given, it is written at the top of the window, otherwise previous title is cleared. If flag is not null, a separator is inserted before msg (i.e. the string '>>>' and a return are inserted , thus the message will be displayed on a new line); when flag is not given its value is 0.
char getchar()
char getchar(char * strprompt)
Displays the Xcoral Dialog Box to get a character. If strprompt is not given, it is replaced by "getchar ? ", which is written before the prompt. Only one character may be given, without line editing nor required return. If you choose the ok button, returns 0, if you choose cancel returns 7 (the bell).
char * gets()
char * gets(char * strprompt)
Displays the Xcoral Dialog Box to get a string with the prompt strprompt ("gets ? " if strprompt is omitted). You have line editing, and the return or ok button is required to validate the input string. If you choose the cancel button, returns a string with one character (and the null terminator) of code 7. If you select the ok button without inputting a string, returns 0.
ATTENTION Be careful, the string is allocated each time the function is called, use free() to release it.
Waits us micro-seconds.
Displays the default cursor.
Displays the cursor as a watch. It is sometimes useful to display a watch as cursor when Smac works, typically when a function runs several seconds.