![]() | ![]() | ![]() | Cuiterm Reference Manual | ![]() |
---|
#include <history.h> CuiGenerator; CuiGenerator* cui_generator_new (void); void cui_generator_set_terminal (CuiGenerator *generator, const gpointer *terminal); void cui_generator_send_shell_command (CuiGenerator *generator, const char *command); enum CuiCommandType; enum CuiCommandOpcode; void cui_generator_emit_file_command (CuiGenerator *generator, CuiCommandOpcode command, CuiFilename *file); void cui_generator_emit_file_command_with_arg (CuiGenerator *generator, CuiCommandOpcode command, CuiFilename *file, const gchar *text); gint cui_generator_emit_commands (CuiGenerator *command_generator, GList *list);
typedef struct { gpointer terminal; gchar *os; } CuiGenerator;
gpointer terminal ; | we send the command for this Terminal |
gchar *os ; | the name of the operating system |
CuiGenerator* cui_generator_new (void);
Returns : | A newly allocated and initialized command generator |
void cui_generator_set_terminal (CuiGenerator *generator, const gpointer *terminal);
Sets the terminal for the command generator.
generator : | |
terminal : | a Terminal we send the commands to |
void cui_generator_send_shell_command (CuiGenerator *generator, const char *command);
Sends a command directly to the terminal. This function does not modify the string just sends it to execute.
generator : | |
command : | a simple shell command |
typedef enum { FileCommand, FileCommandWithArg, WindowCommand, WindowCommandWithArg } CuiCommandType;
A type to arrange the command opcodes into groups.
typedef enum { FileOpen, FileRefresh, FileOpenForEdit, FileOpenForView, FileProcess, FileOpenWithVim, FileOpenWithEmacs, FileNewRegularFile, FileNewDirectory, FileNewTarArchive, FileNewTarGzArchive, FileNewTarBzArchive, FileDelete, FileMoveToTrash, FileUncompress, FileShowProperties, FileClipBoardCut, FileClipBoardCopy, FileClipBoardPaste, FileSetModeToFile, FileSetModeToDir, FileSetModeToProgram, FileViewACLList, FileGrantReadUser, FileRevokeReadUser, FileGrantWriteUser, FileRevokeWriteUser, FileGrantExecuteUser, FileRevokeExecuteUser, FileGrantReadGroup, FileRevokeReadGroup, FileGrantWriteGroup, FileRevokeWriteGroup, FileGrantExecuteGroup, FileRevokeExecuteGroup, FileGrantReadOthers, FileRevokeReadOthers, FileGrantWriteOthers, FileRevokeWriteOthers, FileGrantExecuteOthers, FileRevokeExecuteOthers, /* These commands has a char argument accepted when executing. */ FileRename, FileCopy, FileMove, FileCopyMode, FileCopyOwner, FileCopyGroupOwner, FileChangeOwner, FileChangeGroup, FileChangeAccessDate, FileChangeModifyDate, FileChangeChangeDate, /* These commands has an implicit char argument. */ FileChangeACL, FileOpenWithLine, WindowDirectCommand, /* Window commands */ WindowRefresh } CuiCommandOpcode;
A simple command code.
void cui_generator_emit_file_command (CuiGenerator *generator, CuiCommandOpcode command, CuiFilename *file);
Sends a file command with the command generator to the shell.
generator : | |
command : | the code of the command to send |
file : | the file argument for the command |
void cui_generator_emit_file_command_with_arg (CuiGenerator *generator, CuiCommandOpcode command, CuiFilename *file, const gchar *text);
generator : | |
command : | |
file : | |
text : |
|
gint cui_generator_emit_commands (CuiGenerator *command_generator, GList *list);
Emits a series of commands to the terminal to execute them.
command_generator : | a CuiGenerator to generate the commands |
list : | a list of commands |
Returns : | the number of commands executed |
"os" gchararray : Read / Write
The name of the operating system.
Default value: "Linux"
<<< CuiIcon | The BASH Parser >>> |