Commit d6e119e0f9d42f29358b7a7f69558267a914b9a7

Authored by Perry Werneck
1 parent 69f72a0d
Exists in master and in 2 other branches develop, macos

Removing unused code

src/mkactions/mkactions.c
... ... @@ -1,215 +0,0 @@
1   -/*
2   - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
3   - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
4   - * aplicativos mainframe. Registro no INPI sob o nome G3270. Registro no INPI sob o nome G3270.
5   - *
6   - * Copyright (C) <2008> <Banco do Brasil S.A.>
7   - *
8   - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
9   - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
10   - * Free Software Foundation.
11   - *
12   - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
13   - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
14   - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
15   - * obter mais detalhes.
16   - *
17   - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
18   - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
19   - * St, Fifth Floor, Boston, MA 02110-1301 USA
20   - *
21   - * Este programa está nomeado como mkfb.c e possui - linhas de código.
22   - *
23   - * Contatos:
24   - *
25   - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
26   - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
27   - *
28   - */
29   -
30   -/**
31   - * @brief Utility to create the actions definition files.
32   - *
33   - */
34   -
35   -#include <getopt.h>
36   -#include <stdio.h>
37   -
38   -#define DECLARE_LIB3270_ACTION( name, description ) \
39   - { \
40   - description, \
41   - NULL, \
42   - "LIB3270_EXPORT int lib3270_" # name "(H3270 *hSession);" \
43   - },
44   -
45   -#define DECLARE_LIB3270_CLEAR_SELECTION_ACTION( name, description ) \
46   - { \
47   - description, \
48   - NULL, \
49   - "LIB3270_EXPORT int lib3270_" # name "(H3270 *hSession);" \
50   - },
51   -
52   -#define DECLARE_LIB3270_KEY_ACTION( name, description ) \
53   - { \
54   - description, \
55   - NULL, \
56   - "LIB3270_EXPORT int lib3270_" # name "(H3270 *hSession);" \
57   - },
58   -
59   -#define DECLARE_LIB3270_CURSOR_ACTION( name, description ) \
60   - { \
61   - description, \
62   - NULL, \
63   - "LIB3270_EXPORT int lib3270_cursor_" # name "(H3270 *hSession);" \
64   - },
65   -
66   -#define DECLARE_LIB3270_FKEY_ACTION( name, description ) \
67   - { \
68   - description, \
69   - "keycode\tNumber of the " #name " to activate.", \
70   - "LIB3270_EXPORT int lib3270_" # name "(H3270 *hSession, int keycode);" \
71   - },
72   -
73   -
74   -static struct {
75   - const char *description;
76   - const char *args;
77   - const char *prototype;
78   -} actions[] = {
79   - #include <lib3270/action_table.h>
80   -};
81   -
82   -
83   -int main(int argc, char *argv[]) {
84   -
85   - enum _format {
86   - FORMAT_HEADER
87   - } format = FORMAT_HEADER;
88   -
89   - size_t ix;
90   -
91   - char * outfile = "actions.h";
92   -
93   - //#pragma GCC diagnostic push
94   - //#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
95   - static struct option options[] = {
96   - { "outfile", required_argument, 0, 'o' },
97   - { 0, 0, 0, 0}
98   -
99   - };
100   - //#pragma GCC diagnostic pop
101   -
102   - int long_index =0;
103   - int opt;
104   - while((opt = getopt_long(argc, argv, "o:", options, &long_index )) != -1) {
105   -
106   - switch(opt) {
107   - case 'o': // Pidfile
108   - outfile = optarg;
109   - break;
110   - }
111   -
112   - }
113   -
114   - FILE *out = fopen(outfile,"w");
115   -
116   - fprintf(out,"%s\n",
117   - "/*\n"
118   - " * Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270\n"
119   - " * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a\n"
120   - " * aplicativos mainframe. Registro no INPI sob o nome G3270. Registro no INPI sob o nome G3270.\n"
121   - " *\n"
122   - " * Copyright (C) <2008> <Banco do Brasil S.A.>\n"
123   - " *\n"
124   - " * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob\n"
125   - " * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela\n"
126   - " * Free Software Foundation.\n"
127   - " *\n"
128   - " * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER\n"
129   - " * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO\n"
130   - " * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para\n"
131   - " * obter mais detalhes.\n"
132   - " *\n"
133   - " * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este\n"
134   - " * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin\n"
135   - " * St, Fifth Floor, Boston, MA 02110-1301 USA\n"
136   - " *\n"
137   - " * Contatos:\n"
138   - " *\n"
139   - " * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)\n"
140   - " * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)\n"
141   - " *\n"
142   - " */\n\n"
143   - "#ifndef LIB3270_ACTIONS_H_INCLUDED\n"
144   - "\n"
145   - "\n #define LIB3270_ACTIONS_H_INCLUDED 1\n\n"
146   - "#ifdef __cplusplus\n"
147   - " extern \"C\" {\n"
148   - "#endif\n\n"
149   - );
150   -
151   - if(format == FORMAT_HEADER)
152   - {
153   -
154   - for(ix = 0; ix < (sizeof(actions)/sizeof(actions[0])); ix++)
155   - {
156   - fprintf(out,
157   - "/**\n"
158   - " *\n"
159   - " * @brief %s\n"
160   - " *\n"
161   - " * @param hSession\tTN3270 Session handle.\n",
162   - actions[ix].description
163   - );
164   -
165   - if(actions[ix].args) {
166   - fprintf(out," * @param %s\n", actions[ix].args);
167   - }
168   -
169   - fprintf(out,
170   - " *\n"
171   - " * @return 0 if Ok, non zero if not (sets errno)\n"
172   - );
173   -
174   - fprintf(out," *\n */\n %s\n\n",actions[ix].prototype);
175   - }
176   -
177   - fprintf(out,
178   - "\n"
179   - "\n typedef struct _lib3270_action_entry"
180   - "\n {"
181   - "\n const char *name;"
182   - "\n const char *description;"
183   - "\n int (*call)(H3270 *hSession);"
184   - "\n } LIB3270_ACTION_ENTRY;"
185   - "\n\n"
186   - "/**\n"
187   - " *\n"
188   - " * @brief Get lib3270 action table.\n"
189   - " *\n"
190   - " * @return Array with all the supported actions.\n"
191   - " */\n"
192   - " LIB3270_EXPORT const LIB3270_ACTION_ENTRY * lib3270_get_actions();\n"
193   - "\n"
194   - "/**\n"
195   - " *\n"
196   - " * @brief Call lib3270 action by name.\n"
197   - " *\n"
198   - " * @param hSession\tTN3270 Session handle.\n"
199   - " * @param name\tName of the action to call.\n"
200   - " *\n"
201   - " */\n"
202   - " LIB3270_EXPORT int lib3270_action(H3270 *hSession, const char *name);\n\n"
203   - "#ifdef __cplusplus\n"
204   - " }\n"
205   - "#endif\n"
206   - "\n#endif // LIB3270_ACTIONS_H_INCLUDED"
207   - );
208   - }
209   -
210   - fclose(out);
211   -
212   - return 0;
213   -}
214   -
215   -
src/mkactions/mkactions.cbp
... ... @@ -1,45 +0,0 @@
1   -<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2   -<CodeBlocks_project_file>
3   - <FileVersion major="1" minor="6" />
4   - <Project>
5   - <Option title="LIB3270 Action Table Generator" />
6   - <Option pch_mode="2" />
7   - <Option compiler="gcc" />
8   - <Build>
9   - <Target title="Debug">
10   - <Option output=".bin/Debug/mkactions" prefix_auto="1" extension_auto="1" />
11   - <Option object_output=".obj/Debug/" />
12   - <Option type="1" />
13   - <Option compiler="gcc" />
14   - <Compiler>
15   - <Add option="-g" />
16   - </Compiler>
17   - </Target>
18   - <Target title="Release">
19   - <Option output=".bin/Release/mkactions" prefix_auto="1" extension_auto="1" />
20   - <Option object_output=".obj/Release/" />
21   - <Option type="1" />
22   - <Option compiler="gcc" />
23   - <Compiler>
24   - <Add option="-O2" />
25   - </Compiler>
26   - <Linker>
27   - <Add option="-s" />
28   - </Linker>
29   - </Target>
30   - </Build>
31   - <Compiler>
32   - <Add option="-Wall" />
33   - <Add directory="../../include" />
34   - </Compiler>
35   - <Unit filename="mkactions.c">
36   - <Option compilerVar="CC" />
37   - </Unit>
38   - <Extensions>
39   - <code_completion />
40   - <envvars />
41   - <debugger />
42   - <lib_finder disable_auto="1" />
43   - </Extensions>
44   - </Project>
45   -</CodeBlocks_project_file>