rofi  1.5.1
script.c File Reference
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <strings.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include <errno.h>
#include "rofi.h"
#include "dialogs/script.h"
#include "helper.h"
#include "widgets/textbox.h"
#include "mode-private.h"
Include dependency graph for script.c:

Go to the source code of this file.

Data Structures

struct  ScriptModePrivateData
 

Macros

#define G_LOG_DOMAIN   "Dialogs.Script"
 

Functions

static void parse_header_entry (Mode *sw, char *line, ssize_t length)
 
static char ** get_script_output (Mode *sw, char *command, char *arg, unsigned int *length)
 
static char ** execute_executor (Mode *sw, char *result, unsigned int *length)
 
static void script_switcher_free (Mode *sw)
 
static int script_mode_init (Mode *sw)
 
static unsigned int script_mode_get_num_entries (const Mode *sw)
 
static void script_mode_reset_highlight (Mode *sw)
 
static ModeMode script_mode_result (Mode *sw, int mretv, char **input, unsigned int selected_line)
 
static void script_mode_destroy (Mode *sw)
 
static char * _get_display_value (const Mode *sw, unsigned int selected_line, G_GNUC_UNUSED int *state, G_GNUC_UNUSED GList **list, int get_entry)
 
static int script_token_match (const Mode *sw, rofi_int_matcher **tokens, unsigned int index)
 
static char * script_get_message (const Mode *sw)
 
Modescript_switcher_parse_setup (const char *str)
 
gboolean script_switcher_is_valid (const char *token)
 

Macro Definition Documentation

◆ G_LOG_DOMAIN

#define G_LOG_DOMAIN   "Dialogs.Script"

Definition at line 28 of file script.c.

Function Documentation

◆ _get_display_value()

static char* _get_display_value ( const Mode sw,
unsigned int  selected_line,
G_GNUC_UNUSED int *  state,
G_GNUC_UNUSED GList **  list,
int  get_entry 
)
static

◆ execute_executor()

static char** execute_executor ( Mode sw,
char *  result,
unsigned int *  length 
)
static

Definition at line 159 of file script.c.

References rofi_mode::ed, and get_script_output().

Referenced by script_mode_result().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_script_output()

static char** get_script_output ( Mode sw,
char *  command,
char *  arg,
unsigned int *  length 
)
static

Definition at line 100 of file script.c.

References parse_header_entry(), and rofi_view_error_dialog().

Referenced by execute_executor(), and script_mode_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_header_entry()

static void parse_header_entry ( Mode sw,
char *  line,
ssize_t  length 
)
static

◆ script_get_message()

static char* script_get_message ( const Mode sw)
static

Definition at line 276 of file script.c.

References ScriptModePrivateData::message, and rofi_mode::private_data.

Referenced by script_switcher_parse_setup().

Here is the caller graph for this function:

◆ script_mode_destroy()

static void script_mode_destroy ( Mode sw)
static

◆ script_mode_get_num_entries()

static unsigned int script_mode_get_num_entries ( const Mode sw)
static

Definition at line 184 of file script.c.

References ScriptModePrivateData::cmd_list_length, and rofi_mode::private_data.

Referenced by script_switcher_parse_setup().

Here is the caller graph for this function:

◆ script_mode_init()

static int script_mode_init ( Mode sw)
static

Definition at line 175 of file script.c.

References ScriptModePrivateData::cmd_list, ScriptModePrivateData::cmd_list_length, rofi_mode::ed, get_script_output(), and rofi_mode::private_data.

Referenced by script_switcher_parse_setup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ script_mode_reset_highlight()

static void script_mode_reset_highlight ( Mode sw)
static

◆ script_mode_result()

static ModeMode script_mode_result ( Mode sw,
int  mretv,
char **  input,
unsigned int  selected_line 
)
static

◆ script_switcher_free()

static void script_switcher_free ( Mode sw)
static

Definition at line 165 of file script.c.

References rofi_mode::ed, and rofi_mode::name.

Referenced by script_switcher_parse_setup().

Here is the caller graph for this function:

◆ script_token_match()

static int script_token_match ( const Mode sw,
rofi_int_matcher **  tokens,
unsigned int  index 
)
static

Definition at line 271 of file script.c.

References ScriptModePrivateData::cmd_list, helper_token_match(), and rofi_mode::private_data.

Referenced by script_switcher_parse_setup().

Here is the call graph for this function:
Here is the caller graph for this function: