geany  1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
  Fossies Dox: geany-1.38.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

build.c File Reference
#include "app.h"
#include "build.h"
#include "dialogs.h"
#include "document.h"
#include "filetypesprivate.h"
#include "geanymenubuttonaction.h"
#include "geanyobject.h"
#include "keybindingsprivate.h"
#include "msgwindow.h"
#include "prefs.h"
#include "projectprivate.h"
#include "sciwrappers.h"
#include "spawn.h"
#include "support.h"
#include "toolbar.h"
#include "ui_utils.h"
#include "utils.h"
#include "vte.h"
#include "win32.h"
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
#include <gtk/gtk.h>
#include <glib/gstdio.h>
Include dependency graph for build.c:

Go to the source code of this file.

Classes

struct  RunInfo
 
struct  BuildMenuItemSpec
 
struct  RowWidgets
 
struct  BuildTableFields
 

Macros

#define GEANY_BUILD_ERR_HIGHLIGHT_MAX   50
 
#define GBO_TO_GBG(gbo)
 
#define GBO_TO_CMD(gbo)
 
#define GRP_CMD_TO_POINTER(grp, cmd)   GUINT_TO_POINTER((((grp)&7) << 5) | ((cmd)&0x1f))
 
#define GBO_TO_POINTER(gbo)   (GRP_CMD_TO_POINTER(GBO_TO_GBG(gbo), GBO_TO_CMD(gbo)))
 
#define GPOINTER_TO_CMD(gptr)   (GPOINTER_TO_UINT(gptr)&0x1f)
 
#define GPOINTER_TO_GRP(gptr)   ((GPOINTER_TO_UINT(gptr)&0xe0) >> 5)
 
#define PRINTBUILDCMDS   FALSE
 
#define return_cmd_if(src, cmds)
 
#define return_ft_cmd_if(src, cmds)
 
#define return_nonblank_regex(src, ptr)
 
#define MENU_FT_REST   (GEANY_GBG_COUNT + GEANY_GBG_FT)
 
#define MENU_NON_FT_REST   (GEANY_GBG_COUNT + GEANY_GBG_NON_FT)
 
#define MENU_EXEC_REST   (GEANY_GBG_COUNT + GEANY_GBG_EXEC)
 
#define MENU_SEPARATOR   (2*GEANY_GBG_COUNT)
 
#define MENU_NEXT_ERROR   (MENU_SEPARATOR + 1)
 
#define MENU_PREV_ERROR   (MENU_NEXT_ERROR + 1)
 
#define MENU_COMMANDS   (MENU_PREV_ERROR + 1)
 
#define MENU_DONE   (MENU_COMMANDS + 1)
 
#define DC_ITEM   0
 
#define DC_ENTRIES   1
 
#define DC_CLEAR   4
 
#define DC_N_COL   5
 
#define set_key_grp(key, grp)   (key[prefixlen + 0] = grp[0], key[prefixlen + 1] = grp[1])
 
#define set_key_cmd(key, cmd)   (key[prefixlen + 3] = cmd[0], key[prefixlen + 4] = cmd[1])
 
#define set_key_fld(key, fld)   (key[prefixlen + 6] = fld[0], key[prefixlen + 7] = fld[1])
 

Typedefs

typedef struct RunInfo RunInfo
 
typedef void Callback(GtkWidget *w, gpointer u)
 
typedef struct RowWidgets RowWidgets
 
typedef struct BuildTableFields BuildTableFields
 

Enumerations

enum  GeanyBuildType {
  GEANY_GBO_COMPILE , GEANY_GBO_BUILD , GEANY_GBO_MAKE_ALL , GEANY_GBO_CUSTOM ,
  GEANY_GBO_MAKE_OBJECT , GEANY_GBO_EXEC , GEANY_GBO_COUNT
}
 

Functions

static void build_exit_cb (GPid pid, gint status, gpointer user_data)
 
static void build_iofunc (GString *string, GIOCondition condition, gpointer data)
 
static gchar * build_create_shellscript (const gchar *working_dir, const gchar *cmd, gboolean autoclose, GError **error)
 
static void build_spawn_cmd (GeanyDocument *doc, const gchar *cmd, const gchar *dir)
 
static void set_stop_button (gboolean stop)
 
static void run_exit_cb (GPid child_pid, gint status, gpointer user_data)
 
static void on_set_build_commands_activate (GtkWidget *w, gpointer u)
 
static void on_build_next_error (GtkWidget *menuitem, gpointer user_data)
 
static void on_build_previous_error (GtkWidget *menuitem, gpointer user_data)
 
static void kill_process (GPid *pid)
 
static void show_build_result_message (gboolean failure)
 
static void process_build_output_line (gchar *msg, gint color)
 
static void show_build_commands_dialog (void)
 
static void on_build_menu_item (GtkWidget *w, gpointer user_data)
 
void build_finalize (void)
 
static void add_menu_accel (GeanyKeyGroup *group, guint kb_id, GtkAccelGroup *accel_group, GtkWidget *menuitem)
 
static gchar * id_to_str (GeanyBuildCommand *bc, gint id)
 
static void set_command (GeanyBuildCommand *bc, gint id, gchar *str)
 
static void printfcmds (void)
 
static GeanyBuildCommand * get_next_build_cmd (GeanyDocument *doc, guint cmdgrp, guint cmdindex, guint below, guint *from)
 
static GeanyBuildCommand * get_build_cmd (GeanyDocument *doc, guint grp, guint cmdindex, guint *from)
 
gchar ** build_get_regex (GeanyBuildGroup grp, GeanyFiletype *ft, guint *from)
 
static GeanyBuildCommand ** get_build_group_pointer (const GeanyBuildSource src, const GeanyBuildGroup grp)
 
static GeanyBuildCommand * get_build_group (const GeanyBuildSource src, const GeanyBuildGroup grp)
 
void build_remove_menu_item (const GeanyBuildSource src, const GeanyBuildGroup grp, const gint cmd)
 Remove the specified Build menu item. More...
 
GeanyBuildCommand * build_get_menu_item (GeanyBuildSource src, GeanyBuildGroup grp, guint cmd)
 
const gchar * build_get_current_menu_item (const GeanyBuildGroup grp, const guint cmd, const GeanyBuildCmdEntries fld)
 Get the string for the menu item field. More...
 
void build_set_menu_item (const GeanyBuildSource src, const GeanyBuildGroup grp, const guint cmd, const GeanyBuildCmdEntries fld, const gchar *val)
 Set the string for the menu item field. More...
 
void build_activate_menu_item (const GeanyBuildGroup grp, const guint cmd)
 Activate the menu item. More...
 
static void clear_all_errors (void)
 
static gchar * build_replace_placeholder (const GeanyDocument *doc, const gchar *src)
 
static gchar * prepare_run_cmd (GeanyDocument *doc, gchar **working_dir, guint cmdindex)
 
static void build_run_cmd (GeanyDocument *doc, guint cmdindex)
 
gboolean build_parse_make_dir (const gchar *string, gchar **prefix)
 
static void build_command (GeanyDocument *doc, GeanyBuildGroup grp, guint cmd, gchar *cmd_cat)
 
static void on_make_custom_input_response (const gchar *input, gpointer data)
 
static void create_build_menu_item (GtkWidget *menu, GeanyKeyGroup *group, GtkAccelGroup *ag, struct BuildMenuItemSpec *bs, const gchar *lbl, guint grp, guint cmd)
 
static void create_build_menu (BuildMenuItems *build_menu_items)
 
void build_menu_update (GeanyDocument *doc)
 
static void on_toolbutton_build_activate (GtkWidget *menuitem, gpointer user_data)
 
static void on_toolbutton_make_activate (GtkWidget *menuitem, gpointer user_data)
 
void build_toolbutton_build_clicked (GtkAction *action, gpointer unused)
 
static void set_row_color (RowWidgets *r, GdkRGBA *color)
 
static void set_build_command_entry_text (GtkWidget *wid, const gchar *text)
 
static void on_clear_dialog_row (GtkWidget *unused, gpointer user_data)
 
static void on_clear_dialog_regex_row (GtkEntry *regex, gpointer unused)
 
static void on_label_button_clicked (GtkWidget *wid, gpointer user_data)
 
static void on_entry_focus (GtkWidget *wid, GdkEventFocus *unused, gpointer user_data)
 
static RowWidgetsbuild_add_dialog_row (GeanyDocument *doc, GtkTable *table, guint row, GeanyBuildSource dst, guint grp, guint cmd, gboolean dir)
 
GtkWidget * build_commands_table (GeanyDocument *doc, GeanyBuildSource dst, BuildTableData *table_data, GeanyFiletype *ft)
 
void build_free_fields (BuildTableData table_data)
 
static const gchar * get_build_command_entry_text (GtkWidget *wid)
 
static gboolean read_row (BuildDestination *dst, BuildTableData table_data, guint drow, guint grp, guint cmd)
 
static gboolean read_regex (GtkWidget *regexentry, gchar **src, gchar **dst)
 
static gboolean build_read_commands (BuildDestination *dst, BuildTableData table_data, gint response)
 
void build_read_project (GeanyFiletype *ft, BuildTableData build_properties)
 
BuildMenuItems * build_get_menu_items (gint filetype_idx)
 
static void build_load_menu_grp (GKeyFile *config, GeanyBuildCommand **dst, gint grp, gchar *prefix, gboolean loc)
 
static void assign_cmd (GeanyBuildCommand *type, guint id, const gchar *label, gchar *value)
 
void build_load_menu (GKeyFile *config, GeanyBuildSource src, gpointer p)
 
static guint build_save_menu_grp (GKeyFile *config, GeanyBuildCommand *src, gint grp, gchar *prefix)
 
static gboolean save_project_filetype (GeanyFiletype *ft, GKeyFile *config)
 
void build_save_menu (GKeyFile *config, gpointer ptr, GeanyBuildSource src)
 
void build_set_group_count (GeanyBuildGroup grp, gint count)
 
guint build_get_group_count (const GeanyBuildGroup grp)
 Get the count of commands for the group. More...
 
static void on_project_close (void)
 
void build_init (void)
 
gboolean build_keybinding (guint key_id)
 

Variables

GeanyBuildInfo build_info = {GEANY_GBG_FT, 0, 0, NULL, GEANY_FILETYPES_NONE, NULL, 0}
 
static gchar * current_dir_entered = NULL
 
static RunInforun_info
 
static const gchar RUN_SCRIPT_CMD [] = "geany_run_script_XXXXXX.sh"
 
static gpointer last_toolbutton_action = (GUINT_TO_POINTER(((( (( GEANY_GBO_BUILD ) > GEANY_GBO_EXEC ? GEANY_GBG_COUNT : (( GEANY_GBO_BUILD ) >= GEANY_GBO_EXEC ? GEANY_GBG_EXEC : (( GEANY_GBO_BUILD ) >= GEANY_GBO_MAKE_ALL ? GEANY_GBG_NON_FT : GEANY_GBG_FT))) )&7) << 5) | (( (( GEANY_GBO_BUILD ) >= GEANY_GBO_COUNT ? ( GEANY_GBO_BUILD ) - GEANY_GBO_COUNT : (( GEANY_GBO_BUILD ) >= GEANY_GBO_EXEC ? ( GEANY_GBO_BUILD ) - GEANY_GBO_EXEC : (( GEANY_GBO_BUILD ) >= GEANY_GBO_MAKE_ALL ? ( GEANY_GBO_BUILD ) - GEANY_GBO_MAKE_ALL : ( GEANY_GBO_BUILD )))) )&0x1f)))
 
static BuildMenuItems menu_items = {NULL, {NULL, NULL, NULL, NULL}}
 
struct {
   GtkAction *   run_action
 
   GtkAction *   compile_action
 
   GtkAction *   build_action
 
   GtkWidget *   toolmenu
 
   GtkWidget *   toolitem_build
 
   GtkWidget *   toolitem_make_all
 
   GtkWidget *   toolitem_make_custom
 
   GtkWidget *   toolitem_make_object
 
   GtkWidget *   toolitem_set_args
 
widgets
 
static guint build_groups_count [GEANY_GBG_COUNT] = { 3, 4, 2 }
 
static guint build_items_count = 9
 
static const gchar * config_keys [GEANY_BC_CMDENTRIES_COUNT]
 
static GeanyBuildCommand * ft_def = NULL
 
static GeanyBuildCommand * non_ft_proj = NULL
 
static GeanyBuildCommand * non_ft_pref = NULL
 
static GeanyBuildCommand * non_ft_def = NULL
 
static GeanyBuildCommand * exec_proj = NULL
 
static GeanyBuildCommand * exec_pref = NULL
 
static GeanyBuildCommand * exec_def = NULL
 
static gchar * regex_pref = NULL
 
static gchar * regex_proj = NULL
 
static gboolean printbuildcmds = FALSE
 
static struct BuildMenuItemSpec build_menu_specs []
 
static GdkRGBA insensitive_color
 
static const gchar * colheads []
 
static const guint entry_x_padding = 3
 
static const guint entry_y_padding = 0
 
static const gchar * build_grp_name = "build-menu"
 
static const gchar * groups [GEANY_GBG_COUNT] = { "FT", "NF", "EX" }
 
static const gchar * fixedkey ="xx_xx_xx"
 
struct {
   const gchar *   label
 
   const gchar *   command
 
   const gchar *   working_dir
 
   GeanyBuildCommand **   ptr
 
   gint   index
 
default_cmds []
 

Macro Definition Documentation

◆ DC_CLEAR

#define DC_CLEAR   4

Definition at line 1843 of file build.c.

◆ DC_ENTRIES

#define DC_ENTRIES   1

Definition at line 1842 of file build.c.

◆ DC_ITEM

#define DC_ITEM   0

Definition at line 1841 of file build.c.

◆ DC_N_COL

#define DC_N_COL   5

Definition at line 1844 of file build.c.

◆ GBO_TO_CMD

#define GBO_TO_CMD (   gbo)
Value:
((gbo) >= GEANY_GBO_COUNT ? (gbo) - GEANY_GBO_COUNT : \
((gbo) >= GEANY_GBO_EXEC ? (gbo) - GEANY_GBO_EXEC : \
((gbo) >= GEANY_GBO_MAKE_ALL ? \
(gbo) - GEANY_GBO_MAKE_ALL : (gbo))))
@ GEANY_GBO_EXEC
Definition: build.c:95
@ GEANY_GBO_MAKE_ALL
Definition: build.c:92
@ GEANY_GBO_COUNT
Definition: build.c:96

Definition at line 126 of file build.c.

◆ GBO_TO_GBG

#define GBO_TO_GBG (   gbo)
Value:
@ GEANY_GBG_NON_FT
non filetype items.
Definition: build.h:37
@ GEANY_GBG_FT
filetype items
Definition: build.h:36
@ GEANY_GBG_EXEC
execute items
Definition: build.h:38
@ GEANY_GBG_COUNT
count of groups.
Definition: build.h:39

Definition at line 110 of file build.c.

◆ GBO_TO_POINTER

#define GBO_TO_POINTER (   gbo)    (GRP_CMD_TO_POINTER(GBO_TO_GBG(gbo), GBO_TO_CMD(gbo)))

Definition at line 134 of file build.c.

◆ GEANY_BUILD_ERR_HIGHLIGHT_MAX

#define GEANY_BUILD_ERR_HIGHLIGHT_MAX   50

Definition at line 64 of file build.c.

◆ GPOINTER_TO_CMD

#define GPOINTER_TO_CMD (   gptr)    (GPOINTER_TO_UINT(gptr)&0x1f)

Definition at line 135 of file build.c.

◆ GPOINTER_TO_GRP

#define GPOINTER_TO_GRP (   gptr)    ((GPOINTER_TO_UINT(gptr)&0xe0) >> 5)

Definition at line 136 of file build.c.

◆ GRP_CMD_TO_POINTER

#define GRP_CMD_TO_POINTER (   grp,
  cmd 
)    GUINT_TO_POINTER((((grp)&7) << 5) | ((cmd)&0x1f))

Definition at line 133 of file build.c.

◆ MENU_COMMANDS

#define MENU_COMMANDS   (MENU_PREV_ERROR + 1)

Definition at line 1321 of file build.c.

◆ MENU_DONE

#define MENU_DONE   (MENU_COMMANDS + 1)

Definition at line 1322 of file build.c.

◆ MENU_EXEC_REST

#define MENU_EXEC_REST   (GEANY_GBG_COUNT + GEANY_GBG_EXEC)

Definition at line 1315 of file build.c.

◆ MENU_FT_REST

#define MENU_FT_REST   (GEANY_GBG_COUNT + GEANY_GBG_FT)

Definition at line 1313 of file build.c.

◆ MENU_NEXT_ERROR

#define MENU_NEXT_ERROR   (MENU_SEPARATOR + 1)

Definition at line 1319 of file build.c.

◆ MENU_NON_FT_REST

#define MENU_NON_FT_REST   (GEANY_GBG_COUNT + GEANY_GBG_NON_FT)

Definition at line 1314 of file build.c.

◆ MENU_PREV_ERROR

#define MENU_PREV_ERROR   (MENU_NEXT_ERROR + 1)

Definition at line 1320 of file build.c.

◆ MENU_SEPARATOR

#define MENU_SEPARATOR   (2*GEANY_GBG_COUNT)

Definition at line 1317 of file build.c.

◆ PRINTBUILDCMDS

#define PRINTBUILDCMDS   FALSE

Definition at line 262 of file build.c.

◆ return_cmd_if

#define return_cmd_if (   src,
  cmds 
)
Value:
if (cmds != NULL && cmds[cmdindex].exists && below>src)\
{ \
*fr=src; \
printf("cmd[%u,%u]=%u\n",cmdgrp,cmdindex,src); \
return &(cmds[cmdindex]); \
}
static gboolean printbuildcmds
Definition: build.c:264
#define NULL
Definition: rbtree.h:150

Definition at line 352 of file build.c.

◆ return_ft_cmd_if

#define return_ft_cmd_if (   src,
  cmds 
)
Value:
if (ft != NULL && ft->priv->cmds != NULL \
&& ft->priv->cmds[cmdindex].exists && below>src)\
{ \
*fr=src; \
printf("cmd[%u,%u]=%u\n",cmdgrp,cmdindex,src); \
return &(ft->priv->cmds[cmdindex]); \
}

Definition at line 361 of file build.c.

◆ return_nonblank_regex

#define return_nonblank_regex (   src,
  ptr 
)
Value:
if (!EMPTY(ptr)) \
{ *fr = (src); return &(ptr); }
GeanyBuildCommand ** ptr
Definition: build.c:2679
#define EMPTY(ptr)
Returns TRUE if ptr is NULL or *ptr is FALSE.
Definition: utils.h:38

Definition at line 432 of file build.c.

◆ set_key_cmd

#define set_key_cmd (   key,
  cmd 
)    (key[prefixlen + 3] = cmd[0], key[prefixlen + 4] = cmd[1])

Definition at line 2291 of file build.c.

◆ set_key_fld

#define set_key_fld (   key,
  fld 
)    (key[prefixlen + 6] = fld[0], key[prefixlen + 7] = fld[1])

Definition at line 2292 of file build.c.

◆ set_key_grp

#define set_key_grp (   key,
  grp 
)    (key[prefixlen + 0] = grp[0], key[prefixlen + 1] = grp[1])

Definition at line 2290 of file build.c.

Typedef Documentation

◆ BuildTableFields

◆ Callback

typedef void Callback(GtkWidget *w, gpointer u)

Definition at line 1197 of file build.c.

◆ RowWidgets

typedef struct RowWidgets RowWidgets

◆ RunInfo

typedef struct RunInfo RunInfo

Enumeration Type Documentation

◆ GeanyBuildType

Enumerator
GEANY_GBO_COMPILE 
GEANY_GBO_BUILD 
GEANY_GBO_MAKE_ALL 
GEANY_GBO_CUSTOM 
GEANY_GBO_MAKE_OBJECT 
GEANY_GBO_EXEC 
GEANY_GBO_COUNT 

Definition at line 88 of file build.c.

Function Documentation

◆ add_menu_accel()

static void add_menu_accel ( GeanyKeyGroup group,
guint  kb_id,
GtkAccelGroup *  accel_group,
GtkWidget *  menuitem 
)
static

Definition at line 188 of file build.c.

References group, GeanyKeyBinding::key, keybindings_get_item(), and GeanyKeyBinding::mods.

Referenced by create_build_menu_item().

◆ assign_cmd()

static void assign_cmd ( GeanyBuildCommand *  type,
guint  id,
const gchar *  label,
gchar *  value 
)
static

Definition at line 2339 of file build.c.

References command, EMPTY, GBO_TO_CMD, label, NULL, SETPTR, and working_dir.

Referenced by build_load_menu().

◆ build_activate_menu_item()

void build_activate_menu_item ( const GeanyBuildGroup  grp,
const guint  cmd 
)

Activate the menu item.

Activate the menu item specified by grp and cmd.

Parameters
grpthe group of the specified menu item.
cmdthe index of the command within the group.

Definition at line 693 of file build.c.

References GRP_CMD_TO_POINTER, NULL, and on_build_menu_item().

◆ build_add_dialog_row()

◆ build_command()

static void build_command ( GeanyDocument doc,
GeanyBuildGroup  grp,
guint  cmd,
gchar *  cmd_cat 
)
static

◆ build_commands_table()

◆ build_create_shellscript()

static gchar * build_create_shellscript ( const gchar *  working_dir,
const gchar *  cmd,
gboolean  autoclose,
GError **  error 
)
static

Definition at line 1149 of file build.c.

References close, errno, error(), NULL, RUN_SCRIPT_CMD, and working_dir.

Referenced by prepare_run_cmd().

◆ build_exit_cb()

static void build_exit_cb ( GPid  pid,
gint  status,
gpointer  user_data 
)
static

< non-zero if the child exited normally

< exit status of a child if exited normally

Definition at line 1121 of file build.c.

References build_info, build_menu_update(), NULL, show_build_result_message(), SPAWN_WEXITSTATUS, SPAWN_WIFEXITED, ui_progress_bar_stop(), and utils_beep().

Referenced by build_spawn_cmd().

◆ build_finalize()

void build_finalize ( void  )

Definition at line 177 of file build.c.

References build_info, menu_items, and NULL.

Referenced by do_main_quit().

◆ build_free_fields()

void build_free_fields ( BuildTableData  table_data)

Definition at line 2076 of file build.c.

References build_items_count.

Referenced by show_build_commands_dialog(), and show_project_properties().

◆ build_get_current_menu_item()

const gchar * build_get_current_menu_item ( const GeanyBuildGroup  grp,
const guint  cmd,
const GeanyBuildCmdEntries  fld 
)

Get the string for the menu item field.

Get the current highest priority command specified by grp and cmd. This is the one that the menu item will use if activated.

Parameters
grpthe group of the specified menu item.
cmdthe index of the command within the group.
fldthe field to return
Returns
a pointer to the constant string or NULL if it doesn't exist. This is a pointer to an internal structure and must not be freed.

Definition at line 607 of file build.c.

References build_groups_count, GEANY_BC_CMDENTRIES_COUNT, GEANY_BC_COMMAND, GEANY_BC_LABEL, GEANY_BC_WORKING_DIR, GEANY_GBG_COUNT, get_build_cmd(), and NULL.

◆ build_get_group_count()

guint build_get_group_count ( const GeanyBuildGroup  grp)

Get the count of commands for the group.

Get the number of commands in the group specified by grp.

Parameters
grpthe group of the specified menu item.
Returns
a count of the number of commands in the group

Definition at line 2660 of file build.c.

References build_groups_count, and GEANY_GBG_COUNT.

◆ build_get_menu_item()

GeanyBuildCommand * build_get_menu_item ( GeanyBuildSource  src,
GeanyBuildGroup  grp,
guint  cmd 
)

Definition at line 578 of file build.c.

References build_groups_count, GEANY_BCS_COUNT, GEANY_GBG_COUNT, get_build_group(), and NULL.

◆ build_get_menu_items()

BuildMenuItems * build_get_menu_items ( gint  filetype_idx)

Definition at line 2265 of file build.c.

References create_build_menu(), menu_items, and NULL.

Referenced by build_keybinding(), and process_build_output_line().

◆ build_get_regex()

◆ build_init()

◆ build_iofunc()

static void build_iofunc ( GString *  string,
GIOCondition  condition,
gpointer  data 
)
static

Definition at line 1041 of file build.c.

References COLOR_BLACK, COLOR_DARK_RED, and process_build_output_line().

Referenced by build_spawn_cmd().

◆ build_keybinding()

◆ build_load_menu()

◆ build_load_menu_grp()

static void build_load_menu_grp ( GKeyFile *  config,
GeanyBuildCommand **  dst,
gint  grp,
gchar *  prefix,
gboolean  loc 
)
static

◆ build_menu_update()

◆ build_parse_make_dir()

gboolean build_parse_make_dir ( const gchar *  string,
gchar **  prefix 
)

Definition at line 1051 of file build.c.

References NULL, pos, and strstr().

Referenced by find_prev_build_dir(), and process_build_output_line().

◆ build_read_commands()

static gboolean build_read_commands ( BuildDestination *  dst,
BuildTableData  table_data,
gint  response 
)
static

◆ build_read_project()

void build_read_project ( GeanyFiletype ft,
BuildTableData  build_properties 
)

◆ build_remove_menu_item()

void build_remove_menu_item ( const GeanyBuildSource  src,
const GeanyBuildGroup  grp,
const gint  cmd 
)

Remove the specified Build menu item.

Makes the specified menu item configuration no longer exist. This is different to setting fields to blank because the menu item will be deleted from the configuration file on saving (except the system filetypes settings

See also
Build Menu Configuration section of the Manual).
Parameters
srcthe source of the menu item to remove.
grpthe group of the command to remove.
cmdthe index (from 0) of the command within the group. A negative value will remove the whole group.

If any parameter is out of range does nothing.

Updates the menu.

Definition at line 546 of file build.c.

References build_groups_count, get_build_group(), and NULL.

Referenced by destroy_project().

◆ build_replace_placeholder()

◆ build_run_cmd()

◆ build_save_menu()

◆ build_save_menu_grp()

static guint build_save_menu_grp ( GKeyFile *  config,
GeanyBuildCommand *  src,
gint  grp,
gchar *  prefix 
)
static

◆ build_set_group_count()

void build_set_group_count ( GeanyBuildGroup  grp,
gint  count 
)

Definition at line 2636 of file build.c.

References build_groups_count, build_items_count, count, and GEANY_GBG_COUNT.

Referenced by load_dialog_prefs().

◆ build_set_menu_item()

void build_set_menu_item ( const GeanyBuildSource  src,
const GeanyBuildGroup  grp,
const guint  cmd,
const GeanyBuildCmdEntries  fld,
const gchar *  val 
)

Set the string for the menu item field.

Set the specified field of the command specified by src, grp and cmd.

Parameters
srcthe source of the menu item
grpthe group of the specified menu item.
cmdthe index of the menu item within the group.
fldthe field in the menu item command to set
valthe value to set the field to, is copied

Definition at line 648 of file build.c.

References build_groups_count, build_menu_update(), command, GEANY_BC_CMDENTRIES_COUNT, GEANY_BC_COMMAND, GEANY_BC_LABEL, GEANY_BC_WORKING_DIR, GEANY_BCS_COUNT, GEANY_GBG_COUNT, get_build_group_pointer(), label, NULL, SETPTR, and working_dir.

◆ build_spawn_cmd()

◆ build_toolbutton_build_clicked()

void build_toolbutton_build_clicked ( GtkAction *  action,
gpointer  unused 
)

Definition at line 1705 of file build.c.

References GBO_TO_POINTER, GEANY_GBO_BUILD, last_toolbutton_action, NULL, and on_build_menu_item().

Referenced by toolbar_init().

◆ clear_all_errors()

static void clear_all_errors ( void  )
static

Definition at line 700 of file build.c.

References documents, editor_indicator_clear_errors(), and foreach_document.

Referenced by build_spawn_cmd().

◆ create_build_menu()

◆ create_build_menu_item()

static void create_build_menu_item ( GtkWidget *  menu,
GeanyKeyGroup group,
GtkAccelGroup *  ag,
struct BuildMenuItemSpec bs,
const gchar *  lbl,
guint  grp,
guint  cmd 
)
static

◆ get_build_cmd()

static GeanyBuildCommand * get_build_cmd ( GeanyDocument doc,
guint  grp,
guint  cmdindex,
guint *  from 
)
static

◆ get_build_command_entry_text()

static const gchar * get_build_command_entry_text ( GtkWidget *  wid)
static

Definition at line 2102 of file build.c.

Referenced by read_row().

◆ get_build_group()

static GeanyBuildCommand * get_build_group ( const GeanyBuildSource  src,
const GeanyBuildGroup  grp 
)
static

Definition at line 519 of file build.c.

References get_build_group_pointer(), and NULL.

Referenced by build_get_menu_item(), and build_remove_menu_item().

◆ get_build_group_pointer()

◆ get_next_build_cmd()

◆ id_to_str()

static gchar * id_to_str ( GeanyBuildCommand *  bc,
gint  id 
)
static

◆ kill_process()

static void kill_process ( GPid *  pid)
static

Definition at line 1664 of file build.c.

References _, build_menu_update(), error(), NULL, spawn_kill_process(), and ui_set_statusbar().

Referenced by on_build_menu_item().

◆ on_build_menu_item()

◆ on_build_next_error()

static void on_build_next_error ( GtkWidget *  menuitem,
gpointer  user_data 
)
static

◆ on_build_previous_error()

static void on_build_previous_error ( GtkWidget *  menuitem,
gpointer  user_data 
)
static

◆ on_clear_dialog_regex_row()

static void on_clear_dialog_regex_row ( GtkEntry *  regex,
gpointer  unused 
)
static

Definition at line 1792 of file build.c.

Referenced by build_commands_table().

◆ on_clear_dialog_row()

◆ on_entry_focus()

static void on_entry_focus ( GtkWidget *  wid,
GdkEventFocus *  unused,
gpointer  user_data 
)
static

Definition at line 1820 of file build.c.

References NULL, set_row_color(), and RowWidgets::used_dst.

Referenced by build_add_dialog_row().

◆ on_label_button_clicked()

static void on_label_button_clicked ( GtkWidget *  wid,
gpointer  user_data 
)
static

Definition at line 1798 of file build.c.

References _, dialogs_show_input(), NULL, set_row_color(), and RowWidgets::used_dst.

Referenced by build_add_dialog_row().

◆ on_make_custom_input_response()

static void on_make_custom_input_response ( const gchar *  input,
gpointer  data 
)
static

◆ on_project_close()

static void on_project_close ( void  )
static

Definition at line 2667 of file build.c.

References NULL, regex_proj, and SETPTR.

Referenced by build_init().

◆ on_set_build_commands_activate()

static void on_set_build_commands_activate ( GtkWidget *  w,
gpointer  u 
)
static

Definition at line 1628 of file build.c.

References app, GeanyApp::project, project_build_properties(), and show_build_commands_dialog().

Referenced by build_init().

◆ on_toolbutton_build_activate()

static void on_toolbutton_build_activate ( GtkWidget *  menuitem,
gpointer  user_data 
)
static

Definition at line 1638 of file build.c.

References _, last_toolbutton_action, NULL, on_build_menu_item(), and widgets.

Referenced by build_init().

◆ on_toolbutton_make_activate()

static void on_toolbutton_make_activate ( GtkWidget *  menuitem,
gpointer  user_data 
)
static

◆ prepare_run_cmd()

static gchar * prepare_run_cmd ( GeanyDocument doc,
gchar **  working_dir,
guint  cmdindex 
)
static

◆ printfcmds()

◆ process_build_output_line()

◆ read_regex()

static gboolean read_regex ( GtkWidget *  regexentry,
gchar **  src,
gchar **  dst 
)
static

Definition at line 2154 of file build.c.

References EMPTY, NULL, and SETPTR.

Referenced by build_read_commands().

◆ read_row()

static gboolean read_row ( BuildDestination *  dst,
BuildTableData  table_data,
guint  drow,
guint  grp,
guint  cmd 
)
static

◆ run_exit_cb()

static void run_exit_cb ( GPid  child_pid,
gint  status,
gpointer  user_data 
)
static

Definition at line 1133 of file build.c.

References build_menu_update(), NULL, and RunInfo::pid.

Referenced by build_run_cmd().

◆ save_project_filetype()

◆ set_build_command_entry_text()

static void set_build_command_entry_text ( GtkWidget *  wid,
const gchar *  text 
)
static

Definition at line 1752 of file build.c.

References text.

Referenced by build_add_dialog_row(), and on_clear_dialog_row().

◆ set_command()

static void set_command ( GeanyBuildCommand *  bc,
gint  id,
gchar *  str 
)
static

Definition at line 216 of file build.c.

References GEANY_BC_COMMAND, GEANY_BC_LABEL, GEANY_BC_WORKING_DIR, and SETPTR.

Referenced by read_row().

◆ set_row_color()

static void set_row_color ( RowWidgets r,
GdkRGBA *  color 
)
static

◆ set_stop_button()

static void set_stop_button ( gboolean  stop)
static

Definition at line 1600 of file build.c.

References NULL, toolbar_get_widget_by_name(), and utils_str_equal().

Referenced by build_menu_update().

◆ show_build_commands_dialog()

◆ show_build_result_message()

static void show_build_result_message ( gboolean  failure)
static

Variable Documentation

◆ build_action

GtkAction* build_action

Definition at line 146 of file build.c.

◆ build_groups_count

◆ build_grp_name

const gchar* build_grp_name = "build-menu"
static

◆ build_info

◆ build_items_count

guint build_items_count = 9
static

Definition at line 158 of file build.c.

Referenced by build_commands_table(), build_free_fields(), and build_set_group_count().

◆ build_menu_specs

struct BuildMenuItemSpec build_menu_specs[]
static

◆ colheads

const gchar* colheads[]
static
Initial value:
=
{
"#",
"Label" ,
"Command" ,
"Working directory" ,
"Reset" ,
}

Definition at line 1830 of file build.c.

Referenced by build_commands_table().

◆ command

◆ compile_action

GtkAction* compile_action

Definition at line 145 of file build.c.

◆ config_keys

const gchar* config_keys[GEANY_BC_CMDENTRIES_COUNT]
static
Initial value:
= {
"LB",
"CM",
"WD"
}

Definition at line 235 of file build.c.

Referenced by build_save_menu_grp().

◆ current_dir_entered

gchar* current_dir_entered = NULL
static

Definition at line 69 of file build.c.

Referenced by build_spawn_cmd(), and process_build_output_line().

◆ 

struct { ... } default_cmds[]
Initial value:
= {
{ NULL, NULL, NULL, NULL, 0 }
}
static GeanyBuildCommand * non_ft_def
Definition: build.c:251
static GeanyBuildCommand * exec_def
Definition: build.c:254
@ GEANY_GBO_MAKE_OBJECT
Definition: build.c:94
@ GEANY_GBO_CUSTOM
Definition: build.c:93

Referenced by build_init().

◆ entry_x_padding

const guint entry_x_padding = 3
static

Definition at line 1846 of file build.c.

Referenced by build_add_dialog_row(), and build_commands_table().

◆ entry_y_padding

const guint entry_y_padding = 0
static

Definition at line 1847 of file build.c.

Referenced by build_add_dialog_row(), and build_commands_table().

◆ exec_def

GeanyBuildCommand* exec_def = NULL
static

Definition at line 254 of file build.c.

Referenced by build_init(), get_build_group_pointer(), get_next_build_cmd(), and printfcmds().

◆ exec_pref

GeanyBuildCommand* exec_pref = NULL
static

◆ exec_proj

GeanyBuildCommand* exec_proj = NULL
static

◆ fixedkey

const gchar* fixedkey ="xx_xx_xx"
static

Definition at line 2288 of file build.c.

Referenced by build_load_menu_grp(), and build_save_menu_grp().

◆ ft_def

GeanyBuildCommand* ft_def = NULL
static

Definition at line 248 of file build.c.

Referenced by build_init(), get_next_build_cmd(), and printfcmds().

◆ groups

const gchar* groups[GEANY_GBG_COUNT] = { "FT", "NF", "EX" }
static

◆ index

◆ insensitive_color

GdkRGBA insensitive_color
static

Definition at line 1736 of file build.c.

Referenced by build_add_dialog_row(), and on_clear_dialog_row().

◆ label

const gchar* label

Definition at line 2676 of file build.c.

Referenced by add_file_item(), add_kb(), add_kb_group(), Scintilla::ScintillaGTK::AddToPopUp(), assign_cmd(), build_add_dialog_row(), build_commands_table(), build_init(), build_load_menu(), build_load_menu_grp(), build_menu_update(), build_set_menu_item(), cc_dialog_add_command(), cc_insert_custom_command_items(), cc_show_dialog_custom_commands(), configure_plugins(), create_default_tag_tree(), create_dialog(), create_fif_dialog(), create_find_dialog(), demo_configure(), dialogs_show_file_properties(), dialogs_show_input_full(), dialogs_show_input_numeric(), document_show_message(), encodings_init(), fill_shortcut_labels_treeview(), geany_entry_action_new(), geany_menu_button_action_new(), geany_pong_init(), getLineType(), insert_build_page(), insert_date_items(), insert_include_items(), kb_find_duplicate(), kb_grab_key_dialog_key_press_cb(), kb_init(), kb_tree_view_change_button_clicked_cb(), keybindings_set_group(), keybindings_set_item(), keybindings_set_item_full(), make_filterbar(), makeLabelTag(), on_indent_width_activate(), open_preferences_help(), plugin_configure(), pm_show_dialog(), prefs_show_dialog(), project_new(), show_goto_popup(), tb_editor_create_dialog(), tb_editor_set_item_values(), tools_create_insert_custom_command_menu_items(), tools_show_dialog_insert_special_chars(), tools_word_count(), ui_add_config_file_menu_item(), ui_frame_new_with_alignment(), ui_image_menu_item_new(), ui_label_new_bold(), ui_label_set_markup(), and ui_tool_button_new().

◆ last_toolbutton_action

◆ menu_items

BuildMenuItems menu_items = {NULL, {NULL, NULL, NULL, NULL}}
static

◆ non_ft_def

GeanyBuildCommand* non_ft_def = NULL
static

Definition at line 251 of file build.c.

Referenced by build_init(), get_build_group_pointer(), get_next_build_cmd(), and printfcmds().

◆ non_ft_pref

GeanyBuildCommand* non_ft_pref = NULL
static

◆ non_ft_proj

GeanyBuildCommand* non_ft_proj = NULL
static

◆ printbuildcmds

gboolean printbuildcmds = FALSE
static

Definition at line 264 of file build.c.

Referenced by get_next_build_cmd().

◆ ptr

◆ regex_pref

gchar* regex_pref = NULL
static

◆ regex_proj

gchar* regex_proj = NULL
static

◆ run_action

GtkAction* run_action

Definition at line 144 of file build.c.

◆ run_info

RunInfo* run_info
static

Definition at line 77 of file build.c.

Referenced by build_init(), build_menu_update(), build_run_cmd(), and on_build_menu_item().

◆ RUN_SCRIPT_CMD

const gchar RUN_SCRIPT_CMD[] = "geany_run_script_XXXXXX.sh"
static

Definition at line 80 of file build.c.

Referenced by build_create_shellscript().

◆ toolitem_build

GtkWidget* toolitem_build

Definition at line 149 of file build.c.

◆ toolitem_make_all

GtkWidget* toolitem_make_all

Definition at line 150 of file build.c.

◆ toolitem_make_custom

GtkWidget* toolitem_make_custom

Definition at line 151 of file build.c.

◆ toolitem_make_object

GtkWidget* toolitem_make_object

Definition at line 152 of file build.c.

◆ toolitem_set_args

GtkWidget* toolitem_set_args

Definition at line 153 of file build.c.

◆ toolmenu

GtkWidget* toolmenu

Definition at line 147 of file build.c.

Referenced by build_init().

◆ 

◆ working_dir