Commit 61201f9336a8aced1b0633566b0927cfcad00bd9
1 parent
a242b330
Exists in
master
and in
1 other branch
Ajustando linefeeds, iniciando modernizacao do dialogo de hostname
Showing
1 changed file
with
39 additions
and
39 deletions
Show diff stats
macros.c
| ... | ... | @@ -29,46 +29,46 @@ |
| 29 | 29 | * macmiranda@bb.com.br (Marco Aurélio Caldas Miranda) |
| 30 | 30 | * |
| 31 | 31 | */ |
| 32 | - | |
| 32 | + | |
| 33 | 33 | #include "private.h" |
| 34 | 34 | #include <lib3270/macros.h> |
| 35 | - | |
| 35 | + | |
| 36 | 36 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
| 37 | - | |
| 38 | - static int v3270_macro_copy(GtkWidget *widget, int argc, const char **argv) | |
| 39 | - { | |
| 37 | + | |
| 38 | + static int v3270_macro_copy(GtkWidget *widget, int argc, const char **argv) | |
| 39 | + { | |
| 40 | 40 | v3270_copy(widget, V3270_SELECT_TEXT, FALSE); |
| 41 | - return 0; | |
| 41 | + return 0; | |
| 42 | 42 | } |
| 43 | - | |
| 44 | - static int v3270_macro_append(GtkWidget *widget, int argc, const char **argv) | |
| 45 | - { | |
| 43 | + | |
| 44 | + static int v3270_macro_append(GtkWidget *widget, int argc, const char **argv) | |
| 45 | + { | |
| 46 | 46 | v3270_copy_append(widget); |
| 47 | - return 0; | |
| 47 | + return 0; | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - static int run_macro(GtkWidget *widget, int argc, const char **argv) | |
| 51 | - { | |
| 50 | + static int run_macro(GtkWidget *widget, int argc, const char **argv) | |
| 51 | + { | |
| 52 | 52 | #define V3270_MACRO( name ) { #name, v3270_macro_ ## name } |
| 53 | - | |
| 53 | + | |
| 54 | 54 | static const struct _list |
| 55 | 55 | { |
| 56 | 56 | const char *name; |
| 57 | 57 | int (*exec)(GtkWidget *widget, int argc, const char **argv); |
| 58 | - } list[] = | |
| 59 | - { | |
| 60 | - V3270_MACRO( copy ), | |
| 61 | - V3270_MACRO( append ), | |
| 58 | + } list[] = | |
| 59 | + { | |
| 60 | + V3270_MACRO( copy ), | |
| 61 | + V3270_MACRO( append ), | |
| 62 | 62 | }; |
| 63 | 63 | |
| 64 | 64 | int f; |
| 65 | - gchar *rsp; | |
| 66 | - | |
| 67 | - for(f=0;f<G_N_ELEMENTS(list);f++) | |
| 68 | - { | |
| 69 | - if(!g_ascii_strcasecmp(argv[0],list[f].name)) | |
| 70 | - return list[f].exec(widget,argc,argv); | |
| 71 | - } | |
| 65 | + gchar *rsp; | |
| 66 | + | |
| 67 | + for(f=0;f<G_N_ELEMENTS(list);f++) | |
| 68 | + { | |
| 69 | + if(!g_ascii_strcasecmp(argv[0],list[f].name)) | |
| 70 | + return list[f].exec(widget,argc,argv); | |
| 71 | + } | |
| 72 | 72 | |
| 73 | 73 | rsp = lib3270_run_macro(GTK_V3270(widget)->host,argv); |
| 74 | 74 | if(rsp) |
| ... | ... | @@ -76,21 +76,21 @@ |
| 76 | 76 | g_free(rsp); |
| 77 | 77 | return 0; |
| 78 | 78 | } |
| 79 | - | |
| 80 | - return -1; | |
| 79 | + | |
| 80 | + return -1; | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - int v3270_run_script(GtkWidget *widget, const gchar *script) | |
| 84 | -{ | |
| 85 | - gchar **ln; | |
| 83 | + int v3270_run_script(GtkWidget *widget, const gchar *script) | |
| 84 | +{ | |
| 85 | + gchar **ln; | |
| 86 | 86 | int f; |
| 87 | - | |
| 88 | - if(!script) | |
| 89 | - return 0; | |
| 90 | - | |
| 87 | + | |
| 88 | + if(!script) | |
| 89 | + return 0; | |
| 90 | + | |
| 91 | 91 | g_return_val_if_fail(GTK_IS_V3270(widget),EINVAL); |
| 92 | - | |
| 93 | - ln = g_strsplit(script,"\n",-1); | |
| 92 | + | |
| 93 | + ln = g_strsplit(script,"\n",-1); | |
| 94 | 94 | |
| 95 | 95 | for(f=0;ln[f];f++) |
| 96 | 96 | { |
| ... | ... | @@ -100,7 +100,7 @@ |
| 100 | 100 | |
| 101 | 101 | if(g_shell_parse_argv(g_strstrip(ln[f]),&argc,&argv,&error)) |
| 102 | 102 | { |
| 103 | - run_macro(widget, argc, (const char **) argv); | |
| 103 | + run_macro(widget, argc, (const char **) argv); | |
| 104 | 104 | } |
| 105 | 105 | else |
| 106 | 106 | { |
| ... | ... | @@ -113,8 +113,8 @@ |
| 113 | 113 | |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - g_strfreev(ln); | |
| 117 | - | |
| 116 | + g_strfreev(ln); | |
| 117 | + | |
| 118 | 118 | return 0; |
| 119 | -} | |
| 119 | +} | |
| 120 | 120 | ... | ... |