commands.h 1.33 KB
Newer Older
1
/* SPDX-License-Identifier: Zlib */
Sebastian Ramacher's avatar
Sebastian Ramacher committed
2 3 4 5

#ifndef GIRARA_COMMANDS_H
#define GIRARA_COMMANDS_H

6
#include "macros.h"
Sebastian Ramacher's avatar
Sebastian Ramacher committed
7
#include "types.h"
Sebastian Ramacher's avatar
Sebastian Ramacher committed
8 9

/**
Sebastian Ramacher's avatar
Sebastian Ramacher committed
10
 * Adds an inputbar command
Sebastian Ramacher's avatar
Sebastian Ramacher committed
11 12
 *
 * @param session The used girara session
Sebastian Ramacher's avatar
Sebastian Ramacher committed
13 14 15 16 17
 * @param command The name of the command
 * @param abbreviation The abbreviation of the command
 * @param function Executed function
 * @param completion Completion function
 * @param description Description of the command
18 19
 * @return TRUE No error occurred
 * @return FALSE An error occurred
Sebastian Ramacher's avatar
Sebastian Ramacher committed
20
 */
Moritz Lipp's avatar
Moritz Lipp committed
21 22 23
bool girara_inputbar_command_add(girara_session_t* session,
    const char* command, const char* abbreviation,
    girara_command_function_t function, girara_completion_function_t completion,
24
    const char* description) GIRARA_VISIBLE;
Sebastian Ramacher's avatar
Sebastian Ramacher committed
25 26

/**
Sebastian Ramacher's avatar
Sebastian Ramacher committed
27
 * Adds a special command
Sebastian Ramacher's avatar
Sebastian Ramacher committed
28 29
 *
 * @param session The used girara session
Sebastian Ramacher's avatar
Sebastian Ramacher committed
30 31 32 33 34 35
 * @param identifier Char identifier
 * @param function Executed function
 * @param always If the function should executed on every change of the input
 *        (e.g.: incremental search)
 * @param argument_n Argument identifier
 * @param argument_data Argument data
36 37
 * @return TRUE No error occurred
 * @return FALSE An error occurred
Sebastian Ramacher's avatar
Sebastian Ramacher committed
38
 */
Moritz Lipp's avatar
Moritz Lipp committed
39 40
bool girara_special_command_add(girara_session_t* session, char identifier,
    girara_inputbar_special_function_t function, bool always, int argument_n,
41
    void* argument_data) GIRARA_VISIBLE;
Sebastian Ramacher's avatar
Sebastian Ramacher committed
42 43

#endif