Commit 43dd9cc15f63b6dd342ba52772bbb8238a2edfbe
Committed by
GitHub
Exists in
master
and in
1 other branch
Merge pull request #1 from PerryWerneck/develop
Updating for version 5.2
Showing
53 changed files
with
5130 additions
and
5587 deletions
Show diff stats
.gitignore
Makefile.in
| ... | ... | @@ -24,38 +24,23 @@ |
| 24 | 24 | # erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) |
| 25 | 25 | # |
| 26 | 26 | |
| 27 | -PACKAGE_NAME=@PACKAGE_NAME@ | |
| 28 | - | |
| 29 | -#---[ PLugin configuration ]------------------------------------------------------------- | |
| 30 | - | |
| 31 | -PLUGIN_NAME=ipc3270c | |
| 32 | - | |
| 33 | -PLUGIN_SOURCES= \ | |
| 34 | - $(wildcard src/$(PLUGIN_NAME)/*.c) \ | |
| 35 | - $(wildcard src/$(PLUGIN_NAME)/@OSNAME@/*.c) \ | |
| 36 | - $(wildcard src/$(PLUGIN_NAME)/@OSNAME@/*.rc) | |
| 37 | - | |
| 38 | -PLUGIN_TEST_SOURCES= \ | |
| 39 | - src/testprograms/$(PLUGIN_NAME).c | |
| 40 | - | |
| 41 | 27 | #---[ Library configuration ]------------------------------------------------------------ |
| 42 | 28 | |
| 43 | -LIBRARY_NAME=hllapi | |
| 29 | +LIBNAME=libhllapi | |
| 30 | +SONAME=@SONAME@ | |
| 44 | 31 | |
| 45 | -LIBRARY_SOURCES= \ | |
| 46 | - $(wildcard src/$(LIBRARY_NAME)/*.c) \ | |
| 47 | - $(wildcard src/$(LIBRARY_NAME)/*.cc) \ | |
| 48 | - $(wildcard src/$(LIBRARY_NAME)/@OSNAME@/*.c) \ | |
| 49 | - $(wildcard src/$(LIBRARY_NAME)/@OSNAME@/*.rc) | |
| 32 | +SOURCES= \ | |
| 33 | + $(wildcard src/core/*.cc) \ | |
| 34 | + $(wildcard src/core/@OSNAME@/*.rc) \ | |
| 35 | + $(wildcard src/core/@OSNAME@/*.cc) | |
| 50 | 36 | |
| 51 | -LIBRARY_TEST_SOURCES= \ | |
| 52 | - src/testprograms/$(LIBRARY_NAME).c | |
| 37 | +TEST_SOURCES= \ | |
| 38 | + $(wildcard src/testprogram/*.cc) | |
| 53 | 39 | |
| 54 | 40 | #---[ Tools ]---------------------------------------------------------------------------- |
| 55 | 41 | |
| 56 | -CC=@CC@ | |
| 57 | -LD=@CC@ | |
| 58 | 42 | CXX=@CXX@ |
| 43 | +LD=@CXX@ | |
| 59 | 44 | LN_S=@LN_S@ |
| 60 | 45 | MKDIR=@MKDIR_P@ |
| 61 | 46 | INSTALL=@INSTALL@ |
| ... | ... | @@ -65,7 +50,12 @@ XGETTEXT=@XGETTEXT@ |
| 65 | 50 | MSGCAT=@MSGCAT@ |
| 66 | 51 | WINDRES=@WINDRES@ |
| 67 | 52 | AR=@AR@ |
| 68 | -DBUSBINDINGTOOL=@DBUSBINDINGTOOL@ | |
| 53 | +VALGRIND=@VALGRIND@ | |
| 54 | +GENMARSHAL=@GENMARSHAL@ | |
| 55 | +CONVERT=@CONVERT@ | |
| 56 | +OPTIPNG=@OPTIPNG@ | |
| 57 | +ZIP=@ZIP@ | |
| 58 | +DOXYGEN=@DOXYGEN@ | |
| 69 | 59 | |
| 70 | 60 | #---[ Paths ]---------------------------------------------------------------------------- |
| 71 | 61 | |
| ... | ... | @@ -82,9 +72,7 @@ sysconfdir=@sysconfdir@ |
| 82 | 72 | |
| 83 | 73 | BASEDIR=@BASEDIR@ |
| 84 | 74 | |
| 85 | -POTDIR=$(BASEDIR)/.pot | |
| 86 | - | |
| 87 | -OBJDIR=$(BASEDIR)/.obj | |
| 75 | +OBJDIR=$(BASEDIR)/.obj/$(LIBNAME) | |
| 88 | 76 | OBJDBG=$(OBJDIR)/Debug |
| 89 | 77 | OBJRLS=$(OBJDIR)/Release |
| 90 | 78 | |
| ... | ... | @@ -96,358 +84,159 @@ BINRLS=$(BINDIR)/Release |
| 96 | 84 | |
| 97 | 85 | DEPENDS= \ |
| 98 | 86 | Makefile \ |
| 99 | - @DEPENDS@ | |
| 87 | + src/include/*.h \ | |
| 88 | + src/include/lib3270/*.h | |
| 89 | + | |
| 100 | 90 | |
| 101 | 91 | CFLAGS= \ |
| 102 | 92 | @CFLAGS@ \ |
| 103 | 93 | -g \ |
| 104 | 94 | -Isrc/include \ |
| 105 | 95 | -DBUILD_DATE=`date +%Y%m%d` \ |
| 106 | - @LIB3270_CFLAGS@ \ | |
| 107 | - @V3270_CFLAGS@ \ | |
| 108 | - @GTK_CFLAGS@ \ | |
| 109 | - @GLIB_CFLAGS@ \ | |
| 110 | - @PW3270_CFLAGS@ \ | |
| 111 | - @DBUS_CFLAGS@ \ | |
| 112 | - @GDBUS_CFLAGS@ | |
| 113 | - | |
| 114 | -GTK_LIBS=@GTK_LIBS@ | |
| 115 | -V3270_LIBS=@V3270_LIBS@ | |
| 116 | -GLIB_LIBS=@GLIB_LIBS@ | |
| 117 | -DBUS_LIBS=@DBUS_LIBS@ @GDBUS_LIBS@ | |
| 118 | -STATIC_LDFLAGS=@STATIC_LDFLAGS@ | |
| 96 | + @IPC3270_CFLAGS@ | |
| 97 | + | |
| 119 | 98 | LDFLAGS=@LDFLAGS@ |
| 120 | 99 | |
| 121 | 100 | LIBS= \ |
| 122 | 101 | @LIBS@ \ |
| 123 | - @LIBICONV@ \ | |
| 124 | - @INTL_LIBS@ \ | |
| 125 | - @LIB3270_LIBS@ \ | |
| 126 | - @PW3270_LIBS@ | |
| 127 | - | |
| 128 | -src/include/dbus-glue.h: \ | |
| 129 | - pw3270dbus.xml | |
| 130 | - | |
| 131 | - @echo $@ ... | |
| 132 | - @$(DBUSBINDINGTOOL) \ | |
| 133 | - --mode=glib-server \ | |
| 134 | - --output=$@ \ | |
| 135 | - --prefix=pw3270_dbus $^ | |
| 136 | - | |
| 102 | + @IPC3270_LIBS@ | |
| 137 | 103 | |
| 138 | 104 | #---[ Debug Rules ]---------------------------------------------------------------------- |
| 139 | 105 | |
| 140 | 106 | $(OBJDBG)/%.o: \ |
| 141 | - %.c \ | |
| 142 | - $(DEPENDS) | |
| 143 | - | |
| 144 | - @echo $< ... | |
| 145 | - @$(MKDIR) $(@D) | |
| 146 | - | |
| 147 | - @$(CC) \ | |
| 148 | - $(CFLAGS) \ | |
| 149 | - -Wall -Wextra -fstack-check \ | |
| 150 | - -DDEBUG=1 \ | |
| 151 | - -o $@ -c $< | |
| 152 | - | |
| 153 | -$(OBJDBG)/%.o: \ | |
| 154 | 107 | %.cc \ |
| 155 | 108 | $(DEPENDS) |
| 156 | 109 | |
| 157 | 110 | @echo $< ... |
| 158 | - @$(MKDIR) $(@D) | |
| 111 | + @$(MKDIR) $(dir $@) | |
| 159 | 112 | |
| 160 | 113 | @$(CXX) \ |
| 161 | 114 | $(CFLAGS) \ |
| 162 | 115 | -Wall -Wextra -fstack-check \ |
| 163 | 116 | -DDEBUG=1 \ |
| 164 | - -o $@ -c $< | |
| 117 | + -o $@ \ | |
| 118 | + -c $< | |
| 165 | 119 | |
| 166 | 120 | $(OBJDBG)/%.o: \ |
| 167 | 121 | %.rc |
| 168 | 122 | |
| 169 | 123 | @echo $< ... |
| 170 | - @$(MKDIR) $(@D) | |
| 124 | + @$(MKDIR) $(dir $@) | |
| 171 | 125 | @$(WINDRES) $< -O coff -o $@ |
| 172 | 126 | |
| 173 | 127 | #---[ Release Rules ]-------------------------------------------------------------------- |
| 174 | 128 | |
| 175 | 129 | $(OBJRLS)/%.o: \ |
| 176 | - %.c \ | |
| 177 | - $(DEPENDS) | |
| 178 | - | |
| 179 | - @echo $< ... | |
| 180 | - @$(MKDIR) $(@D) | |
| 181 | - @$(CC) \ | |
| 182 | - $(CFLAGS) \ | |
| 183 | - -DNDEBUG=1 \ | |
| 184 | - -o $@ -c $< | |
| 185 | - | |
| 186 | -$(OBJRLS)/%.o: \ | |
| 187 | 130 | %.cc \ |
| 188 | 131 | $(DEPENDS) |
| 189 | 132 | |
| 190 | 133 | @echo $< ... |
| 191 | - @$(MKDIR) $(@D) | |
| 134 | + @$(MKDIR) $(dir $@) | |
| 192 | 135 | @$(CXX) \ |
| 193 | 136 | $(CFLAGS) \ |
| 194 | 137 | -DNDEBUG=1 \ |
| 195 | - -o $@ -c $< | |
| 138 | + -o $@ \ | |
| 139 | + -c $< | |
| 196 | 140 | |
| 197 | 141 | $(OBJRLS)/%.o: \ |
| 198 | 142 | %.rc |
| 199 | 143 | |
| 200 | 144 | @echo $< ... |
| 201 | - @$(MKDIR) $(@D) | |
| 145 | + @$(MKDIR) $(dir $@) | |
| 202 | 146 | @$(WINDRES) $< -O coff -o $@ |
| 203 | 147 | |
| 204 | -#---[ Misc Rules ]----------------------------------------------------------------------- | |
| 205 | - | |
| 206 | -$(POTDIR)/$(PLUGIN_NAME)/%.pot: \ | |
| 207 | - %.c | |
| 208 | - | |
| 209 | - @echo $(notdir $@) ... | |
| 210 | - @$(MKDIR) $(@D) | |
| 211 | - @$(XGETTEXT) \ | |
| 212 | - --language=C \ | |
| 213 | - --keyword=_ \ | |
| 214 | - --keyword=N_ \ | |
| 215 | - --keyword=MSG_:2 \ | |
| 216 | - --output=$@ \ | |
| 217 | - $< | |
| 218 | - @touch $@ | |
| 219 | - | |
| 220 | -$(POTDIR)/$(PLUGIN_NAME)/%.pot: \ | |
| 221 | - %.rc | |
| 222 | - | |
| 223 | - @echo $< ... | |
| 224 | - @$(MKDIR) $(@D) | |
| 225 | - @touch $@ | |
| 226 | - | |
| 227 | - | |
| 228 | 148 | #---[ Release Targets ]------------------------------------------------------------------ |
| 229 | 149 | |
| 230 | 150 | all: \ |
| 231 | - $(BINRLS)/$(PLUGIN_NAME)@DLLEXT@ \ | |
| 232 | - $(BINRLS)/lib$(LIBRARY_NAME)@DLLEXT@ \ | |
| 233 | - $(POTDIR)/$(PLUGIN_NAME).pot | |
| 151 | + $(BINRLS)/$(SONAME) | |
| 234 | 152 | |
| 235 | 153 | Release: \ |
| 236 | - $(BINRLS)/$(PLUGIN_NAME)@DLLEXT@ \ | |
| 237 | - $(BINRLS)/lib$(LIBRARY_NAME)@DLLEXT@ | |
| 154 | + $(BINRLS)/$(SONAME) | |
| 238 | 155 | |
| 239 | -$(BINRLS)/$(PLUGIN_NAME)@DLLEXT@: \ | |
| 240 | - $(foreach SRC, $(basename $(PLUGIN_SOURCES)), $(OBJRLS)/$(SRC).o) | |
| 156 | +$(BINRLS)/$(SONAME): \ | |
| 157 | + $(foreach SRC, $(basename $(SOURCES)), $(OBJRLS)/$(SRC).o) | |
| 241 | 158 | |
| 242 | - @$(MKDIR) $(@D) | |
| 159 | + @$(MKDIR) $(dir $@) | |
| 243 | 160 | @echo $< ... |
| 244 | 161 | @$(LD) \ |
| 245 | - -shared -Wl,-soname,$(@F) \ | |
| 162 | + @DLL_LDFLAGS@ \ | |
| 246 | 163 | -o $@ \ |
| 247 | 164 | $(LDFLAGS) \ |
| 248 | - $(foreach SRC, $(basename $(PLUGIN_SOURCES)), $(OBJRLS)/$(SRC).o) \ | |
| 249 | - $(V3270_LIBS) \ | |
| 250 | - $(LIBS) \ | |
| 251 | - $(GTK_LIBS) \ | |
| 252 | - $(DBUS_LIBS) | |
| 253 | - | |
| 254 | -$(BINRLS)/lib$(LIBRARY_NAME)@DLLEXT@: \ | |
| 255 | - $(BINRLS)/lib$(LIBRARY_NAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@ | |
| 256 | - | |
| 257 | - @echo $< ... | |
| 258 | - @rm -f $@ | |
| 259 | - @$(LN_S) \ | |
| 260 | - $^ \ | |
| 261 | - $@ | |
| 262 | - | |
| 263 | -$(BINRLS)/lib$(LIBRARY_NAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@: \ | |
| 264 | - $(BINRLS)/lib$(LIBRARY_NAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@ | |
| 265 | - | |
| 266 | - @rm -f $@ | |
| 267 | - @$(LN_S) \ | |
| 268 | 165 | $^ \ |
| 269 | - $@ | |
| 270 | - | |
| 271 | -$(BINRLS)/lib$(LIBRARY_NAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@: \ | |
| 272 | - $(foreach SRC, $(basename $(LIBRARY_SOURCES)), $(OBJRLS)/$(SRC).o) | |
| 273 | - | |
| 274 | - @$(MKDIR) $(@D) | |
| 275 | - @echo $< ... | |
| 276 | - @$(CXX) \ | |
| 277 | - -shared -Wl,-soname,$(@F) \ | |
| 278 | - -o $@ \ | |
| 279 | - $(LDFLAGS) $(STATIC_LDFLAGS)\ | |
| 280 | - $(foreach SRC, $(basename $(LIBRARY_SOURCES)), $(OBJRLS)/$(SRC).o) \ | |
| 281 | - -lpw3270cpp \ | |
| 282 | - -L$(BINDBG) \ | |
| 283 | - $(LIBS) \ | |
| 284 | - $(DBUS_LIBS) | |
| 285 | - | |
| 286 | -zip: \ | |
| 287 | - $(PLUGIN_NAME)-@PACKAGE_VERSION@.@host@.zip | |
| 288 | - | |
| 289 | -$(PLUGIN_NAME)-@PACKAGE_VERSION@.@host@.zip: \ | |
| 290 | - $(BINRLS)/$(PLUGIN_NAME)@DLLEXT@ \ | |
| 291 | - $(BINRLS)/lib$(LIBRARY_NAME)@DLLEXT@ \ | |
| 292 | - $(POTDIR)/$(PLUGIN_NAME).pot | |
| 293 | - | |
| 294 | - @rm -f $@ | |
| 295 | - @zip -9 -j $@ \ | |
| 296 | - $(BINRLS)/$(PLUGIN_NAME)@DLLEXT@ \ | |
| 297 | - $(BINRLS)/lib$(LIBRARY_NAME)@DLLEXT@ \ | |
| 298 | - $(POTDIR)/$(PLUGIN_NAME).pot | |
| 166 | + $(LIBS) | |
| 299 | 167 | |
| 300 | 168 | #---[ Install Targets ]------------------------------------------------------------------ |
| 301 | 169 | |
| 302 | 170 | install: \ |
| 303 | - install-shared \ | |
| 304 | - install-plugin | |
| 171 | + $(BINRLS)/$(SONAME) | |
| 305 | 172 | |
| 306 | -install-plugin: \ | |
| 307 | - $(BINRLS)/$(PLUGIN_NAME)@DLLEXT@ | |
| 308 | - | |
| 309 | - @$(MKDIR) $(DESTDIR)$(libdir)/pw3270-plugins | |
| 310 | - | |
| 311 | - @$(INSTALL_PROGRAM) \ | |
| 312 | - $(BINRLS)/$(PLUGIN_NAME)@DLLEXT@ \ | |
| 313 | - $(DESTDIR)$(libdir)/pw3270-plugins | |
| 314 | - | |
| 315 | -install-shared: \ | |
| 316 | - $(BINRLS)/lib$(LIBRARY_NAME)@DLLEXT@ | |
| 317 | - | |
| 318 | - @$(MKDIR) $(DESTDIR)/$(libdir) | |
| 173 | + # Install library | |
| 174 | + @$(MKDIR) $(DESTDIR)$(libdir) | |
| 319 | 175 | |
| 320 | 176 | @$(INSTALL_PROGRAM) \ |
| 321 | - $(BINRLS)/lib$(LIBRARY_NAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@ \ | |
| 322 | - $(DESTDIR)/$(libdir) | |
| 177 | + $(BINRLS)/$(SONAME) \ | |
| 178 | + $(DESTDIR)$(libdir)/$(LIBNAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@ | |
| 323 | 179 | |
| 324 | 180 | @$(LN_S) \ |
| 325 | - lib$(LIBRARY_NAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@ \ | |
| 326 | - $(DESTDIR)/$(libdir)/lib$(LIBRARY_NAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@ \ | |
| 181 | + $(LIBNAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@ \ | |
| 182 | + $(DESTDIR)$(libdir)/$(LIBNAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@ | |
| 327 | 183 | |
| 328 | 184 | @$(LN_S) \ |
| 329 | - lib$(LIBRARY_NAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@ \ | |
| 330 | - $(DESTDIR)/$(libdir)/lib$(LIBRARY_NAME)@DLLEXT@ | |
| 331 | - | |
| 332 | -#---[ Misc Targets ]--------------------------------------------------------------------- | |
| 185 | + $(LIBNAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@ \ | |
| 186 | + $(DESTDIR)$(libdir)/$(LIBNAME)@DLLEXT@ | |
| 333 | 187 | |
| 334 | -$(POTDIR)/$(PLUGIN_NAME).pot: \ | |
| 335 | - $(foreach SRC, $(basename $(SOURCES)), $(POTDIR)/$(PLUGIN_NAME)/$(SRC).pot) | |
| 336 | - | |
| 337 | - @rm -f $@ | |
| 338 | - @mkdir -p `dirname $@` | |
| 339 | - @$(MSGCAT) --sort-output $^ > $@ | |
| 340 | - | |
| 341 | -locale: \ | |
| 342 | - $(POTDIR)/$(PLUGIN_NAME).pot | |
| 343 | - | |
| 344 | -run-plugin: \ | |
| 345 | - $(BINDBG)/$(PLUGIN_NAME)@EXEEXT@ | |
| 346 | - | |
| 347 | - $(BINDBG)/$(PLUGIN_NAME)@EXEEXT@ | |
| 348 | - | |
| 349 | -run-library: \ | |
| 350 | - $(BINDBG)/$(LIBRARY_NAME)@EXEEXT@ | |
| 351 | - | |
| 352 | - $(BINDBG)/$(LIBRARY_NAME)@EXEEXT@ | |
| 188 | +doc: | |
| 189 | + @$(DOXYGEN) ./doxygen/doxyfile | |
| 353 | 190 | |
| 354 | 191 | #---[ Debug Targets ]-------------------------------------------------------------------- |
| 355 | 192 | |
| 356 | 193 | Debug: \ |
| 357 | - Debug-plugin \ | |
| 358 | - Debug-library | |
| 359 | - | |
| 360 | -Debug-plugin: \ | |
| 361 | - $(BINDBG)/$(PLUGIN_NAME)@EXEEXT@ | |
| 362 | - | |
| 363 | -Debug-library: \ | |
| 364 | - $(BINDBG)/$(LIBRARY_NAME)@EXEEXT@ | |
| 365 | - | |
| 366 | -zip-debug: \ | |
| 367 | - $(PLUGIN_NAME)-debug-@PACKAGE_VERSION@.@host@.zip | |
| 368 | - | |
| 369 | -$(PLUGIN_NAME)-debug-@PACKAGE_VERSION@.@host@.zip: \ | |
| 370 | - $(BINDBG)/$(PLUGIN_NAME)@DLLEXT@ \ | |
| 371 | - $(BINDBG)/lib$(LIBRARY_NAME)@DLLEXT@ \ | |
| 372 | - $(BINDBG)/$(PLUGIN_NAME)@EXEEXT@ \ | |
| 373 | - $(BINDBG)/$(LIBRARY_NAME)@EXEEXT@ | |
| 374 | - | |
| 375 | - @rm -f $@ | |
| 376 | - @zip -9 -j $@ \ | |
| 377 | - $(BINDBG)/$(PLUGIN_NAME)@DLLEXT@ \ | |
| 378 | - $(BINDBG)/lib$(LIBRARY_NAME)@DLLEXT@ \ | |
| 379 | - $(BINDBG)/$(PLUGIN_NAME)@EXEEXT@ \ | |
| 380 | - $(BINDBG)/$(LIBRARY_NAME)@EXEEXT@ | |
| 381 | - | |
| 194 | + $(BINDBG)/$(LIBNAME)@EXEEXT@ | |
| 382 | 195 | |
| 383 | -$(BINDBG)/$(PLUGIN_NAME)@EXEEXT@: \ | |
| 384 | - $(foreach SRC, $(basename $(PLUGIN_TEST_SOURCES)), $(OBJDBG)/$(SRC).o) \ | |
| 385 | - $(BINDBG)/$(PLUGIN_NAME)@DLLEXT@ | |
| 196 | +$(BINDBG)/$(LIBNAME)@EXEEXT@: \ | |
| 197 | + $(foreach SRC, $(basename $(TEST_SOURCES)), $(OBJDBG)/$(SRC).o) \ | |
| 198 | + $(BINDBG)/$(SONAME) | |
| 386 | 199 | |
| 387 | - @$(MKDIR) $(@D) | |
| 200 | + @$(MKDIR) $(dir $@) | |
| 388 | 201 | @echo $< ... |
| 389 | 202 | @$(LD) \ |
| 390 | 203 | -o $@ \ |
| 391 | - $(foreach SRC, $(basename $(PLUGIN_TEST_SOURCES)), $(OBJDBG)/$(SRC).o) \ | |
| 204 | + $^ \ | |
| 392 | 205 | -L$(BINDBG) \ |
| 393 | 206 | -Wl,-rpath,$(BINDBG) \ |
| 394 | 207 | $(LDFLAGS) \ |
| 395 | - $(LIBS) \ | |
| 396 | - $(V3270_LIBS) \ | |
| 397 | - $(GTK_LIBS) \ | |
| 398 | - $(GLIB_LIBS) \ | |
| 399 | - $(DBUS_LIBS) | |
| 208 | + $(LIBS) | |
| 209 | + | |
| 210 | +run: \ | |
| 211 | + $(BINDBG)/$(LIBNAME)@EXEEXT@ | |
| 400 | 212 | |
| 401 | -$(BINDBG)/$(PLUGIN_NAME)@DLLEXT@: \ | |
| 402 | - $(foreach SRC, $(basename $(PLUGIN_SOURCES)), $(OBJDBG)/$(SRC).o) | |
| 213 | +ifeq ($(VALGRIND),no) | |
| 403 | 214 | |
| 404 | - @$(MKDIR) $(@D) | |
| 405 | - @echo $< ... | |
| 406 | - @$(LD) \ | |
| 407 | - -shared -Wl,-soname,$(@F) \ | |
| 408 | - -o $@ \ | |
| 409 | - $(foreach SRC, $(basename $(PLUGIN_SOURCES)), $(OBJDBG)/$(SRC).o) \ | |
| 410 | - $(LDFLAGS) \ | |
| 411 | - -L$(BINDBG) \ | |
| 412 | - $(LIBS) \ | |
| 413 | - $(V3270_LIBS) \ | |
| 414 | - $(GTK_LIBS) \ | |
| 415 | - $(GLIB_LIBS) \ | |
| 416 | - $(DBUS_LIBS) | |
| 215 | + @LD_LIBRARY_PATH=$(BINDBG) \ | |
| 216 | + $(BINDBG)/$(LIBNAME)@EXEEXT@ | |
| 417 | 217 | |
| 418 | -$(BINDBG)/$(LIBRARY_NAME)@EXEEXT@: \ | |
| 419 | - $(foreach SRC, $(basename $(LIBRARY_TEST_SOURCES)), $(OBJDBG)/$(SRC).o) \ | |
| 420 | - $(BINDBG)/lib$(LIBRARY_NAME)@DLLEXT@ | |
| 218 | +else | |
| 219 | + @touch valgrind.suppression | |
| 220 | + | |
| 221 | + @LD_LIBRARY_PATH=$(BINDBG) \ | |
| 222 | + $(VALGRIND) --leak-check=full --track-origins=yes --gen-suppressions=all --suppressions=valgrind.suppression \ | |
| 223 | + $(BINDBG)/$(LIBNAME)@EXEEXT@ | |
| 224 | +endif | |
| 421 | 225 | |
| 422 | - @$(MKDIR) $(@D) | |
| 423 | - @echo $< ... | |
| 424 | - @$(CXX) \ | |
| 425 | - -o $@ \ | |
| 426 | - $(foreach SRC, $(basename $(LIBRARY_TEST_SOURCES)), $(OBJDBG)/$(SRC).o) \ | |
| 427 | - -Wl,-rpath,$(BINDBG) \ | |
| 428 | - $(LDFLAGS) \ | |
| 429 | - -L$(BINDBG) \ | |
| 430 | - -l$(LIBRARY_NAME) \ | |
| 431 | - $(LIBS) \ | |
| 432 | - $(V3270_LIBS) \ | |
| 433 | - $(GTK_LIBS) \ | |
| 434 | - $(GLIB_LIBS) \ | |
| 435 | - $(DBUS_LIBS) | |
| 436 | 226 | |
| 437 | -$(BINDBG)/lib$(LIBRARY_NAME)@DLLEXT@: \ | |
| 438 | - $(foreach SRC, $(basename $(LIBRARY_SOURCES)), $(OBJDBG)/$(SRC).o) | |
| 227 | +$(BINDBG)/$(SONAME): \ | |
| 228 | + $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC).o) | |
| 439 | 229 | |
| 440 | - @$(MKDIR) $(@D) | |
| 230 | + @$(MKDIR) $(dir $@) | |
| 441 | 231 | @echo $< ... |
| 442 | - @$(CXX) \ | |
| 232 | + @$(LD) \ | |
| 443 | 233 | -shared -Wl,-soname,$(@F) \ |
| 444 | 234 | -o $@ \ |
| 445 | - $(LDFLAGS) $(STATIC_LDFLAGS)\ | |
| 446 | - $(foreach SRC, $(basename $(LIBRARY_SOURCES)), $(OBJDBG)/$(SRC).o) \ | |
| 447 | - -lpw3270cpp \ | |
| 448 | 235 | -L$(BINDBG) \ |
| 449 | - $(LIBS) \ | |
| 450 | - $(DBUS_LIBS) | |
| 236 | + $(LDFLAGS) \ | |
| 237 | + $^ \ | |
| 238 | + $(LIBS) | |
| 239 | + | |
| 451 | 240 | |
| 452 | 241 | #---[ Clean Targets ]-------------------------------------------------------------------- |
| 453 | 242 | |
| ... | ... | @@ -455,19 +244,18 @@ clean: \ |
| 455 | 244 | cleanDebug \ |
| 456 | 245 | cleanRelease |
| 457 | 246 | |
| 458 | - @rm -fr $(BASEDIR)/.tmp/$(PLUGIN_NAME) | |
| 459 | - @rm -fr $(POTDIR)/$(PLUGIN_NAME) | |
| 460 | - | |
| 461 | 247 | cleanDebug: |
| 462 | 248 | |
| 463 | 249 | @rm -fr $(OBJDBG) |
| 464 | 250 | @rm -fr $(BINDBG) |
| 465 | - @rm -fr $(OBJDIR)/marshal | |
| 466 | 251 | |
| 467 | 252 | cleanRelease: |
| 468 | 253 | |
| 469 | 254 | @rm -fr $(OBJRLS) |
| 470 | 255 | @rm -fr $(BINRLS) |
| 471 | - @rm -fr $(OBJDIR)/marshal | |
| 256 | + | |
| 257 | +clean: \ | |
| 258 | + cleanDebug \ | |
| 259 | + cleanRelease | |
| 472 | 260 | |
| 473 | 261 | ... | ... |
README.md
configure.ac
| ... | ... | @@ -31,7 +31,7 @@ AC_PREREQ(2.61) |
| 31 | 31 | |
| 32 | 32 | dnl Initialise automake with the package name, version and |
| 33 | 33 | dnl bug-reporting address. |
| 34 | -AC_INIT([ipc3270], [5.1], [perry.werneck@gmail.com]) | |
| 34 | +AC_INIT([hllapi], [5.2], [perry.werneck@gmail.com]) | |
| 35 | 35 | |
| 36 | 36 | dnl Place auxilliary scripts here. |
| 37 | 37 | AC_CONFIG_AUX_DIR([scripts]) |
| ... | ... | @@ -54,7 +54,7 @@ AC_PROG_CXX |
| 54 | 54 | AC_PROG_SED |
| 55 | 55 | AC_PROG_LN_S |
| 56 | 56 | |
| 57 | -AC_LANG([C]) | |
| 57 | +AC_LANG([C++]) | |
| 58 | 58 | |
| 59 | 59 | dnl --------------------------------------------------------------------------- |
| 60 | 60 | dnl Initialize defaults |
| ... | ... | @@ -65,30 +65,40 @@ RLS_CFLAGS="-DNDEBUG=1" |
| 65 | 65 | PLUGINS="" |
| 66 | 66 | APP_RESOURCES="" |
| 67 | 67 | APP_LDFLAGS="" |
| 68 | -DLL_LDFLAGS="-shared" | |
| 69 | -STATIC_LDFLAGS="" | |
| 68 | +DLL_LDFLAGS="-shared -Wl,-soname,\$(@F)" | |
| 70 | 69 | DEPENDS="" |
| 71 | 70 | |
| 72 | 71 | dnl --------------------------------------------------------------------------- |
| 73 | 72 | dnl Check for OS specifics |
| 74 | 73 | dnl --------------------------------------------------------------------------- |
| 75 | 74 | |
| 76 | -DLLPREFIX="lib" | |
| 77 | - | |
| 78 | 75 | case "$host" in |
| 79 | 76 | *-mingw32|*-pc-msys) |
| 80 | 77 | app_cv_osname="windows" |
| 81 | 78 | |
| 82 | 79 | CFLAGS="$CFLAGS -pthread -D_WIN32_WINNT=0x0600" |
| 83 | 80 | LIBS="$LIBS -lws2_32 -lwtsapi32 -lcomdlg32" |
| 84 | - STATIC_LDFLAGS="-static-libgcc -static-libstdc++" | |
| 85 | 81 | DLLEXT=".dll" |
| 86 | - DLLPREFIX="" | |
| 87 | 82 | |
| 88 | - app_win32_revision=$(date +%y.%m.%d.%H) | |
| 83 | + app_win32_revision=$(date +%-y.%-m.%-d.%-H) | |
| 89 | 84 | AC_SUBST(WIN32_VERSION,$app_win32_revision) |
| 90 | - AC_CONFIG_FILES(src/ipc3270c/windows/resources.rc) | |
| 91 | - AC_CONFIG_FILES(src/hllapi/windows/resources.rc) | |
| 85 | + | |
| 86 | + app_win32_file_version=$(date +%-y,%-m,%-d,%-H) | |
| 87 | + AC_SUBST(WIN32_FILE_VERSION,$app_win32_file_version) | |
| 88 | + | |
| 89 | + AC_CONFIG_FILES(src/core/windows/resources.rc) | |
| 90 | + AC_CONFIG_FILES(win/hllapi.nsi) | |
| 91 | + | |
| 92 | + if test "$host_cpu" = "x86_64"; then | |
| 93 | + app_cv_programfiles="PROGRAMFILES64" | |
| 94 | + app_cv_winarch="64" | |
| 95 | + else | |
| 96 | + app_cv_programfiles="PROGRAMFILES" | |
| 97 | + app_cv_winarch="32" | |
| 98 | + fi | |
| 99 | + | |
| 100 | + AC_SUBST(PROGRAMFILES,$app_cv_programfiles) | |
| 101 | + AC_SUBST(WINARCH,$app_cv_winarch) | |
| 92 | 102 | ;; |
| 93 | 103 | |
| 94 | 104 | *) |
| ... | ... | @@ -109,8 +119,8 @@ AC_SUBST(LIBS) |
| 109 | 119 | AC_SUBST(LOGDIR) |
| 110 | 120 | AC_SUBST(DLLEXT) |
| 111 | 121 | AC_SUBST(DLLPREFIX) |
| 112 | -AC_SUBST(STATIC_LDFLAGS) | |
| 113 | 122 | AC_SUBST(LDFLAGS) |
| 123 | +AC_SUBST(DLL_LDFLAGS) | |
| 114 | 124 | |
| 115 | 125 | dnl --------------------------------------------------------------------------- |
| 116 | 126 | dnl Check for other programs |
| ... | ... | @@ -118,6 +128,7 @@ dnl --------------------------------------------------------------------------- |
| 118 | 128 | |
| 119 | 129 | AC_PATH_TOOL([AR], [ar], [ar]) |
| 120 | 130 | AC_PATH_TOOL([WINDRES], [windres], [no]) |
| 131 | +AC_PATH_TOOL([VALGRIND], [valgrind], [no]) | |
| 121 | 132 | |
| 122 | 133 | PKG_CHECK_EXISTS |
| 123 | 134 | |
| ... | ... | @@ -125,7 +136,7 @@ dnl --------------------------------------------------------------------------- |
| 125 | 136 | dnl Version info |
| 126 | 137 | dnl --------------------------------------------------------------------------- |
| 127 | 138 | |
| 128 | -AC_SUBST(PACKAGE_DESCRIPTION,"PW3270 IPC Compatible Module") | |
| 139 | +AC_SUBST(PACKAGE_DESCRIPTION,"PW3270 HLLAPI Module") | |
| 129 | 140 | |
| 130 | 141 | app_vrs_major=$(echo $VERSION | cut -d. -f1) |
| 131 | 142 | app_vrs_minor=$(echo $VERSION | cut -d. -f2) |
| ... | ... | @@ -136,7 +147,7 @@ AC_DEFINE_UNQUOTED(PACKAGE_MINOR_VERSION, $app_vrs_minor) |
| 136 | 147 | AC_SUBST(PACKAGE_MAJOR_VERSION,$app_vrs_major) |
| 137 | 148 | AC_SUBST(PACKAGE_MINOR_VERSION,$app_vrs_minor) |
| 138 | 149 | |
| 139 | -AC_ARG_WITH([release], [AS_HELP_STRING([--with-release], [Set release])], [ app_cv_release="$withval" ],[ app_cv_release="`date +%y`.`date +%m`.`date +%d`" ]) | |
| 150 | +AC_ARG_WITH([release], [AS_HELP_STRING([--with-release], [Set release])], [ app_cv_release="$withval" ],[ app_cv_release="`date +%-y`.`date +%-m`.`date +%-d`" ]) | |
| 140 | 151 | |
| 141 | 152 | app_rls_major=$(echo $app_cv_release.0.0 | cut -d. -f1) |
| 142 | 153 | app_rls_minor=$(echo $app_cv_release.0.0 | cut -d. -f2) |
| ... | ... | @@ -149,83 +160,121 @@ AC_SUBST(PACKAGE_RELEASE,$app_cv_release) |
| 149 | 160 | AC_SUBST(PACKAGE_MAJOR_RELEASE,$app_rls_major) |
| 150 | 161 | AC_SUBST(PACKAGE_MINOR_RELEASE,$app_rls_minor) |
| 151 | 162 | |
| 152 | -dnl --------------------------------------------------------------------------- | |
| 153 | -dnl Check for libintl | |
| 154 | -dnl --------------------------------------------------------------------------- | |
| 163 | +case "$host" in | |
| 164 | + *-mingw32|*-pc-msys) | |
| 165 | + AC_SUBST(SONAME,hllapi.dll) | |
| 166 | + ;; | |
| 155 | 167 | |
| 156 | -INTL_LIBS="" | |
| 168 | + s390x-*) | |
| 169 | + AC_SUBST(SONAME,libhllapi.so) | |
| 170 | + ;; | |
| 157 | 171 | |
| 158 | -AC_PATH_TOOL([XGETTEXT], [xgettext], [no]) | |
| 159 | -AC_PATH_TOOL([MSGCAT], [msgcat], [no]) | |
| 160 | -AC_PATH_TOOL([MSGINIT], [msginit], [no]) | |
| 161 | -AC_PATH_TOOL([MSGMERGE], [msgmerge], [no]) | |
| 162 | -AC_PATH_TOOL([MSGFMT], [msgfmt], [no]) | |
| 172 | + *) | |
| 173 | + AC_SUBST(SONAME,libhllapi.so.$app_vrs_major.$app_vrs_minor) | |
| 163 | 174 | |
| 164 | -AC_SUBST(INTL_LIBS) | |
| 175 | +esac | |
| 165 | 176 | |
| 166 | 177 | dnl --------------------------------------------------------------------------- |
| 167 | -dnl Check for LIB3270 | |
| 178 | +dnl Check for doxygen | |
| 168 | 179 | dnl --------------------------------------------------------------------------- |
| 169 | 180 | |
| 170 | -PKG_CHECK_MODULES( [LIB3270], [lib3270], AC_DEFINE(HAVE_LIB3270), AC_MSG_ERROR([LIB3270 not present.])) | |
| 171 | - | |
| 172 | -AC_SUBST(LIB3270_LIBS) | |
| 173 | -AC_SUBST(LIB3270_CFLAGS) | |
| 174 | - | |
| 175 | -dnl --------------------------------------------------------------------------- | |
| 176 | -dnl Check for PW3270 | |
| 177 | -dnl --------------------------------------------------------------------------- | |
| 181 | +AC_PATH_TOOL([DOXYGEN], [doxygen]) | |
| 182 | + | |
| 183 | +dnl Help line for graphviz (optionally used by doxygen) | |
| 184 | +AC_ARG_ENABLE(graphviz, | |
| 185 | + AS_HELP_STRING([--disable-graphviz], [prevent doxygen from using dot]), | |
| 186 | + [wantgraphviz=$enableval], [wantgraphviz=yes]) | |
| 187 | + | |
| 188 | +AC_CHECK_PROGS([GRAPHVIZDOT], [dot]) | |
| 189 | +AC_MSG_CHECKING([whether doxygen should use graphviz]) | |
| 190 | +if test "x$wantgraphviz" = "xyes" ; then | |
| 191 | + if test $GRAPHVIZDOT ; then | |
| 192 | + AC_MSG_RESULT([yes]) | |
| 193 | + usegraphviz=yes | |
| 194 | + else | |
| 195 | + AC_MSG_RESULT([no, graphviz missing]) | |
| 196 | + usegraphviz=no | |
| 197 | + fi | |
| 198 | +else | |
| 199 | + AC_MSG_RESULT([no, disabled by configure]) | |
| 200 | + usegraphviz=no | |
| 201 | +fi | |
| 178 | 202 | |
| 179 | -PKG_CHECK_MODULES( [PW3270], [pw3270], AC_DEFINE(HAVE_PW3270), AC_MSG_ERROR([PW3270 not present.])) | |
| 203 | +AC_SUBST(HAVE_DOT,`echo $usegraphviz | tr yesno YESNO`) | |
| 180 | 204 | |
| 181 | -AC_SUBST(PW3270_LIBS) | |
| 182 | -AC_SUBST(PW3270_CFLAGS) | |
| 205 | +if test "x$DOXYGEN" != "x"; then | |
| 206 | + AC_CONFIG_FILES(doxygen/doxyfile) | |
| 207 | +fi | |
| 183 | 208 | |
| 184 | 209 | dnl --------------------------------------------------------------------------- |
| 185 | -dnl Check for LIBV3270 | |
| 210 | +dnl Check for C++ 2011 support | |
| 186 | 211 | dnl --------------------------------------------------------------------------- |
| 187 | - | |
| 188 | -PKG_CHECK_MODULES( [V3270], [libv3270], AC_DEFINE(HAVE_V3270), AC_MSG_ERROR([V3270 not present.])) | |
| 189 | - | |
| 190 | -AC_SUBST(V3270_LIBS) | |
| 191 | -AC_SUBST(V3270_CFLAGS) | |
| 212 | +AC_DEFUN([AX_CHECK_COMPILE_FLAG], | |
| 213 | +[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX | |
| 214 | +AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl | |
| 215 | +AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ | |
| 216 | + ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS | |
| 217 | + _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" | |
| 218 | + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], | |
| 219 | + [AS_VAR_SET(CACHEVAR,[yes])], | |
| 220 | + [AS_VAR_SET(CACHEVAR,[no])]) | |
| 221 | + _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) | |
| 222 | +AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], | |
| 223 | + [m4_default([$2], :)], | |
| 224 | + [m4_default([$3], :)]) | |
| 225 | +AS_VAR_POPDEF([CACHEVAR])dnl | |
| 226 | +])dnl AX_CHECK_COMPILE_FLAGS | |
| 227 | + | |
| 228 | +AX_CHECK_COMPILE_FLAG([-std=gnu++11], [CFLAGS="$CFLAGS -std=gnu++11"]) | |
| 192 | 229 | |
| 193 | 230 | dnl --------------------------------------------------------------------------- |
| 194 | -dnl Check for GTK | |
| 231 | +dnl Check for libintl | |
| 195 | 232 | dnl --------------------------------------------------------------------------- |
| 196 | 233 | |
| 197 | -PKG_CHECK_MODULES( [GTK], [gtk+-3.0], AC_DEFINE(HAVE_GTK), AC_MSG_ERROR([GTK not present.])) | |
| 234 | +INTL_LIBS="" | |
| 235 | + | |
| 236 | +AC_PATH_TOOL([XGETTEXT], [xgettext], [no]) | |
| 237 | +AC_PATH_TOOL([MSGCAT], [msgcat], [no]) | |
| 238 | +AC_PATH_TOOL([MSGINIT], [msginit], [no]) | |
| 239 | +AC_PATH_TOOL([MSGMERGE], [msgmerge], [no]) | |
| 240 | +AC_PATH_TOOL([MSGFMT], [msgfmt], [no]) | |
| 198 | 241 | |
| 199 | -AC_SUBST(GTK_LIBS) | |
| 200 | -AC_SUBST(GTK_CFLAGS) | |
| 242 | +AC_SUBST(INTL_LIBS) | |
| 201 | 243 | |
| 202 | 244 | dnl --------------------------------------------------------------------------- |
| 203 | -dnl Check for GLIB | |
| 245 | +dnl Check for IPC3270 | |
| 204 | 246 | dnl --------------------------------------------------------------------------- |
| 205 | 247 | |
| 206 | -PKG_CHECK_MODULES( [GLIB], [glib-2.0 gobject-2.0 gmodule-2.0 gio-2.0], AC_DEFINE(HAVE_GLIB), AC_MSG_ERROR([GLIB not present.] )) | |
| 207 | -AC_SUBST(GLIB_LIBS) | |
| 208 | -AC_SUBST(GLIB_CFLAGS) | |
| 248 | +AC_ARG_WITH([static-ipc3270], | |
| 249 | + [AS_HELP_STRING([--with-static-ipc3270], [Uses static version of ipc3270])], | |
| 250 | +[ | |
| 251 | + app_cv_static_ipc3270=$withval | |
| 252 | +],[ | |
| 253 | + app_cv_static_ipc3270="auto" | |
| 254 | +]) | |
| 209 | 255 | |
| 210 | -dnl --------------------------------------------------------------------------- | |
| 211 | -dnl Check for D-Bus | |
| 212 | -dnl --------------------------------------------------------------------------- | |
| 256 | +if test "$app_cv_static_ipc3270" == "auto"; then | |
| 257 | + case "$host" in | |
| 258 | + *-mingw32|*-pc-msys) | |
| 259 | + app_cv_static_ipc3270="yes" | |
| 260 | + ;; | |
| 213 | 261 | |
| 214 | -AC_PATH_TOOL([DBUSBINDINGTOOL],[dbus-binding-tool],[no]) | |
| 262 | + *) | |
| 263 | + app_cv_static_ipc3270="no" | |
| 215 | 264 | |
| 216 | -PKG_CHECK_MODULES( [DBUS], [dbus-1], app_cv_libdbus=yes, AC_MSG_NOTICE([ No DBUS support.]) ) | |
| 217 | -AC_SUBST(DBUS_LIBS) | |
| 218 | -AC_SUBST(DBUS_CFLAGS) | |
| 265 | + esac | |
| 219 | 266 | |
| 220 | -PKG_CHECK_MODULES( [GDBUS], [dbus-glib-1], app_cv_dbus=yes, AC_MSG_NOTICE([No GDBUS support.]) ) | |
| 221 | -AC_SUBST(GDBUS_LIBS) | |
| 222 | -AC_SUBST(GDBUS_CFLAGS) | |
| 267 | +fi | |
| 223 | 268 | |
| 224 | -if test "$app_cv_dbus" == "yes"; then | |
| 225 | - AC_DEFINE(HAVE_DBUS) | |
| 226 | - DEPENDS="$DEPENDS src/include/dbus-glue.h" | |
| 269 | +if test "$app_cv_static_ipc3270" == "yes"; then | |
| 270 | + LDFLAGS="-static -static-libgcc -static-libstdc++ $LDFLAGS" | |
| 271 | + PKG_CHECK_MODULES( [IPC3270], [ipc3270-static], AC_DEFINE(USING_STATIC_IPC3270), AC_MSG_ERROR([IPC3270 not present.])) | |
| 272 | +else | |
| 273 | + PKG_CHECK_MODULES( [IPC3270], [ipc3270], AC_DEFINE(USING_SHARED_IPC3270), AC_MSG_ERROR([IPC3270 not present.])) | |
| 227 | 274 | fi |
| 228 | 275 | |
| 276 | +AC_SUBST(IPC3270_LIBS) | |
| 277 | +AC_SUBST(IPC3270_CFLAGS) | |
| 229 | 278 | |
| 230 | 279 | dnl --------------------------------------------------------------------------- |
| 231 | 280 | dnl Check for pic | ... | ... |
| ... | ... | @@ -0,0 +1,1820 @@ |
| 1 | +# Doxyfile 1.8.2 | |
| 2 | + | |
| 3 | +# This file describes the settings to be used by the documentation system | |
| 4 | +# doxygen (www.doxygen.org) for a project | |
| 5 | +# | |
| 6 | +# All text after a hash (#) is considered a comment and will be ignored | |
| 7 | +# The format is: | |
| 8 | +# TAG = value [value, ...] | |
| 9 | +# For lists items can also be appended using: | |
| 10 | +# TAG += value [value, ...] | |
| 11 | +# Values that contain spaces should be placed between quotes (" ") | |
| 12 | + | |
| 13 | +#--------------------------------------------------------------------------- | |
| 14 | +# Project related configuration options | |
| 15 | +#--------------------------------------------------------------------------- | |
| 16 | + | |
| 17 | +# This tag specifies the encoding used for all characters in the config file | |
| 18 | +# that follow. The default is UTF-8 which is also the encoding used for all | |
| 19 | +# text before the first occurrence of this tag. Doxygen uses libiconv (or the | |
| 20 | +# iconv built into libc) for the transcoding. See | |
| 21 | +# http://www.gnu.org/software/libiconv for the list of possible encodings. | |
| 22 | + | |
| 23 | +DOXYFILE_ENCODING = UTF-8 | |
| 24 | + | |
| 25 | +# The PROJECT_NAME tag is a single word (or sequence of words) that should | |
| 26 | +# identify the project. Note that if you do not use Doxywizard you need | |
| 27 | +# to put quotes around the project name if it contains spaces. | |
| 28 | + | |
| 29 | +PROJECT_NAME = @PACKAGE_NAME@ | |
| 30 | + | |
| 31 | +# The PROJECT_NUMBER tag can be used to enter a project or revision number. | |
| 32 | +# This could be handy for archiving the generated documentation or | |
| 33 | +# if some version control system is used. | |
| 34 | + | |
| 35 | +PROJECT_NUMBER = @PACKAGE_VERSION@ | |
| 36 | + | |
| 37 | +# Using the PROJECT_BRIEF tag one can provide an optional one line description | |
| 38 | +# for a project that appears at the top of each page and should give viewer | |
| 39 | +# a quick idea about the purpose of the project. Keep the description short. | |
| 40 | + | |
| 41 | +PROJECT_BRIEF = "@PACKAGE_DESCRIPTION@" | |
| 42 | + | |
| 43 | +# With the PROJECT_LOGO tag one can specify an logo or icon that is | |
| 44 | +# included in the documentation. The maximum height of the logo should not | |
| 45 | +# exceed 55 pixels and the maximum width should not exceed 200 pixels. | |
| 46 | +# Doxygen will copy the logo to the output directory. | |
| 47 | + | |
| 48 | +PROJECT_LOGO = "@PACKAGE_NAME@.svg" | |
| 49 | + | |
| 50 | +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) | |
| 51 | +# base path where the generated documentation will be put. | |
| 52 | +# If a relative path is entered, it will be relative to the location | |
| 53 | +# where doxygen was started. If left blank the current directory will be used. | |
| 54 | + | |
| 55 | +OUTPUT_DIRECTORY = @BASEDIR@/doxygen | |
| 56 | + | |
| 57 | +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create | |
| 58 | +# 4096 sub-directories (in 2 levels) under the output directory of each output | |
| 59 | +# format and will distribute the generated files over these directories. | |
| 60 | +# Enabling this option can be useful when feeding doxygen a huge amount of | |
| 61 | +# source files, where putting all generated files in the same directory would | |
| 62 | +# otherwise cause performance problems for the file system. | |
| 63 | + | |
| 64 | +CREATE_SUBDIRS = NO | |
| 65 | + | |
| 66 | +# The OUTPUT_LANGUAGE tag is used to specify the language in which all | |
| 67 | +# documentation generated by doxygen is written. Doxygen will use this | |
| 68 | +# information to generate all constant output in the proper language. | |
| 69 | +# The default language is English, other supported languages are: | |
| 70 | +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, | |
| 71 | +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, | |
| 72 | +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English | |
| 73 | +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, | |
| 74 | +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, | |
| 75 | +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. | |
| 76 | + | |
| 77 | +OUTPUT_LANGUAGE = English | |
| 78 | + | |
| 79 | +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will | |
| 80 | +# include brief member descriptions after the members that are listed in | |
| 81 | +# the file and class documentation (similar to JavaDoc). | |
| 82 | +# Set to NO to disable this. | |
| 83 | + | |
| 84 | +BRIEF_MEMBER_DESC = YES | |
| 85 | + | |
| 86 | +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend | |
| 87 | +# the brief description of a member or function before the detailed description. | |
| 88 | +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the | |
| 89 | +# brief descriptions will be completely suppressed. | |
| 90 | + | |
| 91 | +REPEAT_BRIEF = YES | |
| 92 | + | |
| 93 | +# This tag implements a quasi-intelligent brief description abbreviator | |
| 94 | +# that is used to form the text in various listings. Each string | |
| 95 | +# in this list, if found as the leading text of the brief description, will be | |
| 96 | +# stripped from the text and the result after processing the whole list, is | |
| 97 | +# used as the annotated text. Otherwise, the brief description is used as-is. | |
| 98 | +# If left blank, the following values are used ("$name" is automatically | |
| 99 | +# replaced with the name of the entity): "The $name class" "The $name widget" | |
| 100 | +# "The $name file" "is" "provides" "specifies" "contains" | |
| 101 | +# "represents" "a" "an" "the" | |
| 102 | + | |
| 103 | +ABBREVIATE_BRIEF = "The $name class" \ | |
| 104 | + "The $name widget" \ | |
| 105 | + "The $name file" \ | |
| 106 | + is \ | |
| 107 | + provides \ | |
| 108 | + specifies \ | |
| 109 | + contains \ | |
| 110 | + represents \ | |
| 111 | + a \ | |
| 112 | + an \ | |
| 113 | + the | |
| 114 | + | |
| 115 | +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then | |
| 116 | +# Doxygen will generate a detailed section even if there is only a brief | |
| 117 | +# description. | |
| 118 | + | |
| 119 | +ALWAYS_DETAILED_SEC = NO | |
| 120 | + | |
| 121 | +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all | |
| 122 | +# inherited members of a class in the documentation of that class as if those | |
| 123 | +# members were ordinary class members. Constructors, destructors and assignment | |
| 124 | +# operators of the base classes will not be shown. | |
| 125 | + | |
| 126 | +INLINE_INHERITED_MEMB = NO | |
| 127 | + | |
| 128 | +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full | |
| 129 | +# path before files name in the file list and in the header files. If set | |
| 130 | +# to NO the shortest path that makes the file name unique will be used. | |
| 131 | + | |
| 132 | +FULL_PATH_NAMES = YES | |
| 133 | + | |
| 134 | +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag | |
| 135 | +# can be used to strip a user-defined part of the path. Stripping is | |
| 136 | +# only done if one of the specified strings matches the left-hand part of | |
| 137 | +# the path. The tag can be used to show relative paths in the file list. | |
| 138 | +# If left blank the directory from which doxygen is run is used as the | |
| 139 | +# path to strip. Note that you specify absolute paths here, but also | |
| 140 | +# relative paths, which will be relative from the directory where doxygen is | |
| 141 | +# started. | |
| 142 | + | |
| 143 | +STRIP_FROM_PATH = @BASEDIR@/src | |
| 144 | + | |
| 145 | +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of | |
| 146 | +# the path mentioned in the documentation of a class, which tells | |
| 147 | +# the reader which header file to include in order to use a class. | |
| 148 | +# If left blank only the name of the header file containing the class | |
| 149 | +# definition is used. Otherwise one should specify the include paths that | |
| 150 | +# are normally passed to the compiler using the -I flag. | |
| 151 | + | |
| 152 | +STRIP_FROM_INC_PATH = | |
| 153 | + | |
| 154 | +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter | |
| 155 | +# (but less readable) file names. This can be useful if your file system | |
| 156 | +# doesn't support long names like on DOS, Mac, or CD-ROM. | |
| 157 | + | |
| 158 | +SHORT_NAMES = NO | |
| 159 | + | |
| 160 | +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen | |
| 161 | +# will interpret the first line (until the first dot) of a JavaDoc-style | |
| 162 | +# comment as the brief description. If set to NO, the JavaDoc | |
| 163 | +# comments will behave just like regular Qt-style comments | |
| 164 | +# (thus requiring an explicit @brief command for a brief description.) | |
| 165 | + | |
| 166 | +JAVADOC_AUTOBRIEF = NO | |
| 167 | + | |
| 168 | +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will | |
| 169 | +# interpret the first line (until the first dot) of a Qt-style | |
| 170 | +# comment as the brief description. If set to NO, the comments | |
| 171 | +# will behave just like regular Qt-style comments (thus requiring | |
| 172 | +# an explicit \brief command for a brief description.) | |
| 173 | + | |
| 174 | +QT_AUTOBRIEF = NO | |
| 175 | + | |
| 176 | +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen | |
| 177 | +# treat a multi-line C++ special comment block (i.e. a block of //! or /// | |
| 178 | +# comments) as a brief description. This used to be the default behaviour. | |
| 179 | +# The new default is to treat a multi-line C++ comment block as a detailed | |
| 180 | +# description. Set this tag to YES if you prefer the old behaviour instead. | |
| 181 | + | |
| 182 | +MULTILINE_CPP_IS_BRIEF = NO | |
| 183 | + | |
| 184 | +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented | |
| 185 | +# member inherits the documentation from any documented member that it | |
| 186 | +# re-implements. | |
| 187 | + | |
| 188 | +INHERIT_DOCS = YES | |
| 189 | + | |
| 190 | +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce | |
| 191 | +# a new page for each member. If set to NO, the documentation of a member will | |
| 192 | +# be part of the file/class/namespace that contains it. | |
| 193 | + | |
| 194 | +SEPARATE_MEMBER_PAGES = NO | |
| 195 | + | |
| 196 | +# The TAB_SIZE tag can be used to set the number of spaces in a tab. | |
| 197 | +# Doxygen uses this value to replace tabs by spaces in code fragments. | |
| 198 | + | |
| 199 | +TAB_SIZE = 4 | |
| 200 | + | |
| 201 | +# This tag can be used to specify a number of aliases that acts | |
| 202 | +# as commands in the documentation. An alias has the form "name=value". | |
| 203 | +# For example adding "sideeffect=\par Side Effects:\n" will allow you to | |
| 204 | +# put the command \sideeffect (or @sideeffect) in the documentation, which | |
| 205 | +# will result in a user-defined paragraph with heading "Side Effects:". | |
| 206 | +# You can put \n's in the value part of an alias to insert newlines. | |
| 207 | + | |
| 208 | +ALIASES = | |
| 209 | + | |
| 210 | +# This tag can be used to specify a number of word-keyword mappings (TCL only). | |
| 211 | +# A mapping has the form "name=value". For example adding | |
| 212 | +# "class=itcl::class" will allow you to use the command class in the | |
| 213 | +# itcl::class meaning. | |
| 214 | + | |
| 215 | +TCL_SUBST = | |
| 216 | + | |
| 217 | +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C | |
| 218 | +# sources only. Doxygen will then generate output that is more tailored for C. | |
| 219 | +# For instance, some of the names that are used will be different. The list | |
| 220 | +# of all members will be omitted, etc. | |
| 221 | + | |
| 222 | +OPTIMIZE_OUTPUT_FOR_C = NO | |
| 223 | + | |
| 224 | +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java | |
| 225 | +# sources only. Doxygen will then generate output that is more tailored for | |
| 226 | +# Java. For instance, namespaces will be presented as packages, qualified | |
| 227 | +# scopes will look different, etc. | |
| 228 | + | |
| 229 | +OPTIMIZE_OUTPUT_JAVA = NO | |
| 230 | + | |
| 231 | +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran | |
| 232 | +# sources only. Doxygen will then generate output that is more tailored for | |
| 233 | +# Fortran. | |
| 234 | + | |
| 235 | +OPTIMIZE_FOR_FORTRAN = NO | |
| 236 | + | |
| 237 | +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL | |
| 238 | +# sources. Doxygen will then generate output that is tailored for | |
| 239 | +# VHDL. | |
| 240 | + | |
| 241 | +OPTIMIZE_OUTPUT_VHDL = NO | |
| 242 | + | |
| 243 | +# Doxygen selects the parser to use depending on the extension of the files it | |
| 244 | +# parses. With this tag you can assign which parser to use for a given | |
| 245 | +# extension. Doxygen has a built-in mapping, but you can override or extend it | |
| 246 | +# using this tag. The format is ext=language, where ext is a file extension, | |
| 247 | +# and language is one of the parsers supported by doxygen: IDL, Java, | |
| 248 | +# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, | |
| 249 | +# C++. For instance to make doxygen treat .inc files as Fortran files (default | |
| 250 | +# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note | |
| 251 | +# that for custom extensions you also need to set FILE_PATTERNS otherwise the | |
| 252 | +# files are not read by doxygen. | |
| 253 | + | |
| 254 | +EXTENSION_MAPPING = | |
| 255 | + | |
| 256 | +# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all | |
| 257 | +# comments according to the Markdown format, which allows for more readable | |
| 258 | +# documentation. See http://daringfireball.net/projects/markdown/ for details. | |
| 259 | +# The output of markdown processing is further processed by doxygen, so you | |
| 260 | +# can mix doxygen, HTML, and XML commands with Markdown formatting. | |
| 261 | +# Disable only in case of backward compatibilities issues. | |
| 262 | + | |
| 263 | +MARKDOWN_SUPPORT = YES | |
| 264 | + | |
| 265 | +# When enabled doxygen tries to link words that correspond to documented classes, | |
| 266 | +# or namespaces to their corresponding documentation. Such a link can be | |
| 267 | +# prevented in individual cases by by putting a % sign in front of the word or | |
| 268 | +# globally by setting AUTOLINK_SUPPORT to NO. | |
| 269 | + | |
| 270 | +AUTOLINK_SUPPORT = YES | |
| 271 | + | |
| 272 | +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want | |
| 273 | +# to include (a tag file for) the STL sources as input, then you should | |
| 274 | +# set this tag to YES in order to let doxygen match functions declarations and | |
| 275 | +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. | |
| 276 | +# func(std::string) {}). This also makes the inheritance and collaboration | |
| 277 | +# diagrams that involve STL classes more complete and accurate. | |
| 278 | + | |
| 279 | +BUILTIN_STL_SUPPORT = NO | |
| 280 | + | |
| 281 | +# If you use Microsoft's C++/CLI language, you should set this option to YES to | |
| 282 | +# enable parsing support. | |
| 283 | + | |
| 284 | +CPP_CLI_SUPPORT = NO | |
| 285 | + | |
| 286 | +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. | |
| 287 | +# Doxygen will parse them like normal C++ but will assume all classes use public | |
| 288 | +# instead of private inheritance when no explicit protection keyword is present. | |
| 289 | + | |
| 290 | +SIP_SUPPORT = NO | |
| 291 | + | |
| 292 | +# For Microsoft's IDL there are propget and propput attributes to indicate | |
| 293 | +# getter and setter methods for a property. Setting this option to YES (the | |
| 294 | +# default) will make doxygen replace the get and set methods by a property in | |
| 295 | +# the documentation. This will only work if the methods are indeed getting or | |
| 296 | +# setting a simple type. If this is not the case, or you want to show the | |
| 297 | +# methods anyway, you should set this option to NO. | |
| 298 | + | |
| 299 | +IDL_PROPERTY_SUPPORT = YES | |
| 300 | + | |
| 301 | +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC | |
| 302 | +# tag is set to YES, then doxygen will reuse the documentation of the first | |
| 303 | +# member in the group (if any) for the other members of the group. By default | |
| 304 | +# all members of a group must be documented explicitly. | |
| 305 | + | |
| 306 | +DISTRIBUTE_GROUP_DOC = NO | |
| 307 | + | |
| 308 | +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of | |
| 309 | +# the same type (for instance a group of public functions) to be put as a | |
| 310 | +# subgroup of that type (e.g. under the Public Functions section). Set it to | |
| 311 | +# NO to prevent subgrouping. Alternatively, this can be done per class using | |
| 312 | +# the \nosubgrouping command. | |
| 313 | + | |
| 314 | +SUBGROUPING = YES | |
| 315 | + | |
| 316 | +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and | |
| 317 | +# unions are shown inside the group in which they are included (e.g. using | |
| 318 | +# @ingroup) instead of on a separate page (for HTML and Man pages) or | |
| 319 | +# section (for LaTeX and RTF). | |
| 320 | + | |
| 321 | +INLINE_GROUPED_CLASSES = NO | |
| 322 | + | |
| 323 | +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and | |
| 324 | +# unions with only public data fields will be shown inline in the documentation | |
| 325 | +# of the scope in which they are defined (i.e. file, namespace, or group | |
| 326 | +# documentation), provided this scope is documented. If set to NO (the default), | |
| 327 | +# structs, classes, and unions are shown on a separate page (for HTML and Man | |
| 328 | +# pages) or section (for LaTeX and RTF). | |
| 329 | + | |
| 330 | +INLINE_SIMPLE_STRUCTS = NO | |
| 331 | + | |
| 332 | +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum | |
| 333 | +# is documented as struct, union, or enum with the name of the typedef. So | |
| 334 | +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct | |
| 335 | +# with name TypeT. When disabled the typedef will appear as a member of a file, | |
| 336 | +# namespace, or class. And the struct will be named TypeS. This can typically | |
| 337 | +# be useful for C code in case the coding convention dictates that all compound | |
| 338 | +# types are typedef'ed and only the typedef is referenced, never the tag name. | |
| 339 | + | |
| 340 | +TYPEDEF_HIDES_STRUCT = NO | |
| 341 | + | |
| 342 | +# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be | |
| 343 | +# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given | |
| 344 | +# their name and scope. Since this can be an expensive process and often the | |
| 345 | +# same symbol appear multiple times in the code, doxygen keeps a cache of | |
| 346 | +# pre-resolved symbols. If the cache is too small doxygen will become slower. | |
| 347 | +# If the cache is too large, memory is wasted. The cache size is given by this | |
| 348 | +# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, | |
| 349 | +# corresponding to a cache size of 2^16 = 65536 symbols. | |
| 350 | + | |
| 351 | +LOOKUP_CACHE_SIZE = 0 | |
| 352 | + | |
| 353 | +#--------------------------------------------------------------------------- | |
| 354 | +# Build related configuration options | |
| 355 | +#--------------------------------------------------------------------------- | |
| 356 | + | |
| 357 | +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in | |
| 358 | +# documentation are documented, even if no documentation was available. | |
| 359 | +# Private class members and static file members will be hidden unless | |
| 360 | +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES | |
| 361 | + | |
| 362 | +EXTRACT_ALL = YES | |
| 363 | + | |
| 364 | +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class | |
| 365 | +# will be included in the documentation. | |
| 366 | + | |
| 367 | +EXTRACT_PRIVATE = NO | |
| 368 | + | |
| 369 | +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal | |
| 370 | +# scope will be included in the documentation. | |
| 371 | + | |
| 372 | +EXTRACT_PACKAGE = NO | |
| 373 | + | |
| 374 | +# If the EXTRACT_STATIC tag is set to YES all static members of a file | |
| 375 | +# will be included in the documentation. | |
| 376 | + | |
| 377 | +EXTRACT_STATIC = NO | |
| 378 | + | |
| 379 | +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) | |
| 380 | +# defined locally in source files will be included in the documentation. | |
| 381 | +# If set to NO only classes defined in header files are included. | |
| 382 | + | |
| 383 | +EXTRACT_LOCAL_CLASSES = YES | |
| 384 | + | |
| 385 | +# This flag is only useful for Objective-C code. When set to YES local | |
| 386 | +# methods, which are defined in the implementation section but not in | |
| 387 | +# the interface are included in the documentation. | |
| 388 | +# If set to NO (the default) only methods in the interface are included. | |
| 389 | + | |
| 390 | +EXTRACT_LOCAL_METHODS = NO | |
| 391 | + | |
| 392 | +# If this flag is set to YES, the members of anonymous namespaces will be | |
| 393 | +# extracted and appear in the documentation as a namespace called | |
| 394 | +# 'anonymous_namespace{file}', where file will be replaced with the base | |
| 395 | +# name of the file that contains the anonymous namespace. By default | |
| 396 | +# anonymous namespaces are hidden. | |
| 397 | + | |
| 398 | +EXTRACT_ANON_NSPACES = NO | |
| 399 | + | |
| 400 | +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all | |
| 401 | +# undocumented members of documented classes, files or namespaces. | |
| 402 | +# If set to NO (the default) these members will be included in the | |
| 403 | +# various overviews, but no documentation section is generated. | |
| 404 | +# This option has no effect if EXTRACT_ALL is enabled. | |
| 405 | + | |
| 406 | +HIDE_UNDOC_MEMBERS = NO | |
| 407 | + | |
| 408 | +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all | |
| 409 | +# undocumented classes that are normally visible in the class hierarchy. | |
| 410 | +# If set to NO (the default) these classes will be included in the various | |
| 411 | +# overviews. This option has no effect if EXTRACT_ALL is enabled. | |
| 412 | + | |
| 413 | +HIDE_UNDOC_CLASSES = NO | |
| 414 | + | |
| 415 | +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all | |
| 416 | +# friend (class|struct|union) declarations. | |
| 417 | +# If set to NO (the default) these declarations will be included in the | |
| 418 | +# documentation. | |
| 419 | + | |
| 420 | +HIDE_FRIEND_COMPOUNDS = NO | |
| 421 | + | |
| 422 | +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any | |
| 423 | +# documentation blocks found inside the body of a function. | |
| 424 | +# If set to NO (the default) these blocks will be appended to the | |
| 425 | +# function's detailed documentation block. | |
| 426 | + | |
| 427 | +HIDE_IN_BODY_DOCS = NO | |
| 428 | + | |
| 429 | +# The INTERNAL_DOCS tag determines if documentation | |
| 430 | +# that is typed after a \internal command is included. If the tag is set | |
| 431 | +# to NO (the default) then the documentation will be excluded. | |
| 432 | +# Set it to YES to include the internal documentation. | |
| 433 | + | |
| 434 | +INTERNAL_DOCS = NO | |
| 435 | + | |
| 436 | +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate | |
| 437 | +# file names in lower-case letters. If set to YES upper-case letters are also | |
| 438 | +# allowed. This is useful if you have classes or files whose names only differ | |
| 439 | +# in case and if your file system supports case sensitive file names. Windows | |
| 440 | +# and Mac users are advised to set this option to NO. | |
| 441 | + | |
| 442 | +CASE_SENSE_NAMES = NO | |
| 443 | + | |
| 444 | +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen | |
| 445 | +# will show members with their full class and namespace scopes in the | |
| 446 | +# documentation. If set to YES the scope will be hidden. | |
| 447 | + | |
| 448 | +HIDE_SCOPE_NAMES = NO | |
| 449 | + | |
| 450 | +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen | |
| 451 | +# will put a list of the files that are included by a file in the documentation | |
| 452 | +# of that file. | |
| 453 | + | |
| 454 | +SHOW_INCLUDE_FILES = YES | |
| 455 | + | |
| 456 | +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen | |
| 457 | +# will list include files with double quotes in the documentation | |
| 458 | +# rather than with sharp brackets. | |
| 459 | + | |
| 460 | +FORCE_LOCAL_INCLUDES = NO | |
| 461 | + | |
| 462 | +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] | |
| 463 | +# is inserted in the documentation for inline members. | |
| 464 | + | |
| 465 | +INLINE_INFO = YES | |
| 466 | + | |
| 467 | +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen | |
| 468 | +# will sort the (detailed) documentation of file and class members | |
| 469 | +# alphabetically by member name. If set to NO the members will appear in | |
| 470 | +# declaration order. | |
| 471 | + | |
| 472 | +SORT_MEMBER_DOCS = YES | |
| 473 | + | |
| 474 | +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the | |
| 475 | +# brief documentation of file, namespace and class members alphabetically | |
| 476 | +# by member name. If set to NO (the default) the members will appear in | |
| 477 | +# declaration order. | |
| 478 | + | |
| 479 | +SORT_BRIEF_DOCS = NO | |
| 480 | + | |
| 481 | +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen | |
| 482 | +# will sort the (brief and detailed) documentation of class members so that | |
| 483 | +# constructors and destructors are listed first. If set to NO (the default) | |
| 484 | +# the constructors will appear in the respective orders defined by | |
| 485 | +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. | |
| 486 | +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO | |
| 487 | +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. | |
| 488 | + | |
| 489 | +SORT_MEMBERS_CTORS_1ST = NO | |
| 490 | + | |
| 491 | +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the | |
| 492 | +# hierarchy of group names into alphabetical order. If set to NO (the default) | |
| 493 | +# the group names will appear in their defined order. | |
| 494 | + | |
| 495 | +SORT_GROUP_NAMES = NO | |
| 496 | + | |
| 497 | +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be | |
| 498 | +# sorted by fully-qualified names, including namespaces. If set to | |
| 499 | +# NO (the default), the class list will be sorted only by class name, | |
| 500 | +# not including the namespace part. | |
| 501 | +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. | |
| 502 | +# Note: This option applies only to the class list, not to the | |
| 503 | +# alphabetical list. | |
| 504 | + | |
| 505 | +SORT_BY_SCOPE_NAME = NO | |
| 506 | + | |
| 507 | +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to | |
| 508 | +# do proper type resolution of all parameters of a function it will reject a | |
| 509 | +# match between the prototype and the implementation of a member function even | |
| 510 | +# if there is only one candidate or it is obvious which candidate to choose | |
| 511 | +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen | |
| 512 | +# will still accept a match between prototype and implementation in such cases. | |
| 513 | + | |
| 514 | +STRICT_PROTO_MATCHING = NO | |
| 515 | + | |
| 516 | +# The GENERATE_TODOLIST tag can be used to enable (YES) or | |
| 517 | +# disable (NO) the todo list. This list is created by putting \todo | |
| 518 | +# commands in the documentation. | |
| 519 | + | |
| 520 | +GENERATE_TODOLIST = YES | |
| 521 | + | |
| 522 | +# The GENERATE_TESTLIST tag can be used to enable (YES) or | |
| 523 | +# disable (NO) the test list. This list is created by putting \test | |
| 524 | +# commands in the documentation. | |
| 525 | + | |
| 526 | +GENERATE_TESTLIST = YES | |
| 527 | + | |
| 528 | +# The GENERATE_BUGLIST tag can be used to enable (YES) or | |
| 529 | +# disable (NO) the bug list. This list is created by putting \bug | |
| 530 | +# commands in the documentation. | |
| 531 | + | |
| 532 | +GENERATE_BUGLIST = YES | |
| 533 | + | |
| 534 | +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or | |
| 535 | +# disable (NO) the deprecated list. This list is created by putting | |
| 536 | +# \deprecated commands in the documentation. | |
| 537 | + | |
| 538 | +GENERATE_DEPRECATEDLIST= YES | |
| 539 | + | |
| 540 | +# The ENABLED_SECTIONS tag can be used to enable conditional | |
| 541 | +# documentation sections, marked by \if sectionname ... \endif. | |
| 542 | + | |
| 543 | +ENABLED_SECTIONS = | |
| 544 | + | |
| 545 | +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines | |
| 546 | +# the initial value of a variable or macro consists of for it to appear in | |
| 547 | +# the documentation. If the initializer consists of more lines than specified | |
| 548 | +# here it will be hidden. Use a value of 0 to hide initializers completely. | |
| 549 | +# The appearance of the initializer of individual variables and macros in the | |
| 550 | +# documentation can be controlled using \showinitializer or \hideinitializer | |
| 551 | +# command in the documentation regardless of this setting. | |
| 552 | + | |
| 553 | +MAX_INITIALIZER_LINES = 30 | |
| 554 | + | |
| 555 | +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated | |
| 556 | +# at the bottom of the documentation of classes and structs. If set to YES the | |
| 557 | +# list will mention the files that were used to generate the documentation. | |
| 558 | + | |
| 559 | +SHOW_USED_FILES = YES | |
| 560 | + | |
| 561 | +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. | |
| 562 | +# This will remove the Files entry from the Quick Index and from the | |
| 563 | +# Folder Tree View (if specified). The default is YES. | |
| 564 | + | |
| 565 | +SHOW_FILES = YES | |
| 566 | + | |
| 567 | +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the | |
| 568 | +# Namespaces page. This will remove the Namespaces entry from the Quick Index | |
| 569 | +# and from the Folder Tree View (if specified). The default is YES. | |
| 570 | + | |
| 571 | +SHOW_NAMESPACES = YES | |
| 572 | + | |
| 573 | +# The FILE_VERSION_FILTER tag can be used to specify a program or script that | |
| 574 | +# doxygen should invoke to get the current version for each file (typically from | |
| 575 | +# the version control system). Doxygen will invoke the program by executing (via | |
| 576 | +# popen()) the command <command> <input-file>, where <command> is the value of | |
| 577 | +# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file | |
| 578 | +# provided by doxygen. Whatever the program writes to standard output | |
| 579 | +# is used as the file version. See the manual for examples. | |
| 580 | + | |
| 581 | +FILE_VERSION_FILTER = | |
| 582 | + | |
| 583 | +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed | |
| 584 | +# by doxygen. The layout file controls the global structure of the generated | |
| 585 | +# output files in an output format independent way. To create the layout file | |
| 586 | +# that represents doxygen's defaults, run doxygen with the -l option. | |
| 587 | +# You can optionally specify a file name after the option, if omitted | |
| 588 | +# DoxygenLayout.xml will be used as the name of the layout file. | |
| 589 | + | |
| 590 | +LAYOUT_FILE = | |
| 591 | + | |
| 592 | +# The CITE_BIB_FILES tag can be used to specify one or more bib files | |
| 593 | +# containing the references data. This must be a list of .bib files. The | |
| 594 | +# .bib extension is automatically appended if omitted. Using this command | |
| 595 | +# requires the bibtex tool to be installed. See also | |
| 596 | +# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style | |
| 597 | +# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this | |
| 598 | +# feature you need bibtex and perl available in the search path. | |
| 599 | + | |
| 600 | +CITE_BIB_FILES = | |
| 601 | + | |
| 602 | +#--------------------------------------------------------------------------- | |
| 603 | +# configuration options related to warning and progress messages | |
| 604 | +#--------------------------------------------------------------------------- | |
| 605 | + | |
| 606 | +# The QUIET tag can be used to turn on/off the messages that are generated | |
| 607 | +# by doxygen. Possible values are YES and NO. If left blank NO is used. | |
| 608 | + | |
| 609 | +QUIET = YES | |
| 610 | + | |
| 611 | +# The WARNINGS tag can be used to turn on/off the warning messages that are | |
| 612 | +# generated by doxygen. Possible values are YES and NO. If left blank | |
| 613 | +# NO is used. | |
| 614 | + | |
| 615 | +WARNINGS = YES | |
| 616 | + | |
| 617 | +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings | |
| 618 | +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will | |
| 619 | +# automatically be disabled. | |
| 620 | + | |
| 621 | +WARN_IF_UNDOCUMENTED = YES | |
| 622 | + | |
| 623 | +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for | |
| 624 | +# potential errors in the documentation, such as not documenting some | |
| 625 | +# parameters in a documented function, or documenting parameters that | |
| 626 | +# don't exist or using markup commands wrongly. | |
| 627 | + | |
| 628 | +WARN_IF_DOC_ERROR = YES | |
| 629 | + | |
| 630 | +# The WARN_NO_PARAMDOC option can be enabled to get warnings for | |
| 631 | +# functions that are documented, but have no documentation for their parameters | |
| 632 | +# or return value. If set to NO (the default) doxygen will only warn about | |
| 633 | +# wrong or incomplete parameter documentation, but not about the absence of | |
| 634 | +# documentation. | |
| 635 | + | |
| 636 | +WARN_NO_PARAMDOC = NO | |
| 637 | + | |
| 638 | +# The WARN_FORMAT tag determines the format of the warning messages that | |
| 639 | +# doxygen can produce. The string should contain the $file, $line, and $text | |
| 640 | +# tags, which will be replaced by the file and line number from which the | |
| 641 | +# warning originated and the warning text. Optionally the format may contain | |
| 642 | +# $version, which will be replaced by the version of the file (if it could | |
| 643 | +# be obtained via FILE_VERSION_FILTER) | |
| 644 | + | |
| 645 | +WARN_FORMAT = "$file:$line: $text" | |
| 646 | + | |
| 647 | +# The WARN_LOGFILE tag can be used to specify a file to which warning | |
| 648 | +# and error messages should be written. If left blank the output is written | |
| 649 | +# to stderr. | |
| 650 | + | |
| 651 | +WARN_LOGFILE = @BASEDIR@/doxygen/doxygen.log | |
| 652 | + | |
| 653 | +#--------------------------------------------------------------------------- | |
| 654 | +# configuration options related to the input files | |
| 655 | +#--------------------------------------------------------------------------- | |
| 656 | + | |
| 657 | +# The INPUT tag can be used to specify the files and/or directories that contain | |
| 658 | +# documented source files. You may enter file names like "myfile.cpp" or | |
| 659 | +# directories like "/usr/src/myproject". Separate the files or directories | |
| 660 | +# with spaces. | |
| 661 | + | |
| 662 | +INPUT = @BASEDIR@/src | |
| 663 | + | |
| 664 | +# This tag can be used to specify the character encoding of the source files | |
| 665 | +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is | |
| 666 | +# also the default input encoding. Doxygen uses libiconv (or the iconv built | |
| 667 | +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for | |
| 668 | +# the list of possible encodings. | |
| 669 | + | |
| 670 | +INPUT_ENCODING = UTF-8 | |
| 671 | + | |
| 672 | +# If the value of the INPUT tag contains directories, you can use the | |
| 673 | +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp | |
| 674 | +# and *.h) to filter out the source-files in the directories. If left | |
| 675 | +# blank the following patterns are tested: | |
| 676 | +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh | |
| 677 | +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py | |
| 678 | +# *.f90 *.f *.for *.vhd *.vhdl | |
| 679 | + | |
| 680 | +FILE_PATTERNS = *.c \ | |
| 681 | + *.cc \ | |
| 682 | + *.cxx \ | |
| 683 | + *.cpp \ | |
| 684 | + *.c++ \ | |
| 685 | + *.d \ | |
| 686 | + *.java \ | |
| 687 | + *.ii \ | |
| 688 | + *.ixx \ | |
| 689 | + *.ipp \ | |
| 690 | + *.i++ \ | |
| 691 | + *.inl \ | |
| 692 | + *.h \ | |
| 693 | + *.hh \ | |
| 694 | + *.hxx \ | |
| 695 | + *.hpp \ | |
| 696 | + *.h++ \ | |
| 697 | + *.idl \ | |
| 698 | + *.odl \ | |
| 699 | + *.cs \ | |
| 700 | + *.php \ | |
| 701 | + *.php3 \ | |
| 702 | + *.inc \ | |
| 703 | + *.m \ | |
| 704 | + *.markdown \ | |
| 705 | + *.md \ | |
| 706 | + *.mm \ | |
| 707 | + *.dox \ | |
| 708 | + *.py \ | |
| 709 | + *.f90 \ | |
| 710 | + *.f \ | |
| 711 | + *.for \ | |
| 712 | + *.vhd \ | |
| 713 | + *.vhdl \ | |
| 714 | + *.js \ | |
| 715 | + *.xml | |
| 716 | + | |
| 717 | +# The RECURSIVE tag can be used to turn specify whether or not subdirectories | |
| 718 | +# should be searched for input files as well. Possible values are YES and NO. | |
| 719 | +# If left blank NO is used. | |
| 720 | + | |
| 721 | +RECURSIVE = YES | |
| 722 | + | |
| 723 | +# The EXCLUDE tag can be used to specify files and/or directories that should be | |
| 724 | +# excluded from the INPUT source files. This way you can easily exclude a | |
| 725 | +# subdirectory from a directory tree whose root is specified with the INPUT tag. | |
| 726 | +# Note that relative paths are relative to the directory from which doxygen is | |
| 727 | +# run. | |
| 728 | + | |
| 729 | +EXCLUDE = | |
| 730 | + | |
| 731 | +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or | |
| 732 | +# directories that are symbolic links (a Unix file system feature) are excluded | |
| 733 | +# from the input. | |
| 734 | + | |
| 735 | +EXCLUDE_SYMLINKS = YES | |
| 736 | + | |
| 737 | +# If the value of the INPUT tag contains directories, you can use the | |
| 738 | +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude | |
| 739 | +# certain files from those directories. Note that the wildcards are matched | |
| 740 | +# against the file with absolute path, so to exclude all test directories | |
| 741 | +# for example use the pattern */test/* | |
| 742 | + | |
| 743 | +EXCLUDE_PATTERNS = | |
| 744 | + | |
| 745 | +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names | |
| 746 | +# (namespaces, classes, functions, etc.) that should be excluded from the | |
| 747 | +# output. The symbol name can be a fully qualified name, a word, or if the | |
| 748 | +# wildcard * is used, a substring. Examples: ANamespace, AClass, | |
| 749 | +# AClass::ANamespace, ANamespace::*Test | |
| 750 | + | |
| 751 | +EXCLUDE_SYMBOLS = | |
| 752 | + | |
| 753 | +# The EXAMPLE_PATH tag can be used to specify one or more files or | |
| 754 | +# directories that contain example code fragments that are included (see | |
| 755 | +# the \include command). | |
| 756 | + | |
| 757 | +EXAMPLE_PATH = | |
| 758 | + | |
| 759 | +# If the value of the EXAMPLE_PATH tag contains directories, you can use the | |
| 760 | +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp | |
| 761 | +# and *.h) to filter out the source-files in the directories. If left | |
| 762 | +# blank all files are included. | |
| 763 | + | |
| 764 | +EXAMPLE_PATTERNS = * | |
| 765 | + | |
| 766 | +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be | |
| 767 | +# searched for input files to be used with the \include or \dontinclude | |
| 768 | +# commands irrespective of the value of the RECURSIVE tag. | |
| 769 | +# Possible values are YES and NO. If left blank NO is used. | |
| 770 | + | |
| 771 | +EXAMPLE_RECURSIVE = NO | |
| 772 | + | |
| 773 | +# The IMAGE_PATH tag can be used to specify one or more files or | |
| 774 | +# directories that contain image that are included in the documentation (see | |
| 775 | +# the \image command). | |
| 776 | + | |
| 777 | +IMAGE_PATH = | |
| 778 | + | |
| 779 | +# The INPUT_FILTER tag can be used to specify a program that doxygen should | |
| 780 | +# invoke to filter for each input file. Doxygen will invoke the filter program | |
| 781 | +# by executing (via popen()) the command <filter> <input-file>, where <filter> | |
| 782 | +# is the value of the INPUT_FILTER tag, and <input-file> is the name of an | |
| 783 | +# input file. Doxygen will then use the output that the filter program writes | |
| 784 | +# to standard output. If FILTER_PATTERNS is specified, this tag will be | |
| 785 | +# ignored. | |
| 786 | + | |
| 787 | +INPUT_FILTER = | |
| 788 | + | |
| 789 | +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern | |
| 790 | +# basis. Doxygen will compare the file name with each pattern and apply the | |
| 791 | +# filter if there is a match. The filters are a list of the form: | |
| 792 | +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further | |
| 793 | +# info on how filters are used. If FILTER_PATTERNS is empty or if | |
| 794 | +# non of the patterns match the file name, INPUT_FILTER is applied. | |
| 795 | + | |
| 796 | +FILTER_PATTERNS = | |
| 797 | + | |
| 798 | +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using | |
| 799 | +# INPUT_FILTER) will be used to filter the input files when producing source | |
| 800 | +# files to browse (i.e. when SOURCE_BROWSER is set to YES). | |
| 801 | + | |
| 802 | +FILTER_SOURCE_FILES = NO | |
| 803 | + | |
| 804 | +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file | |
| 805 | +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) | |
| 806 | +# and it is also possible to disable source filtering for a specific pattern | |
| 807 | +# using *.ext= (so without naming a filter). This option only has effect when | |
| 808 | +# FILTER_SOURCE_FILES is enabled. | |
| 809 | + | |
| 810 | +FILTER_SOURCE_PATTERNS = | |
| 811 | + | |
| 812 | +#--------------------------------------------------------------------------- | |
| 813 | +# configuration options related to source browsing | |
| 814 | +#--------------------------------------------------------------------------- | |
| 815 | + | |
| 816 | +# If the SOURCE_BROWSER tag is set to YES then a list of source files will | |
| 817 | +# be generated. Documented entities will be cross-referenced with these sources. | |
| 818 | +# Note: To get rid of all source code in the generated output, make sure also | |
| 819 | +# VERBATIM_HEADERS is set to NO. | |
| 820 | + | |
| 821 | +SOURCE_BROWSER = YES | |
| 822 | + | |
| 823 | +# Setting the INLINE_SOURCES tag to YES will include the body | |
| 824 | +# of functions and classes directly in the documentation. | |
| 825 | + | |
| 826 | +INLINE_SOURCES = NO | |
| 827 | + | |
| 828 | +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct | |
| 829 | +# doxygen to hide any special comment blocks from generated source code | |
| 830 | +# fragments. Normal C, C++ and Fortran comments will always remain visible. | |
| 831 | + | |
| 832 | +STRIP_CODE_COMMENTS = YES | |
| 833 | + | |
| 834 | +# If the REFERENCED_BY_RELATION tag is set to YES | |
| 835 | +# then for each documented function all documented | |
| 836 | +# functions referencing it will be listed. | |
| 837 | + | |
| 838 | +REFERENCED_BY_RELATION = NO | |
| 839 | + | |
| 840 | +# If the REFERENCES_RELATION tag is set to YES | |
| 841 | +# then for each documented function all documented entities | |
| 842 | +# called/used by that function will be listed. | |
| 843 | + | |
| 844 | +REFERENCES_RELATION = NO | |
| 845 | + | |
| 846 | +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) | |
| 847 | +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from | |
| 848 | +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will | |
| 849 | +# link to the source code. Otherwise they will link to the documentation. | |
| 850 | + | |
| 851 | +REFERENCES_LINK_SOURCE = YES | |
| 852 | + | |
| 853 | +# If the USE_HTAGS tag is set to YES then the references to source code | |
| 854 | +# will point to the HTML generated by the htags(1) tool instead of doxygen | |
| 855 | +# built-in source browser. The htags tool is part of GNU's global source | |
| 856 | +# tagging system (see http://www.gnu.org/software/global/global.html). You | |
| 857 | +# will need version 4.8.6 or higher. | |
| 858 | + | |
| 859 | +USE_HTAGS = NO | |
| 860 | + | |
| 861 | +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen | |
| 862 | +# will generate a verbatim copy of the header file for each class for | |
| 863 | +# which an include is specified. Set to NO to disable this. | |
| 864 | + | |
| 865 | +VERBATIM_HEADERS = YES | |
| 866 | + | |
| 867 | +#--------------------------------------------------------------------------- | |
| 868 | +# configuration options related to the alphabetical class index | |
| 869 | +#--------------------------------------------------------------------------- | |
| 870 | + | |
| 871 | +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index | |
| 872 | +# of all compounds will be generated. Enable this if the project | |
| 873 | +# contains a lot of classes, structs, unions or interfaces. | |
| 874 | + | |
| 875 | +ALPHABETICAL_INDEX = YES | |
| 876 | + | |
| 877 | +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then | |
| 878 | +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns | |
| 879 | +# in which this list will be split (can be a number in the range [1..20]) | |
| 880 | + | |
| 881 | +COLS_IN_ALPHA_INDEX = 5 | |
| 882 | + | |
| 883 | +# In case all classes in a project start with a common prefix, all | |
| 884 | +# classes will be put under the same header in the alphabetical index. | |
| 885 | +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that | |
| 886 | +# should be ignored while generating the index headers. | |
| 887 | + | |
| 888 | +IGNORE_PREFIX = | |
| 889 | + | |
| 890 | +#--------------------------------------------------------------------------- | |
| 891 | +# configuration options related to the HTML output | |
| 892 | +#--------------------------------------------------------------------------- | |
| 893 | + | |
| 894 | +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will | |
| 895 | +# generate HTML output. | |
| 896 | + | |
| 897 | +GENERATE_HTML = YES | |
| 898 | + | |
| 899 | +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. | |
| 900 | +# If a relative path is entered the value of OUTPUT_DIRECTORY will be | |
| 901 | +# put in front of it. If left blank `html' will be used as the default path. | |
| 902 | + | |
| 903 | +HTML_OUTPUT = html | |
| 904 | + | |
| 905 | +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for | |
| 906 | +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank | |
| 907 | +# doxygen will generate files with .html extension. | |
| 908 | + | |
| 909 | +HTML_FILE_EXTENSION = .html | |
| 910 | + | |
| 911 | +# The HTML_HEADER tag can be used to specify a personal HTML header for | |
| 912 | +# each generated HTML page. If it is left blank doxygen will generate a | |
| 913 | +# standard header. Note that when using a custom header you are responsible | |
| 914 | +# for the proper inclusion of any scripts and style sheets that doxygen | |
| 915 | +# needs, which is dependent on the configuration options used. | |
| 916 | +# It is advised to generate a default header using "doxygen -w html | |
| 917 | +# header.html footer.html stylesheet.css YourConfigFile" and then modify | |
| 918 | +# that header. Note that the header is subject to change so you typically | |
| 919 | +# have to redo this when upgrading to a newer version of doxygen or when | |
| 920 | +# changing the value of configuration settings such as GENERATE_TREEVIEW! | |
| 921 | + | |
| 922 | +HTML_HEADER = | |
| 923 | + | |
| 924 | +# The HTML_FOOTER tag can be used to specify a personal HTML footer for | |
| 925 | +# each generated HTML page. If it is left blank doxygen will generate a | |
| 926 | +# standard footer. | |
| 927 | + | |
| 928 | +HTML_FOOTER = | |
| 929 | + | |
| 930 | +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading | |
| 931 | +# style sheet that is used by each HTML page. It can be used to | |
| 932 | +# fine-tune the look of the HTML output. If left blank doxygen will | |
| 933 | +# generate a default style sheet. Note that it is recommended to use | |
| 934 | +# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this | |
| 935 | +# tag will in the future become obsolete. | |
| 936 | + | |
| 937 | +HTML_STYLESHEET = | |
| 938 | + | |
| 939 | +# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional | |
| 940 | +# user-defined cascading style sheet that is included after the standard | |
| 941 | +# style sheets created by doxygen. Using this option one can overrule | |
| 942 | +# certain style aspects. This is preferred over using HTML_STYLESHEET | |
| 943 | +# since it does not replace the standard style sheet and is therefor more | |
| 944 | +# robust against future updates. Doxygen will copy the style sheet file to | |
| 945 | +# the output directory. | |
| 946 | + | |
| 947 | +HTML_EXTRA_STYLESHEET = | |
| 948 | + | |
| 949 | +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or | |
| 950 | +# other source files which should be copied to the HTML output directory. Note | |
| 951 | +# that these files will be copied to the base HTML output directory. Use the | |
| 952 | +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these | |
| 953 | +# files. In the HTML_STYLESHEET file, use the file name only. Also note that | |
| 954 | +# the files will be copied as-is; there are no commands or markers available. | |
| 955 | + | |
| 956 | +HTML_EXTRA_FILES = | |
| 957 | + | |
| 958 | +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. | |
| 959 | +# Doxygen will adjust the colors in the style sheet and background images | |
| 960 | +# according to this color. Hue is specified as an angle on a colorwheel, | |
| 961 | +# see http://en.wikipedia.org/wiki/Hue for more information. | |
| 962 | +# For instance the value 0 represents red, 60 is yellow, 120 is green, | |
| 963 | +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. | |
| 964 | +# The allowed range is 0 to 359. | |
| 965 | + | |
| 966 | +HTML_COLORSTYLE_HUE = 220 | |
| 967 | + | |
| 968 | +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of | |
| 969 | +# the colors in the HTML output. For a value of 0 the output will use | |
| 970 | +# grayscales only. A value of 255 will produce the most vivid colors. | |
| 971 | + | |
| 972 | +HTML_COLORSTYLE_SAT = 100 | |
| 973 | + | |
| 974 | +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to | |
| 975 | +# the luminance component of the colors in the HTML output. Values below | |
| 976 | +# 100 gradually make the output lighter, whereas values above 100 make | |
| 977 | +# the output darker. The value divided by 100 is the actual gamma applied, | |
| 978 | +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, | |
| 979 | +# and 100 does not change the gamma. | |
| 980 | + | |
| 981 | +HTML_COLORSTYLE_GAMMA = 80 | |
| 982 | + | |
| 983 | +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML | |
| 984 | +# page will contain the date and time when the page was generated. Setting | |
| 985 | +# this to NO can help when comparing the output of multiple runs. | |
| 986 | + | |
| 987 | +HTML_TIMESTAMP = YES | |
| 988 | + | |
| 989 | +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML | |
| 990 | +# documentation will contain sections that can be hidden and shown after the | |
| 991 | +# page has loaded. | |
| 992 | + | |
| 993 | +HTML_DYNAMIC_SECTIONS = NO | |
| 994 | + | |
| 995 | +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of | |
| 996 | +# entries shown in the various tree structured indices initially; the user | |
| 997 | +# can expand and collapse entries dynamically later on. Doxygen will expand | |
| 998 | +# the tree to such a level that at most the specified number of entries are | |
| 999 | +# visible (unless a fully collapsed tree already exceeds this amount). | |
| 1000 | +# So setting the number of entries 1 will produce a full collapsed tree by | |
| 1001 | +# default. 0 is a special value representing an infinite number of entries | |
| 1002 | +# and will result in a full expanded tree by default. | |
| 1003 | + | |
| 1004 | +HTML_INDEX_NUM_ENTRIES = 100 | |
| 1005 | + | |
| 1006 | +# If the GENERATE_DOCSET tag is set to YES, additional index files | |
| 1007 | +# will be generated that can be used as input for Apple's Xcode 3 | |
| 1008 | +# integrated development environment, introduced with OSX 10.5 (Leopard). | |
| 1009 | +# To create a documentation set, doxygen will generate a Makefile in the | |
| 1010 | +# HTML output directory. Running make will produce the docset in that | |
| 1011 | +# directory and running "make install" will install the docset in | |
| 1012 | +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find | |
| 1013 | +# it at startup. | |
| 1014 | +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html | |
| 1015 | +# for more information. | |
| 1016 | + | |
| 1017 | +GENERATE_DOCSET = NO | |
| 1018 | + | |
| 1019 | +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the | |
| 1020 | +# feed. A documentation feed provides an umbrella under which multiple | |
| 1021 | +# documentation sets from a single provider (such as a company or product suite) | |
| 1022 | +# can be grouped. | |
| 1023 | + | |
| 1024 | +DOCSET_FEEDNAME = "Doxygen generated docs" | |
| 1025 | + | |
| 1026 | +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that | |
| 1027 | +# should uniquely identify the documentation set bundle. This should be a | |
| 1028 | +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen | |
| 1029 | +# will append .docset to the name. | |
| 1030 | + | |
| 1031 | +DOCSET_BUNDLE_ID = org.doxygen.Project | |
| 1032 | + | |
| 1033 | +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely | |
| 1034 | +# identify the documentation publisher. This should be a reverse domain-name | |
| 1035 | +# style string, e.g. com.mycompany.MyDocSet.documentation. | |
| 1036 | + | |
| 1037 | +DOCSET_PUBLISHER_ID = org.doxygen.Publisher | |
| 1038 | + | |
| 1039 | +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. | |
| 1040 | + | |
| 1041 | +DOCSET_PUBLISHER_NAME = Publisher | |
| 1042 | + | |
| 1043 | +# If the GENERATE_HTMLHELP tag is set to YES, additional index files | |
| 1044 | +# will be generated that can be used as input for tools like the | |
| 1045 | +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) | |
| 1046 | +# of the generated HTML documentation. | |
| 1047 | + | |
| 1048 | +GENERATE_HTMLHELP = NO | |
| 1049 | + | |
| 1050 | +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can | |
| 1051 | +# be used to specify the file name of the resulting .chm file. You | |
| 1052 | +# can add a path in front of the file if the result should not be | |
| 1053 | +# written to the html output directory. | |
| 1054 | + | |
| 1055 | +CHM_FILE = | |
| 1056 | + | |
| 1057 | +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can | |
| 1058 | +# be used to specify the location (absolute path including file name) of | |
| 1059 | +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run | |
| 1060 | +# the HTML help compiler on the generated index.hhp. | |
| 1061 | + | |
| 1062 | +HHC_LOCATION = | |
| 1063 | + | |
| 1064 | +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag | |
| 1065 | +# controls if a separate .chi index file is generated (YES) or that | |
| 1066 | +# it should be included in the master .chm file (NO). | |
| 1067 | + | |
| 1068 | +GENERATE_CHI = NO | |
| 1069 | + | |
| 1070 | +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING | |
| 1071 | +# is used to encode HtmlHelp index (hhk), content (hhc) and project file | |
| 1072 | +# content. | |
| 1073 | + | |
| 1074 | +CHM_INDEX_ENCODING = | |
| 1075 | + | |
| 1076 | +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag | |
| 1077 | +# controls whether a binary table of contents is generated (YES) or a | |
| 1078 | +# normal table of contents (NO) in the .chm file. | |
| 1079 | + | |
| 1080 | +BINARY_TOC = NO | |
| 1081 | + | |
| 1082 | +# The TOC_EXPAND flag can be set to YES to add extra items for group members | |
| 1083 | +# to the contents of the HTML help documentation and to the tree view. | |
| 1084 | + | |
| 1085 | +TOC_EXPAND = NO | |
| 1086 | + | |
| 1087 | +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and | |
| 1088 | +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated | |
| 1089 | +# that can be used as input for Qt's qhelpgenerator to generate a | |
| 1090 | +# Qt Compressed Help (.qch) of the generated HTML documentation. | |
| 1091 | + | |
| 1092 | +GENERATE_QHP = NO | |
| 1093 | + | |
| 1094 | +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can | |
| 1095 | +# be used to specify the file name of the resulting .qch file. | |
| 1096 | +# The path specified is relative to the HTML output folder. | |
| 1097 | + | |
| 1098 | +QCH_FILE = | |
| 1099 | + | |
| 1100 | +# The QHP_NAMESPACE tag specifies the namespace to use when generating | |
| 1101 | +# Qt Help Project output. For more information please see | |
| 1102 | +# http://doc.trolltech.com/qthelpproject.html#namespace | |
| 1103 | + | |
| 1104 | +QHP_NAMESPACE = org.doxygen.Project | |
| 1105 | + | |
| 1106 | +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating | |
| 1107 | +# Qt Help Project output. For more information please see | |
| 1108 | +# http://doc.trolltech.com/qthelpproject.html#virtual-folders | |
| 1109 | + | |
| 1110 | +QHP_VIRTUAL_FOLDER = doc | |
| 1111 | + | |
| 1112 | +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to | |
| 1113 | +# add. For more information please see | |
| 1114 | +# http://doc.trolltech.com/qthelpproject.html#custom-filters | |
| 1115 | + | |
| 1116 | +QHP_CUST_FILTER_NAME = | |
| 1117 | + | |
| 1118 | +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the | |
| 1119 | +# custom filter to add. For more information please see | |
| 1120 | +# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters"> | |
| 1121 | +# Qt Help Project / Custom Filters</a>. | |
| 1122 | + | |
| 1123 | +QHP_CUST_FILTER_ATTRS = | |
| 1124 | + | |
| 1125 | +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this | |
| 1126 | +# project's | |
| 1127 | +# filter section matches. | |
| 1128 | +# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes"> | |
| 1129 | +# Qt Help Project / Filter Attributes</a>. | |
| 1130 | + | |
| 1131 | +QHP_SECT_FILTER_ATTRS = | |
| 1132 | + | |
| 1133 | +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can | |
| 1134 | +# be used to specify the location of Qt's qhelpgenerator. | |
| 1135 | +# If non-empty doxygen will try to run qhelpgenerator on the generated | |
| 1136 | +# .qhp file. | |
| 1137 | + | |
| 1138 | +QHG_LOCATION = | |
| 1139 | + | |
| 1140 | +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files | |
| 1141 | +# will be generated, which together with the HTML files, form an Eclipse help | |
| 1142 | +# plugin. To install this plugin and make it available under the help contents | |
| 1143 | +# menu in Eclipse, the contents of the directory containing the HTML and XML | |
| 1144 | +# files needs to be copied into the plugins directory of eclipse. The name of | |
| 1145 | +# the directory within the plugins directory should be the same as | |
| 1146 | +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before | |
| 1147 | +# the help appears. | |
| 1148 | + | |
| 1149 | +GENERATE_ECLIPSEHELP = NO | |
| 1150 | + | |
| 1151 | +# A unique identifier for the eclipse help plugin. When installing the plugin | |
| 1152 | +# the directory name containing the HTML and XML files should also have | |
| 1153 | +# this name. | |
| 1154 | + | |
| 1155 | +ECLIPSE_DOC_ID = org.doxygen.Project | |
| 1156 | + | |
| 1157 | +# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) | |
| 1158 | +# at top of each HTML page. The value NO (the default) enables the index and | |
| 1159 | +# the value YES disables it. Since the tabs have the same information as the | |
| 1160 | +# navigation tree you can set this option to NO if you already set | |
| 1161 | +# GENERATE_TREEVIEW to YES. | |
| 1162 | + | |
| 1163 | +DISABLE_INDEX = NO | |
| 1164 | + | |
| 1165 | +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index | |
| 1166 | +# structure should be generated to display hierarchical information. | |
| 1167 | +# If the tag value is set to YES, a side panel will be generated | |
| 1168 | +# containing a tree-like index structure (just like the one that | |
| 1169 | +# is generated for HTML Help). For this to work a browser that supports | |
| 1170 | +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). | |
| 1171 | +# Windows users are probably better off using the HTML help feature. | |
| 1172 | +# Since the tree basically has the same information as the tab index you | |
| 1173 | +# could consider to set DISABLE_INDEX to NO when enabling this option. | |
| 1174 | + | |
| 1175 | +GENERATE_TREEVIEW = NO | |
| 1176 | + | |
| 1177 | +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values | |
| 1178 | +# (range [0,1..20]) that doxygen will group on one line in the generated HTML | |
| 1179 | +# documentation. Note that a value of 0 will completely suppress the enum | |
| 1180 | +# values from appearing in the overview section. | |
| 1181 | + | |
| 1182 | +ENUM_VALUES_PER_LINE = 4 | |
| 1183 | + | |
| 1184 | +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be | |
| 1185 | +# used to set the initial width (in pixels) of the frame in which the tree | |
| 1186 | +# is shown. | |
| 1187 | + | |
| 1188 | +TREEVIEW_WIDTH = 250 | |
| 1189 | + | |
| 1190 | +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open | |
| 1191 | +# links to external symbols imported via tag files in a separate window. | |
| 1192 | + | |
| 1193 | +EXT_LINKS_IN_WINDOW = NO | |
| 1194 | + | |
| 1195 | +# Use this tag to change the font size of Latex formulas included | |
| 1196 | +# as images in the HTML documentation. The default is 10. Note that | |
| 1197 | +# when you change the font size after a successful doxygen run you need | |
| 1198 | +# to manually remove any form_*.png images from the HTML output directory | |
| 1199 | +# to force them to be regenerated. | |
| 1200 | + | |
| 1201 | +FORMULA_FONTSIZE = 10 | |
| 1202 | + | |
| 1203 | +# Use the FORMULA_TRANPARENT tag to determine whether or not the images | |
| 1204 | +# generated for formulas are transparent PNGs. Transparent PNGs are | |
| 1205 | +# not supported properly for IE 6.0, but are supported on all modern browsers. | |
| 1206 | +# Note that when changing this option you need to delete any form_*.png files | |
| 1207 | +# in the HTML output before the changes have effect. | |
| 1208 | + | |
| 1209 | +FORMULA_TRANSPARENT = YES | |
| 1210 | + | |
| 1211 | +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax | |
| 1212 | +# (see http://www.mathjax.org) which uses client side Javascript for the | |
| 1213 | +# rendering instead of using prerendered bitmaps. Use this if you do not | |
| 1214 | +# have LaTeX installed or if you want to formulas look prettier in the HTML | |
| 1215 | +# output. When enabled you may also need to install MathJax separately and | |
| 1216 | +# configure the path to it using the MATHJAX_RELPATH option. | |
| 1217 | + | |
| 1218 | +USE_MATHJAX = NO | |
| 1219 | + | |
| 1220 | +# When MathJax is enabled you need to specify the location relative to the | |
| 1221 | +# HTML output directory using the MATHJAX_RELPATH option. The destination | |
| 1222 | +# directory should contain the MathJax.js script. For instance, if the mathjax | |
| 1223 | +# directory is located at the same level as the HTML output directory, then | |
| 1224 | +# MATHJAX_RELPATH should be ../mathjax. The default value points to | |
| 1225 | +# the MathJax Content Delivery Network so you can quickly see the result without | |
| 1226 | +# installing MathJax. However, it is strongly recommended to install a local | |
| 1227 | +# copy of MathJax from http://www.mathjax.org before deployment. | |
| 1228 | + | |
| 1229 | +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest | |
| 1230 | + | |
| 1231 | +# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension | |
| 1232 | +# names that should be enabled during MathJax rendering. | |
| 1233 | + | |
| 1234 | +MATHJAX_EXTENSIONS = | |
| 1235 | + | |
| 1236 | +# When the SEARCHENGINE tag is enabled doxygen will generate a search box | |
| 1237 | +# for the HTML output. The underlying search engine uses javascript | |
| 1238 | +# and DHTML and should work on any modern browser. Note that when using | |
| 1239 | +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets | |
| 1240 | +# (GENERATE_DOCSET) there is already a search function so this one should | |
| 1241 | +# typically be disabled. For large projects the javascript based search engine | |
| 1242 | +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. | |
| 1243 | + | |
| 1244 | +SEARCHENGINE = YES | |
| 1245 | + | |
| 1246 | +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be | |
| 1247 | +# implemented using a PHP enabled web server instead of at the web client | |
| 1248 | +# using Javascript. Doxygen will generate the search PHP script and index | |
| 1249 | +# file to put on the web server. The advantage of the server | |
| 1250 | +# based approach is that it scales better to large projects and allows | |
| 1251 | +# full text search. The disadvantages are that it is more difficult to setup | |
| 1252 | +# and does not have live searching capabilities. | |
| 1253 | + | |
| 1254 | +SERVER_BASED_SEARCH = NO | |
| 1255 | + | |
| 1256 | +#--------------------------------------------------------------------------- | |
| 1257 | +# configuration options related to the LaTeX output | |
| 1258 | +#--------------------------------------------------------------------------- | |
| 1259 | + | |
| 1260 | +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will | |
| 1261 | +# generate Latex output. | |
| 1262 | + | |
| 1263 | +GENERATE_LATEX = NO | |
| 1264 | + | |
| 1265 | +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. | |
| 1266 | +# If a relative path is entered the value of OUTPUT_DIRECTORY will be | |
| 1267 | +# put in front of it. If left blank `latex' will be used as the default path. | |
| 1268 | + | |
| 1269 | +LATEX_OUTPUT = latex | |
| 1270 | + | |
| 1271 | +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be | |
| 1272 | +# invoked. If left blank `latex' will be used as the default command name. | |
| 1273 | +# Note that when enabling USE_PDFLATEX this option is only used for | |
| 1274 | +# generating bitmaps for formulas in the HTML output, but not in the | |
| 1275 | +# Makefile that is written to the output directory. | |
| 1276 | + | |
| 1277 | +LATEX_CMD_NAME = latex | |
| 1278 | + | |
| 1279 | +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to | |
| 1280 | +# generate index for LaTeX. If left blank `makeindex' will be used as the | |
| 1281 | +# default command name. | |
| 1282 | + | |
| 1283 | +MAKEINDEX_CMD_NAME = makeindex | |
| 1284 | + | |
| 1285 | +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact | |
| 1286 | +# LaTeX documents. This may be useful for small projects and may help to | |
| 1287 | +# save some trees in general. | |
| 1288 | + | |
| 1289 | +COMPACT_LATEX = NO | |
| 1290 | + | |
| 1291 | +# The PAPER_TYPE tag can be used to set the paper type that is used | |
| 1292 | +# by the printer. Possible values are: a4, letter, legal and | |
| 1293 | +# executive. If left blank a4wide will be used. | |
| 1294 | + | |
| 1295 | +PAPER_TYPE = a4 | |
| 1296 | + | |
| 1297 | +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX | |
| 1298 | +# packages that should be included in the LaTeX output. | |
| 1299 | + | |
| 1300 | +EXTRA_PACKAGES = | |
| 1301 | + | |
| 1302 | +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for | |
| 1303 | +# the generated latex document. The header should contain everything until | |
| 1304 | +# the first chapter. If it is left blank doxygen will generate a | |
| 1305 | +# standard header. Notice: only use this tag if you know what you are doing! | |
| 1306 | + | |
| 1307 | +LATEX_HEADER = | |
| 1308 | + | |
| 1309 | +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for | |
| 1310 | +# the generated latex document. The footer should contain everything after | |
| 1311 | +# the last chapter. If it is left blank doxygen will generate a | |
| 1312 | +# standard footer. Notice: only use this tag if you know what you are doing! | |
| 1313 | + | |
| 1314 | +LATEX_FOOTER = | |
| 1315 | + | |
| 1316 | +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated | |
| 1317 | +# is prepared for conversion to pdf (using ps2pdf). The pdf file will | |
| 1318 | +# contain links (just like the HTML output) instead of page references | |
| 1319 | +# This makes the output suitable for online browsing using a pdf viewer. | |
| 1320 | + | |
| 1321 | +PDF_HYPERLINKS = YES | |
| 1322 | + | |
| 1323 | +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of | |
| 1324 | +# plain latex in the generated Makefile. Set this option to YES to get a | |
| 1325 | +# higher quality PDF documentation. | |
| 1326 | + | |
| 1327 | +USE_PDFLATEX = YES | |
| 1328 | + | |
| 1329 | +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. | |
| 1330 | +# command to the generated LaTeX files. This will instruct LaTeX to keep | |
| 1331 | +# running if errors occur, instead of asking the user for help. | |
| 1332 | +# This option is also used when generating formulas in HTML. | |
| 1333 | + | |
| 1334 | +LATEX_BATCHMODE = NO | |
| 1335 | + | |
| 1336 | +# If LATEX_HIDE_INDICES is set to YES then doxygen will not | |
| 1337 | +# include the index chapters (such as File Index, Compound Index, etc.) | |
| 1338 | +# in the output. | |
| 1339 | + | |
| 1340 | +LATEX_HIDE_INDICES = NO | |
| 1341 | + | |
| 1342 | +# If LATEX_SOURCE_CODE is set to YES then doxygen will include | |
| 1343 | +# source code with syntax highlighting in the LaTeX output. | |
| 1344 | +# Note that which sources are shown also depends on other settings | |
| 1345 | +# such as SOURCE_BROWSER. | |
| 1346 | + | |
| 1347 | +LATEX_SOURCE_CODE = NO | |
| 1348 | + | |
| 1349 | +# The LATEX_BIB_STYLE tag can be used to specify the style to use for the | |
| 1350 | +# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See | |
| 1351 | +# http://en.wikipedia.org/wiki/BibTeX for more info. | |
| 1352 | + | |
| 1353 | +LATEX_BIB_STYLE = plain | |
| 1354 | + | |
| 1355 | +#--------------------------------------------------------------------------- | |
| 1356 | +# configuration options related to the RTF output | |
| 1357 | +#--------------------------------------------------------------------------- | |
| 1358 | + | |
| 1359 | +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output | |
| 1360 | +# The RTF output is optimized for Word 97 and may not look very pretty with | |
| 1361 | +# other RTF readers or editors. | |
| 1362 | + | |
| 1363 | +GENERATE_RTF = YES | |
| 1364 | + | |
| 1365 | +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. | |
| 1366 | +# If a relative path is entered the value of OUTPUT_DIRECTORY will be | |
| 1367 | +# put in front of it. If left blank `rtf' will be used as the default path. | |
| 1368 | + | |
| 1369 | +RTF_OUTPUT = rtf | |
| 1370 | + | |
| 1371 | +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact | |
| 1372 | +# RTF documents. This may be useful for small projects and may help to | |
| 1373 | +# save some trees in general. | |
| 1374 | + | |
| 1375 | +COMPACT_RTF = NO | |
| 1376 | + | |
| 1377 | +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated | |
| 1378 | +# will contain hyperlink fields. The RTF file will | |
| 1379 | +# contain links (just like the HTML output) instead of page references. | |
| 1380 | +# This makes the output suitable for online browsing using WORD or other | |
| 1381 | +# programs which support those fields. | |
| 1382 | +# Note: wordpad (write) and others do not support links. | |
| 1383 | + | |
| 1384 | +RTF_HYPERLINKS = NO | |
| 1385 | + | |
| 1386 | +# Load style sheet definitions from file. Syntax is similar to doxygen's | |
| 1387 | +# config file, i.e. a series of assignments. You only have to provide | |
| 1388 | +# replacements, missing definitions are set to their default value. | |
| 1389 | + | |
| 1390 | +RTF_STYLESHEET_FILE = | |
| 1391 | + | |
| 1392 | +# Set optional variables used in the generation of an rtf document. | |
| 1393 | +# Syntax is similar to doxygen's config file. | |
| 1394 | + | |
| 1395 | +RTF_EXTENSIONS_FILE = | |
| 1396 | + | |
| 1397 | +#--------------------------------------------------------------------------- | |
| 1398 | +# configuration options related to the man page output | |
| 1399 | +#--------------------------------------------------------------------------- | |
| 1400 | + | |
| 1401 | +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will | |
| 1402 | +# generate man pages | |
| 1403 | + | |
| 1404 | +GENERATE_MAN = NO | |
| 1405 | + | |
| 1406 | +# The MAN_OUTPUT tag is used to specify where the man pages will be put. | |
| 1407 | +# If a relative path is entered the value of OUTPUT_DIRECTORY will be | |
| 1408 | +# put in front of it. If left blank `man' will be used as the default path. | |
| 1409 | + | |
| 1410 | +MAN_OUTPUT = man | |
| 1411 | + | |
| 1412 | +# The MAN_EXTENSION tag determines the extension that is added to | |
| 1413 | +# the generated man pages (default is the subroutine's section .3) | |
| 1414 | + | |
| 1415 | +MAN_EXTENSION = .3 | |
| 1416 | + | |
| 1417 | +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, | |
| 1418 | +# then it will generate one additional man file for each entity | |
| 1419 | +# documented in the real man page(s). These additional files | |
| 1420 | +# only source the real man page, but without them the man command | |
| 1421 | +# would be unable to find the correct page. The default is NO. | |
| 1422 | + | |
| 1423 | +MAN_LINKS = NO | |
| 1424 | + | |
| 1425 | +#--------------------------------------------------------------------------- | |
| 1426 | +# configuration options related to the XML output | |
| 1427 | +#--------------------------------------------------------------------------- | |
| 1428 | + | |
| 1429 | +# If the GENERATE_XML tag is set to YES Doxygen will | |
| 1430 | +# generate an XML file that captures the structure of | |
| 1431 | +# the code including all documentation. | |
| 1432 | + | |
| 1433 | +GENERATE_XML = NO | |
| 1434 | + | |
| 1435 | +# The XML_OUTPUT tag is used to specify where the XML pages will be put. | |
| 1436 | +# If a relative path is entered the value of OUTPUT_DIRECTORY will be | |
| 1437 | +# put in front of it. If left blank `xml' will be used as the default path. | |
| 1438 | + | |
| 1439 | +XML_OUTPUT = xml | |
| 1440 | + | |
| 1441 | +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will | |
| 1442 | +# dump the program listings (including syntax highlighting | |
| 1443 | +# and cross-referencing information) to the XML output. Note that | |
| 1444 | +# enabling this will significantly increase the size of the XML output. | |
| 1445 | + | |
| 1446 | +XML_PROGRAMLISTING = YES | |
| 1447 | + | |
| 1448 | +#--------------------------------------------------------------------------- | |
| 1449 | +# configuration options for the AutoGen Definitions output | |
| 1450 | +#--------------------------------------------------------------------------- | |
| 1451 | + | |
| 1452 | +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will | |
| 1453 | +# generate an AutoGen Definitions (see autogen.sf.net) file | |
| 1454 | +# that captures the structure of the code including all | |
| 1455 | +# documentation. Note that this feature is still experimental | |
| 1456 | +# and incomplete at the moment. | |
| 1457 | + | |
| 1458 | +GENERATE_AUTOGEN_DEF = NO | |
| 1459 | + | |
| 1460 | +#--------------------------------------------------------------------------- | |
| 1461 | +# configuration options related to the Perl module output | |
| 1462 | +#--------------------------------------------------------------------------- | |
| 1463 | + | |
| 1464 | +# If the GENERATE_PERLMOD tag is set to YES Doxygen will | |
| 1465 | +# generate a Perl module file that captures the structure of | |
| 1466 | +# the code including all documentation. Note that this | |
| 1467 | +# feature is still experimental and incomplete at the | |
| 1468 | +# moment. | |
| 1469 | + | |
| 1470 | +GENERATE_PERLMOD = NO | |
| 1471 | + | |
| 1472 | +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate | |
| 1473 | +# the necessary Makefile rules, Perl scripts and LaTeX code to be able | |
| 1474 | +# to generate PDF and DVI output from the Perl module output. | |
| 1475 | + | |
| 1476 | +PERLMOD_LATEX = NO | |
| 1477 | + | |
| 1478 | +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be | |
| 1479 | +# nicely formatted so it can be parsed by a human reader. This is useful | |
| 1480 | +# if you want to understand what is going on. On the other hand, if this | |
| 1481 | +# tag is set to NO the size of the Perl module output will be much smaller | |
| 1482 | +# and Perl will parse it just the same. | |
| 1483 | + | |
| 1484 | +PERLMOD_PRETTY = YES | |
| 1485 | + | |
| 1486 | +# The names of the make variables in the generated doxyrules.make file | |
| 1487 | +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. | |
| 1488 | +# This is useful so different doxyrules.make files included by the same | |
| 1489 | +# Makefile don't overwrite each other's variables. | |
| 1490 | + | |
| 1491 | +PERLMOD_MAKEVAR_PREFIX = | |
| 1492 | + | |
| 1493 | +#--------------------------------------------------------------------------- | |
| 1494 | +# Configuration options related to the preprocessor | |
| 1495 | +#--------------------------------------------------------------------------- | |
| 1496 | + | |
| 1497 | +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will | |
| 1498 | +# evaluate all C-preprocessor directives found in the sources and include | |
| 1499 | +# files. | |
| 1500 | + | |
| 1501 | +ENABLE_PREPROCESSING = YES | |
| 1502 | + | |
| 1503 | +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro | |
| 1504 | +# names in the source code. If set to NO (the default) only conditional | |
| 1505 | +# compilation will be performed. Macro expansion can be done in a controlled | |
| 1506 | +# way by setting EXPAND_ONLY_PREDEF to YES. | |
| 1507 | + | |
| 1508 | +MACRO_EXPANSION = NO | |
| 1509 | + | |
| 1510 | +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES | |
| 1511 | +# then the macro expansion is limited to the macros specified with the | |
| 1512 | +# PREDEFINED and EXPAND_AS_DEFINED tags. | |
| 1513 | + | |
| 1514 | +EXPAND_ONLY_PREDEF = NO | |
| 1515 | + | |
| 1516 | +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files | |
| 1517 | +# pointed to by INCLUDE_PATH will be searched when a #include is found. | |
| 1518 | + | |
| 1519 | +SEARCH_INCLUDES = YES | |
| 1520 | + | |
| 1521 | +# The INCLUDE_PATH tag can be used to specify one or more directories that | |
| 1522 | +# contain include files that are not input files but should be processed by | |
| 1523 | +# the preprocessor. | |
| 1524 | + | |
| 1525 | +INCLUDE_PATH = | |
| 1526 | + | |
| 1527 | +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard | |
| 1528 | +# patterns (like *.h and *.hpp) to filter out the header-files in the | |
| 1529 | +# directories. If left blank, the patterns specified with FILE_PATTERNS will | |
| 1530 | +# be used. | |
| 1531 | + | |
| 1532 | +INCLUDE_FILE_PATTERNS = | |
| 1533 | + | |
| 1534 | +# The PREDEFINED tag can be used to specify one or more macro names that | |
| 1535 | +# are defined before the preprocessor is started (similar to the -D option of | |
| 1536 | +# gcc). The argument of the tag is a list of macros of the form: name | |
| 1537 | +# or name=definition (no spaces). If the definition and the = are | |
| 1538 | +# omitted =1 is assumed. To prevent a macro definition from being | |
| 1539 | +# undefined via #undef or recursively expanded use the := operator | |
| 1540 | +# instead of the = operator. | |
| 1541 | + | |
| 1542 | +PREDEFINED = | |
| 1543 | + | |
| 1544 | +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then | |
| 1545 | +# this tag can be used to specify a list of macro names that should be expanded. | |
| 1546 | +# The macro definition that is found in the sources will be used. | |
| 1547 | +# Use the PREDEFINED tag if you want to use a different macro definition that | |
| 1548 | +# overrules the definition found in the source code. | |
| 1549 | + | |
| 1550 | +EXPAND_AS_DEFINED = | |
| 1551 | + | |
| 1552 | +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then | |
| 1553 | +# doxygen's preprocessor will remove all references to function-like macros | |
| 1554 | +# that are alone on a line, have an all uppercase name, and do not end with a | |
| 1555 | +# semicolon, because these will confuse the parser if not removed. | |
| 1556 | + | |
| 1557 | +SKIP_FUNCTION_MACROS = YES | |
| 1558 | + | |
| 1559 | +#--------------------------------------------------------------------------- | |
| 1560 | +# Configuration::additions related to external references | |
| 1561 | +#--------------------------------------------------------------------------- | |
| 1562 | + | |
| 1563 | +# The TAGFILES option can be used to specify one or more tagfiles. For each | |
| 1564 | +# tag file the location of the external documentation should be added. The | |
| 1565 | +# format of a tag file without this location is as follows: | |
| 1566 | +# TAGFILES = file1 file2 ... | |
| 1567 | +# Adding location for the tag files is done as follows: | |
| 1568 | +# TAGFILES = file1=loc1 "file2 = loc2" ... | |
| 1569 | +# where "loc1" and "loc2" can be relative or absolute paths | |
| 1570 | +# or URLs. Note that each tag file must have a unique name (where the name does | |
| 1571 | +# NOT include the path). If a tag file is not located in the directory in which | |
| 1572 | +# doxygen is run, you must also specify the path to the tagfile here. | |
| 1573 | + | |
| 1574 | +TAGFILES = | |
| 1575 | + | |
| 1576 | +# When a file name is specified after GENERATE_TAGFILE, doxygen will create | |
| 1577 | +# a tag file that is based on the input files it reads. | |
| 1578 | + | |
| 1579 | +GENERATE_TAGFILE = | |
| 1580 | + | |
| 1581 | +# If the ALLEXTERNALS tag is set to YES all external classes will be listed | |
| 1582 | +# in the class index. If set to NO only the inherited external classes | |
| 1583 | +# will be listed. | |
| 1584 | + | |
| 1585 | +ALLEXTERNALS = NO | |
| 1586 | + | |
| 1587 | +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed | |
| 1588 | +# in the modules index. If set to NO, only the current project's groups will | |
| 1589 | +# be listed. | |
| 1590 | + | |
| 1591 | +EXTERNAL_GROUPS = YES | |
| 1592 | + | |
| 1593 | +# The PERL_PATH should be the absolute path and name of the perl script | |
| 1594 | +# interpreter (i.e. the result of `which perl'). | |
| 1595 | + | |
| 1596 | +PERL_PATH = /usr/bin/perl | |
| 1597 | + | |
| 1598 | +#--------------------------------------------------------------------------- | |
| 1599 | +# Configuration options related to the dot tool | |
| 1600 | +#--------------------------------------------------------------------------- | |
| 1601 | + | |
| 1602 | +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will | |
| 1603 | +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base | |
| 1604 | +# or super classes. Setting the tag to NO turns the diagrams off. Note that | |
| 1605 | +# this option also works with HAVE_DOT disabled, but it is recommended to | |
| 1606 | +# install and use dot, since it yields more powerful graphs. | |
| 1607 | + | |
| 1608 | +CLASS_DIAGRAMS = YES | |
| 1609 | + | |
| 1610 | +# You can define message sequence charts within doxygen comments using the \msc | |
| 1611 | +# command. Doxygen will then run the mscgen tool (see | |
| 1612 | +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the | |
| 1613 | +# documentation. The MSCGEN_PATH tag allows you to specify the directory where | |
| 1614 | +# the mscgen tool resides. If left empty the tool is assumed to be found in the | |
| 1615 | +# default search path. | |
| 1616 | + | |
| 1617 | +MSCGEN_PATH = | |
| 1618 | + | |
| 1619 | +# If set to YES, the inheritance and collaboration graphs will hide | |
| 1620 | +# inheritance and usage relations if the target is undocumented | |
| 1621 | +# or is not a class. | |
| 1622 | + | |
| 1623 | +HIDE_UNDOC_RELATIONS = YES | |
| 1624 | + | |
| 1625 | +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is | |
| 1626 | +# available from the path. This tool is part of Graphviz, a graph visualization | |
| 1627 | +# toolkit from AT&T and Lucent Bell Labs. The other options in this section | |
| 1628 | +# have no effect if this option is set to NO (the default) | |
| 1629 | + | |
| 1630 | +HAVE_DOT = @HAVE_DOT@ | |
| 1631 | + | |
| 1632 | +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is | |
| 1633 | +# allowed to run in parallel. When set to 0 (the default) doxygen will | |
| 1634 | +# base this on the number of processors available in the system. You can set it | |
| 1635 | +# explicitly to a value larger than 0 to get control over the balance | |
| 1636 | +# between CPU load and processing speed. | |
| 1637 | + | |
| 1638 | +DOT_NUM_THREADS = 0 | |
| 1639 | + | |
| 1640 | +# By default doxygen will use the Helvetica font for all dot files that | |
| 1641 | +# doxygen generates. When you want a differently looking font you can specify | |
| 1642 | +# the font name using DOT_FONTNAME. You need to make sure dot is able to find | |
| 1643 | +# the font, which can be done by putting it in a standard location or by setting | |
| 1644 | +# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the | |
| 1645 | +# directory containing the font. | |
| 1646 | + | |
| 1647 | +DOT_FONTNAME = Helvetica | |
| 1648 | + | |
| 1649 | +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. | |
| 1650 | +# The default size is 10pt. | |
| 1651 | + | |
| 1652 | +DOT_FONTSIZE = 10 | |
| 1653 | + | |
| 1654 | +# By default doxygen will tell dot to use the Helvetica font. | |
| 1655 | +# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to | |
| 1656 | +# set the path where dot can find it. | |
| 1657 | + | |
| 1658 | +DOT_FONTPATH = | |
| 1659 | + | |
| 1660 | +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen | |
| 1661 | +# will generate a graph for each documented class showing the direct and | |
| 1662 | +# indirect inheritance relations. Setting this tag to YES will force the | |
| 1663 | +# CLASS_DIAGRAMS tag to NO. | |
| 1664 | + | |
| 1665 | +CLASS_GRAPH = YES | |
| 1666 | + | |
| 1667 | +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen | |
| 1668 | +# will generate a graph for each documented class showing the direct and | |
| 1669 | +# indirect implementation dependencies (inheritance, containment, and | |
| 1670 | +# class references variables) of the class with other documented classes. | |
| 1671 | + | |
| 1672 | +COLLABORATION_GRAPH = YES | |
| 1673 | + | |
| 1674 | +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen | |
| 1675 | +# will generate a graph for groups, showing the direct groups dependencies | |
| 1676 | + | |
| 1677 | +GROUP_GRAPHS = YES | |
| 1678 | + | |
| 1679 | +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and | |
| 1680 | +# collaboration diagrams in a style similar to the OMG's Unified Modeling | |
| 1681 | +# Language. | |
| 1682 | + | |
| 1683 | +UML_LOOK = NO | |
| 1684 | + | |
| 1685 | +# If the UML_LOOK tag is enabled, the fields and methods are shown inside | |
| 1686 | +# the class node. If there are many fields or methods and many nodes the | |
| 1687 | +# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS | |
| 1688 | +# threshold limits the number of items for each type to make the size more | |
| 1689 | +# managable. Set this to 0 for no limit. Note that the threshold may be | |
| 1690 | +# exceeded by 50% before the limit is enforced. | |
| 1691 | + | |
| 1692 | +UML_LIMIT_NUM_FIELDS = 10 | |
| 1693 | + | |
| 1694 | +# If set to YES, the inheritance and collaboration graphs will show the | |
| 1695 | +# relations between templates and their instances. | |
| 1696 | + | |
| 1697 | +TEMPLATE_RELATIONS = NO | |
| 1698 | + | |
| 1699 | +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT | |
| 1700 | +# tags are set to YES then doxygen will generate a graph for each documented | |
| 1701 | +# file showing the direct and indirect include dependencies of the file with | |
| 1702 | +# other documented files. | |
| 1703 | + | |
| 1704 | +INCLUDE_GRAPH = YES | |
| 1705 | + | |
| 1706 | +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and | |
| 1707 | +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each | |
| 1708 | +# documented header file showing the documented files that directly or | |
| 1709 | +# indirectly include this file. | |
| 1710 | + | |
| 1711 | +INCLUDED_BY_GRAPH = YES | |
| 1712 | + | |
| 1713 | +# If the CALL_GRAPH and HAVE_DOT options are set to YES then | |
| 1714 | +# doxygen will generate a call dependency graph for every global function | |
| 1715 | +# or class method. Note that enabling this option will significantly increase | |
| 1716 | +# the time of a run. So in most cases it will be better to enable call graphs | |
| 1717 | +# for selected functions only using the \callgraph command. | |
| 1718 | + | |
| 1719 | +CALL_GRAPH = NO | |
| 1720 | + | |
| 1721 | +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then | |
| 1722 | +# doxygen will generate a caller dependency graph for every global function | |
| 1723 | +# or class method. Note that enabling this option will significantly increase | |
| 1724 | +# the time of a run. So in most cases it will be better to enable caller | |
| 1725 | +# graphs for selected functions only using the \callergraph command. | |
| 1726 | + | |
| 1727 | +CALLER_GRAPH = NO | |
| 1728 | + | |
| 1729 | +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen | |
| 1730 | +# will generate a graphical hierarchy of all classes instead of a textual one. | |
| 1731 | + | |
| 1732 | +GRAPHICAL_HIERARCHY = YES | |
| 1733 | + | |
| 1734 | +# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES | |
| 1735 | +# then doxygen will show the dependencies a directory has on other directories | |
| 1736 | +# in a graphical way. The dependency relations are determined by the #include | |
| 1737 | +# relations between the files in the directories. | |
| 1738 | + | |
| 1739 | +DIRECTORY_GRAPH = YES | |
| 1740 | + | |
| 1741 | +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images | |
| 1742 | +# generated by dot. Possible values are svg, png, jpg, or gif. | |
| 1743 | +# If left blank png will be used. If you choose svg you need to set | |
| 1744 | +# HTML_FILE_EXTENSION to xhtml in order to make the SVG files | |
| 1745 | +# visible in IE 9+ (other browsers do not have this requirement). | |
| 1746 | + | |
| 1747 | +DOT_IMAGE_FORMAT = png | |
| 1748 | + | |
| 1749 | +# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to | |
| 1750 | +# enable generation of interactive SVG images that allow zooming and panning. | |
| 1751 | +# Note that this requires a modern browser other than Internet Explorer. | |
| 1752 | +# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you | |
| 1753 | +# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files | |
| 1754 | +# visible. Older versions of IE do not have SVG support. | |
| 1755 | + | |
| 1756 | +INTERACTIVE_SVG = YES | |
| 1757 | + | |
| 1758 | +# The tag DOT_PATH can be used to specify the path where the dot tool can be | |
| 1759 | +# found. If left blank, it is assumed the dot tool can be found in the path. | |
| 1760 | + | |
| 1761 | +DOT_PATH = | |
| 1762 | + | |
| 1763 | +# The DOTFILE_DIRS tag can be used to specify one or more directories that | |
| 1764 | +# contain dot files that are included in the documentation (see the | |
| 1765 | +# \dotfile command). | |
| 1766 | + | |
| 1767 | +DOTFILE_DIRS = | |
| 1768 | + | |
| 1769 | +# The MSCFILE_DIRS tag can be used to specify one or more directories that | |
| 1770 | +# contain msc files that are included in the documentation (see the | |
| 1771 | +# \mscfile command). | |
| 1772 | + | |
| 1773 | +MSCFILE_DIRS = | |
| 1774 | + | |
| 1775 | +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of | |
| 1776 | +# nodes that will be shown in the graph. If the number of nodes in a graph | |
| 1777 | +# becomes larger than this value, doxygen will truncate the graph, which is | |
| 1778 | +# visualized by representing a node as a red box. Note that doxygen if the | |
| 1779 | +# number of direct children of the root node in a graph is already larger than | |
| 1780 | +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note | |
| 1781 | +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. | |
| 1782 | + | |
| 1783 | +DOT_GRAPH_MAX_NODES = 50 | |
| 1784 | + | |
| 1785 | +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the | |
| 1786 | +# graphs generated by dot. A depth value of 3 means that only nodes reachable | |
| 1787 | +# from the root by following a path via at most 3 edges will be shown. Nodes | |
| 1788 | +# that lay further from the root node will be omitted. Note that setting this | |
| 1789 | +# option to 1 or 2 may greatly reduce the computation time needed for large | |
| 1790 | +# code bases. Also note that the size of a graph can be further restricted by | |
| 1791 | +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. | |
| 1792 | + | |
| 1793 | +MAX_DOT_GRAPH_DEPTH = 0 | |
| 1794 | + | |
| 1795 | +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent | |
| 1796 | +# background. This is disabled by default, because dot on Windows does not | |
| 1797 | +# seem to support this out of the box. Warning: Depending on the platform used, | |
| 1798 | +# enabling this option may lead to badly anti-aliased labels on the edges of | |
| 1799 | +# a graph (i.e. they become hard to read). | |
| 1800 | + | |
| 1801 | +DOT_TRANSPARENT = NO | |
| 1802 | + | |
| 1803 | +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output | |
| 1804 | +# files in one run (i.e. multiple -o and -T options on the command line). This | |
| 1805 | +# makes dot run faster, but since only newer versions of dot (>1.8.10) | |
| 1806 | +# support this, this feature is disabled by default. | |
| 1807 | + | |
| 1808 | +DOT_MULTI_TARGETS = NO | |
| 1809 | + | |
| 1810 | +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will | |
| 1811 | +# generate a legend page explaining the meaning of the various boxes and | |
| 1812 | +# arrows in the dot generated graphs. | |
| 1813 | + | |
| 1814 | +GENERATE_LEGEND = YES | |
| 1815 | + | |
| 1816 | +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will | |
| 1817 | +# remove the intermediate dot files that are used to generate | |
| 1818 | +# the various graphs. | |
| 1819 | + | |
| 1820 | +DOT_CLEANUP = YES | ... | ... |
hllapi.cbp
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | <CodeBlocks_project_file> |
| 3 | 3 | <FileVersion major="1" minor="6" /> |
| 4 | 4 | <Project> |
| 5 | - <Option title="pw3270 HLLAPI v5.1 compatibility plugin" /> | |
| 5 | + <Option title="HLLAPI Language binding for pw3270/lib3270" /> | |
| 6 | 6 | <Option makefile_is_custom="1" /> |
| 7 | 7 | <Option pch_mode="2" /> |
| 8 | 8 | <Option compiler="gcc" /> |
| ... | ... | @@ -32,45 +32,20 @@ |
| 32 | 32 | <Compiler> |
| 33 | 33 | <Add option="-Wall" /> |
| 34 | 34 | </Compiler> |
| 35 | - <Unit filename="src/daemon/linux/daemon.c"> | |
| 36 | - <Option compilerVar="CC" /> | |
| 37 | - </Unit> | |
| 38 | - <Unit filename="src/daemon/linux/iocallback.c"> | |
| 39 | - <Option compilerVar="CC" /> | |
| 40 | - </Unit> | |
| 41 | - <Unit filename="src/hllapi/calls.cc" /> | |
| 42 | - <Unit filename="src/hllapi/client.h" /> | |
| 43 | - <Unit filename="src/hllapi/hllapi.c"> | |
| 44 | - <Option compilerVar="CC" /> | |
| 45 | - </Unit> | |
| 46 | - <Unit filename="src/hllapi/remotectl.h" /> | |
| 35 | + <Unit filename="src/core/actions.cc" /> | |
| 36 | + <Unit filename="src/core/calls.cc" /> | |
| 37 | + <Unit filename="src/core/controller.cc" /> | |
| 38 | + <Unit filename="src/core/cursor.cc" /> | |
| 39 | + <Unit filename="src/core/get.cc" /> | |
| 40 | + <Unit filename="src/core/hllapi.cc" /> | |
| 41 | + <Unit filename="src/core/keyboard.cc" /> | |
| 42 | + <Unit filename="src/core/private.h" /> | |
| 43 | + <Unit filename="src/core/set.cc" /> | |
| 44 | + <Unit filename="src/core/tools.cc" /> | |
| 45 | + <Unit filename="src/core/windows/resources.rc" /> | |
| 47 | 46 | <Unit filename="src/include/config.h" /> |
| 48 | - <Unit filename="src/include/dbus-glue.h" /> | |
| 49 | - <Unit filename="src/ipc3270c/linux/daemon.h" /> | |
| 50 | - <Unit filename="src/ipc3270c/linux/globals.h" /> | |
| 51 | - <Unit filename="src/ipc3270c/linux/gobject.c"> | |
| 52 | - <Option compilerVar="CC" /> | |
| 53 | - </Unit> | |
| 54 | - <Unit filename="src/ipc3270c/linux/main.c"> | |
| 55 | - <Option compilerVar="CC" /> | |
| 56 | - </Unit> | |
| 57 | - <Unit filename="src/ipc3270c/linux/misc.c"> | |
| 58 | - <Option compilerVar="CC" /> | |
| 59 | - </Unit> | |
| 60 | - <Unit filename="src/ipc3270c/linux/service.h" /> | |
| 61 | - <Unit filename="src/ipc3270c/windows/main.c"> | |
| 62 | - <Option compilerVar="CC" /> | |
| 63 | - </Unit> | |
| 64 | - <Unit filename="src/ipc3270c/windows/private.h" /> | |
| 65 | - <Unit filename="src/ipc3270c/windows/resources.rc" /> | |
| 66 | - <Unit filename="src/plugin/windows/private.h" /> | |
| 67 | - <Unit filename="src/plugin/windows/resources.rc" /> | |
| 68 | - <Unit filename="src/testprograms/hllapi.c"> | |
| 69 | - <Option compilerVar="CC" /> | |
| 70 | - </Unit> | |
| 71 | - <Unit filename="src/testprograms/ipc3270c.c"> | |
| 72 | - <Option compilerVar="CC" /> | |
| 73 | - </Unit> | |
| 47 | + <Unit filename="src/include/lib3270/hllapi.h" /> | |
| 48 | + <Unit filename="src/testprogram/testprogram.cc" /> | |
| 74 | 49 | <Extensions> |
| 75 | 50 | <code_completion /> |
| 76 | 51 | <envvars /> | ... | ... |
pw3270dbus.xml
| ... | ... | @@ -1,251 +0,0 @@ |
| 1 | -<?xml version="1.0" encoding="UTF-8" ?> | |
| 2 | -<node name="/br/com/bb/pw3270"> | |
| 3 | - <interface name="br.com.bb.pw3270"> | |
| 4 | - <method name="getRevision"> | |
| 5 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 6 | - <arg type="s" name="revision" direction="out" /> | |
| 7 | - </method> | |
| 8 | - <method name="quit"> | |
| 9 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 10 | - <arg type="i" name="result" direction="out" /> | |
| 11 | - </method> | |
| 12 | - <method name="connect"> | |
| 13 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 14 | - <arg type="s" name="uri" direction="in" /> | |
| 15 | - <arg type="i" name="result" direction="out" /> | |
| 16 | - </method> | |
| 17 | - <method name="setURL"> | |
| 18 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 19 | - <arg type="s" name="uri" direction="in" /> | |
| 20 | - <arg type="i" name="result" direction="out" /> | |
| 21 | - </method> | |
| 22 | - <method name="getURL"> | |
| 23 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 24 | - <arg type="s" name="uri" direction="out" /> | |
| 25 | - </method> | |
| 26 | - <method name="disconnect"> | |
| 27 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 28 | - <arg type="i" name="result" direction="out" /> | |
| 29 | - </method> | |
| 30 | - <method name="getMessageID"> | |
| 31 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 32 | - <arg type="i" name="status" direction="out" /> | |
| 33 | - </method> | |
| 34 | - <method name="getConnectionState"> | |
| 35 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 36 | - <arg type="i" name="status" direction="out" /> | |
| 37 | - </method> | |
| 38 | - <method name="getSecureState"> | |
| 39 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 40 | - <arg type="i" name="status" direction="out" /> | |
| 41 | - </method> | |
| 42 | - <method name="getScreenContents"> | |
| 43 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 44 | - <arg type="s" name="contents" direction="out" /> | |
| 45 | - </method> | |
| 46 | - <method name="enter"> | |
| 47 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 48 | - <arg type="i" name="result" direction="out" /> | |
| 49 | - </method> | |
| 50 | - <method name="pfKey"> | |
| 51 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 52 | - <arg type="i" name="key" direction="in" /> | |
| 53 | - <arg type="i" name="result" direction="out" /> | |
| 54 | - </method> | |
| 55 | - <method name="paKey"> | |
| 56 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 57 | - <arg type="i" name="key" direction="in" /> | |
| 58 | - <arg type="i" name="result" direction="out" /> | |
| 59 | - </method> | |
| 60 | - <method name="input"> | |
| 61 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 62 | - <arg type="s" name="text" direction="in" /> | |
| 63 | - </method> | |
| 64 | - <method name="setTextAt"> | |
| 65 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 66 | - <arg type="i" name="row" direction="in" /> | |
| 67 | - <arg type="i" name="col" direction="in" /> | |
| 68 | - <arg type="s" name="text" direction="in" /> | |
| 69 | - <arg type="i" name="result" direction="out" /> | |
| 70 | - </method> | |
| 71 | - <method name="getTextAt"> | |
| 72 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 73 | - <arg type="i" name="row" direction="in" /> | |
| 74 | - <arg type="i" name="col" direction="in" /> | |
| 75 | - <arg type="i" name="len" direction="in" /> | |
| 76 | - <arg type="y" name="lf" direction="in" /> | |
| 77 | - <arg type="s" name="text" direction="out" /> | |
| 78 | - </method> | |
| 79 | - <method name="getText"> | |
| 80 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 81 | - <arg type="i" name="addr" direction="in" /> | |
| 82 | - <arg type="i" name="len" direction="in" /> | |
| 83 | - <arg type="y" name="lf" direction="in" /> | |
| 84 | - <arg type="s" name="text" direction="out" /> | |
| 85 | - </method> | |
| 86 | - <method name="setClipboard"> | |
| 87 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 88 | - <arg type="s" name="text" direction="in" /> | |
| 89 | - <arg type="i" name="result" direction="out" /> | |
| 90 | - </method> | |
| 91 | - <method name="getClipboard"> | |
| 92 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 93 | - <arg type="s" name="text" direction="out" /> | |
| 94 | - </method> | |
| 95 | - <method name="isConnected"> | |
| 96 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 97 | - <arg type="i" name="result" direction="out" /> | |
| 98 | - </method> | |
| 99 | - <method name="isReady"> | |
| 100 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 101 | - <arg type="i" name="result" direction="out" /> | |
| 102 | - </method> | |
| 103 | - <method name="inTN3270E"> | |
| 104 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 105 | - <arg type="i" name="result" direction="out" /> | |
| 106 | - </method> | |
| 107 | - <method name="waitForReady"> | |
| 108 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 109 | - <arg type="i" name="timeout" direction="in" /> | |
| 110 | - <arg type="i" name="result" direction="out" /> | |
| 111 | - </method> | |
| 112 | - <method name="setCursorAt"> | |
| 113 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 114 | - <arg type="i" name="row" direction="in" /> | |
| 115 | - <arg type="i" name="col" direction="in" /> | |
| 116 | - <arg type="i" name="result" direction="out" /> | |
| 117 | - </method> | |
| 118 | - <method name="setCursorAddress"> | |
| 119 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 120 | - <arg type="i" name="addr" direction="in" /> | |
| 121 | - <arg type="i" name="result" direction="out" /> | |
| 122 | - </method> | |
| 123 | - <method name="getCursorAddress"> | |
| 124 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 125 | - <arg type="i" name="addr" direction="out" /> | |
| 126 | - </method> | |
| 127 | - <method name="getScreenWidth"> | |
| 128 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 129 | - <arg type="i" name="width" direction="out" /> | |
| 130 | - </method> | |
| 131 | - <method name="getScreenHeight"> | |
| 132 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 133 | - <arg type="i" name="height" direction="out" /> | |
| 134 | - </method> | |
| 135 | - <method name="getScreenLength"> | |
| 136 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 137 | - <arg type="i" name="len" direction="out" /> | |
| 138 | - </method> | |
| 139 | - <method name="getNextUnprotected"> | |
| 140 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 141 | - <arg type="i" name="addr" direction="in" /> | |
| 142 | - <arg type="i" name="result" direction="out" /> | |
| 143 | - </method> | |
| 144 | - <method name="getIsProtected"> | |
| 145 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 146 | - <arg type="i" name="addr" direction="in" /> | |
| 147 | - <arg type="i" name="result" direction="out" /> | |
| 148 | - </method> | |
| 149 | - <method name="getIsProtectedAt"> | |
| 150 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 151 | - <arg type="i" name="row" direction="in" /> | |
| 152 | - <arg type="i" name="col" direction="in" /> | |
| 153 | - <arg type="i" name="result" direction="out" /> | |
| 154 | - </method> | |
| 155 | - <method name="setToggle"> | |
| 156 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 157 | - <arg type="i" name="id" direction="in" /> | |
| 158 | - <arg type="i" name="value" direction="in" /> | |
| 159 | - <arg type="i" name="result" direction="out" /> | |
| 160 | - </method> | |
| 161 | - <method name="cmpTextAt"> | |
| 162 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 163 | - <arg type="i" name="row" direction="in" /> | |
| 164 | - <arg type="i" name="col" direction="in" /> | |
| 165 | - <arg type="s" name="text" direction="in" /> | |
| 166 | - <arg type="y" name="lf" direction="in" /> | |
| 167 | - <arg type="i" name="result" direction="out" /> | |
| 168 | - </method> | |
| 169 | - <method name="getFieldStart"> | |
| 170 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 171 | - <arg type="i" name="addr" direction="in" /> | |
| 172 | - <arg type="i" name="result" direction="out" /> | |
| 173 | - </method> | |
| 174 | - <method name="getFieldLength"> | |
| 175 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 176 | - <arg type="i" name="addr" direction="in" /> | |
| 177 | - <arg type="i" name="result" direction="out" /> | |
| 178 | - </method> | |
| 179 | - <method name="setScript"> | |
| 180 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 181 | - <arg type="s" name="id" direction="in" /> | |
| 182 | - <arg type="i" name="status" direction="in" /> | |
| 183 | - <arg type="i" name="result" direction="out" /> | |
| 184 | - </method> | |
| 185 | - <method name="showPopup"> | |
| 186 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 187 | - <arg type="i" name="id" direction="in" /> | |
| 188 | - <arg type="s" name="title" direction="in" /> | |
| 189 | - <arg type="s" name="msg" direction="in" /> | |
| 190 | - <arg type="s" name="text" direction="in" /> | |
| 191 | - </method> | |
| 192 | - <method name="getHostCharset"> | |
| 193 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 194 | - <arg type="s" name="charset" direction="out" /> | |
| 195 | - </method> | |
| 196 | - <method name="getDisplayCharset"> | |
| 197 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 198 | - <arg type="s" name="charset" direction="out" /> | |
| 199 | - </method> | |
| 200 | - <method name="setHostCharset"> | |
| 201 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 202 | - <arg type="s" name="charset" direction="in" /> | |
| 203 | - <arg type="i" name="result" direction="out" /> | |
| 204 | - </method> | |
| 205 | - <method name="eraseEof"> | |
| 206 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 207 | - <arg type="i" name="result" direction="out" /> | |
| 208 | - </method> | |
| 209 | - <method name="print"> | |
| 210 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 211 | - <arg type="i" name="result" direction="out" /> | |
| 212 | - </method> | |
| 213 | - <method name="ebc2asc"> | |
| 214 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 215 | - <arg type="s" name="from" direction="in" /> | |
| 216 | - <arg type="s" name="to" direction="out" /> | |
| 217 | - </method> | |
| 218 | - <method name="asc2ebc"> | |
| 219 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 220 | - <arg type="s" name="from" direction="in" /> | |
| 221 | - <arg type="s" name="to" direction="out" /> | |
| 222 | - </method> | |
| 223 | - | |
| 224 | - <method name="action"> | |
| 225 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 226 | - <arg type="s" name="name" direction="in" /> | |
| 227 | - <arg type="i" name="result" direction="out" /> | |
| 228 | - </method> | |
| 229 | - | |
| 230 | - <method name="filetransfer"> | |
| 231 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 232 | - <arg type="s" name="local" direction="in" /> | |
| 233 | - <arg type="s" name="remote" direction="in" /> | |
| 234 | - <arg type="i" name="flags" direction="in" /> | |
| 235 | - <arg type="i" name="lrecl" direction="in" /> | |
| 236 | - <arg type="i" name="blksize" direction="in" /> | |
| 237 | - <arg type="i" name="primspace" direction="in" /> | |
| 238 | - <arg type="i" name="secspace" direction="in" /> | |
| 239 | - <arg type="i" name="dft" direction="in" /> | |
| 240 | - <arg type="i" name="result" direction="out" /> | |
| 241 | - </method> | |
| 242 | - | |
| 243 | - <method name="setUnlockDelay"> | |
| 244 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
| 245 | - <arg type="i" name="value" direction="in" /> | |
| 246 | - <arg type="i" name="result" direction="out" /> | |
| 247 | - </method> | |
| 248 | - | |
| 249 | - </interface> | |
| 250 | - | |
| 251 | -</node> |
| ... | ... | @@ -0,0 +1,83 @@ |
| 1 | +# | |
| 2 | +# spec file for packages pw3270-plugin-ipc | |
| 3 | +# | |
| 4 | +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. | |
| 5 | +# Copyright (C) <2008> <Banco do Brasil S.A.> | |
| 6 | +# | |
| 7 | +# All modifications and additions to the file contributed by third parties | |
| 8 | +# remain the property of their copyright owners, unless otherwise agreed | |
| 9 | +# upon. The license for this file, and modifications and additions to the | |
| 10 | +# file, is the same license as for the pristine package itself (unless the | |
| 11 | +# license for the pristine package is not an Open Source License, in which | |
| 12 | +# case the license is the MIT License). An "Open Source License" is a | |
| 13 | +# license that conforms to the Open Source Definition (Version 1.9) | |
| 14 | +# published by the Open Source Initiative. | |
| 15 | + | |
| 16 | +# Please submit bugfixes or comments via http://bugs.opensuse.org/ | |
| 17 | +# | |
| 18 | + | |
| 19 | +#---[ Versions ]------------------------------------------------------------------------------------------------------ | |
| 20 | + | |
| 21 | +%define MAJOR_VERSION 5 | |
| 22 | +%define MINOR_VERSION 2 | |
| 23 | + | |
| 24 | +#---[ Main package ]-------------------------------------------------------------------------------------------------- | |
| 25 | + | |
| 26 | +Summary: HLLAPI client library for lib3270/pw3270 | |
| 27 | +Name: lib3270-hllapi-bindings | |
| 28 | +Version: 5.2 | |
| 29 | +Release: 0 | |
| 30 | +License: LGPL-3.0 | |
| 31 | +Source: %{name}-%{version}.tar.xz | |
| 32 | + | |
| 33 | +Url: https://portal.softwarepublico.gov.br/social/pw3270/ | |
| 34 | + | |
| 35 | +Group: System/X11/Terminals | |
| 36 | +BuildRoot: /var/tmp/%{name}-%{version} | |
| 37 | + | |
| 38 | +Provides: pw3270-plugin-hllapi | |
| 39 | +Conflicts: otherproviders(pw3270-plugin-hllapi) | |
| 40 | + | |
| 41 | +BuildRequires: autoconf >= 2.61 | |
| 42 | +BuildRequires: automake | |
| 43 | +BuildRequires: binutils | |
| 44 | +BuildRequires: coreutils | |
| 45 | +BuildRequires: gcc-c++ | |
| 46 | +BuildRequires: gettext-devel | |
| 47 | +BuildRequires: m4 | |
| 48 | +BuildRequires: pkgconfig(ipc3270) | |
| 49 | + | |
| 50 | +%description | |
| 51 | + | |
| 52 | +Client library for compatibility with the old HLLAPI. | |
| 53 | + | |
| 54 | +See more details at https://softwarepublico.gov.br/social/pw3270/ | |
| 55 | + | |
| 56 | +#---[ Build & Install ]----------------------------------------------------------------------------------------------- | |
| 57 | + | |
| 58 | +%prep | |
| 59 | +%setup | |
| 60 | + | |
| 61 | +NOCONFIGURE=1 ./autogen.sh | |
| 62 | + | |
| 63 | +%configure | |
| 64 | + | |
| 65 | +%build | |
| 66 | +make clean | |
| 67 | +make all | |
| 68 | + | |
| 69 | +%install | |
| 70 | +rm -rf $RPM_BUILD_ROOT | |
| 71 | + | |
| 72 | +make \ | |
| 73 | + DESTDIR=%{?buildroot:%{buildroot}} \ | |
| 74 | + install | |
| 75 | + | |
| 76 | +%files | |
| 77 | +%defattr(-,root,root) | |
| 78 | +%doc AUTHORS LICENSE README.md | |
| 79 | + | |
| 80 | +%{_libdir}/pw3270-plugins/*.so | |
| 81 | + | |
| 82 | +%changelog | |
| 83 | + | ... | ... |
rpm/pw3270-plugin-hllapi.spec
| ... | ... | @@ -1,116 +0,0 @@ |
| 1 | -# | |
| 2 | -# spec file for packages pw3270-plugin-ipc | |
| 3 | -# | |
| 4 | -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. | |
| 5 | -# Copyright (C) <2008> <Banco do Brasil S.A.> | |
| 6 | -# | |
| 7 | -# All modifications and additions to the file contributed by third parties | |
| 8 | -# remain the property of their copyright owners, unless otherwise agreed | |
| 9 | -# upon. The license for this file, and modifications and additions to the | |
| 10 | -# file, is the same license as for the pristine package itself (unless the | |
| 11 | -# license for the pristine package is not an Open Source License, in which | |
| 12 | -# case the license is the MIT License). An "Open Source License" is a | |
| 13 | -# license that conforms to the Open Source Definition (Version 1.9) | |
| 14 | -# published by the Open Source Initiative. | |
| 15 | - | |
| 16 | -# Please submit bugfixes or comments via http://bugs.opensuse.org/ | |
| 17 | -# | |
| 18 | - | |
| 19 | -#---[ Versions ]------------------------------------------------------------------------------------------------------ | |
| 20 | - | |
| 21 | -%define MAJOR_VERSION 5 | |
| 22 | -%define MINOR_VERSION 1 | |
| 23 | - | |
| 24 | -#---[ Main package ]-------------------------------------------------------------------------------------------------- | |
| 25 | - | |
| 26 | -Summary: HLLAPI plugin and client library for pw3270 | |
| 27 | -Name: pw3270-plugin-hllapi | |
| 28 | -Version: 5.1 | |
| 29 | -Release: 0 | |
| 30 | -License: LGPL-3.0 | |
| 31 | -Source: %{name}-%{version}.tar.xz | |
| 32 | - | |
| 33 | -Url: https://portal.softwarepublico.gov.br/social/pw3270/ | |
| 34 | - | |
| 35 | -Group: System/X11/Terminals | |
| 36 | -BuildRoot: /var/tmp/%{name}-%{version} | |
| 37 | - | |
| 38 | -Provides: pw3270-plugin-dbus | |
| 39 | -Conflicts: otherproviders(pw3270-plugin-dbus) | |
| 40 | - | |
| 41 | -BuildRequires: lib3270-devel >= 5.2 | |
| 42 | -BuildRequires: libv3270-devel >= 5.2 | |
| 43 | -BuildRequires: pw3270-devel >= 5.2 | |
| 44 | -BuildRequires: autoconf >= 2.61 | |
| 45 | -BuildRequires: automake | |
| 46 | -BuildRequires: binutils | |
| 47 | -BuildRequires: coreutils | |
| 48 | -BuildRequires: gcc-c++ | |
| 49 | -BuildRequires: gettext-devel | |
| 50 | -BuildRequires: m4 | |
| 51 | - | |
| 52 | -%if 0%{?fedora} || 0%{?suse_version} > 1200 | |
| 53 | - | |
| 54 | -BuildRequires: pkgconfig(dbus-1) | |
| 55 | -BuildRequires: pkgconfig(dbus-glib-1) | |
| 56 | -BuildRequires: pkgconfig(gtk+-3.0) | |
| 57 | - | |
| 58 | -%else | |
| 59 | - | |
| 60 | -BuildRequires: openssl-devel | |
| 61 | -BuildRequires: dbus-1-devel | |
| 62 | -BuildRequires: gtk3-devel | |
| 63 | - | |
| 64 | -%endif | |
| 65 | - | |
| 66 | -%description | |
| 67 | - | |
| 68 | -Plugin and client library for compatibility with the old HLLAPI. | |
| 69 | - | |
| 70 | -See more details at https://softwarepublico.gov.br/social/pw3270/ | |
| 71 | - | |
| 72 | -#---[ Build & Install ]----------------------------------------------------------------------------------------------- | |
| 73 | - | |
| 74 | -%prep | |
| 75 | -%setup | |
| 76 | - | |
| 77 | -NOCONFIGURE=1 ./autogen.sh | |
| 78 | - | |
| 79 | -%configure \ | |
| 80 | - --with-sdk-version=%{version} | |
| 81 | - | |
| 82 | -%build | |
| 83 | -make clean | |
| 84 | -make all | |
| 85 | - | |
| 86 | -%install | |
| 87 | -rm -rf $RPM_BUILD_ROOT | |
| 88 | - | |
| 89 | -make \ | |
| 90 | - DESTDIR=%{?buildroot:%{buildroot}} \ | |
| 91 | - install | |
| 92 | - | |
| 93 | -%files | |
| 94 | -%defattr(-,root,root) | |
| 95 | -%doc AUTHORS LICENSE README.md | |
| 96 | - | |
| 97 | -%{_libdir}/pw3270-plugins/*.so | |
| 98 | - | |
| 99 | -%{_libdir}/libhllapi.so | |
| 100 | -%{_libdir}/libhllapi.so.%{MAJOR_VERSION} | |
| 101 | -%{_libdir}/libhllapi.so.%{MAJOR_VERSION}.%{MINOR_VERSION} | |
| 102 | - | |
| 103 | -%pre | |
| 104 | -/sbin/ldconfig | |
| 105 | -exit 0 | |
| 106 | - | |
| 107 | -%post | |
| 108 | -/sbin/ldconfig | |
| 109 | -exit 0 | |
| 110 | - | |
| 111 | -%postun | |
| 112 | -/sbin/ldconfig | |
| 113 | -exit 0 | |
| 114 | - | |
| 115 | -%changelog | |
| 116 | - |
| ... | ... | @@ -0,0 +1,250 @@ |
| 1 | +REM Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
| 2 | +REM (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
| 3 | +REM aplicativos mainframe. Registro no INPI sob o nome G3270. | |
| 4 | +REM | |
| 5 | +REM Copyright (C) <2008> <Banco do Brasil S.A.> | |
| 6 | +REM | |
| 7 | +REM Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
| 8 | +REM os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
| 9 | +REM Free Software Foundation. | |
| 10 | +REM | |
| 11 | +REM Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
| 12 | +REM GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
| 13 | +REM A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
| 14 | +REM obter mais detalhes. | |
| 15 | +REM | |
| 16 | +REM Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
| 17 | +REM programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin | |
| 18 | +REM St, Fifth Floor, Boston, MA 02110-1301 USA | |
| 19 | +REM | |
| 20 | +REM Contatos: | |
| 21 | +REM | |
| 22 | +REM perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
| 23 | +REM erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | |
| 24 | +REM | |
| 25 | + | |
| 26 | +REM Inicializa a biblioteca | |
| 27 | + | |
| 28 | +rem hllapi_init() - Inicia uma sessão 3270 | |
| 29 | +rem | |
| 30 | +rem hllapi_init pode receber como argumento o nome de uma janela já aberta, | |
| 31 | +rem por exemplo, "pw3270:a" para com que atue direto sobre ela, ou, | |
| 32 | +rem com uma string vazia ("") para tentar criar uma sessão sem janela. | |
| 33 | +rem | |
| 34 | +Declare Function hllapi_init Lib "libhllapi.dll" (ByVal tp as string) as Long | |
| 35 | + | |
| 36 | +rem hllapi_deinit() - Encerra uma sessão 3270 | |
| 37 | +rem | |
| 38 | +rem Finaliza a sessão 3270 liberando os recursos usados. | |
| 39 | +rem | |
| 40 | +Declare Function hllapi_deinit Lib "libhllapi.dll" () as Long | |
| 41 | + | |
| 42 | +rem hllapi_get_revision - Obtém a revisão do pw3270 que está sendo usada. | |
| 43 | +rem | |
| 44 | +Declare Function hllapi_get_revision Lib "libhllapi.dll" () as Long | |
| 45 | + | |
| 46 | +rem hllapi_connect() - Conecta a um host 3270 | |
| 47 | +rem | |
| 48 | +rem Efetua a conexão ao host 3270, recebe 2 parâmetros | |
| 49 | +rem | |
| 50 | +rem uri - URI com o endereço de conexão ao host | |
| 51 | +rem wait - Quantos segundos a função deve esperar até o estabelecimento da sessão | |
| 52 | +rem | |
| 53 | +Declare Function hllapi_connect Lib "libhllapi.dll" (ByVal uri as string, ByVal wait as Integer) as Long | |
| 54 | + | |
| 55 | +rem hllapi_disconnect() - Desconecta do host 3270 | |
| 56 | +rem | |
| 57 | +Declare Function hllapi_disconnect Lib "libhllapi.dll" () as Long | |
| 58 | + | |
| 59 | +rem hllapi_wait_for_ready() - Aguarda que o terminal fique disponível | |
| 60 | +rem | |
| 61 | +rem Suspende a atividade até que o terminal esteja pronto para receber comandos. | |
| 62 | +rem | |
| 63 | +rem Recebe apenas um valor numérico com o tempo em segundos a esperar; caso esse | |
| 64 | +rem tempo seja atingido sem o terminal ficar disponível a função retorna erro. | |
| 65 | +rem | |
| 66 | +Declare Function hllapi_wait_for_ready Lib "libhllapi.dll" (ByVal timeout as Integer) as Long | |
| 67 | + | |
| 68 | +rem hllapi_wait() - Aguarda por "x" segundos | |
| 69 | +rem | |
| 70 | +rem Suspende a atividade do script mantendo a comunicação com o host ativa; pode ser usada | |
| 71 | +rem para parar por um tempo específico enquanto o host executa algum processo. | |
| 72 | +rem | |
| 73 | +rem Recebe apenas um valor numérico com o tempo em segundos a esperar. | |
| 74 | +rem | |
| 75 | +Declare Function hllapi_wait Lib "libhllapi.dll" (ByVal timeout as Integer) as Long | |
| 76 | + | |
| 77 | +rem hllapi_get_message_id() - Obtém o código da mensagem atual da OIA | |
| 78 | +rem | |
| 79 | +rem Obtém o código numérico correspondente à mensagem de status da OIA. | |
| 80 | +rem | |
| 81 | +Declare Function hllapi_get_message_id Lib "libhllapi.dll" () as Long | |
| 82 | + | |
| 83 | +rem hllapi_is_connected() - Verifica se existe uma conexão com o host | |
| 84 | +rem | |
| 85 | +Declare Function hllapi_is_connected Lib "libhllapi.dll" () as Long | |
| 86 | + | |
| 87 | +rem hllapi_get_screen() - Obtém conteúdo de uma parte do terminal pelo endereço | |
| 88 | +rem | |
| 89 | +rem Preenche a string com o conteúdo do termina na posição desejada | |
| 90 | +rem | |
| 91 | +rem Recebe 3 parâmetros: | |
| 92 | +rem | |
| 93 | +rem - Posição na tela | |
| 94 | +rem - String com espaço suficiente | |
| 95 | +rem - Tamanho desejado (se for -1 usa o tamanho da string) | |
| 96 | +rem | |
| 97 | +Declare Function hllapi_get_screen Lib "libhllapi.dll" (ByVal offset as Integer, ByVal text as String, ByVal length as Integer) as Long | |
| 98 | + | |
| 99 | +rem hllapi_get_screen_at() - Obtém o conteúdo de uma parte da tela do terminal. | |
| 100 | +rem | |
| 101 | +rem Preenche a string com o conteúdo do terminal a partir da linha e coluna | |
| 102 | +rem desejadas. | |
| 103 | +rem | |
| 104 | +rem Recebe 3 parâmetros: | |
| 105 | +rem | |
| 106 | +rem - Linha da posição inicial | |
| 107 | +rem - Coluna da posição inicial | |
| 108 | +rem - String já com o tamanho desejado | |
| 109 | +rem | |
| 110 | +Declare Function hllapi_get_screen_at Lib "libhllapi.dll" (ByVal row as Integer, ByVal col as Integer, ByVal text as String) as Long | |
| 111 | + | |
| 112 | +rem hllapi_set_text_at() - Aplica string na tela do terminal. | |
| 113 | +rem | |
| 114 | +rem Aplica a string na linha e coluna informadas; atentar para o fato de que | |
| 115 | +rem a posição deve estar disponível para escrita. | |
| 116 | +rem | |
| 117 | +rem Recebe 3 parâmetros: | |
| 118 | +rem | |
| 119 | +rem - Linha da posição inicial | |
| 120 | +rem - Coluna da posição inicial | |
| 121 | +rem - String que será aplicada | |
| 122 | +rem | |
| 123 | +Declare Function hllapi_set_text_at Lib "libhllapi.dll" (ByVal row as Integer, ByVal col as Integer, ByVal text as String) as Long | |
| 124 | + | |
| 125 | +rem hllapi_cmp_text_at() - Compara conteúdo da tela. | |
| 126 | +rem | |
| 127 | +rem Compara o conteúdo da tela na posição informada, recebe 3 parâmetros. | |
| 128 | +rem | |
| 129 | +rem - Linha da posição inicial | |
| 130 | +rem - Coluna da posição inicial | |
| 131 | +rem - String a comparar | |
| 132 | +rem | |
| 133 | +rem Retorna 0 se o valor contido na tela é igual ao informado, diferente de zero se não for. | |
| 134 | +rem | |
| 135 | +Declare Function hllapi_cmp_text_at Lib "libhllapi.dll" (ByVal row as Integer, ByVal col as Integer, ByVal text as String) as Long | |
| 136 | + | |
| 137 | +rem hllapi_find_text | |
| 138 | +rem | |
| 139 | +rem Obtém a posição da string na tela. | |
| 140 | +rem | |
| 141 | +rem - String a pesquisar | |
| 142 | +rem | |
| 143 | +rem 0 se a string não foi encontrada, a posição na tela se encontrar. | |
| 144 | +rem | |
| 145 | +Declare Function hllapi_find_text Lib "libhllapi.dll" (ByVal text as String) as Long | |
| 146 | + | |
| 147 | +rem hllapi_enter() | |
| 148 | +rem | |
| 149 | +rem Envia um [ENTER] para o host. | |
| 150 | +rem | |
| 151 | +Declare Function hllapi_enter Lib "libhllapi.dll" () as Long | |
| 152 | + | |
| 153 | +rem hllapi_pfkey() | |
| 154 | +rem | |
| 155 | +rem Envia uma [PF] para o host. | |
| 156 | +rem | |
| 157 | +rem Recebe como argumento o número da PF que será enviada. | |
| 158 | +rem | |
| 159 | +Declare Function hllapi_pfkey Lib "libhllapi.dll" (ByVal keycode as Integer) as Long | |
| 160 | + | |
| 161 | +rem hllapi_pakey() | |
| 162 | +rem | |
| 163 | +rem Envia uma [PA] para o host. | |
| 164 | +rem | |
| 165 | +rem Recebe como argumento o número da PA que será enviada. | |
| 166 | +rem | |
| 167 | +Declare Function hllapi_pakey Lib "libhllapi.dll" (ByVal keycode as Integer) as Long | |
| 168 | + | |
| 169 | +rem hllapi_set_session_parameter() | |
| 170 | +rem | |
| 171 | +rem Configura um parâmetro da sessão | |
| 172 | +rem | |
| 173 | +rem Recebe como argumentos: | |
| 174 | +rem | |
| 175 | +rem 1. Nome do parâmetro a ser ajustado | |
| 176 | +rem 2. Tamanho do nome do parâmetro (ou 0) | |
| 177 | +rem 3. Valor a atribuir | |
| 178 | +rem | |
| 179 | +Declare Function hllapi_set_session_parameter Lib "libhllapi.dll" (ByVal text as String, ByVal len as Integer, ByVal value as Integer) as Long | |
| 180 | + | |
| 181 | +rem hllapi_set_charset() | |
| 182 | +rem | |
| 183 | +rem Configura a página de código | |
| 184 | +rem | |
| 185 | +rem Recebe como argumentos: | |
| 186 | +rem | |
| 187 | +rem 1. Nome da página de código desejada (UTF-8, CP1252, ISO-8859-1, etc). | |
| 188 | +rem | |
| 189 | +Declare Function hllapi_set_charset Lib "libhllapi.dll" (ByVal text as String, ByVal len as Integer, ByVal value as Integer) as Long | |
| 190 | + | |
| 191 | +rem hllapi_set_unlock_delay() | |
| 192 | +rem | |
| 193 | +rem Define o tempo (em milisegundos) que o terminal | |
| 194 | +rem espera para desbloquear a sessão após um comando. | |
| 195 | +rem | |
| 196 | +rem Recebe como argumento o valor do delay em milisegundos. | |
| 197 | +rem | |
| 198 | +Declare Function hllapi_set_unlock_delay Lib "libhllapi.dll" (ByVal delay as Integer) as Long | |
| 199 | + | |
| 200 | +rem hllapi_get_cursor_address() - Obtém a posição atual do cursor | |
| 201 | +rem | |
| 202 | +rem Obtém a posição atual do cursor dentro da tela do terminal | |
| 203 | +rem | |
| 204 | +Declare Function hllapi_get_cursor_address Lib "libhllapi.dll" () as Long | |
| 205 | + | |
| 206 | +rem hllapi_set_cursor_address() | |
| 207 | +rem | |
| 208 | +rem Define a posição atual do cursor | |
| 209 | +rem | |
| 210 | +rem Recebe 1 argumento: | |
| 211 | +rem | |
| 212 | +rem Novo endereço do cursor dentro da tela do terminal. | |
| 213 | +rem | |
| 214 | +Declare Function hllapi_set_cursor_address Lib "libhllapi.dll" (ByVal addr) as Long | |
| 215 | + | |
| 216 | +Sub Main | |
| 217 | + | |
| 218 | + if hllapi_init("") <> 0 then | |
| 219 | + print "Erro ao inicializar a biblioteca" | |
| 220 | + Exit Sub | |
| 221 | + End If | |
| 222 | + | |
| 223 | + hllapi_connect("fandezhi.efglobe.com:23",0) | |
| 224 | + | |
| 225 | + Do While hllapi_is_connected() = 0 | |
| 226 | + | |
| 227 | + hllapi_wait(1) | |
| 228 | + | |
| 229 | + Loop | |
| 230 | + | |
| 231 | + if hllapi_wait_for_ready(60) <> 0 then | |
| 232 | + print "Conexão não se estabilizou no tempo esperado" | |
| 233 | + Exit Sub | |
| 234 | + End If | |
| 235 | + | |
| 236 | + Dim text as string | |
| 237 | + text = space(2000) | |
| 238 | + | |
| 239 | + if hllapi_get_screen_at(1,1,text) <> 0 then | |
| 240 | + print "Erro ao tentar obter conteudo do terminal" | |
| 241 | + Exit Sub | |
| 242 | + End If | |
| 243 | + | |
| 244 | + print text | |
| 245 | + | |
| 246 | + hllapi_disconnect() | |
| 247 | + hllapi_deinit() | |
| 248 | + | |
| 249 | +End Sub | |
| 250 | + | ... | ... |
| ... | ... | @@ -0,0 +1,112 @@ |
| 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. | |
| 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., 59 Temple | |
| 19 | + * Place, Suite 330, Boston, MA, 02111-1307, USA | |
| 20 | + * | |
| 21 | + * Este programa está nomeado como - 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 | + #include "private.h" | |
| 31 | + #include <functional> | |
| 32 | + | |
| 33 | +/*--[ Implement ]------------------------------------------------------------------------------------*/ | |
| 34 | + | |
| 35 | + static DWORD action(std::function<void(TN3270::Host &)> worker) noexcept { | |
| 36 | + | |
| 37 | + try { | |
| 38 | + | |
| 39 | + TN3270::Host &host = getSession(); | |
| 40 | + | |
| 41 | + if(!host.isConnected()) | |
| 42 | + return HLLAPI_STATUS_DISCONNECTED; | |
| 43 | + | |
| 44 | + worker(host); | |
| 45 | + | |
| 46 | + return HLLAPI_STATUS_SUCCESS; | |
| 47 | + | |
| 48 | + } catch(const std::system_error &e) { | |
| 49 | + | |
| 50 | + return hllapi_translate_error(e); | |
| 51 | + | |
| 52 | + } catch(const std::exception &e) { | |
| 53 | + | |
| 54 | + hllapi_lasterror = e.what(); | |
| 55 | + | |
| 56 | + } catch(...) { | |
| 57 | + | |
| 58 | + hllapi_lasterror = "Unexpected error"; | |
| 59 | + | |
| 60 | + } | |
| 61 | + | |
| 62 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 63 | + | |
| 64 | + } | |
| 65 | + | |
| 66 | + static DWORD action(const TN3270::Action id) noexcept { | |
| 67 | + | |
| 68 | + return action([id](TN3270::Host &host) { | |
| 69 | + host.push(id); | |
| 70 | + }); | |
| 71 | + | |
| 72 | + } | |
| 73 | + | |
| 74 | + HLLAPI_API_CALL hllapi_enter(void) { | |
| 75 | + return action(TN3270::ENTER); | |
| 76 | + } | |
| 77 | + | |
| 78 | + HLLAPI_API_CALL hllapi_erase(void) { | |
| 79 | + return action(TN3270::ERASE); | |
| 80 | + } | |
| 81 | + | |
| 82 | + HLLAPI_API_CALL hllapi_erase_eof(void) { | |
| 83 | + return action(TN3270::ERASE_EOF); | |
| 84 | + } | |
| 85 | + | |
| 86 | + HLLAPI_API_CALL hllapi_erase_eol(void) { | |
| 87 | + return action(TN3270::ERASE_EOL); | |
| 88 | + } | |
| 89 | + | |
| 90 | + HLLAPI_API_CALL hllapi_erase_input(void) { | |
| 91 | + return action(TN3270::ERASE_INPUT); | |
| 92 | + } | |
| 93 | + | |
| 94 | + HLLAPI_API_CALL hllapi_kybdreset(void) { | |
| 95 | + return action(TN3270::KYBD_RESET); | |
| 96 | + } | |
| 97 | + | |
| 98 | + HLLAPI_API_CALL hllapi_action(LPSTR action_name) { | |
| 99 | + | |
| 100 | + return action([action_name](TN3270::Host &host) { | |
| 101 | + host.action(action_name); | |
| 102 | + }); | |
| 103 | + | |
| 104 | + } | |
| 105 | + | |
| 106 | + HLLAPI_API_CALL hllapi_print(void) { | |
| 107 | + | |
| 108 | + return action([](TN3270::Host &host) { | |
| 109 | + host.print(); | |
| 110 | + }); | |
| 111 | + | |
| 112 | + } | ... | ... |
| ... | ... | @@ -0,0 +1,296 @@ |
| 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. | |
| 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., 59 Temple | |
| 19 | + * Place, Suite 330, Boston, MA, 02111-1307, USA | |
| 20 | + * | |
| 21 | + * Este programa está nomeado como - 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 | + #include "private.h" | |
| 31 | + | |
| 32 | +/*--[ Implement ]------------------------------------------------------------------------------------*/ | |
| 33 | + | |
| 34 | + HLLAPI_API_CALL hllapi_get_revision(void) | |
| 35 | + { | |
| 36 | + try { | |
| 37 | + | |
| 38 | + return atoi(getSession().getRevision().c_str()); | |
| 39 | + | |
| 40 | + } catch(const std::exception &e) { | |
| 41 | + | |
| 42 | + hllapi_lasterror = e.what(); | |
| 43 | + | |
| 44 | + } | |
| 45 | + | |
| 46 | + return (DWORD) -1; | |
| 47 | + } | |
| 48 | + | |
| 49 | + HLLAPI_API_CALL hllapi_connect(const LPSTR uri, WORD wait) | |
| 50 | + { | |
| 51 | + try { | |
| 52 | + | |
| 53 | + getSession().connect((const char *) uri); | |
| 54 | + | |
| 55 | + if(wait) | |
| 56 | + return hllapi_wait_for_ready(wait); | |
| 57 | + | |
| 58 | + } catch(const std::exception &e) { | |
| 59 | + | |
| 60 | + hllapi_lasterror = e.what(); | |
| 61 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 62 | + | |
| 63 | + } catch(...) { | |
| 64 | + | |
| 65 | + hllapi_lasterror = "Unexpected error"; | |
| 66 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 67 | + | |
| 68 | + } | |
| 69 | + | |
| 70 | + return hllapi_get_state(); | |
| 71 | + | |
| 72 | + } | |
| 73 | + | |
| 74 | + HLLAPI_API_CALL hllapi_is_connected(void) { | |
| 75 | + | |
| 76 | + try { | |
| 77 | + | |
| 78 | + return getSession().isConnected(); | |
| 79 | + | |
| 80 | + } catch(std::exception &e) { | |
| 81 | + | |
| 82 | + hllapi_lasterror = e.what(); | |
| 83 | + } | |
| 84 | + | |
| 85 | + return HLLAPI_STATUS_SUCCESS; | |
| 86 | + | |
| 87 | + } | |
| 88 | + | |
| 89 | + HLLAPI_API_CALL hllapi_get_state(void) { | |
| 90 | + | |
| 91 | + try { | |
| 92 | + | |
| 93 | + switch(hllapi_get_message_id()) { | |
| 94 | + case LIB3270_MESSAGE_NONE: // 0 - No message | |
| 95 | + return HLLAPI_STATUS_SUCCESS; // keyboard was unlocked and ready for input. | |
| 96 | + | |
| 97 | + case LIB3270_MESSAGE_DISCONNECTED: // 4 - Disconnected from host | |
| 98 | + return HLLAPI_STATUS_DISCONNECTED; // Your application program was not connected to a valid session. | |
| 99 | + | |
| 100 | + case LIB3270_MESSAGE_MINUS: | |
| 101 | + case LIB3270_MESSAGE_PROTECTED: | |
| 102 | + case LIB3270_MESSAGE_NUMERIC: | |
| 103 | + case LIB3270_MESSAGE_OVERFLOW: | |
| 104 | + case LIB3270_MESSAGE_INHIBIT: | |
| 105 | + case LIB3270_MESSAGE_KYBDLOCK: | |
| 106 | + return HLLAPI_STATUS_KEYBOARD_LOCKED; // keyboard is locked. | |
| 107 | + | |
| 108 | + case LIB3270_MESSAGE_SYSWAIT: | |
| 109 | + case LIB3270_MESSAGE_TWAIT: | |
| 110 | + case LIB3270_MESSAGE_AWAITING_FIRST: | |
| 111 | + case LIB3270_MESSAGE_X: | |
| 112 | + case LIB3270_MESSAGE_RESOLVING: | |
| 113 | + case LIB3270_MESSAGE_CONNECTING: | |
| 114 | + return HLLAPI_STATUS_WAITING; // time-out while still busy (in XCLOCK or XSYSTEM in X) for the 3270 terminal emulation. | |
| 115 | + } | |
| 116 | + | |
| 117 | + } catch(std::exception &e) { | |
| 118 | + | |
| 119 | + hllapi_lasterror = e.what(); | |
| 120 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 121 | + } | |
| 122 | + | |
| 123 | + hllapi_lasterror = "Unexpected message id"; | |
| 124 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 125 | + } | |
| 126 | + | |
| 127 | + HLLAPI_API_CALL hllapi_get_message_id(void) { | |
| 128 | + | |
| 129 | + try { | |
| 130 | + | |
| 131 | + return (DWORD) getSession().getProgramMessage(); | |
| 132 | + | |
| 133 | + } catch(std::exception &e) { | |
| 134 | + | |
| 135 | + hllapi_lasterror = e.what(); | |
| 136 | + | |
| 137 | + } | |
| 138 | + | |
| 139 | + return -1; | |
| 140 | + | |
| 141 | + } | |
| 142 | + | |
| 143 | + HLLAPI_API_CALL hllapi_disconnect(void) { | |
| 144 | + | |
| 145 | + try { | |
| 146 | + | |
| 147 | + getSession().disconnect(); | |
| 148 | + | |
| 149 | + } catch(std::exception &e) { | |
| 150 | + | |
| 151 | + hllapi_lasterror = e.what(); | |
| 152 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 153 | + | |
| 154 | + } | |
| 155 | + | |
| 156 | + return HLLAPI_STATUS_SUCCESS; | |
| 157 | + | |
| 158 | + } | |
| 159 | + | |
| 160 | + HLLAPI_API_CALL hllapi_wait_for_ready(WORD seconds) { | |
| 161 | + | |
| 162 | + try { | |
| 163 | + | |
| 164 | + TN3270::Host &host = getSession(); | |
| 165 | + | |
| 166 | + if(host.isConnected()) | |
| 167 | + host.waitForReady((unsigned int) seconds); | |
| 168 | + | |
| 169 | + return hllapi_get_state(); | |
| 170 | + | |
| 171 | + } catch(const std::exception &e) { | |
| 172 | + | |
| 173 | + hllapi_lasterror = e.what(); | |
| 174 | + | |
| 175 | + } | |
| 176 | + | |
| 177 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 178 | + | |
| 179 | + } | |
| 180 | + | |
| 181 | + HLLAPI_API_CALL hllapi_wait_for_change(WORD seconds) { | |
| 182 | + | |
| 183 | + try { | |
| 184 | + | |
| 185 | + TN3270::Host &host = getSession(); | |
| 186 | + | |
| 187 | + if(host.isConnected()) | |
| 188 | + host.waitForChange((unsigned int) seconds); | |
| 189 | + | |
| 190 | + return hllapi_get_state(); | |
| 191 | + | |
| 192 | + } catch(std::exception &e) { | |
| 193 | + | |
| 194 | + hllapi_lasterror = e.what(); | |
| 195 | + | |
| 196 | + } | |
| 197 | + | |
| 198 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 199 | + | |
| 200 | + } | |
| 201 | + | |
| 202 | + HLLAPI_API_CALL hllapi_set_charset(LPSTR text) { | |
| 203 | + | |
| 204 | + try { | |
| 205 | + | |
| 206 | + getSession().setCharSet((const char *) text); | |
| 207 | + return HLLAPI_STATUS_SUCCESS; | |
| 208 | + | |
| 209 | + } catch(std::exception &e) { | |
| 210 | + | |
| 211 | + hllapi_lasterror = e.what(); | |
| 212 | + | |
| 213 | + } | |
| 214 | + | |
| 215 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 216 | + } | |
| 217 | + | |
| 218 | + | |
| 219 | + HLLAPI_API_CALL hllapi_wait(WORD seconds) { | |
| 220 | + | |
| 221 | + try { | |
| 222 | + | |
| 223 | + TN3270::Host &host = getSession(); | |
| 224 | + | |
| 225 | + if(!host.isConnected()) | |
| 226 | + return HLLAPI_STATUS_DISCONNECTED; | |
| 227 | + | |
| 228 | + host.wait(seconds); | |
| 229 | + | |
| 230 | + return hllapi_get_state(); | |
| 231 | + | |
| 232 | + } catch(std::exception &e) { | |
| 233 | + | |
| 234 | + hllapi_lasterror = e.what(); | |
| 235 | + | |
| 236 | + } | |
| 237 | + | |
| 238 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 239 | + | |
| 240 | + } | |
| 241 | + | |
| 242 | + HLLAPI_API_CALL hllapi_cmp_text_at(WORD row, WORD col, LPSTR text) { | |
| 243 | + | |
| 244 | + try { | |
| 245 | + | |
| 246 | + return getSession().compare((unsigned int) row, (unsigned int) col, text); | |
| 247 | + | |
| 248 | + } catch(std::exception &e) { | |
| 249 | + | |
| 250 | + hllapi_lasterror = e.what(); | |
| 251 | + | |
| 252 | + } | |
| 253 | + | |
| 254 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 255 | + | |
| 256 | + } | |
| 257 | + | |
| 258 | + HLLAPI_API_CALL hllapi_cmp_text_at_address(WORD addr, LPSTR text) { | |
| 259 | + | |
| 260 | + try { | |
| 261 | + | |
| 262 | + return getSession().compare((int) addr, text); | |
| 263 | + | |
| 264 | + } catch(std::exception &e) { | |
| 265 | + | |
| 266 | + hllapi_lasterror = e.what(); | |
| 267 | + | |
| 268 | + } | |
| 269 | + | |
| 270 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 271 | + | |
| 272 | + } | |
| 273 | + | |
| 274 | + | |
| 275 | + HLLAPI_API_CALL hllapi_find_text(const LPSTR text) { | |
| 276 | + | |
| 277 | + try { | |
| 278 | + | |
| 279 | + if(text && *text) { | |
| 280 | + | |
| 281 | + size_t pos = getSession().find(text); | |
| 282 | + if(pos != string::npos) | |
| 283 | + return pos; | |
| 284 | + | |
| 285 | + } | |
| 286 | + | |
| 287 | + } catch(std::exception &e) { | |
| 288 | + | |
| 289 | + hllapi_lasterror = e.what(); | |
| 290 | + | |
| 291 | + } | |
| 292 | + | |
| 293 | + return -1; | |
| 294 | + | |
| 295 | + } | |
| 296 | + | ... | ... |
| ... | ... | @@ -0,0 +1,97 @@ |
| 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. | |
| 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., 59 Temple | |
| 19 | + * Place, Suite 330, Boston, MA, 02111-1307, USA | |
| 20 | + * | |
| 21 | + * Este programa está nomeado como - 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 | + #include "private.h" | |
| 31 | + | |
| 32 | +/*--[ Globals ]--------------------------------------------------------------------------------------*/ | |
| 33 | + | |
| 34 | + static TN3270::Host * hllapi_host = nullptr; | |
| 35 | + static time_t hllapi_timeout = 120; | |
| 36 | + std::string hllapi_lasterror = ""; | |
| 37 | + | |
| 38 | +/*--[ Implement ]------------------------------------------------------------------------------------*/ | |
| 39 | + | |
| 40 | + HLLAPI_API_CALL hllapi_init(LPSTR id) | |
| 41 | + { | |
| 42 | + trace("%s(%s)",__FUNCTION__,id); | |
| 43 | + | |
| 44 | + try | |
| 45 | + { | |
| 46 | + if(hllapi_host) | |
| 47 | + delete hllapi_host; | |
| 48 | + | |
| 49 | + hllapi_host = new TN3270::Host(*id ? id : nullptr,nullptr,hllapi_timeout); | |
| 50 | + | |
| 51 | + } | |
| 52 | + catch(std::exception &e) | |
| 53 | + { | |
| 54 | + hllapi_lasterror = e.what(); | |
| 55 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 56 | + } | |
| 57 | + | |
| 58 | + return HLLAPI_STATUS_SUCCESS; | |
| 59 | + | |
| 60 | + } | |
| 61 | + | |
| 62 | + HLLAPI_API_CALL hllapi_deinit(void) | |
| 63 | + { | |
| 64 | + trace("%s()",__FUNCTION__); | |
| 65 | + | |
| 66 | + try | |
| 67 | + { | |
| 68 | + if(hllapi_host) | |
| 69 | + { | |
| 70 | + delete hllapi_host; | |
| 71 | + hllapi_host = NULL; | |
| 72 | + } | |
| 73 | + | |
| 74 | + } | |
| 75 | + catch(std::exception &e) | |
| 76 | + { | |
| 77 | + hllapi_lasterror = e.what(); | |
| 78 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 79 | + } | |
| 80 | + | |
| 81 | + return HLLAPI_STATUS_SUCCESS; | |
| 82 | + } | |
| 83 | + | |
| 84 | + TN3270::Host & getSession() { | |
| 85 | + | |
| 86 | + if(!hllapi_host) { | |
| 87 | + throw runtime_error("Not initialized"); | |
| 88 | + } | |
| 89 | + | |
| 90 | + return *hllapi_host; | |
| 91 | + | |
| 92 | + } | |
| 93 | + | |
| 94 | + HLLAPI_API_CSTR hllapi_get_last_error() { | |
| 95 | + return hllapi_lasterror.c_str(); | |
| 96 | + } | |
| 97 | + | ... | ... |
| ... | ... | @@ -0,0 +1,110 @@ |
| 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. | |
| 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., 59 Temple | |
| 19 | + * Place, Suite 330, Boston, MA, 02111-1307, USA | |
| 20 | + * | |
| 21 | + * Este programa está nomeado como - 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 | + #include "private.h" | |
| 31 | + | |
| 32 | +/*--[ Implement ]------------------------------------------------------------------------------------*/ | |
| 33 | + | |
| 34 | + static DWORD set(std::function<void(TN3270::Host &)> worker) noexcept { | |
| 35 | + | |
| 36 | + try { | |
| 37 | + | |
| 38 | + TN3270::Host &host = getSession(); | |
| 39 | + | |
| 40 | + if(!host.isConnected()) | |
| 41 | + return HLLAPI_STATUS_DISCONNECTED; | |
| 42 | + | |
| 43 | + worker(host); | |
| 44 | + | |
| 45 | + return HLLAPI_STATUS_SUCCESS; | |
| 46 | + | |
| 47 | + } catch(const std::exception &e) { | |
| 48 | + | |
| 49 | + hllapi_lasterror = e.what(); | |
| 50 | + | |
| 51 | + } catch(...) { | |
| 52 | + | |
| 53 | + hllapi_lasterror = "Unexpected error"; | |
| 54 | + | |
| 55 | + } | |
| 56 | + | |
| 57 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 58 | + | |
| 59 | + } | |
| 60 | + | |
| 61 | + HLLAPI_API_CALL hllapi_set_cursor_address(WORD pos) { | |
| 62 | + | |
| 63 | + return set([pos](TN3270::Host &host) { | |
| 64 | + host.setCursor((unsigned short) pos -1); | |
| 65 | + }); | |
| 66 | + | |
| 67 | + | |
| 68 | + } | |
| 69 | + | |
| 70 | + HLLAPI_API_CALL hllapi_setcursor(WORD pos) { | |
| 71 | + | |
| 72 | + return set([pos](TN3270::Host &host) { | |
| 73 | + host.setCursor((unsigned short) pos -1); | |
| 74 | + }); | |
| 75 | + | |
| 76 | + } | |
| 77 | + | |
| 78 | + HLLAPI_API_CALL hllapi_set_cursor_position(WORD row, WORD col) { | |
| 79 | + | |
| 80 | + return set([row,col](TN3270::Host &host) { | |
| 81 | + host.setCursor((unsigned short) row, (unsigned short) col); | |
| 82 | + }); | |
| 83 | + | |
| 84 | + } | |
| 85 | + | |
| 86 | + HLLAPI_API_CALL hllapi_get_cursor_address() { | |
| 87 | + | |
| 88 | + try { | |
| 89 | + | |
| 90 | + TN3270::Host &host = getSession(); | |
| 91 | + | |
| 92 | + if(!host.isConnected()) | |
| 93 | + return 0; | |
| 94 | + | |
| 95 | + return (DWORD) (host.getCursorAddress()+1); | |
| 96 | + | |
| 97 | + } catch(std::exception &e) { | |
| 98 | + | |
| 99 | + hllapi_lasterror = e.what(); | |
| 100 | + return -1; | |
| 101 | + | |
| 102 | + } | |
| 103 | + | |
| 104 | + return -1; | |
| 105 | + } | |
| 106 | + | |
| 107 | + HLLAPI_API_CALL hllapi_getcursor() { | |
| 108 | + return hllapi_get_cursor_address(); | |
| 109 | + } | |
| 110 | + | ... | ... |
| ... | ... | @@ -0,0 +1,188 @@ |
| 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. | |
| 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., 59 Temple | |
| 19 | + * Place, Suite 330, Boston, MA, 02111-1307, USA | |
| 20 | + * | |
| 21 | + * Este programa está nomeado como - 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 | + #include "private.h" | |
| 31 | + | |
| 32 | +/*--[ Implement ]------------------------------------------------------------------------------------*/ | |
| 33 | + | |
| 34 | + static DWORD get(std::function<void(TN3270::Host &)> worker) noexcept { | |
| 35 | + | |
| 36 | + try { | |
| 37 | + | |
| 38 | + TN3270::Host &host = getSession(); | |
| 39 | + | |
| 40 | + host.waitForReady(); | |
| 41 | + worker(host); | |
| 42 | + | |
| 43 | + } catch(const std::system_error &e) { | |
| 44 | + | |
| 45 | + return hllapi_translate_error(e); | |
| 46 | + | |
| 47 | + } catch(std::exception &e) { | |
| 48 | + | |
| 49 | + hllapi_lasterror = e.what(); | |
| 50 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 51 | + | |
| 52 | + } catch(...) { | |
| 53 | + | |
| 54 | + hllapi_lasterror = "Unexpected error"; | |
| 55 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 56 | + | |
| 57 | + } | |
| 58 | + | |
| 59 | + return HLLAPI_STATUS_SUCCESS; | |
| 60 | + | |
| 61 | + } | |
| 62 | + | |
| 63 | + HLLAPI_API_CALL hllapi_get_screen_at(WORD row, WORD col, LPSTR buffer) { | |
| 64 | + | |
| 65 | + if(!(buffer && *buffer)) | |
| 66 | + return HLLAPI_STATUS_BAD_PARAMETER; | |
| 67 | + | |
| 68 | + return get([row,col,buffer](TN3270::Host &host) { | |
| 69 | + | |
| 70 | + size_t length = strlen(buffer); | |
| 71 | + string contents = host.toString( (unsigned int) row, (unsigned int) col, (int) length); | |
| 72 | + | |
| 73 | + strncpy((char *) buffer, contents.c_str(), std::min(length,contents.size())); | |
| 74 | + | |
| 75 | + }); | |
| 76 | + | |
| 77 | + /* | |
| 78 | + try { | |
| 79 | + | |
| 80 | + TN3270::Host &host = getSession(); | |
| 81 | + | |
| 82 | + if(!host.isConnected()) | |
| 83 | + return HLLAPI_STATUS_DISCONNECTED; | |
| 84 | + | |
| 85 | + if(!(buffer && *buffer)) | |
| 86 | + return HLLAPI_STATUS_BAD_PARAMETER; | |
| 87 | + | |
| 88 | + size_t length = strlen(buffer); | |
| 89 | + string contents = host.toString( (int) row, (int) col, length); | |
| 90 | + | |
| 91 | + strncpy((char *) buffer, contents.c_str(), std::min(length,contents.size())); | |
| 92 | + | |
| 93 | + } catch(std::exception &e) { | |
| 94 | + | |
| 95 | + hllapi_lasterror = e.what(); | |
| 96 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 97 | + | |
| 98 | + } | |
| 99 | + | |
| 100 | + return HLLAPI_STATUS_SUCCESS; | |
| 101 | + */ | |
| 102 | + | |
| 103 | + } | |
| 104 | + | |
| 105 | + HLLAPI_API_CALL hllapi_get_screen(WORD offset, LPSTR buffer, WORD len) { | |
| 106 | + | |
| 107 | + if(!(buffer && *buffer)) | |
| 108 | + return HLLAPI_STATUS_BAD_PARAMETER; | |
| 109 | + | |
| 110 | + if(len == 0) | |
| 111 | + return HLLAPI_STATUS_BAD_PARAMETER; | |
| 112 | + | |
| 113 | + return get([offset,buffer,len](TN3270::Host &host) { | |
| 114 | + | |
| 115 | + string contents = host.toString((int) offset, (int) len); | |
| 116 | + | |
| 117 | + memset(buffer,' ',len); | |
| 118 | + strncpy((char *) buffer, contents.c_str(), std::min((size_t) len,contents.size())); | |
| 119 | + | |
| 120 | + }); | |
| 121 | + | |
| 122 | + | |
| 123 | + /* | |
| 124 | + try { | |
| 125 | + | |
| 126 | + TN3270::Host &host = getSession(); | |
| 127 | + | |
| 128 | + if(!host.isConnected()) | |
| 129 | + return HLLAPI_STATUS_DISCONNECTED; | |
| 130 | + | |
| 131 | + if(!(buffer && *buffer)) | |
| 132 | + return HLLAPI_STATUS_BAD_PARAMETER; | |
| 133 | + | |
| 134 | + if(len == 0) | |
| 135 | + return HLLAPI_STATUS_BAD_PARAMETER; | |
| 136 | + | |
| 137 | + string contents = host.toString((int) offset, (size_t) len); | |
| 138 | + | |
| 139 | + memset(buffer,' ',len); | |
| 140 | + strncpy((char *) buffer, contents.c_str(), std::min((size_t) len,contents.size())); | |
| 141 | + | |
| 142 | + } catch(std::exception &e) { | |
| 143 | + | |
| 144 | + hllapi_lasterror = e.what(); | |
| 145 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 146 | + | |
| 147 | + } | |
| 148 | + | |
| 149 | + return HLLAPI_STATUS_SUCCESS; | |
| 150 | + */ | |
| 151 | + | |
| 152 | + } | |
| 153 | + | |
| 154 | + HLLAPI_API_CALL hllapi_get_lu_name(LPSTR buffer, WORD len) { | |
| 155 | + | |
| 156 | + if(!(buffer && *buffer)) | |
| 157 | + return HLLAPI_STATUS_BAD_PARAMETER; | |
| 158 | + | |
| 159 | + if(len == 0) | |
| 160 | + return HLLAPI_STATUS_BAD_PARAMETER; | |
| 161 | + | |
| 162 | + return get([buffer,len](TN3270::Host &host) { | |
| 163 | + | |
| 164 | + string luname = host.getLUName(); | |
| 165 | + memset(buffer,' ',len); | |
| 166 | + strncpy((char *) buffer, luname.c_str(), std::min((size_t) len,luname.size())); | |
| 167 | + | |
| 168 | + }); | |
| 169 | + | |
| 170 | + } | |
| 171 | + | |
| 172 | + | |
| 173 | + /* | |
| 174 | + char * hllapi_get_string(int offset, size_t len) | |
| 175 | + { | |
| 176 | + try | |
| 177 | + { | |
| 178 | + string str = session::get_default()->get_string(offset-1,len); | |
| 179 | + char * ret = strdup(str.c_str()); | |
| 180 | + return ret; | |
| 181 | + } | |
| 182 | + catch(std::exception &e) | |
| 183 | + { | |
| 184 | + } | |
| 185 | + | |
| 186 | + return NULL; | |
| 187 | + } | |
| 188 | + */ | ... | ... |
| ... | ... | @@ -0,0 +1,477 @@ |
| 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. | |
| 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., 59 Temple | |
| 19 | + * Place, Suite 330, Boston, MA, 02111-1307, USA | |
| 20 | + * | |
| 21 | + * Este programa está nomeado como hllapi.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 | + #include "private.h" | |
| 31 | + #include <lib3270/hllapi.h> | |
| 32 | + | |
| 33 | + /*--[ Prototipes ]-----------------------------------------------------------------------------------*/ | |
| 34 | + | |
| 35 | + static int connect_ps(char *buffer, unsigned short *length, unsigned short *rc); | |
| 36 | + static int disconnect_ps(char *buffer, unsigned short *length, unsigned short *rc); | |
| 37 | + static int get_library_revision(char *buffer, unsigned short *length, unsigned short *rc); | |
| 38 | + static int copy_ps_to_str(char *buffer, unsigned short *length, unsigned short *rc); | |
| 39 | + static int copy_str_to_ps(char *buffer, unsigned short *length, unsigned short *rc); | |
| 40 | + static int search_ps(char *buffer, unsigned short *length, unsigned short *rc); | |
| 41 | + static int copy_ps(char *buffer, unsigned short *length, unsigned short *rc); | |
| 42 | + static int wait_system(char *buffer, unsigned short *length, unsigned short *rc); | |
| 43 | + static int reset_system(char *buffer, unsigned short *length, unsigned short *rc); | |
| 44 | + static int pause_system(char *buffer, unsigned short *length, unsigned short *rc); | |
| 45 | + static int set_session_parameters(char *buffer, unsigned short *length, unsigned short *rc); | |
| 46 | + | |
| 47 | + static int get_cursor_position(char *buffer, unsigned short *length, unsigned short *rc); | |
| 48 | + static int set_cursor_position(char *buffer, unsigned short *length, unsigned short *rc); | |
| 49 | + static int input_string(char *buffer, unsigned short *length, unsigned short *rc); | |
| 50 | + | |
| 51 | + static int invalid_request(char *buffer, unsigned short *length, unsigned short *rc); | |
| 52 | + | |
| 53 | +/*--[ Globals ]--------------------------------------------------------------------------------------*/ | |
| 54 | + | |
| 55 | + static const struct _hllapi_call | |
| 56 | + { | |
| 57 | + unsigned long func; | |
| 58 | + int (*exec)(char *buffer, unsigned short *length, unsigned short *rc); | |
| 59 | + } hllapi_call[] = | |
| 60 | + { | |
| 61 | + { HLLAPI_CMD_CONNECTPS, connect_ps }, | |
| 62 | + { HLLAPI_CMD_DISCONNECTPS, disconnect_ps }, | |
| 63 | + { HLLAPI_CMD_GETREVISION, get_library_revision }, | |
| 64 | + { HLLAPI_CMD_QUERYCURSOR, get_cursor_position }, | |
| 65 | + { HLLAPI_CMD_SETCURSOR, set_cursor_position }, | |
| 66 | + { HLLAPI_CMD_COPYPSTOSTR, copy_ps_to_str }, | |
| 67 | + { HLLAPI_CMD_INPUTSTRING, input_string }, | |
| 68 | + { HLLAPI_CMD_WAIT, wait_system }, | |
| 69 | + { HLLAPI_CMD_COPYPS, copy_ps }, | |
| 70 | + { HLLAPI_CMD_SEARCHPS, search_ps }, | |
| 71 | + { HLLAPI_CMD_COPYSTRTOPS, copy_str_to_ps }, | |
| 72 | + { HLLAPI_CMD_SENDFILE, invalid_request }, | |
| 73 | + { HLLAPI_CMD_RECEIVEFILE, invalid_request }, | |
| 74 | + { HLLAPI_RESET_SYSTEM, reset_system }, | |
| 75 | + { HLLAPI_CMD_PAUSE, pause_system }, | |
| 76 | + { HLLAPI_SET_SESSION_PARAMETERS, set_session_parameters } | |
| 77 | + | |
| 78 | + }; | |
| 79 | + | |
| 80 | + static enum _pause_mode | |
| 81 | + { | |
| 82 | + PAUSE_MODE_IPAUSE, ///< @brief Interruptible pause. After the Start Host Notification (23) function is executed, a host event satisfies a pause. | |
| 83 | + PAUSE_MODE_FPAUSE ///< @brief A full-duration pause lasts for however long you specified in the Pause (18) function. | |
| 84 | + } pause_mode = PAUSE_MODE_IPAUSE; | |
| 85 | + | |
| 86 | +/*--[ Implement ]------------------------------------------------------------------------------------*/ | |
| 87 | + | |
| 88 | +HLLAPI_API_CALL hllapi(const LPWORD func, LPSTR buffer, LPWORD length, LPWORD rc) { | |
| 89 | + | |
| 90 | + for(unsigned int f=0;f < (sizeof (hllapi_call) / sizeof ((hllapi_call)[0]));f++) { | |
| 91 | + | |
| 92 | + if(hllapi_call[f].func == *func) { | |
| 93 | + | |
| 94 | + try { | |
| 95 | + | |
| 96 | + return hllapi_call[f].exec(buffer,length,rc); | |
| 97 | + | |
| 98 | + } catch(std::exception &e) { | |
| 99 | + | |
| 100 | + hllapi_lasterror = e.what(); | |
| 101 | + *rc = HLLAPI_STATUS_SYSTEM_ERROR; | |
| 102 | + return *rc; | |
| 103 | + | |
| 104 | + } | |
| 105 | + | |
| 106 | + } | |
| 107 | + | |
| 108 | + } | |
| 109 | + | |
| 110 | + trace("hllapi(%d) failed",*func); | |
| 111 | + | |
| 112 | + *rc = HLLAPI_STATUS_UNSUPPORTED; | |
| 113 | + return *rc; | |
| 114 | + | |
| 115 | +} | |
| 116 | + | |
| 117 | +static int invalid_request(char *buffer, unsigned short *length, unsigned short *rc) { | |
| 118 | + *rc = HLLAPI_STATUS_BAD_PARAMETER; | |
| 119 | + return *rc; | |
| 120 | +} | |
| 121 | + | |
| 122 | +static int connect_ps(char *buffer, unsigned short *length, unsigned short *rc) { | |
| 123 | + | |
| 124 | + char *tempbuffer = NULL; | |
| 125 | + | |
| 126 | + trace("%s: len=%d buflen=%d",__FUNCTION__,*length,(int) strlen(buffer)); | |
| 127 | + | |
| 128 | + if(strlen(buffer) > *length) | |
| 129 | + buffer[*length] = 0; | |
| 130 | + | |
| 131 | + if(!strrchr(buffer,':')) | |
| 132 | + { | |
| 133 | + int sz = strlen(buffer); | |
| 134 | + | |
| 135 | + tempbuffer = (char *) malloc(sz+2); | |
| 136 | + strcpy(tempbuffer,buffer); | |
| 137 | + tempbuffer[sz-1] = ':'; | |
| 138 | + tempbuffer[sz] = buffer[sz-1]; | |
| 139 | + tempbuffer[sz+1] = 0; | |
| 140 | + buffer = tempbuffer; | |
| 141 | + } | |
| 142 | + | |
| 143 | + *rc = hllapi_init(buffer); | |
| 144 | + | |
| 145 | + if(tempbuffer) | |
| 146 | + free(tempbuffer); | |
| 147 | + | |
| 148 | + return HLLAPI_STATUS_SUCCESS; | |
| 149 | + | |
| 150 | +} | |
| 151 | + | |
| 152 | +static int disconnect_ps(char *buffer, unsigned short *length, unsigned short *rc) { | |
| 153 | + *rc = hllapi_deinit(); | |
| 154 | + return HLLAPI_STATUS_SUCCESS; | |
| 155 | +} | |
| 156 | + | |
| 157 | +static int get_library_revision(char *buffer, unsigned short *length, unsigned short *rc) { | |
| 158 | + *rc = hllapi_get_revision(); | |
| 159 | + return HLLAPI_STATUS_SUCCESS; | |
| 160 | +} | |
| 161 | + | |
| 162 | +static int get_cursor_position(char *buffer, unsigned short *length, unsigned short *rc) { | |
| 163 | + | |
| 164 | + try { | |
| 165 | + | |
| 166 | + TN3270::Host &host = getSession(); | |
| 167 | + | |
| 168 | + if(!host.isConnected()) | |
| 169 | + return HLLAPI_STATUS_DISCONNECTED; | |
| 170 | + | |
| 171 | + *rc = (unsigned short) (host.getCursorAddress()+1); | |
| 172 | + | |
| 173 | + } catch(std::exception &e) { | |
| 174 | + | |
| 175 | + hllapi_lasterror = e.what(); | |
| 176 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 177 | + | |
| 178 | + } | |
| 179 | + | |
| 180 | + return HLLAPI_STATUS_SUCCESS; | |
| 181 | + | |
| 182 | +} | |
| 183 | + | |
| 184 | +static int set_cursor_position(char *buffer, unsigned short *length, unsigned short *rc) { | |
| 185 | + | |
| 186 | + try { | |
| 187 | + | |
| 188 | + TN3270::Host &host = getSession(); | |
| 189 | + | |
| 190 | + if(!host.isConnected()) | |
| 191 | + return HLLAPI_STATUS_DISCONNECTED; | |
| 192 | + | |
| 193 | + host.setCursor((unsigned short) *rc -1); | |
| 194 | + | |
| 195 | + return HLLAPI_STATUS_SUCCESS; | |
| 196 | + | |
| 197 | + } catch(std::exception &e) { | |
| 198 | + | |
| 199 | + hllapi_lasterror = e.what(); | |
| 200 | + | |
| 201 | + } | |
| 202 | + | |
| 203 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 204 | + | |
| 205 | +} | |
| 206 | + | |
| 207 | +static int copy_ps_to_str(char *buffer, unsigned short *length, unsigned short *rc) { | |
| 208 | + | |
| 209 | + // Length Length of the target data string. | |
| 210 | + // PS Position Position within the host presentation space of the first byte in your target data string. | |
| 211 | + *rc = hllapi_get_screen(*rc,buffer,*length); | |
| 212 | + | |
| 213 | + return HLLAPI_STATUS_SUCCESS; | |
| 214 | +} | |
| 215 | + | |
| 216 | +static int input_string(char *buffer, unsigned short *length, unsigned short *rc) { | |
| 217 | + *rc = hllapi_input_string(buffer,*length); | |
| 218 | + return HLLAPI_STATUS_SUCCESS; | |
| 219 | +} | |
| 220 | + | |
| 221 | +static int search_ps(char *buffer, unsigned short *length, unsigned short *ps) { | |
| 222 | + | |
| 223 | + // | |
| 224 | + // Data String Target string for search. | |
| 225 | + // Length Length of the target data string. Overridden in EOT mode. | |
| 226 | + // | |
| 227 | + // PS Position Position within the host presentation space where the search is to begin (SRCHFRWD option) or to end | |
| 228 | + // (SRCHBKWD option). Overridden in SRCHALL (default) mode. | |
| 229 | + // | |
| 230 | + // Return in *ps: | |
| 231 | + // | |
| 232 | + // = 0 The string was not found. | |
| 233 | + // > 0 The string was found at the indicated host presentation space position. | |
| 234 | + // | |
| 235 | + // Return code: | |
| 236 | + // | |
| 237 | + // 0 HLLAPI_STATUS_SUCCESS The Search Presentation Space function was successful. | |
| 238 | + // 1 HLLAPI_STATUS_DISCONNECTED Your program is not connected to a host session. | |
| 239 | + // 2 HLLAPI_STATUS_BAD_PARAMETER An error was made in specifying parameters. | |
| 240 | + // 7 HLLAPI_STATUS_BAD_POSITION The host presentation space position is not valid. | |
| 241 | + // 9 HLLAPI_STATUS_SYSTEM_ERROR A system error was encountered. | |
| 242 | + // 24 HLLAPI_STATUS_NOT_FOUND The search string was not found. | |
| 243 | + // | |
| 244 | + // | |
| 245 | + | |
| 246 | + try { | |
| 247 | + | |
| 248 | + size_t pos = string::npos; | |
| 249 | + | |
| 250 | + if(length > 0) { | |
| 251 | + | |
| 252 | + pos = getSession().find(string((const char *) buffer,(size_t) length).c_str()); | |
| 253 | + | |
| 254 | + } else { | |
| 255 | + | |
| 256 | + pos = getSession().find(buffer); | |
| 257 | + | |
| 258 | + } | |
| 259 | + | |
| 260 | + if(pos == string::npos) { | |
| 261 | + *ps = 0; | |
| 262 | + return HLLAPI_STATUS_NOT_FOUND; | |
| 263 | + } | |
| 264 | + | |
| 265 | + *ps = pos; | |
| 266 | + | |
| 267 | + return HLLAPI_STATUS_SUCCESS; | |
| 268 | + | |
| 269 | + } catch(const std::system_error &e) { | |
| 270 | + | |
| 271 | + return hllapi_translate_error(e); | |
| 272 | + | |
| 273 | + } catch(std::exception &e) { | |
| 274 | + | |
| 275 | + hllapi_lasterror = e.what(); | |
| 276 | + | |
| 277 | + } | |
| 278 | + | |
| 279 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 280 | + | |
| 281 | +} | |
| 282 | + | |
| 283 | +static int copy_ps(char *buffer, unsigned short *length, unsigned short *rc) { | |
| 284 | + | |
| 285 | + // | |
| 286 | + // Data String Preallocated target string the size of your host presentation space. This can vary depending on how your host presentation space | |
| 287 | + // is configured. When the Set Session Parameters (9) function with the EAB option is issued, the length of the data string must be | |
| 288 | + // at least twice the length of the presentation space. | |
| 289 | + // DBCS Only: When the EAD option is specified, the length of the data string must be at least three times the length of the | |
| 290 | + // presentation space. When both the EAB and EAD options are specified, the length of the data string must be at least four times | |
| 291 | + // the length of the presentation space. | |
| 292 | + // | |
| 293 | + // Length NA (the length of the host presentation space is implied). | |
| 294 | + // PS Position NA. | |
| 295 | + // | |
| 296 | + // Return values: | |
| 297 | + // | |
| 298 | + // 0 HLLAPI_STATUS_SUCCESS The host presentation space contents were copied to the application program. The target presentation space was active, and the keyboard was unlocked. | |
| 299 | + // 1 HLLAPI_STATUS_DISCONNECTED Your program is not connected to a host session. | |
| 300 | + // 4 HLLAPI_STATUS_TIMEOUT The host presentation space contents were copied. The connected host presentation space was waiting for host response. | |
| 301 | + // 5 HLLAPI_STATUS_KEYBOARD_LOCKED The host presentation space was copied. The keyboard was locked. | |
| 302 | + // 9 HLLAPI_STATUS_SYSTEM_ERROR A system error was encountered. | |
| 303 | + // | |
| 304 | + // | |
| 305 | + try { | |
| 306 | + | |
| 307 | + TN3270::Host &host = getSession(); | |
| 308 | + | |
| 309 | + if(!host.isConnected()) | |
| 310 | + return HLLAPI_STATUS_DISCONNECTED; | |
| 311 | + | |
| 312 | + string contents = host.toString(0,-1,'\0'); | |
| 313 | + | |
| 314 | + size_t szBuffer = std::min(contents.size(), ((size_t) *length)); | |
| 315 | + *length = (unsigned short) szBuffer; | |
| 316 | + | |
| 317 | + strncpy(buffer,contents.c_str(),szBuffer); | |
| 318 | + | |
| 319 | + return hllapi_get_state(); | |
| 320 | + | |
| 321 | + } catch(std::exception &e) { | |
| 322 | + | |
| 323 | + hllapi_lasterror = e.what(); | |
| 324 | + | |
| 325 | + } | |
| 326 | + | |
| 327 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 328 | + | |
| 329 | + /* | |
| 330 | + | |
| 331 | + size_t szBuffer = strlen(buffer); | |
| 332 | + char * text; | |
| 333 | + | |
| 334 | + if(!hllapi_is_connected()) | |
| 335 | + return HLLAPI_STATUS_DISCONNECTED; | |
| 336 | + | |
| 337 | + text = hllapi_get_string(1, szBuffer); | |
| 338 | + | |
| 339 | + if(!text) | |
| 340 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 341 | + | |
| 342 | + memcpy(buffer,text,szBuffer); | |
| 343 | + | |
| 344 | + hllapi_free(text); | |
| 345 | + | |
| 346 | + return hllapi_get_state(); | |
| 347 | + | |
| 348 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 349 | + | |
| 350 | + */ | |
| 351 | + | |
| 352 | +} | |
| 353 | + | |
| 354 | +static int wait_system(char *buffer, unsigned short *length, unsigned short *rc) { | |
| 355 | + | |
| 356 | + // | |
| 357 | + // Checks the status of the host-connected presentation space. If the session is | |
| 358 | + // waiting for a host response (indicated by XCLOCK (X []) or XSYSTEM), the Wait | |
| 359 | + // function causes HLLAPI to wait up to 1 minute to see if the condition clears. | |
| 360 | + // | |
| 361 | + // | |
| 362 | + | |
| 363 | + // | |
| 364 | + // Return Code Definition | |
| 365 | + // | |
| 366 | + // HLLAPI_STATUS_SUCCESS 0 The keyboard is unlocked and ready for input. | |
| 367 | + // HLLAPI_STATUS_DISCONNECTED 1 Your application program is not connected to a valid session. | |
| 368 | + // HLLAPI_STATUS_TIMEOUT 4 Timeout while still in XCLOCK (X []) or XSYSTEM. | |
| 369 | + // HLLAPI_STATUS_KEYBOARD_LOCKED 5 The keyboard is locked. | |
| 370 | + // HLLAPI_STATUS_SYSTEM_ERROR 9 A system error was encountered. | |
| 371 | + // | |
| 372 | + // | |
| 373 | + | |
| 374 | + int state = hllapi_wait_for_ready(60); | |
| 375 | + return (state == HLLAPI_STATUS_WAITING ? HLLAPI_STATUS_TIMEOUT : state); | |
| 376 | + | |
| 377 | +} | |
| 378 | + | |
| 379 | +static int copy_str_to_ps(char *text, unsigned short *length, unsigned short *ps) { | |
| 380 | + // | |
| 381 | + // Call Parameters | |
| 382 | + // | |
| 383 | + // Data String of ASCII data to be copied into the host presentation space. | |
| 384 | + // Length Length, in number of bytes, of the source data string. Overridden if in EOT mode. | |
| 385 | + // PS Position in the host presentation space to begin the copy, a value between 1 and the configured size of your host presentation space. | |
| 386 | + // | |
| 387 | + // Return Parameters | |
| 388 | + // | |
| 389 | + // HLLAPI_STATUS_SUCCESS 0 The Copy String to Presentation Space function was successful. | |
| 390 | + // HLLAPI_STATUS_DISCONNECTED 1 Your program is not connected to a host session. | |
| 391 | + // HLLAPI_STATUS_BAD_PARAMETER 2 Parameter error or zero length for copy. | |
| 392 | + // HLLAPI_STATUS_KEYBOARD_LOCKED 5 The target presentation space is protected or inhibited, or incorrect data was sent to the target presentation space (such as a field attribute byte). | |
| 393 | + // 6 The copy was completed, but the data was truncated. | |
| 394 | + // 7 The host presentation space position is not valid. | |
| 395 | + // HLLAPI_STATUS_SYSTEM_ERROR 9 A system error was encountered. | |
| 396 | + // | |
| 397 | + // | |
| 398 | + *ps = 0; | |
| 399 | + return hllapi_emulate_input(text,*length,0); | |
| 400 | +} | |
| 401 | + | |
| 402 | +static int reset_system(char *buffer, unsigned short *length, unsigned short *rc) { | |
| 403 | + return hllapi_kybdreset(); | |
| 404 | +} | |
| 405 | + | |
| 406 | + | |
| 407 | +static int pause_system(char *buffer, unsigned short *length, unsigned short *rc) { | |
| 408 | + | |
| 409 | + if(!*length) | |
| 410 | + { | |
| 411 | + // If you use the IPAUSE option and the pause value is zero, then the function | |
| 412 | + // waits up to 2400 half-second intervals, unless interrupted sooner. If you use the | |
| 413 | + // FPAUSE option and the pause value is zero, then the function returns | |
| 414 | + // immediately. | |
| 415 | + | |
| 416 | + if(pause_mode == PAUSE_MODE_FPAUSE) | |
| 417 | + { | |
| 418 | + return HLLAPI_STATUS_SUCCESS; | |
| 419 | + } | |
| 420 | + return hllapi_wait_for_ready(1200); | |
| 421 | + } | |
| 422 | + | |
| 423 | + if(pause_mode == PAUSE_MODE_FPAUSE) | |
| 424 | + { | |
| 425 | + // Pause fixo - Aguarda pelo tempo informado, independente de eventos. | |
| 426 | + return hllapi_wait( (*length) / 2); | |
| 427 | + } | |
| 428 | + | |
| 429 | + // Pause "flexivel", aguarda mudança no conteúdo da tela!!! | |
| 430 | + return hllapi_wait_for_change((*length) / 2); | |
| 431 | + | |
| 432 | +} | |
| 433 | + | |
| 434 | +static int set_session_parameters(char *buffer, unsigned short *length, unsigned short *rc) | |
| 435 | +{ | |
| 436 | + if(!(*length && buffer && *buffer)) | |
| 437 | + { | |
| 438 | + return HLLAPI_STATUS_BAD_PARAMETER; | |
| 439 | + } | |
| 440 | + | |
| 441 | + *rc = hllapi_set_session_parameter(buffer, *length, *rc); | |
| 442 | + | |
| 443 | + return HLLAPI_STATUS_SUCCESS; | |
| 444 | +} | |
| 445 | + | |
| 446 | +HLLAPI_API_CALL hllapi_set_session_parameter(LPSTR param, WORD len, WORD value) | |
| 447 | +{ | |
| 448 | + if(!param) | |
| 449 | + return HLLAPI_STATUS_BAD_PARAMETER; | |
| 450 | + | |
| 451 | + if(!len) | |
| 452 | + len = strlen(param); | |
| 453 | + | |
| 454 | + if(!strncasecmp(param,"IPAUSE",len)) { | |
| 455 | + | |
| 456 | + // IPAUSE | |
| 457 | + pause_mode = PAUSE_MODE_IPAUSE; | |
| 458 | + | |
| 459 | + } else if(!strncasecmp(param,"FPAUSE",len)) { | |
| 460 | + | |
| 461 | + // FPAUSE | |
| 462 | + pause_mode = PAUSE_MODE_FPAUSE; | |
| 463 | + | |
| 464 | + } else if(!strncasecmp(param,"UNLOCKDELAY",len)) { | |
| 465 | + | |
| 466 | + // UNLOCKDELAY | |
| 467 | + hllapi_set_unlock_delay(value); | |
| 468 | + | |
| 469 | + } else { | |
| 470 | + | |
| 471 | + return HLLAPI_STATUS_BAD_PARAMETER; | |
| 472 | + | |
| 473 | + } | |
| 474 | + | |
| 475 | + return HLLAPI_STATUS_SUCCESS; | |
| 476 | +} | |
| 477 | + | ... | ... |
| ... | ... | @@ -0,0 +1,105 @@ |
| 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. | |
| 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., 59 Temple | |
| 19 | + * Place, Suite 330, Boston, MA, 02111-1307, USA | |
| 20 | + * | |
| 21 | + * Este programa está nomeado como - 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 | + #include "private.h" | |
| 31 | + | |
| 32 | +/*--[ Implement ]------------------------------------------------------------------------------------*/ | |
| 33 | + | |
| 34 | +static DWORD set(std::function<void(TN3270::Host &)> worker) noexcept { | |
| 35 | + | |
| 36 | + try { | |
| 37 | + | |
| 38 | + TN3270::Host &host = getSession(); | |
| 39 | + | |
| 40 | + if(!host.isConnected()) | |
| 41 | + return HLLAPI_STATUS_DISCONNECTED; | |
| 42 | + | |
| 43 | + host.waitForReady(); | |
| 44 | + | |
| 45 | + worker(host); | |
| 46 | + | |
| 47 | + } catch(const std::exception &e) { | |
| 48 | + | |
| 49 | + // Worker has failed! | |
| 50 | + hllapi_lasterror = e.what(); | |
| 51 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 52 | + | |
| 53 | + } catch(...) { | |
| 54 | + | |
| 55 | + // Unexpected error getting session or lock state | |
| 56 | + hllapi_lasterror = "Unexpected error"; | |
| 57 | + | |
| 58 | + } | |
| 59 | + | |
| 60 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 61 | + | |
| 62 | + } | |
| 63 | + | |
| 64 | + | |
| 65 | + HLLAPI_API_CALL hllapi_pfkey(WORD key) { | |
| 66 | + | |
| 67 | +#ifdef DEBUG | |
| 68 | + clog << __FUNCTION__ << "(" << key << ")" << endl; | |
| 69 | +#endif // DEBUG | |
| 70 | + | |
| 71 | + return set([key](TN3270::Host &host) { | |
| 72 | + | |
| 73 | + host.pfkey((unsigned short) key); | |
| 74 | + | |
| 75 | + }); | |
| 76 | + | |
| 77 | + | |
| 78 | + } | |
| 79 | + | |
| 80 | + HLLAPI_API_CALL hllapi_pakey(WORD key) { | |
| 81 | + | |
| 82 | + return set([key](TN3270::Host &host) { | |
| 83 | + | |
| 84 | + host.pakey((unsigned short) key); | |
| 85 | + | |
| 86 | + }); | |
| 87 | + | |
| 88 | + } | |
| 89 | + | |
| 90 | + HLLAPI_API_CALL hllapi_set_unlock_delay(WORD ms) { | |
| 91 | + | |
| 92 | + try { | |
| 93 | + | |
| 94 | + getSession().setUnlockDelay((unsigned short) ms); | |
| 95 | + return HLLAPI_STATUS_SUCCESS; | |
| 96 | + | |
| 97 | + } catch(std::exception &e) { | |
| 98 | + | |
| 99 | + hllapi_lasterror = e.what(); | |
| 100 | + | |
| 101 | + } | |
| 102 | + | |
| 103 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 104 | + } | |
| 105 | + | ... | ... |
| ... | ... | @@ -0,0 +1,60 @@ |
| 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. | |
| 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., 59 Temple | |
| 19 | + * Place, Suite 330, Boston, MA, 02111-1307, USA | |
| 20 | + * | |
| 21 | + * Este programa está nomeado como - 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 | +#ifndef PRIVATE_H_INCLUDED | |
| 31 | + | |
| 32 | + #define PRIVATE_H_INCLUDED 1 | |
| 33 | + | |
| 34 | + #include <exception> | |
| 35 | + #include <stdexcept> | |
| 36 | + #include <string> | |
| 37 | + #include <cerrno> | |
| 38 | + #include <cstring> | |
| 39 | + #include <iostream> | |
| 40 | + #include <system_error> | |
| 41 | + #include <lib3270/ipc.h> | |
| 42 | + #include <lib3270/log.h> | |
| 43 | + #include <lib3270/hllapi.h> | |
| 44 | + | |
| 45 | + using std::runtime_error; | |
| 46 | + using std::string; | |
| 47 | + using TN3270::Host; | |
| 48 | + using std::exception; | |
| 49 | + using std::clog; | |
| 50 | + using std::endl; | |
| 51 | + | |
| 52 | + extern TN3270_PRIVATE std::string hllapi_lasterror; | |
| 53 | + | |
| 54 | + TN3270_PRIVATE TN3270::Host & getSession(); | |
| 55 | + | |
| 56 | + TN3270_PRIVATE DWORD hllapi_translate_error(LIB3270_KEYBOARD_LOCK_STATE state); | |
| 57 | + TN3270_PRIVATE DWORD hllapi_translate_error(LIB3270_MESSAGE state); | |
| 58 | + TN3270_PRIVATE DWORD hllapi_translate_error(const std::system_error &error); | |
| 59 | + | |
| 60 | +#endif // PRIVATE_H_INCLUDED | ... | ... |
| ... | ... | @@ -0,0 +1,135 @@ |
| 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. | |
| 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., 59 Temple | |
| 19 | + * Place, Suite 330, Boston, MA, 02111-1307, USA | |
| 20 | + * | |
| 21 | + * Este programa está nomeado como - 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 | + #include "private.h" | |
| 31 | + #include <lib3270/keyboard.h> | |
| 32 | + | |
| 33 | + #include <string> | |
| 34 | + #include <functional> | |
| 35 | + | |
| 36 | + | |
| 37 | +/*--[ Implement ]------------------------------------------------------------------------------------*/ | |
| 38 | + | |
| 39 | + static DWORD set(std::function<void(TN3270::Host &)> worker) noexcept { | |
| 40 | + | |
| 41 | + LIB3270_KEYBOARD_LOCK_STATE kLock = LIB3270_KL_UNLOCKED; | |
| 42 | + | |
| 43 | + try { | |
| 44 | + | |
| 45 | + TN3270::Host &host = getSession(); | |
| 46 | + | |
| 47 | + kLock = host.waitForKeyboardUnlock(); | |
| 48 | + | |
| 49 | + if(kLock == LIB3270_KL_UNLOCKED) { | |
| 50 | + | |
| 51 | + try { | |
| 52 | + | |
| 53 | + worker(host); | |
| 54 | + return HLLAPI_STATUS_SUCCESS; | |
| 55 | + | |
| 56 | + } catch(const std::exception &e) { | |
| 57 | + | |
| 58 | + // Worker has failed! | |
| 59 | + | |
| 60 | + hllapi_lasterror = e.what(); | |
| 61 | + } | |
| 62 | + | |
| 63 | + // Failed! Get lock state. | |
| 64 | + kLock = host.getKeyboardLockState(); | |
| 65 | + | |
| 66 | + } | |
| 67 | + | |
| 68 | + } catch(const std::system_error &e) { | |
| 69 | + | |
| 70 | + return hllapi_translate_error(e); | |
| 71 | + | |
| 72 | + } catch(const std::exception &e) { | |
| 73 | + | |
| 74 | + // Error getting session or lock state | |
| 75 | + hllapi_lasterror = e.what(); | |
| 76 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 77 | + | |
| 78 | + } catch(...) { | |
| 79 | + | |
| 80 | + // Unexpected error getting session or lock state | |
| 81 | + hllapi_lasterror = "Unexpected error"; | |
| 82 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 83 | + | |
| 84 | + } | |
| 85 | + | |
| 86 | + return hllapi_translate_error(kLock); | |
| 87 | + | |
| 88 | + } | |
| 89 | + | |
| 90 | + HLLAPI_API_CALL hllapi_set_text_at(WORD row, WORD col, LPSTR text) { | |
| 91 | + | |
| 92 | + if(!(text && *text)) | |
| 93 | + return HLLAPI_STATUS_BAD_PARAMETER; | |
| 94 | + | |
| 95 | + return set([row,col,text](TN3270::Host &host) { | |
| 96 | + | |
| 97 | + host.push(row,col,(const char *) text); | |
| 98 | + | |
| 99 | + }); | |
| 100 | + | |
| 101 | + | |
| 102 | + } | |
| 103 | + | |
| 104 | + HLLAPI_API_CALL hllapi_input_string(LPSTR text, WORD length) | |
| 105 | + { | |
| 106 | + | |
| 107 | + if(!(text && *text)) | |
| 108 | + return HLLAPI_STATUS_BAD_PARAMETER; | |
| 109 | + | |
| 110 | + if(length < 1) | |
| 111 | + length = strlen(text); | |
| 112 | + | |
| 113 | + return set([text,length](TN3270::Host &host) { | |
| 114 | + | |
| 115 | + host.input((const char *) text, (int) length, '@'); | |
| 116 | + | |
| 117 | + }); | |
| 118 | + | |
| 119 | + } | |
| 120 | + | |
| 121 | + HLLAPI_API_CALL hllapi_emulate_input(const LPSTR text, WORD length, WORD pasting) | |
| 122 | + { | |
| 123 | + if(!(text && *text)) | |
| 124 | + return HLLAPI_STATUS_BAD_PARAMETER; | |
| 125 | + | |
| 126 | + if(!length) | |
| 127 | + length = strlen(text); | |
| 128 | + | |
| 129 | + return set([text,length](TN3270::Host &host) { | |
| 130 | + | |
| 131 | + host.input((const char *) text, (int) length, '@'); | |
| 132 | + | |
| 133 | + }); | |
| 134 | + | |
| 135 | + } | ... | ... |
| ... | ... | @@ -0,0 +1,132 @@ |
| 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. | |
| 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., 59 Temple | |
| 19 | + * Place, Suite 330, Boston, MA, 02111-1307, USA | |
| 20 | + * | |
| 21 | + * Este programa está nomeado como - 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 | + #include "private.h" | |
| 31 | + #include <errno.h> | |
| 32 | + | |
| 33 | +/*--[ Implement ]------------------------------------------------------------------------------------*/ | |
| 34 | + | |
| 35 | + HLLAPI_API_CALL hllapi_get_datadir(LPSTR datadir) { | |
| 36 | + | |
| 37 | + #ifdef _WIN32 | |
| 38 | + HKEY hKey = 0; | |
| 39 | + unsigned long datalen = strlen(datadir); | |
| 40 | + | |
| 41 | + *datadir = 0; | |
| 42 | + | |
| 43 | + if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\\pw3270",0,KEY_QUERY_VALUE,&hKey) == ERROR_SUCCESS) | |
| 44 | + { | |
| 45 | + unsigned long datatype; // #defined in winnt.h (predefined types 0-11) | |
| 46 | + if(RegQueryValueExA(hKey,"datadir",NULL,&datatype,(LPBYTE) datadir,&datalen) != ERROR_SUCCESS) | |
| 47 | + *datadir = 0; | |
| 48 | + RegCloseKey(hKey); | |
| 49 | + } | |
| 50 | +#endif // _WIN32 | |
| 51 | + | |
| 52 | + return *datadir; | |
| 53 | + } | |
| 54 | + | |
| 55 | + DWORD hllapi_translate_error(LIB3270_KEYBOARD_LOCK_STATE state) { | |
| 56 | + | |
| 57 | + // Is unlocked. | |
| 58 | + if(state == LIB3270_KL_UNLOCKED) | |
| 59 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 60 | + | |
| 61 | + // Is connected? | |
| 62 | + if((state & LIB3270_KL_NOT_CONNECTED) != 0) | |
| 63 | + return HLLAPI_STATUS_DISCONNECTED; | |
| 64 | + | |
| 65 | + if( (state & (LIB3270_KL_AWAITING_FIRST|LIB3270_KL_OIA_TWAIT)) != 0) | |
| 66 | + return HLLAPI_STATUS_WAITING; | |
| 67 | + | |
| 68 | + return HLLAPI_STATUS_KEYBOARD_LOCKED; | |
| 69 | + | |
| 70 | + } | |
| 71 | + | |
| 72 | + DWORD hllapi_translate_error(const std::system_error &error) { | |
| 73 | + | |
| 74 | + static const struct Translate { | |
| 75 | + int from; | |
| 76 | + HLLAPI_STATUS to; | |
| 77 | + } translate[] = { | |
| 78 | + { ENOTCONN, HLLAPI_STATUS_DISCONNECTED }, | |
| 79 | + { ECONNRESET, HLLAPI_STATUS_DISCONNECTED }, | |
| 80 | +#ifndef _WIN32 | |
| 81 | + { EHOSTDOWN, HLLAPI_STATUS_DISCONNECTED }, | |
| 82 | +#endif // !_WIN32 | |
| 83 | + { EINVAL, HLLAPI_STATUS_BAD_PARAMETER }, | |
| 84 | + { ETIMEDOUT, HLLAPI_STATUS_TIMEOUT }, | |
| 85 | + { EBUSY, HLLAPI_STATUS_TIMEOUT }, | |
| 86 | + { EPERM, HLLAPI_STATUS_KEYBOARD_LOCKED }, | |
| 87 | + { EROFS, HLLAPI_STATUS_KEYBOARD_LOCKED }, | |
| 88 | + { EOVERFLOW, HLLAPI_STATUS_BAD_POSITION }, | |
| 89 | + }; | |
| 90 | + | |
| 91 | + int value = error.code().value(); | |
| 92 | + | |
| 93 | + hllapi_lasterror = error.what(); | |
| 94 | + | |
| 95 | + hllapi_lasterror += " (rc="; | |
| 96 | + hllapi_lasterror += std::to_string(value); | |
| 97 | + hllapi_lasterror += ")"; | |
| 98 | + | |
| 99 | + for(size_t ix = 0; ix < (sizeof(translate)/sizeof(struct Translate)); ix++) { | |
| 100 | + | |
| 101 | + if(translate[ix].from == value) | |
| 102 | + return translate[ix].to; | |
| 103 | + | |
| 104 | + } | |
| 105 | + | |
| 106 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 107 | + | |
| 108 | + } | |
| 109 | + | |
| 110 | + DWORD hllapi_translate_error(LIB3270_MESSAGE state) { | |
| 111 | + | |
| 112 | + switch(state) { | |
| 113 | + case LIB3270_MESSAGE_NONE: | |
| 114 | + return HLLAPI_STATUS_SUCCESS; | |
| 115 | + | |
| 116 | + case LIB3270_MESSAGE_DISCONNECTED: | |
| 117 | + return HLLAPI_STATUS_DISCONNECTED; | |
| 118 | + | |
| 119 | + case LIB3270_MESSAGE_MINUS: | |
| 120 | + case LIB3270_MESSAGE_PROTECTED: | |
| 121 | + case LIB3270_MESSAGE_NUMERIC: | |
| 122 | + case LIB3270_MESSAGE_OVERFLOW: | |
| 123 | + case LIB3270_MESSAGE_INHIBIT: | |
| 124 | + case LIB3270_MESSAGE_KYBDLOCK: | |
| 125 | + return HLLAPI_STATUS_KEYBOARD_LOCKED; | |
| 126 | + | |
| 127 | + default: | |
| 128 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 129 | + } | |
| 130 | + | |
| 131 | + return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 132 | + } | ... | ... |
| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | +#include <windows.h> | |
| 2 | + | |
| 3 | +VS_VERSION_INFO VERSIONINFO | |
| 4 | +FILEVERSION @WIN32_FILE_VERSION@ | |
| 5 | +PRODUCTVERSION @PACKAGE_MAJOR_VERSION@,@PACKAGE_MINOR_VERSION@,@PACKAGE_MAJOR_RELEASE@,@PACKAGE_MINOR_RELEASE@ | |
| 6 | + | |
| 7 | +BEGIN | |
| 8 | + | |
| 9 | + BLOCK "StringFileInfo" | |
| 10 | + BEGIN | |
| 11 | + BLOCK "080904E4" | |
| 12 | + BEGIN | |
| 13 | + VALUE "FileDescription", "pw3270 HLLAPI Client Module\0" | |
| 14 | + VALUE "CompanyName", "Banco do Brasil S/A.\0" | |
| 15 | + VALUE "FileVersion", "@WIN32_VERSION@\0" | |
| 16 | + VALUE "LegalCopyright", "(C) 2017 Banco do Brasil S/A. All Rights Reserved\0" | |
| 17 | + VALUE "OriginalFilename", "hllapi@DLLEXT@\0" | |
| 18 | + VALUE "ProductName", "pw3270\0" | |
| 19 | + VALUE "ProductVersion", "@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@.@PACKAGE_MAJOR_RELEASE@.@PACKAGE_MINOR_RELEASE@\0" | |
| 20 | + END | |
| 21 | + END | |
| 22 | + | |
| 23 | + BLOCK "VarFileInfo" | |
| 24 | + BEGIN | |
| 25 | + VALUE "Translation", 0x809, 0x04E4 | |
| 26 | + END | |
| 27 | + | |
| 28 | +END | |
| 29 | + | ... | ... |
src/daemon/linux/daemon.c
| ... | ... | @@ -1,122 +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. | |
| 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 daemon.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 | - * licinio@bb.com.br (Licínio Luis Branco) | |
| 28 | - * kraucer@bb.com.br (Kraucer Fernandes Mazuco) | |
| 29 | - * | |
| 30 | - * Referencias: | |
| 31 | - * | |
| 32 | - * https://live.gnome.org/DBusGlibBindings | |
| 33 | - * | |
| 34 | - */ | |
| 35 | - | |
| 36 | -#include <glib.h> | |
| 37 | -#include <dbus/dbus.h> | |
| 38 | -#include <dbus/dbus-glib-lowlevel.h> | |
| 39 | -#include <dbus/dbus-glib.h> | |
| 40 | - | |
| 41 | -#include "daemon.h" | |
| 42 | -#include "dbus-glue.h" | |
| 43 | - | |
| 44 | -#define PW3270_DBUS_SERVICE_PATH "/br/com/bb/pw3270" | |
| 45 | -#define PW3270_DBUS_SERVICE "br.com.bb.pw3270" | |
| 46 | - | |
| 47 | - | |
| 48 | -/*---[ Globals ]---------------------------------------------------------------------------------*/ | |
| 49 | - | |
| 50 | - static DBusGConnection * connection = NULL; | |
| 51 | - static DBusGProxy * proxy = NULL; | |
| 52 | - static H3270 * hSession = NULL; | |
| 53 | - | |
| 54 | - GMainLoop * main_loop = NULL; | |
| 55 | - | |
| 56 | - | |
| 57 | -/*---[ Implement ]-------------------------------------------------------------------------------*/ | |
| 58 | - | |
| 59 | -static int initialize(void) | |
| 60 | -{ | |
| 61 | - GError * error = NULL; | |
| 62 | - guint result; | |
| 63 | - | |
| 64 | - connection = dbus_g_bus_get_private(DBUS_BUS_SESSION, g_main_context_default(), &error); | |
| 65 | - if(error) | |
| 66 | - { | |
| 67 | - g_message("Error \"%s\" getting session dbus",error->message); | |
| 68 | - g_error_free(error); | |
| 69 | - return -1; | |
| 70 | - } | |
| 71 | - | |
| 72 | - proxy = dbus_g_proxy_new_for_name(connection,DBUS_SERVICE_DBUS,DBUS_PATH_DBUS,DBUS_INTERFACE_DBUS); | |
| 73 | - | |
| 74 | - org_freedesktop_DBus_request_name(proxy, PW3270_DBUS_SERVICE, DBUS_NAME_FLAG_DO_NOT_QUEUE, &result, &error); | |
| 75 | - | |
| 76 | - pw3270_dbus_register_object(connection,proxy,PW3270_TYPE_DBUS,&dbus_glib_pw3270_dbus_object_info,PW3270_DBUS_SERVICE_PATH); | |
| 77 | - | |
| 78 | - return 0; | |
| 79 | -} | |
| 80 | - | |
| 81 | -static void loghandler(H3270 *session, const char *module, int rc, const char *fmt, va_list args) | |
| 82 | -{ | |
| 83 | - g_logv(module,rc ? G_LOG_LEVEL_WARNING : G_LOG_LEVEL_MESSAGE, fmt, args); | |
| 84 | -} | |
| 85 | - | |
| 86 | -int main(int numpar, char *param[]) | |
| 87 | -{ | |
| 88 | - g_type_init (); | |
| 89 | - | |
| 90 | - if (!g_thread_supported ()) | |
| 91 | - g_thread_init (NULL); | |
| 92 | - | |
| 93 | - dbus_g_thread_init (); | |
| 94 | - | |
| 95 | - lib3270_set_log_handler(loghandler); | |
| 96 | - pw3270_dbus_register_io_handlers(); | |
| 97 | - | |
| 98 | - hSession = lib3270_session_new(""); | |
| 99 | - | |
| 100 | - main_loop = g_main_loop_new (NULL, FALSE); | |
| 101 | - | |
| 102 | - if(initialize()) | |
| 103 | - return -1; | |
| 104 | - | |
| 105 | - g_main_loop_run(main_loop); | |
| 106 | - | |
| 107 | - lib3270_session_free(hSession); | |
| 108 | - | |
| 109 | - return 0; | |
| 110 | -} | |
| 111 | - | |
| 112 | -void pw3270_dbus_quit(PW3270Dbus *object, DBusGMethodInvocation *context) | |
| 113 | -{ | |
| 114 | - g_main_loop_quit(main_loop); | |
| 115 | - dbus_g_method_return(context,0); | |
| 116 | -} | |
| 117 | - | |
| 118 | -H3270 * pw3270_dbus_get_session_handle(PW3270Dbus *object) | |
| 119 | -{ | |
| 120 | - return hSession; | |
| 121 | -} | |
| 122 | - |
src/daemon/linux/iocallback.c
| ... | ... | @@ -1,361 +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. | |
| 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 iocallback.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 | - * licinio@bb.com.br (Licínio Luis Branco) | |
| 28 | - * kraucer@bb.com.br (Kraucer Fernandes Mazuco) | |
| 29 | - * | |
| 30 | - */ | |
| 31 | - | |
| 32 | -#if defined(_WIN32) /*[*/ | |
| 33 | - #include <windows.h> | |
| 34 | -#elif defined(__APPLE__) | |
| 35 | - #include <poll.h> | |
| 36 | - #include <string.h> | |
| 37 | -#else | |
| 38 | - #include <poll.h> | |
| 39 | - #include <string.h> | |
| 40 | -#endif /*]*/ | |
| 41 | - | |
| 42 | -#include <stdio.h> | |
| 43 | -#include <glib.h> | |
| 44 | -#include "daemon.h" | |
| 45 | - | |
| 46 | -static int static_CallAndWait(int(*callback)(H3270 *session, void *), H3270 *session, void *parm); | |
| 47 | -static void static_RemoveSource(void *id); | |
| 48 | - | |
| 49 | -static void * static_AddInput(int source, H3270 *session, void (*fn)(H3270 *session)); | |
| 50 | -static void * static_AddExcept(int source, H3270 *session, void (*fn)(H3270 *session)); | |
| 51 | - | |
| 52 | -static void * static_AddTimeOut(unsigned long interval_ms, H3270 *session, void (*proc)(H3270 *session)); | |
| 53 | -static void static_RemoveTimeOut(void * timer); | |
| 54 | -static int static_Sleep(H3270 *hSession, int seconds); | |
| 55 | -static int static_RunPendingEvents(H3270 *hSession, int wait); | |
| 56 | - | |
| 57 | -static gboolean IO_prepare(GSource *source, gint *timeout); | |
| 58 | -static gboolean IO_check(GSource *source); | |
| 59 | -static gboolean IO_dispatch(GSource *source, GSourceFunc callback, gpointer user_data); | |
| 60 | -static void IO_finalize(GSource *source); /* Can be NULL */ | |
| 61 | -static gboolean IO_closure(gpointer data); | |
| 62 | - | |
| 63 | -/*---[ Structs ]-------------------------------------------------------------------------------------------*/ | |
| 64 | - | |
| 65 | - typedef struct _IO_Source | |
| 66 | - { | |
| 67 | - GSource gsrc; | |
| 68 | - GPollFD poll; | |
| 69 | -#if defined(_WIN32) | |
| 70 | - HANDLE source; | |
| 71 | -#else | |
| 72 | - int source; | |
| 73 | -#endif // _WIN32 | |
| 74 | - void (*fn)(H3270 *session); | |
| 75 | - H3270 *session; | |
| 76 | - } IO_Source; | |
| 77 | - | |
| 78 | - typedef struct _timer | |
| 79 | - { | |
| 80 | - unsigned char remove; | |
| 81 | - void (*fn)(H3270 *session); | |
| 82 | - H3270 *session; | |
| 83 | - } TIMER; | |
| 84 | - | |
| 85 | - static GSourceFuncs IOSources = | |
| 86 | - { | |
| 87 | - IO_prepare, | |
| 88 | - IO_check, | |
| 89 | - IO_dispatch, | |
| 90 | - IO_finalize, | |
| 91 | - IO_closure, | |
| 92 | - NULL | |
| 93 | - }; | |
| 94 | - | |
| 95 | -/*---[ Implement ]-----------------------------------------------------------------------------------------*/ | |
| 96 | - | |
| 97 | -#ifdef _WIN32 | |
| 98 | -static void * AddSource(HANDLE source, H3270 *session, gushort events, void (*fn)(H3270 *session)) | |
| 99 | -#else | |
| 100 | -static void * AddSource(int source, H3270 *session, gushort events, void (*fn)(H3270 *session)) | |
| 101 | -#endif // _WIN32 | |
| 102 | -{ | |
| 103 | - IO_Source *src = (IO_Source *) g_source_new(&IOSources,sizeof(IO_Source)); | |
| 104 | - | |
| 105 | - src->source = source; | |
| 106 | - src->fn = fn; | |
| 107 | - src->poll.fd = (int) source; | |
| 108 | - src->poll.events = events; | |
| 109 | - src->session = session; | |
| 110 | - | |
| 111 | - g_source_attach((GSource *) src,NULL); | |
| 112 | - g_source_add_poll((GSource *) src,&src->poll); | |
| 113 | - | |
| 114 | - return src; | |
| 115 | -} | |
| 116 | - | |
| 117 | -#ifdef _WIN32 | |
| 118 | -static void * static_AddInput(HANDLE source, H3270 *session, void (*fn)(H3270 *session)) | |
| 119 | -#else | |
| 120 | -static void * static_AddInput(int source, H3270 *session, void (*fn)(H3270 *session)) | |
| 121 | -#endif // _WIN32 | |
| 122 | -{ | |
| 123 | - return AddSource(source,session,G_IO_IN|G_IO_HUP|G_IO_ERR,fn); | |
| 124 | -} | |
| 125 | - | |
| 126 | -static void static_RemoveSource(void *id) | |
| 127 | -{ | |
| 128 | - if(id) | |
| 129 | - g_source_destroy((GSource *) id); | |
| 130 | -} | |
| 131 | - | |
| 132 | -#if defined(_WIN32) | |
| 133 | -static void * static_AddExcept(HANDLE source, H3270 *session, void (*fn)(H3270 *session)) | |
| 134 | -{ | |
| 135 | - return 0; | |
| 136 | -} | |
| 137 | -#else | |
| 138 | -static void * static_AddExcept(int source, H3270 *session, void (*fn)(H3270 *session)) | |
| 139 | -{ | |
| 140 | - return AddSource(source,session,G_IO_HUP|G_IO_ERR,fn); | |
| 141 | -} | |
| 142 | -#endif // _WIN32 | |
| 143 | - | |
| 144 | -static gboolean do_timer(TIMER *t) | |
| 145 | -{ | |
| 146 | - if(!t->remove) | |
| 147 | - t->fn(t->session); | |
| 148 | - return FALSE; | |
| 149 | -} | |
| 150 | - | |
| 151 | -static void * static_AddTimeOut(unsigned long interval, H3270 *session, void (*proc)(H3270 *session)) | |
| 152 | -{ | |
| 153 | - TIMER *t = g_malloc0(sizeof(TIMER)); | |
| 154 | - | |
| 155 | - t->fn = proc; | |
| 156 | - t->session = session; | |
| 157 | - | |
| 158 | - g_timeout_add_full(G_PRIORITY_DEFAULT, (guint) interval, (GSourceFunc) do_timer, t, g_free); | |
| 159 | - | |
| 160 | - return t; | |
| 161 | -} | |
| 162 | - | |
| 163 | -static void static_RemoveTimeOut(void * timer) | |
| 164 | -{ | |
| 165 | - ((TIMER *) timer)->remove++; | |
| 166 | -} | |
| 167 | - | |
| 168 | -static gboolean IO_prepare(GSource *source, gint *timeout) | |
| 169 | -{ | |
| 170 | - /* | |
| 171 | - * Called before all the file descriptors are polled. | |
| 172 | - * If the source can determine that it is ready here | |
| 173 | - * (without waiting for the results of the poll() call) | |
| 174 | - * it should return TRUE. | |
| 175 | - * | |
| 176 | - * It can also return a timeout_ value which should be the maximum | |
| 177 | - * timeout (in milliseconds) which should be passed to the poll() call. | |
| 178 | - * The actual timeout used will be -1 if all sources returned -1, | |
| 179 | - * or it will be the minimum of all the timeout_ values | |
| 180 | - * returned which were >= 0. | |
| 181 | - * | |
| 182 | - */ | |
| 183 | - return 0; | |
| 184 | -} | |
| 185 | - | |
| 186 | -static gboolean IO_check(GSource *source) | |
| 187 | -{ | |
| 188 | - /* | |
| 189 | - * Called after all the file descriptors are polled. | |
| 190 | - * The source should return TRUE if it is ready to be dispatched. | |
| 191 | - * Note that some time may have passed since the previous prepare | |
| 192 | - * function was called, so the source should be checked again here. | |
| 193 | - * | |
| 194 | - */ | |
| 195 | -#if defined(_WIN32) /*[*/ | |
| 196 | - | |
| 197 | - if(WaitForSingleObject(((IO_Source *) source)->source,0) == WAIT_OBJECT_0) | |
| 198 | - return TRUE; | |
| 199 | - | |
| 200 | -#else /*][*/ | |
| 201 | - | |
| 202 | - struct pollfd fds; | |
| 203 | - | |
| 204 | - memset(&fds,0,sizeof(fds)); | |
| 205 | - | |
| 206 | - fds.fd = ((IO_Source *) source)->poll.fd; | |
| 207 | - fds.events = ((IO_Source *) source)->poll.events; | |
| 208 | - | |
| 209 | - if(poll(&fds,1,0) > 0) | |
| 210 | - return TRUE; | |
| 211 | - | |
| 212 | -#endif /*]*/ | |
| 213 | - | |
| 214 | - return FALSE; | |
| 215 | -} | |
| 216 | - | |
| 217 | -static gboolean IO_dispatch(GSource *source, GSourceFunc callback, gpointer user_data) | |
| 218 | -{ | |
| 219 | - /* | |
| 220 | - * Called to dispatch the event source, | |
| 221 | - * after it has returned TRUE in either its prepare or its check function. | |
| 222 | - * The dispatch function is passed in a callback function and data. | |
| 223 | - * The callback function may be NULL if the source was never connected | |
| 224 | - * to a callback using g_source_set_callback(). The dispatch function | |
| 225 | - * should call the callback function with user_data and whatever additional | |
| 226 | - * parameters are needed for this type of event source. | |
| 227 | - */ | |
| 228 | - ((IO_Source *) source)->fn(((IO_Source *) source)->session); | |
| 229 | - return TRUE; | |
| 230 | -} | |
| 231 | - | |
| 232 | -static void IO_finalize(GSource *source) | |
| 233 | -{ | |
| 234 | - | |
| 235 | -} | |
| 236 | - | |
| 237 | -static gboolean IO_closure(gpointer data) | |
| 238 | -{ | |
| 239 | - return 0; | |
| 240 | -} | |
| 241 | - | |
| 242 | -struct bgParameter | |
| 243 | -{ | |
| 244 | - gboolean running; | |
| 245 | - gboolean timer; | |
| 246 | - H3270 *session; | |
| 247 | - int rc; | |
| 248 | - int(*callback)(H3270 *session, void *); | |
| 249 | - void *parm; | |
| 250 | - | |
| 251 | -}; | |
| 252 | - | |
| 253 | -gpointer BgCall(struct bgParameter *p) | |
| 254 | -{ | |
| 255 | -// trace("%s starts",__FUNCTION__); | |
| 256 | - p->rc = p->callback(p->session, p->parm); | |
| 257 | - p->running = FALSE; | |
| 258 | -// trace("%s ends",__FUNCTION__); | |
| 259 | - return 0; | |
| 260 | -} | |
| 261 | - | |
| 262 | -static gboolean wait_for_thread(struct bgParameter *p) | |
| 263 | -{ | |
| 264 | - if(!p->running) | |
| 265 | - { | |
| 266 | - p->timer = 0; | |
| 267 | - return FALSE; | |
| 268 | - } | |
| 269 | - return TRUE; | |
| 270 | -} | |
| 271 | - | |
| 272 | -static int static_CallAndWait(int(*callback)(H3270 *session, void *), H3270 *session, void *parm) | |
| 273 | -{ | |
| 274 | - struct bgParameter p = { TRUE, TRUE, session, -1, callback, parm }; | |
| 275 | - GThread * thread; | |
| 276 | - | |
| 277 | -// trace("Starting auxiliary thread for callback %p",callback); | |
| 278 | - | |
| 279 | - p.running = TRUE; | |
| 280 | - p.timer = TRUE; | |
| 281 | - | |
| 282 | - thread = g_thread_create( (GThreadFunc) BgCall, &p, 0, NULL); | |
| 283 | - | |
| 284 | - if(!thread) | |
| 285 | - { | |
| 286 | - g_error("Can't start background thread"); | |
| 287 | - return -1; | |
| 288 | - } | |
| 289 | - | |
| 290 | - g_timeout_add(50,(GSourceFunc) wait_for_thread,(gpointer) &p); | |
| 291 | - | |
| 292 | - while(p.timer) | |
| 293 | - g_main_context_iteration(g_main_loop_get_context(main_loop),TRUE); | |
| 294 | - | |
| 295 | - return p.rc; | |
| 296 | -} | |
| 297 | - | |
| 298 | -static int static_Sleep(H3270 *hSession, int seconds) | |
| 299 | -{ | |
| 300 | - time_t end = time(0) + seconds; | |
| 301 | - | |
| 302 | - while(time(0) < end) | |
| 303 | - g_main_iteration(TRUE); | |
| 304 | - | |
| 305 | - return 0; | |
| 306 | -} | |
| 307 | - | |
| 308 | -static int static_RunPendingEvents(H3270 *hSession, int wait) | |
| 309 | -{ | |
| 310 | - GMainContext *context = g_main_loop_get_context(main_loop); | |
| 311 | - int rc = 0; | |
| 312 | - while(g_main_context_pending(context)) | |
| 313 | - { | |
| 314 | - rc = 1; | |
| 315 | - g_main_context_iteration(context,FALSE); | |
| 316 | - } | |
| 317 | - | |
| 318 | - if(wait) | |
| 319 | - g_main_context_iteration(context,TRUE); | |
| 320 | - | |
| 321 | - return rc; | |
| 322 | -} | |
| 323 | - | |
| 324 | -static void beep(H3270 *session) | |
| 325 | -{ | |
| 326 | -} | |
| 327 | - | |
| 328 | -void pw3270_dbus_register_io_handlers(void) | |
| 329 | -{ | |
| 330 | - static const struct lib3270_callbacks hdl = | |
| 331 | - { | |
| 332 | - sizeof(struct lib3270_callbacks), | |
| 333 | - | |
| 334 | - static_AddTimeOut, | |
| 335 | - static_RemoveTimeOut, | |
| 336 | - | |
| 337 | - static_AddInput, | |
| 338 | - static_RemoveSource, | |
| 339 | - | |
| 340 | - static_AddExcept, | |
| 341 | - | |
| 342 | -#ifdef G_THREADS_ENABLED | |
| 343 | - static_CallAndWait, | |
| 344 | -#else | |
| 345 | - NULL, | |
| 346 | -#endif | |
| 347 | - | |
| 348 | - static_Sleep, | |
| 349 | - static_RunPendingEvents, | |
| 350 | - beep | |
| 351 | - | |
| 352 | - }; | |
| 353 | - | |
| 354 | - #error Need rewrite | |
| 355 | - | |
| 356 | - if(lib3270_register_handlers(&hdl)) | |
| 357 | - { | |
| 358 | - g_error("%s","Can't set lib3270 I/O handlers"); | |
| 359 | - } | |
| 360 | - | |
| 361 | -} |
src/hllapi/Makefile.in
| ... | ... | @@ -1,315 +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. | |
| 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., 59 Temple | |
| 19 | -# Place, Suite 330, Boston, MA, 02111-1307, USA | |
| 20 | -# | |
| 21 | -# Contatos: | |
| 22 | -# | |
| 23 | -# perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
| 24 | -# erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) | |
| 25 | -# | |
| 26 | - | |
| 27 | -MODULE_NAME=hllapi | |
| 28 | -LIBNAME=lib$(MODULE_NAME)@DLLEXT@ | |
| 29 | - | |
| 30 | -PLUGIN_SOURCES=pluginmain.c | |
| 31 | -API_SOURCES=calls.c hllapi.c | |
| 32 | - | |
| 33 | -#---[ Configuration values ]------------------------------------------------------------- | |
| 34 | - | |
| 35 | -PACKAGE_NAME=@PACKAGE_NAME@ | |
| 36 | -PACKAGE_VERSION=@PACKAGE_VERSION@ | |
| 37 | -PACKAGE_TARNAME=@PACKAGE_TARNAME@ | |
| 38 | - | |
| 39 | -prefix=@prefix@ | |
| 40 | -exec_prefix=@exec_prefix@ | |
| 41 | -bindir=@bindir@ | |
| 42 | -sbindir=@sbindir@ | |
| 43 | -libdir=@libdir@ | |
| 44 | - | |
| 45 | -BASEDIR=@BASEDIR@ | |
| 46 | -SRCDIR=$(BASEDIR)/.src/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)/src/plugins/$(MODULE_NAME) | |
| 47 | -POTDIR=$(BASEDIR)/.pot/plugins/$(MODULE_NAME) | |
| 48 | - | |
| 49 | -OBJDIR=$(BASEDIR)/.obj/plugins/$(MODULE_NAME) | |
| 50 | -OBJDBG=$(OBJDIR)/Debug | |
| 51 | -OBJRLS=$(OBJDIR)/Release | |
| 52 | - | |
| 53 | -BINDIR=$(BASEDIR)/.bin | |
| 54 | -BINDBG=$(BINDIR)/Debug | |
| 55 | -BINRLS=$(BINDIR)/Release | |
| 56 | - | |
| 57 | -MKDIR=@MKDIR_P@ | |
| 58 | -CC=@CC@ | |
| 59 | -CXX=@CXX@ | |
| 60 | -LD=@CXX@ | |
| 61 | -AR=@AR@ | |
| 62 | -XGETTEXT=@XGETTEXT@ | |
| 63 | -MSGCAT=@MSGCAT@ | |
| 64 | -INSTALL=@INSTALL@ | |
| 65 | -INSTALL_DATA=@INSTALL_DATA@ | |
| 66 | -INSTALL_PROGRAM=@INSTALL_PROGRAM@ | |
| 67 | -LN_S=@LN_S@ | |
| 68 | - | |
| 69 | -CFLAGS=\ | |
| 70 | - @CFLAGS@ \ | |
| 71 | - @LIBV3270_CFLAGS@ \ | |
| 72 | - @GTK_CFLAGS@ \ | |
| 73 | - -I$(BASEDIR)/src/include | |
| 74 | - | |
| 75 | -LIBS=@LIBS@ | |
| 76 | - | |
| 77 | -API_LIBS=\ | |
| 78 | - $(LIBS) \ | |
| 79 | - -lpw3270cpp \ | |
| 80 | - @LIBICONV@ | |
| 81 | - | |
| 82 | -PLUGIN_LIBS=\ | |
| 83 | - $(LIBS) \ | |
| 84 | - @GTK_LIBS@ \ | |
| 85 | - @GLIB_LIBS@ \ | |
| 86 | - @LIB3270_LIBS@ \ | |
| 87 | - @LIBV3270_LIBS@ \ | |
| 88 | - @PW3270_LIBS@ | |
| 89 | - | |
| 90 | -LDFLAGS=\ | |
| 91 | - @LDFLAGS@ | |
| 92 | - | |
| 93 | -#---[ Rules ]---------------------------------------------------------------------------- | |
| 94 | - | |
| 95 | -DEPENDS=*.h Makefile | |
| 96 | - | |
| 97 | -$(OBJDBG)/%.o: \ | |
| 98 | - %.c \ | |
| 99 | - $(DEPENDS) | |
| 100 | - | |
| 101 | - @echo $< ... | |
| 102 | - @$(MKDIR) `dirname $@` | |
| 103 | - @$(CC) $(CFLAGS) \ | |
| 104 | - @DBG_CFLAGS@ \ | |
| 105 | - -DBUILD_DATE=`date +"0x%Y%m%d"`\ | |
| 106 | - -o $@ -c $< | |
| 107 | - | |
| 108 | -$(OBJDBG)/%.o: \ | |
| 109 | - %.cc \ | |
| 110 | - $(DEPENDS) | |
| 111 | - | |
| 112 | - @echo $< ... | |
| 113 | - @$(MKDIR) `dirname $@` | |
| 114 | - @$(CXX) $(CFLAGS) \ | |
| 115 | - @DBG_CFLAGS@ \ | |
| 116 | - -DBUILD_DATE=`date +"0x%Y%m%d"`\ | |
| 117 | - -o $@ -c $< | |
| 118 | - | |
| 119 | -$(OBJRLS)/%.o: \ | |
| 120 | - %.c \ | |
| 121 | - $(DEPENDS) | |
| 122 | - | |
| 123 | - @echo $< ... | |
| 124 | - @$(MKDIR) `dirname $@` | |
| 125 | - @$(CC) $(CFLAGS) \ | |
| 126 | - @RLS_CFLAGS@ \ | |
| 127 | - -DBUILD_DATE=`date +"0x%Y%m%d"` \ | |
| 128 | - -o $@ -c $< | |
| 129 | - | |
| 130 | -$(OBJRLS)/%.o: \ | |
| 131 | - %.cc \ | |
| 132 | - $(DEPENDS) | |
| 133 | - | |
| 134 | - @echo $< ... | |
| 135 | - @$(MKDIR) `dirname $@` | |
| 136 | - @$(CXX) $(CFLAGS) \ | |
| 137 | - @RLS_CFLAGS@ \ | |
| 138 | - -DBUILD_DATE=`date +"0x%Y%m%d"` \ | |
| 139 | - -o $@ -c $< | |
| 140 | - | |
| 141 | -$(POTDIR)/%.pot: %.c | |
| 142 | - | |
| 143 | - @echo $(notdir $@) ... | |
| 144 | - @$(MKDIR) `dirname $@` | |
| 145 | - @$(XGETTEXT) \ | |
| 146 | - --default-domain=$(PACKAGE) \ | |
| 147 | - --language=C \ | |
| 148 | - --keyword=_ \ | |
| 149 | - --keyword=N_ \ | |
| 150 | - --keyword=MSG_:2 \ | |
| 151 | - --output=$@ \ | |
| 152 | - $< | |
| 153 | - | |
| 154 | - @touch $@ | |
| 155 | - | |
| 156 | -#---[ Release Targets ]------------------------------------------------------------------ | |
| 157 | - | |
| 158 | -Release: \ | |
| 159 | - $(BINRLS)/plugins/$(MODULE_NAME)@DLLEXT@ | |
| 160 | - | |
| 161 | -install: \ | |
| 162 | - $(BINRLS)/$(LIBNAME) \ | |
| 163 | - $(BINRLS)/plugins/$(MODULE_NAME)@DLLEXT@ | |
| 164 | - | |
| 165 | - @echo $@ ... | |
| 166 | - @$(MKDIR) $(DESTDIR)$(libdir)/$(PACKAGE_TARNAME)-plugins | |
| 167 | - @$(INSTALL_PROGRAM) $(BINRLS)/plugins/$(MODULE_NAME)@DLLEXT@ $(DESTDIR)$(libdir)/$(PACKAGE_TARNAME)-plugins/$(MODULE_NAME)@DLLEXT@ | |
| 168 | - | |
| 169 | - @$(MKDIR) $(DESTDIR)$(libdir) | |
| 170 | - @$(INSTALL_PROGRAM) $(BINRLS)/$(LIBNAME) $(DESTDIR)$(libdir) | |
| 171 | - | |
| 172 | -$(DESTDIR)$(libdir)/$(PACKAGE_TARNAME)-plugins/$(MODULE_NAME)@DLLEXT@: \ | |
| 173 | - $(BINRLS)/$(LIBNAME) \ | |
| 174 | - $(BINRLS)/plugins/$(MODULE_NAME)@DLLEXT@ | |
| 175 | - | |
| 176 | - @echo $@ ... | |
| 177 | - @$(MKDIR) `dirname $@` | |
| 178 | - @$(INSTALL_PROGRAM) $(BINRLS)/plugins/$(MODULE_NAME)@DLLEXT@ $@ | |
| 179 | - | |
| 180 | - @$(MKDIR) $(DESTDIR)$(libdir) | |
| 181 | - @$(INSTALL_PROGRAM) $(BINRLS)/$(LIBNAME) $(DESTDIR)$(libdir) | |
| 182 | - | |
| 183 | -$(BINRLS)/$(LIBNAME): \ | |
| 184 | - $(BINRLS)/$(LIBNAME).@PACKAGE_MAJOR_VERSION@ | |
| 185 | - | |
| 186 | - @echo $(basename $@) ... | |
| 187 | - @$(MKDIR) `dirname $@` | |
| 188 | - @$(LN_S) -f $(LIBNAME).@PACKAGE_MAJOR_VERSION@ $@ | |
| 189 | - | |
| 190 | -$(BINRLS)/$(LIBNAME).@PACKAGE_MAJOR_VERSION@: \ | |
| 191 | - $(BINRLS)/$(LIBNAME).@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@ | |
| 192 | - | |
| 193 | - @echo $(basename $@) ... | |
| 194 | - @$(MKDIR) `dirname $@` | |
| 195 | - @$(LN_S) -f $(LIBNAME).@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@ $@ | |
| 196 | - | |
| 197 | -$(BINRLS)/$(LIBNAME).@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@: \ | |
| 198 | - $(foreach SRC, $(basename $(API_SOURCES)), $(OBJRLS)/$(SRC).o) | |
| 199 | - | |
| 200 | - @echo $@ ... | |
| 201 | - @$(MKDIR) `dirname $@` | |
| 202 | - @$(LD) \ | |
| 203 | - $(LDFLAGS) \ | |
| 204 | - @DLL_LDFLAGS@ \ | |
| 205 | - -Wl,-soname,`basename $@` \ | |
| 206 | - -L$(BASEDIR)/.bin/Release \ | |
| 207 | - @STATIC_LDFLAGS@ \ | |
| 208 | - -o $@ $^ \ | |
| 209 | - $(API_LIBS) | |
| 210 | - | |
| 211 | -$(BINRLS)/plugins/$(MODULE_NAME)@DLLEXT@: \ | |
| 212 | - $(BINRLS)/$(LIBNAME) \ | |
| 213 | - $(foreach SRC, $(basename $(PLUGIN_SOURCES)), $(OBJRLS)/$(SRC).o) | |
| 214 | - | |
| 215 | - @echo $@ ... | |
| 216 | - @$(MKDIR) `dirname $@` | |
| 217 | - @$(LD) \ | |
| 218 | - $(LDFLAGS) \ | |
| 219 | - @DLL_LDFLAGS@ \ | |
| 220 | - -Wl,-soname,$(MODULE_NAME)d \ | |
| 221 | - -L$(BASEDIR)/.bin/Release \ | |
| 222 | - -o $@ $(foreach SRC, $(basename $(PLUGIN_SOURCES)), $(OBJRLS)/$(SRC).o) \ | |
| 223 | - $(PLUGIN_LIBS) | |
| 224 | - | |
| 225 | -pot: \ | |
| 226 | - $(BASEDIR)/.pot/plugins/$(MODULE_NAME).pot | |
| 227 | - | |
| 228 | -$(BASEDIR)/.pot/plugins/$(MODULE_NAME).pot: \ | |
| 229 | - $(foreach SRC, $(basename $(SOURCES)), $(POTDIR)/$(SRC).pot) | |
| 230 | - | |
| 231 | - @rm -f $@ | |
| 232 | - @mkdir -p `dirname $@` | |
| 233 | - @$(MSGCAT) --sort-output $^ > $@ | |
| 234 | - | |
| 235 | -$(SRCDIR): \ | |
| 236 | - clean | |
| 237 | - | |
| 238 | - @$(MKDIR) $@ | |
| 239 | - @$(INSTALL_DATA) *.c *.cc *.h *.in *.cbp $@ | |
| 240 | - | |
| 241 | - | |
| 242 | -#---[ Debug Targets ]-------------------------------------------------------------------- | |
| 243 | - | |
| 244 | -Debug: \ | |
| 245 | - $(BINDBG)/plugins/$(MODULE_NAME)@DLLEXT@ | |
| 246 | - | |
| 247 | -test: \ | |
| 248 | - $(BINDBG)/$(LIBNAME) \ | |
| 249 | - $(OBJDBG)/testprogram.o | |
| 250 | - | |
| 251 | - $(LD) -Wl,--rpath,$(BINDBG) -o $(BINDBG)/$(MODULE_NAME)@EXEEXT@ $(OBJDBG)/testprogram.o -L$(BINDBG) $(LIBS) -l$(MODULE_NAME) | |
| 252 | - | |
| 253 | -$(BINDBG)/$(LIBNAME): \ | |
| 254 | - $(BINDBG)/$(LIBNAME).@PACKAGE_MAJOR_VERSION@ | |
| 255 | - | |
| 256 | - @echo $(basename $@) ... | |
| 257 | - @$(MKDIR) `dirname $@` | |
| 258 | - @$(LN_S) -f $(LIBNAME).@PACKAGE_MAJOR_VERSION@ $@ | |
| 259 | - | |
| 260 | -$(BINDBG)/$(LIBNAME).@PACKAGE_MAJOR_VERSION@: \ | |
| 261 | - $(BINDBG)/$(LIBNAME).@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@ | |
| 262 | - | |
| 263 | - @echo $(basename $@) ... | |
| 264 | - @$(MKDIR) `dirname $@` | |
| 265 | - @$(LN_S) -f $(LIBNAME).@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@ $@ | |
| 266 | - | |
| 267 | -$(BINDBG)/$(LIBNAME).@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@: \ | |
| 268 | - $(foreach SRC, $(basename $(API_SOURCES)), $(OBJDBG)/$(SRC).o) | |
| 269 | - | |
| 270 | - @echo $@ ... | |
| 271 | - @$(MKDIR) `dirname $@` | |
| 272 | - @$(LD) \ | |
| 273 | - -shared \ | |
| 274 | - -Wl,-soname,`basename $@` \ | |
| 275 | - $(LDFLAGS) \ | |
| 276 | - -L$(BASEDIR)/.bin/Debug \ | |
| 277 | - -o $@ $^ \ | |
| 278 | - $(API_LIBS) | |
| 279 | - | |
| 280 | -$(BINDBG)/plugins/$(MODULE_NAME)@DLLEXT@: \ | |
| 281 | - $(BINDBG)/$(LIBNAME) \ | |
| 282 | - $(foreach SRC, $(basename $(PLUGIN_SOURCES)), $(OBJDBG)/$(SRC).o) | |
| 283 | - | |
| 284 | - @echo $@ ... | |
| 285 | - @$(MKDIR) `dirname $@` | |
| 286 | - @$(LD) \ | |
| 287 | - -shared \ | |
| 288 | - -Wl,-soname,$(MODULE_NAME)d,--rpath,$(BASEDIR)/.bin/Debug \ | |
| 289 | - $(LDFLAGS) \ | |
| 290 | - -L$(BASEDIR)/.bin/Debug \ | |
| 291 | - -o $@ $(foreach SRC, $(basename $(PLUGIN_SOURCES)), $(OBJDBG)/$(SRC).o) \ | |
| 292 | - $(PLUGIN_LIBS) | |
| 293 | - | |
| 294 | - | |
| 295 | -#---[ Clean Targets]--------------------------------------------------------------------- | |
| 296 | - | |
| 297 | -cleanDebug: | |
| 298 | - | |
| 299 | - @rm -fr $(BINDBG)/$(MODULE_NAME)@DLLEXT@ \ | |
| 300 | - $(OBJDBG) \ | |
| 301 | - dbus-glue.h | |
| 302 | - | |
| 303 | -cleanRelease: | |
| 304 | - | |
| 305 | - @rm -fr $(BINRLS)/$(MODULE_NAME)@DLLEXT@ \ | |
| 306 | - $(OBJRLS) \ | |
| 307 | - dbus-glue.h | |
| 308 | - | |
| 309 | - @rm -fr $(POTDIR) | |
| 310 | - | |
| 311 | -clean: \ | |
| 312 | - cleanDebug \ | |
| 313 | - cleanRelease | |
| 314 | - | |
| 315 | - |
src/hllapi/calls.cc
| ... | ... | @@ -1,826 +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. | |
| 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., 59 Temple | |
| 19 | - * Place, Suite 330, Boston, MA, 02111-1307, USA | |
| 20 | - * | |
| 21 | - * Este programa está nomeado como calls.cc 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 | - #include <exception> | |
| 31 | - #include <cstdlib> | |
| 32 | - #include <cstring> | |
| 33 | - | |
| 34 | - #include <pw3270/hllapi.h> | |
| 35 | - #include <pw3270/pw3270cpp.h> | |
| 36 | - #include "client.h" | |
| 37 | - | |
| 38 | - using namespace std; | |
| 39 | - using namespace PW3270_NAMESPACE; | |
| 40 | - | |
| 41 | -/*--[ Globals ]--------------------------------------------------------------------------------------*/ | |
| 42 | - | |
| 43 | - static session * hSession = NULL; | |
| 44 | - static time_t hllapi_timeout = 120; | |
| 45 | - | |
| 46 | -/*--[ Implement ]------------------------------------------------------------------------------------*/ | |
| 47 | - | |
| 48 | - HLLAPI_API_CALL hllapi_init(LPSTR mode) | |
| 49 | - { | |
| 50 | - trace("%s(%s)",__FUNCTION__,mode); | |
| 51 | - | |
| 52 | - try | |
| 53 | - { | |
| 54 | - if(hSession) | |
| 55 | - delete hSession; | |
| 56 | - hSession = session::create(mode); | |
| 57 | - | |
| 58 | - if(!hSession) { | |
| 59 | - return HLLAPI_STATUS_UNAVAILABLE; | |
| 60 | - } | |
| 61 | - | |
| 62 | - hSession->set_display_charset(); | |
| 63 | - | |
| 64 | - trace("hSession=%p",hSession); | |
| 65 | - } | |
| 66 | - catch(std::exception &e) | |
| 67 | - { | |
| 68 | - trace("Error \"%s\"",e.what()); | |
| 69 | - return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 70 | - } | |
| 71 | - | |
| 72 | - return HLLAPI_STATUS_SUCCESS; | |
| 73 | - | |
| 74 | - } | |
| 75 | - | |
| 76 | - HLLAPI_API_CALL hllapi_deinit(void) | |
| 77 | - { | |
| 78 | - trace("%s()",__FUNCTION__); | |
| 79 | - | |
| 80 | - try | |
| 81 | - { | |
| 82 | - if(hSession) | |
| 83 | - { | |
| 84 | - delete hSession; | |
| 85 | - hSession = NULL; | |
| 86 | - } | |
| 87 | - } | |
| 88 | - catch(std::exception &e) | |
| 89 | - { | |
| 90 | - return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 91 | - } | |
| 92 | - | |
| 93 | - return HLLAPI_STATUS_SUCCESS; | |
| 94 | - } | |
| 95 | - | |
| 96 | - HLLAPI_API_CALL hllapi_get_revision(void) | |
| 97 | - { | |
| 98 | - try | |
| 99 | - { | |
| 100 | - return atoi(session::get_default()->get_revision().c_str()); | |
| 101 | - } | |
| 102 | - catch(std::exception &e) | |
| 103 | - { | |
| 104 | - return -1; | |
| 105 | - } | |
| 106 | - return (DWORD) -1; | |
| 107 | - } | |
| 108 | - | |
| 109 | - HLLAPI_API_CALL hllapi_connect(LPSTR uri, WORD wait) | |
| 110 | - { | |
| 111 | - try | |
| 112 | - { | |
| 113 | - session::get_default()->connect(uri,hllapi_timeout); | |
| 114 | - } | |
| 115 | - catch(std::exception &e) | |
| 116 | - { | |
| 117 | - return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 118 | - } | |
| 119 | - | |
| 120 | - return hllapi_get_state(); | |
| 121 | - } | |
| 122 | - | |
| 123 | - HLLAPI_API_CALL hllapi_is_connected(void) | |
| 124 | - { | |
| 125 | - if(!session::has_default()) | |
| 126 | - { | |
| 127 | - return 0; | |
| 128 | - } | |
| 129 | - | |
| 130 | - return session::get_default()->is_connected(); | |
| 131 | - } | |
| 132 | - | |
| 133 | - HLLAPI_API_CALL hllapi_get_state(void) | |
| 134 | - { | |
| 135 | - switch(hllapi_get_message_id()) | |
| 136 | - { | |
| 137 | - case LIB3270_MESSAGE_NONE: // 0 - No message | |
| 138 | - return HLLAPI_STATUS_SUCCESS; // keyboard was unlocked and ready for input. | |
| 139 | - | |
| 140 | - case LIB3270_MESSAGE_DISCONNECTED: // 4 - Disconnected from host | |
| 141 | - return HLLAPI_STATUS_DISCONNECTED; // Your application program was not connected to a valid session. | |
| 142 | - | |
| 143 | - case LIB3270_MESSAGE_MINUS: | |
| 144 | - case LIB3270_MESSAGE_PROTECTED: | |
| 145 | - case LIB3270_MESSAGE_NUMERIC: | |
| 146 | - case LIB3270_MESSAGE_OVERFLOW: | |
| 147 | - case LIB3270_MESSAGE_INHIBIT: | |
| 148 | - case LIB3270_MESSAGE_KYBDLOCK: | |
| 149 | - return HLLAPI_STATUS_KEYBOARD_LOCKED; // keyboard is locked. | |
| 150 | - | |
| 151 | - case LIB3270_MESSAGE_SYSWAIT: | |
| 152 | - case LIB3270_MESSAGE_TWAIT: | |
| 153 | - case LIB3270_MESSAGE_AWAITING_FIRST: | |
| 154 | - case LIB3270_MESSAGE_X: | |
| 155 | - case LIB3270_MESSAGE_RESOLVING: | |
| 156 | - case LIB3270_MESSAGE_CONNECTING: | |
| 157 | - return HLLAPI_STATUS_WAITING; // time-out while still busy (in XCLOCK or XSYSTEM in X) for the 3270 terminal emulation. | |
| 158 | - } | |
| 159 | - | |
| 160 | - return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 161 | - } | |
| 162 | - | |
| 163 | - HLLAPI_API_CALL hllapi_disconnect(void) | |
| 164 | - { | |
| 165 | - session::get_default()->disconnect(); | |
| 166 | - return HLLAPI_STATUS_SUCCESS; | |
| 167 | - } | |
| 168 | - | |
| 169 | - HLLAPI_API_CALL hllapi_wait_for_ready(WORD seconds) | |
| 170 | - { | |
| 171 | - if(!hllapi_is_connected()) | |
| 172 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 173 | - | |
| 174 | - session::get_default()->wait_for_ready(seconds); | |
| 175 | - | |
| 176 | - return hllapi_get_state(); | |
| 177 | - } | |
| 178 | - | |
| 179 | - HLLAPI_API_CALL hllapi_wait(WORD seconds) | |
| 180 | - { | |
| 181 | - if(!hllapi_is_connected()) | |
| 182 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 183 | - | |
| 184 | - session::get_default()->wait(seconds); | |
| 185 | - | |
| 186 | - return hllapi_get_state(); | |
| 187 | - } | |
| 188 | - | |
| 189 | - HLLAPI_API_CALL hllapi_get_message_id(void) | |
| 190 | - { | |
| 191 | - if(!hllapi_is_connected()) | |
| 192 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 193 | - | |
| 194 | - return session::get_default()->get_program_message(); | |
| 195 | - } | |
| 196 | - | |
| 197 | - HLLAPI_API_CALL hllapi_get_screen_at(WORD row, WORD col, LPSTR buffer) | |
| 198 | - { | |
| 199 | - if(!hllapi_is_connected()) | |
| 200 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 201 | - | |
| 202 | - if(!(buffer && *buffer)) | |
| 203 | - return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 204 | - | |
| 205 | - try | |
| 206 | - { | |
| 207 | - size_t sz = strlen(buffer); | |
| 208 | - string str = session::get_default()->get_string_at(row,col,sz); | |
| 209 | - strncpy(buffer,str.c_str(),sz); | |
| 210 | - } | |
| 211 | - catch(std::exception &e) | |
| 212 | - { | |
| 213 | - return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 214 | - } | |
| 215 | - | |
| 216 | - return HLLAPI_STATUS_SUCCESS; | |
| 217 | - } | |
| 218 | - | |
| 219 | - HLLAPI_API_CALL hllapi_enter(void) | |
| 220 | - { | |
| 221 | - if(!hllapi_is_connected()) | |
| 222 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 223 | - | |
| 224 | - return session::get_default()->enter(); | |
| 225 | - } | |
| 226 | - | |
| 227 | - HLLAPI_API_CALL hllapi_set_text_at(WORD row, WORD col, LPSTR text) | |
| 228 | - { | |
| 229 | - if(!hllapi_is_connected()) | |
| 230 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 231 | - | |
| 232 | - try | |
| 233 | - { | |
| 234 | - session::get_default()->set_string_at(row,col,text); | |
| 235 | - } | |
| 236 | - catch(std::exception &e) | |
| 237 | - { | |
| 238 | - return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 239 | - } | |
| 240 | - | |
| 241 | - return HLLAPI_STATUS_SUCCESS; | |
| 242 | - } | |
| 243 | - | |
| 244 | - HLLAPI_API_CALL hllapi_cmp_text_at(WORD row, WORD col, LPSTR text) | |
| 245 | - { | |
| 246 | - | |
| 247 | - if(!hllapi_is_connected()) | |
| 248 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 249 | - | |
| 250 | - int rc = HLLAPI_STATUS_SYSTEM_ERROR; | |
| 251 | - | |
| 252 | - try | |
| 253 | - { | |
| 254 | - rc = session::get_default()->cmp_string_at(row,col,text); | |
| 255 | - } | |
| 256 | - catch(std::exception &e) | |
| 257 | - { | |
| 258 | - return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 259 | - } | |
| 260 | - | |
| 261 | - return rc; | |
| 262 | - } | |
| 263 | - | |
| 264 | - HLLAPI_API_CALL hllapi_find_text(LPSTR text) | |
| 265 | - { | |
| 266 | - if(!hllapi_is_connected()) | |
| 267 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 268 | - | |
| 269 | - return (int) session::get_default()->find_string((const char *) text, false); | |
| 270 | - } | |
| 271 | - | |
| 272 | - HLLAPI_API_CALL hllapi_set_unlock_delay(WORD ms) | |
| 273 | - { | |
| 274 | - session::get_default()->set_unlock_delay(ms); | |
| 275 | - return 0; | |
| 276 | - } | |
| 277 | - | |
| 278 | - HLLAPI_API_CALL hllapi_set_charset(LPSTR text) | |
| 279 | - { | |
| 280 | - try | |
| 281 | - { | |
| 282 | - | |
| 283 | - session::get_default()->set_display_charset(NULL, (const char *) text); | |
| 284 | - | |
| 285 | - } | |
| 286 | - catch(std::exception &e) | |
| 287 | - { | |
| 288 | - return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 289 | - } | |
| 290 | - | |
| 291 | - return 0; | |
| 292 | - } | |
| 293 | - | |
| 294 | - HLLAPI_API_CALL hllapi_pfkey(WORD key) | |
| 295 | - { | |
| 296 | - if(!hllapi_is_connected()) | |
| 297 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 298 | - | |
| 299 | - return session::get_default()->pfkey(key); | |
| 300 | - } | |
| 301 | - | |
| 302 | - HLLAPI_API_CALL hllapi_pakey(WORD key) | |
| 303 | - { | |
| 304 | - if(!hllapi_is_connected()) | |
| 305 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 306 | - | |
| 307 | - return session::get_default()->pakey(key); | |
| 308 | - } | |
| 309 | - | |
| 310 | - HLLAPI_API_CALL hllapi_get_datadir(LPSTR datadir) | |
| 311 | - { | |
| 312 | - #ifdef _WIN32 | |
| 313 | - HKEY hKey = 0; | |
| 314 | - unsigned long datalen = strlen(datadir); | |
| 315 | - | |
| 316 | - *datadir = 0; | |
| 317 | - | |
| 318 | - if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\\pw3270",0,KEY_QUERY_VALUE,&hKey) == ERROR_SUCCESS) | |
| 319 | - { | |
| 320 | - unsigned long datatype; // #defined in winnt.h (predefined types 0-11) | |
| 321 | - if(RegQueryValueExA(hKey,"datadir",NULL,&datatype,(LPBYTE) datadir,&datalen) != ERROR_SUCCESS) | |
| 322 | - *datadir = 0; | |
| 323 | - RegCloseKey(hKey); | |
| 324 | - } | |
| 325 | -#endif // _WIN32 | |
| 326 | - | |
| 327 | - return *datadir; | |
| 328 | - } | |
| 329 | - | |
| 330 | - HLLAPI_API_CALL hllapi_setcursor(WORD pos) | |
| 331 | - { | |
| 332 | - if(!hllapi_is_connected()) | |
| 333 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 334 | - | |
| 335 | - session::get_default()->set_cursor_addr(pos-1); | |
| 336 | - | |
| 337 | - return HLLAPI_STATUS_SUCCESS; | |
| 338 | - | |
| 339 | - } | |
| 340 | - | |
| 341 | - HLLAPI_API_CALL hllapi_set_cursor_address(WORD pos) | |
| 342 | - { | |
| 343 | - if(!hllapi_is_connected()) | |
| 344 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 345 | - | |
| 346 | - session::get_default()->set_cursor_addr(pos-1); | |
| 347 | - | |
| 348 | - return HLLAPI_STATUS_SUCCESS; | |
| 349 | - | |
| 350 | - } | |
| 351 | - | |
| 352 | - HLLAPI_API_CALL hllapi_get_cursor_address() | |
| 353 | - { | |
| 354 | - return session::get_default()->get_cursor_addr()+1; | |
| 355 | - } | |
| 356 | - | |
| 357 | - HLLAPI_API_CALL hllapi_getcursor() | |
| 358 | - { | |
| 359 | - return session::get_default()->get_cursor_addr()+1; | |
| 360 | - } | |
| 361 | - | |
| 362 | - HLLAPI_API_CALL hllapi_get_screen(WORD offset, LPSTR buffer, WORD len) | |
| 363 | - { | |
| 364 | - if(!hllapi_is_connected()) | |
| 365 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 366 | - | |
| 367 | - int rc = HLLAPI_STATUS_SYSTEM_ERROR; | |
| 368 | - | |
| 369 | - if(offset < 1) | |
| 370 | - { | |
| 371 | - return HLLAPI_STATUS_BAD_PARAMETER; | |
| 372 | - } | |
| 373 | - | |
| 374 | - offset--; | |
| 375 | - | |
| 376 | - if(!session::has_default()) | |
| 377 | - { | |
| 378 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 379 | - } | |
| 380 | - | |
| 381 | - if(!(buffer && *buffer)) { | |
| 382 | - return HLLAPI_STATUS_BAD_PARAMETER; | |
| 383 | - } | |
| 384 | - | |
| 385 | - try | |
| 386 | - { | |
| 387 | - size_t szBuffer; | |
| 388 | - | |
| 389 | - if(len > 0) | |
| 390 | - { | |
| 391 | - szBuffer = (size_t) len; | |
| 392 | - } | |
| 393 | - else | |
| 394 | - { | |
| 395 | - return HLLAPI_STATUS_BAD_PARAMETER; | |
| 396 | - } | |
| 397 | - | |
| 398 | - memset(buffer,' ',szBuffer); | |
| 399 | - | |
| 400 | - string str = session::get_default()->get_string(offset,szBuffer,false); | |
| 401 | - strncpy(buffer,str.c_str(),szBuffer); | |
| 402 | - rc = HLLAPI_STATUS_SUCCESS; | |
| 403 | - } | |
| 404 | - catch(std::exception &e) | |
| 405 | - { | |
| 406 | - rc = HLLAPI_STATUS_SYSTEM_ERROR; | |
| 407 | - } | |
| 408 | - | |
| 409 | - return rc; | |
| 410 | - } | |
| 411 | - | |
| 412 | - HLLAPI_API_CALL hllapi_emulate_input(const LPSTR buffer, WORD len, WORD pasting) | |
| 413 | - { | |
| 414 | - if(!hllapi_is_connected()) | |
| 415 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 416 | - | |
| 417 | - try | |
| 418 | - { | |
| 419 | - session::get_default()->input_string(buffer); | |
| 420 | - } | |
| 421 | - catch(std::exception &e) | |
| 422 | - { | |
| 423 | - return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 424 | - } | |
| 425 | - | |
| 426 | - return HLLAPI_STATUS_SUCCESS; | |
| 427 | - } | |
| 428 | - | |
| 429 | - HLLAPI_API_CALL hllapi_erase(void) | |
| 430 | - { | |
| 431 | - try | |
| 432 | - { | |
| 433 | - session::get_default()->erase(); | |
| 434 | - } | |
| 435 | - catch(std::exception &e) | |
| 436 | - { | |
| 437 | - return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 438 | - } | |
| 439 | - return HLLAPI_STATUS_SUCCESS; | |
| 440 | - } | |
| 441 | - | |
| 442 | - HLLAPI_API_CALL hllapi_erase_eof(void) | |
| 443 | - { | |
| 444 | - if(!hllapi_is_connected()) | |
| 445 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 446 | - | |
| 447 | - try | |
| 448 | - { | |
| 449 | - session::get_default()->erase_eof(); | |
| 450 | - } | |
| 451 | - catch(std::exception &e) | |
| 452 | - { | |
| 453 | - return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 454 | - } | |
| 455 | - return HLLAPI_STATUS_SUCCESS; | |
| 456 | - } | |
| 457 | - | |
| 458 | - HLLAPI_API_CALL hllapi_erase_eol(void) | |
| 459 | - { | |
| 460 | - if(!hllapi_is_connected()) | |
| 461 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 462 | - | |
| 463 | - try | |
| 464 | - { | |
| 465 | - session::get_default()->erase_eol(); | |
| 466 | - } | |
| 467 | - catch(std::exception &e) | |
| 468 | - { | |
| 469 | - return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 470 | - } | |
| 471 | - return HLLAPI_STATUS_SUCCESS; | |
| 472 | - } | |
| 473 | - | |
| 474 | - HLLAPI_API_CALL hllapi_erase_input(void) | |
| 475 | - { | |
| 476 | - if(!hllapi_is_connected()) | |
| 477 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 478 | - | |
| 479 | - try | |
| 480 | - { | |
| 481 | - session::get_default()->erase_input(); | |
| 482 | - } | |
| 483 | - catch(std::exception &e) | |
| 484 | - { | |
| 485 | - return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 486 | - } | |
| 487 | - return HLLAPI_STATUS_SUCCESS; | |
| 488 | - } | |
| 489 | - | |
| 490 | - HLLAPI_API_CALL hllapi_action(LPSTR buffer) { | |
| 491 | - try | |
| 492 | - { | |
| 493 | - session::get_default()->action((const char *) buffer); | |
| 494 | - } | |
| 495 | - catch(std::exception &e) | |
| 496 | - { | |
| 497 | - return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 498 | - } | |
| 499 | - return HLLAPI_STATUS_SUCCESS; | |
| 500 | - } | |
| 501 | - | |
| 502 | - HLLAPI_API_CALL hllapi_print(void) | |
| 503 | - { | |
| 504 | - return session::get_default()->print(); | |
| 505 | - } | |
| 506 | - | |
| 507 | - char * hllapi_get_string(int offset, size_t len) | |
| 508 | - { | |
| 509 | - try | |
| 510 | - { | |
| 511 | - string str = session::get_default()->get_string(offset-1,len); | |
| 512 | - char * ret = strdup(str.c_str()); | |
| 513 | - return ret; | |
| 514 | - } | |
| 515 | - catch(std::exception &e) | |
| 516 | - { | |
| 517 | - } | |
| 518 | - | |
| 519 | - return NULL; | |
| 520 | - } | |
| 521 | - | |
| 522 | - void hllapi_free(void *p) | |
| 523 | - { | |
| 524 | - free(p); | |
| 525 | - } | |
| 526 | - | |
| 527 | - HLLAPI_API_CALL hllapi_reset(void) | |
| 528 | - { | |
| 529 | - return HLLAPI_STATUS_SUCCESS; | |
| 530 | - } | |
| 531 | - | |
| 532 | - HLLAPI_API_CALL hllapi_input_string(LPSTR input, WORD length) | |
| 533 | - { | |
| 534 | - static const char control_char = '@'; | |
| 535 | - | |
| 536 | - size_t szText; | |
| 537 | - char * text; | |
| 538 | - int rc = 0; | |
| 539 | - | |
| 540 | - if(!hllapi_is_connected()) { | |
| 541 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 542 | - } | |
| 543 | - | |
| 544 | - if(!input) | |
| 545 | - { | |
| 546 | - return HLLAPI_STATUS_BAD_PARAMETER; | |
| 547 | - } | |
| 548 | - | |
| 549 | - if(length > 0 ) | |
| 550 | - szText = length; | |
| 551 | - else | |
| 552 | - szText = strlen(input); | |
| 553 | - | |
| 554 | - text = (char *) malloc(szText+2); | |
| 555 | - memcpy(text,input,szText); | |
| 556 | - text[szText] = 0; | |
| 557 | - | |
| 558 | - trace("input[%s]",text); | |
| 559 | - | |
| 560 | - if(strchr(text,control_char)) | |
| 561 | - { | |
| 562 | - // Convert control char | |
| 563 | - char * buffer = text; | |
| 564 | - char * ptr; | |
| 565 | - | |
| 566 | - for(ptr = strchr(text,control_char);ptr;ptr = strchr(buffer,control_char)) | |
| 567 | - { | |
| 568 | - *(ptr++) = 0; | |
| 569 | - | |
| 570 | - trace("input[%s]",buffer); | |
| 571 | - hllapi_emulate_input(buffer,-1,0); | |
| 572 | - | |
| 573 | - switch(*(ptr++)) | |
| 574 | - { | |
| 575 | - case 'P': // Print | |
| 576 | - rc = hllapi_print(); | |
| 577 | - break; | |
| 578 | - | |
| 579 | - case 'E': // Enter | |
| 580 | - hllapi_enter(); | |
| 581 | - break; | |
| 582 | - | |
| 583 | - case 'F': // Erase EOF | |
| 584 | - hllapi_erase_eof(); | |
| 585 | - break; | |
| 586 | - | |
| 587 | - case '1': // PF1 | |
| 588 | - hllapi_pfkey(1); | |
| 589 | - break; | |
| 590 | - | |
| 591 | - case '2': // PF2 | |
| 592 | - hllapi_pfkey(2); | |
| 593 | - break; | |
| 594 | - | |
| 595 | - case '3': // PF3 | |
| 596 | - hllapi_pfkey(3); | |
| 597 | - break; | |
| 598 | - | |
| 599 | - case '4': // PF4 | |
| 600 | - hllapi_pfkey(4); | |
| 601 | - break; | |
| 602 | - | |
| 603 | - case '5': // PF5 | |
| 604 | - hllapi_pfkey(5); | |
| 605 | - break; | |
| 606 | - | |
| 607 | - case '6': // PF6 | |
| 608 | - hllapi_pfkey(6); | |
| 609 | - break; | |
| 610 | - | |
| 611 | - case '7': // PF7 | |
| 612 | - hllapi_pfkey(7); | |
| 613 | - break; | |
| 614 | - | |
| 615 | - case '8': // PF8 | |
| 616 | - hllapi_pfkey(8); | |
| 617 | - break; | |
| 618 | - | |
| 619 | - case '9': // PF9 | |
| 620 | - hllapi_pfkey(9); | |
| 621 | - break; | |
| 622 | - | |
| 623 | - case 'a': // PF10 | |
| 624 | - hllapi_pfkey(10); | |
| 625 | - break; | |
| 626 | - | |
| 627 | - case 'b': // PF11 | |
| 628 | - hllapi_pfkey(11); | |
| 629 | - break; | |
| 630 | - | |
| 631 | - case 'c': // PF12 | |
| 632 | - hllapi_pfkey(12); | |
| 633 | - break; | |
| 634 | - | |
| 635 | - case 'd': // PF13 | |
| 636 | - hllapi_pfkey(13); | |
| 637 | - break; | |
| 638 | - | |
| 639 | - case 'e': // PF14 | |
| 640 | - hllapi_pfkey(14); | |
| 641 | - break; | |
| 642 | - | |
| 643 | - case 'f': // PF15 | |
| 644 | - hllapi_pfkey(15); | |
| 645 | - break; | |
| 646 | - | |
| 647 | - case 'g': // PF16 | |
| 648 | - hllapi_pfkey(16); | |
| 649 | - break; | |
| 650 | - | |
| 651 | - case 'h': // PF17 | |
| 652 | - hllapi_pfkey(17); | |
| 653 | - break; | |
| 654 | - | |
| 655 | - case 'i': // PF18 | |
| 656 | - hllapi_pfkey(18); | |
| 657 | - break; | |
| 658 | - | |
| 659 | - case 'j': // PF19 | |
| 660 | - hllapi_pfkey(19); | |
| 661 | - break; | |
| 662 | - | |
| 663 | - case 'k': // PF20 | |
| 664 | - hllapi_pfkey(20); | |
| 665 | - break; | |
| 666 | - | |
| 667 | - case 'l': // PF21 | |
| 668 | - hllapi_pfkey(21); | |
| 669 | - break; | |
| 670 | - | |
| 671 | - case 'm': // PF22 | |
| 672 | - hllapi_pfkey(22); | |
| 673 | - break; | |
| 674 | - | |
| 675 | - case 'n': // PF23 | |
| 676 | - hllapi_pfkey(23); | |
| 677 | - break; | |
| 678 | - | |
| 679 | - case 'o': // PF24 | |
| 680 | - hllapi_pfkey(24); | |
| 681 | - break; | |
| 682 | - | |
| 683 | - case '@': // Send '@' character | |
| 684 | - hllapi_emulate_input((LPSTR) "@",-1,0); | |
| 685 | - break; | |
| 686 | - | |
| 687 | - case 'x': // PA1 | |
| 688 | - hllapi_pakey(1); | |
| 689 | - break; | |
| 690 | - | |
| 691 | - case 'y': // PA2 | |
| 692 | - hllapi_pakey(2); | |
| 693 | - break; | |
| 694 | - | |
| 695 | - case 'z': // PA3 | |
| 696 | - hllapi_pakey(3); | |
| 697 | - break; | |
| 698 | - | |
| 699 | - case 'B': // PC_LEFTTAB = "@B" | |
| 700 | - break; | |
| 701 | - | |
| 702 | - case 'T': // PC_RIGHTTAB = "@T" | |
| 703 | - break; | |
| 704 | - | |
| 705 | - case 'N': // PC_NEWLINE = "@N" | |
| 706 | - break; | |
| 707 | - | |
| 708 | - case 'C': // PC_CLEAR = "@C" | |
| 709 | - hllapi_erase_input(); | |
| 710 | - break; | |
| 711 | - | |
| 712 | - case 'D': // PC_DELETE = "@D" | |
| 713 | - break; | |
| 714 | - | |
| 715 | - case 'H': // PC_HELP = "@H" | |
| 716 | - break; | |
| 717 | - | |
| 718 | - case 'I': // PC_INSERT = "@I" | |
| 719 | - break; | |
| 720 | - | |
| 721 | - case 'L': // PC_CURSORLEFT = "@L" | |
| 722 | - break; | |
| 723 | - | |
| 724 | - case 'R': // PC_RESET = "@R" | |
| 725 | - hllapi_reset(); | |
| 726 | - break; | |
| 727 | - | |
| 728 | - case 'U': // PC_CURSORUP = "@U" | |
| 729 | - break; | |
| 730 | - | |
| 731 | - case 'V': // PC_CURSORDOWN = "@V" | |
| 732 | - break; | |
| 733 | - | |
| 734 | - case 'Z': // PC_CURSORRIGHT = "@Z" | |
| 735 | - break; | |
| 736 | - | |
| 737 | - case '0': // PC_HOME = "@0" | |
| 738 | - break; | |
| 739 | - | |
| 740 | - case 'p': // PC_PLUSKEY = "@p" | |
| 741 | - break; | |
| 742 | - | |
| 743 | - case 'q': // PC_END = "@q" | |
| 744 | - break; | |
| 745 | - | |
| 746 | - case 's': // PC_SCRLK = "@s" | |
| 747 | - break; | |
| 748 | - | |
| 749 | - case 't': // PC_NUMLOCK = "@t" | |
| 750 | - break; | |
| 751 | - | |
| 752 | - case 'u': // PC_PAGEUP = "@u" | |
| 753 | - break; | |
| 754 | - | |
| 755 | - case 'v': // PC_PAGEDOWN = "@v" | |
| 756 | - break; | |
| 757 | - | |
| 758 | - case '/': // PC_OVERRUNOFQUEUE = "@/" ' Queue overflow, used in Get Key only | |
| 759 | - break; | |
| 760 | - | |
| 761 | - case '$': // PC_ALTCURSOR = "@$" ' Presentation Manager only, unused in VB environment | |
| 762 | - break; | |
| 763 | - | |
| 764 | - case '<': // PC_BACKSPACE = "@<" | |
| 765 | - break; | |
| 766 | - | |
| 767 | - | |
| 768 | -/* | |
| 769 | - | |
| 770 | -Global Const PC_TEST = "@A@C" | |
| 771 | -Global Const PC_WORDDELETE = "@A@D" | |
| 772 | -Global Const PC_FIELDEXIT = "@A@E" | |
| 773 | -Global Const PC_ERASEINPUT = "@A@F" | |
| 774 | -Global Const PC_SYSTEMREQUEST = "@A@H" | |
| 775 | -Global Const PC_INSERTTOGGLE = "@A@I" | |
| 776 | -Global Const PC_CURSORSELECT = "@A@J" | |
| 777 | -Global Const PC_CURSLEFTFAST = "@A@L" | |
| 778 | -Global Const PC_GETCURSOR = "@A@N" | |
| 779 | -Global Const PC_LOCATECURSOR = "@A@O" | |
| 780 | -Global Const PC_ATTENTION = "@A@Q" | |
| 781 | -Global Const PC_DEVICECANCEL = "@A@R" | |
| 782 | -Global Const PC_PRINTPS = "@A@T" | |
| 783 | -Global Const PC_CURSUPFAST = "@A@U" | |
| 784 | -Global Const PC_CURSDOWNFAST = "@A@V" | |
| 785 | -Global Const PC_HEX = "@A@X" | |
| 786 | -Global Const PC_FUNCTIONKEY = "@A@Y" | |
| 787 | -Global Const PC_CURSRIGHTFAST = "@A@Z" | |
| 788 | - | |
| 789 | -Global Const PC_REVERSEVIDEO = "@A@9" | |
| 790 | -Global Const PC_UNDERSCORE = "@A@b" | |
| 791 | -Global Const PC_BLINK = "@A@c" | |
| 792 | -Global Const PC_RED = "@A@d" | |
| 793 | -Global Const PC_PINK = "@A@e" | |
| 794 | -Global Const PC_GREEN = "@A@f" | |
| 795 | -Global Const PC_YELLOW = "@A@g" | |
| 796 | -Global Const PC_BLUE = "@A@h" | |
| 797 | -Global Const PC_TURQOISE = "@A@i" | |
| 798 | -Global Const PC_WHITE = "@A@j" | |
| 799 | -Global Const PC_RSTHOSTCOLORS = "@A@l" | |
| 800 | -Global Const PC_PRINTPC = "@A@t" | |
| 801 | - | |
| 802 | -Global Const PC_FIELDMINUS = "@A@-" | |
| 803 | -Global Const PC_FIELDPLUS = "@A@+" | |
| 804 | - | |
| 805 | -*/ | |
| 806 | - | |
| 807 | - } | |
| 808 | - | |
| 809 | - buffer = ptr; | |
| 810 | - | |
| 811 | - } | |
| 812 | - | |
| 813 | - if(*buffer) | |
| 814 | - hllapi_emulate_input(buffer,-1,0); | |
| 815 | - | |
| 816 | - } | |
| 817 | - else | |
| 818 | - { | |
| 819 | - hllapi_emulate_input(text,szText,0); | |
| 820 | - } | |
| 821 | - | |
| 822 | - free(text); | |
| 823 | - | |
| 824 | - return rc; | |
| 825 | - } | |
| 826 | - |
src/hllapi/client.h
| ... | ... | @@ -1,56 +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. | |
| 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., 59 Temple | |
| 19 | - * Place, Suite 330, Boston, MA, 02111-1307, USA | |
| 20 | - * | |
| 21 | - * Este programa está nomeado como private.h 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 | - #include <pw3270/hllapi.h> | |
| 31 | - | |
| 32 | - #ifndef ETIMEDOUT | |
| 33 | - #define ETIMEDOUT 1238 | |
| 34 | - #endif // ETIMEDOUT | |
| 35 | - | |
| 36 | - #define PIPE_BUFFER_LENGTH 8192 | |
| 37 | - | |
| 38 | - #define set_active(x) /* x */ | |
| 39 | - | |
| 40 | - #if defined(DEBUG) && defined(_WIN32) | |
| 41 | - #undef trace | |
| 42 | - #define trace( fmt, ... ) fprintf(stderr, "%s(%d) " fmt "\n", __FILE__, __LINE__, __VA_ARGS__ ); fflush(stderr); | |
| 43 | - #endif // DEBUG | |
| 44 | - | |
| 45 | - #ifdef __cplusplus | |
| 46 | - extern "C" { | |
| 47 | - #endif | |
| 48 | - | |
| 49 | - char * hllapi_get_string(int offset, size_t len); | |
| 50 | - void hllapi_free(void *p); | |
| 51 | - | |
| 52 | - #ifdef __cplusplus | |
| 53 | - } /* end of extern "C" */ | |
| 54 | - #endif | |
| 55 | - | |
| 56 | - |
src/hllapi/environ.bat
src/hllapi/hllapi.c
| ... | ... | @@ -1,466 +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. | |
| 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., 59 Temple | |
| 19 | - * Place, Suite 330, Boston, MA, 02111-1307, USA | |
| 20 | - * | |
| 21 | - * Este programa está nomeado como hllapi.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 | - #include <lib3270.h> | |
| 31 | - #include <malloc.h> | |
| 32 | - #include <string.h> | |
| 33 | - #include <errno.h> | |
| 34 | - #include <pw3270/hllapi.h> | |
| 35 | - #include <stdio.h> | |
| 36 | - #include <time.h> | |
| 37 | - #include <lib3270/log.h> | |
| 38 | - #include "client.h" | |
| 39 | - | |
| 40 | - /*--[ Prototipes ]-----------------------------------------------------------------------------------*/ | |
| 41 | - | |
| 42 | - static int connect_ps(char *buffer, unsigned short *length, unsigned short *rc); | |
| 43 | - static int disconnect_ps(char *buffer, unsigned short *length, unsigned short *rc); | |
| 44 | - static int get_library_revision(char *buffer, unsigned short *length, unsigned short *rc); | |
| 45 | - static int copy_ps_to_str(char *buffer, unsigned short *length, unsigned short *rc); | |
| 46 | - static int copy_str_to_ps(char *buffer, unsigned short *length, unsigned short *rc); | |
| 47 | - static int search_ps(char *buffer, unsigned short *length, unsigned short *rc); | |
| 48 | - static int copy_ps(char *buffer, unsigned short *length, unsigned short *rc); | |
| 49 | - static int wait_system(char *buffer, unsigned short *length, unsigned short *rc); | |
| 50 | - static int reset_system(char *buffer, unsigned short *length, unsigned short *rc); | |
| 51 | - static int pause_system(char *buffer, unsigned short *length, unsigned short *rc); | |
| 52 | - static int set_session_parameters(char *buffer, unsigned short *length, unsigned short *rc); | |
| 53 | - | |
| 54 | - static int get_cursor_position(char *buffer, unsigned short *length, unsigned short *rc); | |
| 55 | - static int set_cursor_position(char *buffer, unsigned short *length, unsigned short *rc); | |
| 56 | - static int input_string(char *buffer, unsigned short *length, unsigned short *rc); | |
| 57 | - | |
| 58 | - static int invalid_request(char *buffer, unsigned short *length, unsigned short *rc); | |
| 59 | - | |
| 60 | -/*--[ Globals ]--------------------------------------------------------------------------------------*/ | |
| 61 | - | |
| 62 | - static const struct _hllapi_call | |
| 63 | - { | |
| 64 | - unsigned long func; | |
| 65 | - int (*exec)(char *buffer, unsigned short *length, unsigned short *rc); | |
| 66 | - } hllapi_call[] = | |
| 67 | - { | |
| 68 | - { HLLAPI_CMD_CONNECTPS, connect_ps }, | |
| 69 | - { HLLAPI_CMD_DISCONNECTPS, disconnect_ps }, | |
| 70 | - { HLLAPI_CMD_GETREVISION, get_library_revision }, | |
| 71 | - { HLLAPI_CMD_QUERYCURSOR, get_cursor_position }, | |
| 72 | - { HLLAPI_CMD_SETCURSOR, set_cursor_position }, | |
| 73 | - { HLLAPI_CMD_COPYPSTOSTR, copy_ps_to_str }, | |
| 74 | - { HLLAPI_CMD_INPUTSTRING, input_string }, | |
| 75 | - { HLLAPI_CMD_WAIT, wait_system }, | |
| 76 | - { HLLAPI_CMD_COPYPS, copy_ps }, | |
| 77 | - { HLLAPI_CMD_SEARCHPS, search_ps }, | |
| 78 | - { HLLAPI_CMD_COPYSTRTOPS, copy_str_to_ps }, | |
| 79 | - { HLLAPI_CMD_SENDFILE, invalid_request }, | |
| 80 | - { HLLAPI_CMD_RECEIVEFILE, invalid_request }, | |
| 81 | - { HLLAPI_RESET_SYSTEM, reset_system }, | |
| 82 | - { HLLAPI_CMD_PAUSE, pause_system }, | |
| 83 | - { HLLAPI_SET_SESSION_PARAMETERS, set_session_parameters } | |
| 84 | - | |
| 85 | - }; | |
| 86 | - | |
| 87 | - static enum _pause_mode | |
| 88 | - { | |
| 89 | - PAUSE_MODE_IPAUSE, ///< @brief Interruptible pause. After the Start Host Notification (23) function is executed, a host event satisfies a pause. | |
| 90 | - PAUSE_MODE_FPAUSE ///< @brief A full-duration pause lasts for however long you specified in the Pause (18) function. | |
| 91 | - } pause_mode = PAUSE_MODE_IPAUSE; | |
| 92 | - | |
| 93 | -/*--[ Implement ]------------------------------------------------------------------------------------*/ | |
| 94 | - | |
| 95 | -HLLAPI_API_CALL hllapi(const LPWORD func, LPSTR buffer, LPWORD length, LPWORD rc) | |
| 96 | -{ | |
| 97 | - unsigned int f; | |
| 98 | - | |
| 99 | - trace("%s(%d)",__FUNCTION__,*func); | |
| 100 | - | |
| 101 | - for(f=0;f< (sizeof (hllapi_call) / sizeof ((hllapi_call)[0]));f++) | |
| 102 | - { | |
| 103 | - if(hllapi_call[f].func == *func) | |
| 104 | - { | |
| 105 | - int status = hllapi_call[f].exec(buffer,length,rc); | |
| 106 | - trace("hllapi(%d) exits with rc=%d",*func,status); | |
| 107 | - return status; | |
| 108 | - } | |
| 109 | - } | |
| 110 | - | |
| 111 | - trace("hllapi(%d) failed",*func); | |
| 112 | - | |
| 113 | - *rc = HLLAPI_STATUS_UNSUPPORTED; | |
| 114 | - return *rc; | |
| 115 | - | |
| 116 | -} | |
| 117 | - | |
| 118 | -static int invalid_request(char *buffer, unsigned short *length, unsigned short *rc) | |
| 119 | -{ | |
| 120 | - *rc = HLLAPI_STATUS_BAD_PARAMETER; | |
| 121 | - return *rc; | |
| 122 | -} | |
| 123 | - | |
| 124 | -static int connect_ps(char *buffer, unsigned short *length, unsigned short *rc) | |
| 125 | -{ | |
| 126 | - char *tempbuffer = NULL; | |
| 127 | - | |
| 128 | - trace("%s: len=%d buflen=%d",__FUNCTION__,*length,(int) strlen(buffer)); | |
| 129 | - | |
| 130 | - if(strlen(buffer) > *length) | |
| 131 | - buffer[*length] = 0; | |
| 132 | - | |
| 133 | - if(!strrchr(buffer,':')) | |
| 134 | - { | |
| 135 | - int sz = strlen(buffer); | |
| 136 | - | |
| 137 | - tempbuffer = (char *) malloc(sz+2); | |
| 138 | - strcpy(tempbuffer,buffer); | |
| 139 | - tempbuffer[sz-1] = ':'; | |
| 140 | - tempbuffer[sz] = buffer[sz-1]; | |
| 141 | - tempbuffer[sz+1] = 0; | |
| 142 | - buffer = tempbuffer; | |
| 143 | - } | |
| 144 | - | |
| 145 | - *rc = hllapi_init(buffer); | |
| 146 | - | |
| 147 | - if(tempbuffer) | |
| 148 | - free(tempbuffer); | |
| 149 | - | |
| 150 | - return 0; | |
| 151 | -} | |
| 152 | - | |
| 153 | -static int disconnect_ps(char *buffer, unsigned short *length, unsigned short *rc) | |
| 154 | -{ | |
| 155 | - *rc = hllapi_deinit(); | |
| 156 | - return 0; | |
| 157 | -} | |
| 158 | - | |
| 159 | -static int get_library_revision(char *buffer, unsigned short *length, unsigned short *rc) | |
| 160 | -{ | |
| 161 | - *rc = hllapi_get_revision(); | |
| 162 | - return 0; | |
| 163 | -} | |
| 164 | - | |
| 165 | -static int get_cursor_position(char *buffer, unsigned short *length, unsigned short *rc) | |
| 166 | -{ | |
| 167 | - int pos = hllapi_getcursor(); | |
| 168 | - | |
| 169 | - trace("%s(%d)",__FUNCTION__,pos); | |
| 170 | - | |
| 171 | - if(pos < 0) | |
| 172 | - return -1; | |
| 173 | - | |
| 174 | - *rc = pos; | |
| 175 | - return 0; | |
| 176 | -} | |
| 177 | - | |
| 178 | -static int set_cursor_position(char *buffer, unsigned short *length, unsigned short *rc) | |
| 179 | -{ | |
| 180 | - trace("%s(%d)",__FUNCTION__,*rc); | |
| 181 | - *rc = hllapi_setcursor(*rc); | |
| 182 | - return 0; | |
| 183 | -} | |
| 184 | - | |
| 185 | -static int copy_ps_to_str(char *buffer, unsigned short *length, unsigned short *rc) | |
| 186 | -{ | |
| 187 | - | |
| 188 | - // Length Length of the target data string. | |
| 189 | - // PS Position Position within the host presentation space of the first byte in your target data string. | |
| 190 | - *rc = hllapi_get_screen(*rc,buffer,*length); | |
| 191 | - | |
| 192 | - return 0; | |
| 193 | -} | |
| 194 | - | |
| 195 | -static int input_string(char *buffer, unsigned short *length, unsigned short *rc) | |
| 196 | -{ | |
| 197 | - *rc = hllapi_input_string(buffer,*length); | |
| 198 | - return 0; | |
| 199 | -} | |
| 200 | - | |
| 201 | -static int search_ps(char *buffer, unsigned short *length, unsigned short *ps) | |
| 202 | -{ | |
| 203 | - /* | |
| 204 | - * Data String Target string for search. | |
| 205 | - * Length Length of the target data string. Overridden in EOT mode. | |
| 206 | - * PS Position Position within the host presentation space where the search is to begin (SRCHFRWD option) or to end | |
| 207 | - * (SRCHBKWD option). Overridden in SRCHALL (default) mode. | |
| 208 | - * | |
| 209 | - * Return in *ps: | |
| 210 | - * | |
| 211 | - * = 0 The string was not found. | |
| 212 | - * > 0 The string was found at the indicated host presentation space position. | |
| 213 | - * | |
| 214 | - * Return code: | |
| 215 | - * | |
| 216 | - * 0 The Search Presentation Space function was successful. | |
| 217 | - * 1 Your program is not connected to a host session. | |
| 218 | - * 2 An error was made in specifying parameters. | |
| 219 | - * 7 The host presentation space position is not valid. | |
| 220 | - * 9 A system error was encountered. | |
| 221 | - * 24 The search string was not found. | |
| 222 | - * | |
| 223 | - */ | |
| 224 | - size_t szBuffer = strlen(buffer); | |
| 225 | - char * text; | |
| 226 | - int rc = HLLAPI_STATUS_SYSTEM_ERROR; | |
| 227 | - | |
| 228 | - if(!hllapi_is_connected()) | |
| 229 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 230 | - | |
| 231 | - if(*length < szBuffer) | |
| 232 | - szBuffer = *length; | |
| 233 | - | |
| 234 | - | |
| 235 | - text = hllapi_get_string(*ps,szBuffer); | |
| 236 | - if(!text) | |
| 237 | - return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 238 | - | |
| 239 | - if(strncmp(text,buffer,szBuffer)) | |
| 240 | - { | |
| 241 | - // String not found | |
| 242 | - *ps = 0; | |
| 243 | - rc = HLLAPI_STATUS_NOT_FOUND; | |
| 244 | - } | |
| 245 | - else | |
| 246 | - { | |
| 247 | - // String found | |
| 248 | - *ps = 1; | |
| 249 | - rc = HLLAPI_STATUS_SUCCESS; | |
| 250 | - } | |
| 251 | - | |
| 252 | - hllapi_free(text); | |
| 253 | - | |
| 254 | - return rc; | |
| 255 | -} | |
| 256 | - | |
| 257 | -static int copy_ps(char *buffer, unsigned short *length, unsigned short *rc) | |
| 258 | -{ | |
| 259 | - /* | |
| 260 | - * Data String Preallocated target string the size of your host presentation space. This can vary depending on how your host presentation space is configured. When the Set Session Parameters (9) function with the EAB option is issued, the length of the data string must be at least twice the length of the presentation space. | |
| 261 | - * DBCS Only: When the EAD option is specified, the length of the data string must be at least three times the length of the presentation space. When both the EAB and EAD options are specified, the length of the data string must be at least four times the length of the presentation space. | |
| 262 | - * | |
| 263 | - * Length NA (the length of the host presentation space is implied). | |
| 264 | - * PS Position NA. | |
| 265 | - * | |
| 266 | - * Return values: | |
| 267 | - * | |
| 268 | - * 0 The host presentation space contents were copied to the application program. The target presentation space was active, and the keyboard was unlocked. | |
| 269 | - * 1 Your program is not connected to a host session. | |
| 270 | - * 4 The host presentation space contents were copied. The connected host presentation space was waiting for host response. | |
| 271 | - * 5 The host presentation space was copied. The keyboard was locked. | |
| 272 | - * 9 A system error was encountered. | |
| 273 | - * | |
| 274 | - */ | |
| 275 | - size_t szBuffer = strlen(buffer); | |
| 276 | - char * text; | |
| 277 | - | |
| 278 | - if(!hllapi_is_connected()) | |
| 279 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 280 | - | |
| 281 | - text = hllapi_get_string(1, szBuffer); | |
| 282 | - | |
| 283 | - if(!text) | |
| 284 | - return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 285 | - | |
| 286 | - memcpy(buffer,text,szBuffer); | |
| 287 | - | |
| 288 | - hllapi_free(text); | |
| 289 | - | |
| 290 | - return hllapi_get_state(); | |
| 291 | -} | |
| 292 | - | |
| 293 | -static int wait_system(char *buffer, unsigned short *length, unsigned short *rc) | |
| 294 | -{ | |
| 295 | - /* | |
| 296 | - * Checks the status of the host-connected presentation space. If the session is | |
| 297 | - * waiting for a host response (indicated by XCLOCK (X []) or XSYSTEM), the Wait | |
| 298 | - * function causes HLLAPI to wait up to 1 minute to see if the condition clears. | |
| 299 | - * | |
| 300 | - */ | |
| 301 | - | |
| 302 | - /* | |
| 303 | - * Return Code Definition | |
| 304 | - * | |
| 305 | - * HLLAPI_STATUS_SUCCESS 0 The keyboard is unlocked and ready for input. | |
| 306 | - * HLLAPI_STATUS_DISCONNECTED 1 Your application program is not connected to a valid session. | |
| 307 | - * HLLAPI_STATUS_TIMEOUT 4 Timeout while still in XCLOCK (X []) or XSYSTEM. | |
| 308 | - * HLLAPI_STATUS_KEYBOARD_LOCKED 5 The keyboard is locked. | |
| 309 | - * HLLAPI_STATUS_SYSTEM_ERROR 9 A system error was encountered. | |
| 310 | - * | |
| 311 | - */ | |
| 312 | - | |
| 313 | - /* | |
| 314 | - time_t end = time(0) + 60; | |
| 315 | - | |
| 316 | - while(time(0) < end) | |
| 317 | - { | |
| 318 | - int state = hllapi_get_state(); | |
| 319 | - | |
| 320 | - if(state != HLLAPI_STATUS_WAITING) | |
| 321 | - return state; | |
| 322 | - | |
| 323 | - hllapi_wait(1); | |
| 324 | - | |
| 325 | - } | |
| 326 | - | |
| 327 | - return HLLAPI_STATUS_TIMEOUT; | |
| 328 | - */ | |
| 329 | - | |
| 330 | - int state = hllapi_wait_for_ready(60); | |
| 331 | - return (state == HLLAPI_STATUS_WAITING ? HLLAPI_STATUS_TIMEOUT : state); | |
| 332 | - | |
| 333 | -} | |
| 334 | - | |
| 335 | -static int copy_str_to_ps(char *text, unsigned short *length, unsigned short *ps) | |
| 336 | -{ | |
| 337 | - /* | |
| 338 | - * Call Parameters | |
| 339 | - * | |
| 340 | - * Data String of ASCII data to be copied into the host presentation space. | |
| 341 | - * Length Length, in number of bytes, of the source data string. Overridden if in EOT mode. | |
| 342 | - * PS Position in the host presentation space to begin the copy, a value between 1 and the configured size of your host presentation space. | |
| 343 | - * | |
| 344 | - * Return Parameters | |
| 345 | - * | |
| 346 | - * HLLAPI_STATUS_SUCCESS 0 The Copy String to Presentation Space function was successful. | |
| 347 | - * HLLAPI_STATUS_DISCONNECTED 1 Your program is not connected to a host session. | |
| 348 | - * HLLAPI_STATUS_BAD_PARAMETER 2 Parameter error or zero length for copy. | |
| 349 | - * HLLAPI_STATUS_KEYBOARD_LOCKED 5 The target presentation space is protected or inhibited, or incorrect data was sent to the target presentation space (such as a field attribute byte). | |
| 350 | - * 6 The copy was completed, but the data was truncated. | |
| 351 | - * 7 The host presentation space position is not valid. | |
| 352 | - * HLLAPI_STATUS_SYSTEM_ERROR 9 A system error was encountered. | |
| 353 | - * | |
| 354 | - */ | |
| 355 | - size_t szText = strlen(text); | |
| 356 | - | |
| 357 | - if(*length < szText) | |
| 358 | - szText = *length; | |
| 359 | - | |
| 360 | - if(!szText) | |
| 361 | - return HLLAPI_STATUS_BAD_PARAMETER; | |
| 362 | - | |
| 363 | - switch(hllapi_get_message_id()) | |
| 364 | - { | |
| 365 | - case LIB3270_MESSAGE_NONE: | |
| 366 | - break; | |
| 367 | - | |
| 368 | - case LIB3270_MESSAGE_DISCONNECTED: | |
| 369 | - return HLLAPI_STATUS_DISCONNECTED; | |
| 370 | - | |
| 371 | - case LIB3270_MESSAGE_MINUS: | |
| 372 | - case LIB3270_MESSAGE_PROTECTED: | |
| 373 | - case LIB3270_MESSAGE_NUMERIC: | |
| 374 | - case LIB3270_MESSAGE_OVERFLOW: | |
| 375 | - case LIB3270_MESSAGE_INHIBIT: | |
| 376 | - case LIB3270_MESSAGE_KYBDLOCK: | |
| 377 | - return HLLAPI_STATUS_KEYBOARD_LOCKED; | |
| 378 | - | |
| 379 | - default: | |
| 380 | - return HLLAPI_STATUS_SYSTEM_ERROR; | |
| 381 | - } | |
| 382 | - | |
| 383 | - return hllapi_emulate_input(text,szText,0); | |
| 384 | -} | |
| 385 | - | |
| 386 | -static int reset_system(char *buffer, unsigned short *length, unsigned short *rc) | |
| 387 | -{ | |
| 388 | - return hllapi_reset(); | |
| 389 | -} | |
| 390 | - | |
| 391 | - | |
| 392 | -static int pause_system(char *buffer, unsigned short *length, unsigned short *rc) | |
| 393 | -{ | |
| 394 | - if(!*length) | |
| 395 | - { | |
| 396 | - // If you use the IPAUSE option and the pause value is zero, then the function | |
| 397 | - // waits up to 2400 half-second intervals, unless interrupted sooner. If you use the | |
| 398 | - // FPAUSE option and the pause value is zero, then the function returns | |
| 399 | - // immediately. | |
| 400 | - | |
| 401 | - if(pause_mode == PAUSE_MODE_FPAUSE) | |
| 402 | - { | |
| 403 | - return HLLAPI_STATUS_SUCCESS; | |
| 404 | - } | |
| 405 | - return hllapi_wait_for_ready(1200); | |
| 406 | - } | |
| 407 | - | |
| 408 | - if(pause_mode == PAUSE_MODE_FPAUSE) | |
| 409 | - { | |
| 410 | - // Pause fixo - Aguarda pelo tempo informado, independente de eventos. | |
| 411 | - return hllapi_wait( (*length) / 2); | |
| 412 | - } | |
| 413 | - | |
| 414 | - // Pause "flexivel", aguarda mudança no conteúdo da tela!!! | |
| 415 | - | |
| 416 | - // #warning Mudar comportamento na lib! | |
| 417 | - | |
| 418 | - return hllapi_wait_for_ready((*length) / 2); | |
| 419 | -} | |
| 420 | - | |
| 421 | -static int set_session_parameters(char *buffer, unsigned short *length, unsigned short *rc) | |
| 422 | -{ | |
| 423 | - if(!(*length && buffer && *buffer)) | |
| 424 | - { | |
| 425 | - return HLLAPI_STATUS_BAD_PARAMETER; | |
| 426 | - } | |
| 427 | - | |
| 428 | - *rc = hllapi_set_session_parameter(buffer, *length, *rc); | |
| 429 | - | |
| 430 | - return 0; | |
| 431 | -} | |
| 432 | - | |
| 433 | -HLLAPI_API_CALL hllapi_set_session_parameter(LPSTR param, WORD len, WORD value) | |
| 434 | -{ | |
| 435 | - if(!param) | |
| 436 | - { | |
| 437 | - return HLLAPI_STATUS_BAD_PARAMETER; | |
| 438 | - } | |
| 439 | - | |
| 440 | - if(!len) | |
| 441 | - { | |
| 442 | - len = strlen(param); | |
| 443 | - } | |
| 444 | - | |
| 445 | - if(!strncasecmp(param,"IPAUSE",len)) | |
| 446 | - { | |
| 447 | - // IPAUSE | |
| 448 | - pause_mode = PAUSE_MODE_IPAUSE; | |
| 449 | - } | |
| 450 | - else if(!strncasecmp(param,"FPAUSE",len)) | |
| 451 | - { | |
| 452 | - // FPAUSE | |
| 453 | - pause_mode = PAUSE_MODE_FPAUSE; | |
| 454 | - } | |
| 455 | - else if(!strncasecmp(param,"UNLOCKDELAY",len)) | |
| 456 | - { | |
| 457 | - // UNLOCKDELAY | |
| 458 | - hllapi_set_unlock_delay(value); | |
| 459 | - } | |
| 460 | - else | |
| 461 | - { | |
| 462 | - return HLLAPI_STATUS_BAD_PARAMETER; | |
| 463 | - } | |
| 464 | - | |
| 465 | - return HLLAPI_STATUS_SUCCESS; | |
| 466 | -} |
src/hllapi/hllapi.cbp
| ... | ... | @@ -1,89 +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="pw3270 HLLAPI" /> | |
| 6 | - <Option makefile_is_custom="1" /> | |
| 7 | - <Option pch_mode="2" /> | |
| 8 | - <Option compiler="gcc" /> | |
| 9 | - <Build> | |
| 10 | - <Target title="Debug"> | |
| 11 | - <Option output=".bin/Debug/pw3270 HLLAPI" prefix_auto="1" extension_auto="1" /> | |
| 12 | - <Option object_output=".obj/Debug/" /> | |
| 13 | - <Option type="1" /> | |
| 14 | - <Option compiler="gcc" /> | |
| 15 | - <Compiler> | |
| 16 | - <Add option="-g" /> | |
| 17 | - </Compiler> | |
| 18 | - <MakeCommands> | |
| 19 | - <Build command="$make LIB3270_MODE=Debug -f $makefile $target" /> | |
| 20 | - <CompileFile command="$make -f $makefile $file" /> | |
| 21 | - <Clean command="$make -f $makefile clean$target" /> | |
| 22 | - <DistClean command="$make -f $makefile distclean$target" /> | |
| 23 | - <AskRebuildNeeded command="$make -q -f $makefile $target" /> | |
| 24 | - <SilentBuild command="$make LIB3270_MODE=Debug -f $makefile $target > $(CMD_NULL)" /> | |
| 25 | - </MakeCommands> | |
| 26 | - </Target> | |
| 27 | - <Target title="Release"> | |
| 28 | - <Option output=".bin/Release/pw3270 HLLAPI" prefix_auto="1" extension_auto="1" /> | |
| 29 | - <Option object_output=".obj/Release/" /> | |
| 30 | - <Option type="1" /> | |
| 31 | - <Option compiler="gcc" /> | |
| 32 | - <Compiler> | |
| 33 | - <Add option="-O2" /> | |
| 34 | - </Compiler> | |
| 35 | - <Linker> | |
| 36 | - <Add option="-s" /> | |
| 37 | - </Linker> | |
| 38 | - </Target> | |
| 39 | - <Target title="test"> | |
| 40 | - <Option output=".bin/Debug/test" prefix_auto="1" extension_auto="1" /> | |
| 41 | - <Option object_output=".obj/Debug/" /> | |
| 42 | - <Option type="1" /> | |
| 43 | - <Option compiler="gcc" /> | |
| 44 | - <Compiler> | |
| 45 | - <Add option="-g" /> | |
| 46 | - </Compiler> | |
| 47 | - <Environment> | |
| 48 | - <Variable name="LIB3270_CFLAGS" value='"-I../../../src/include"' /> | |
| 49 | - <Variable name="LIB3270_LIBS" value='"-L../../../.bin/Debug -l3270"' /> | |
| 50 | - <Variable name="PW3270_LIBS" value='"-L../../../.bin/Debug -lpw3270 -l3270"' /> | |
| 51 | - </Environment> | |
| 52 | - <MakeCommands> | |
| 53 | - <Build command="$make LIB3270_MODE=Debug -f $makefile $target" /> | |
| 54 | - <CompileFile command="$make -f $makefile $file" /> | |
| 55 | - <Clean command="$make -f $makefile clean$target" /> | |
| 56 | - <DistClean command="$make -f $makefile distclean$target" /> | |
| 57 | - <AskRebuildNeeded command="$make -q -f $makefile $target" /> | |
| 58 | - <SilentBuild command="$make LIB3270_MODE=Debug -f $makefile $target > $(CMD_NULL)" /> | |
| 59 | - </MakeCommands> | |
| 60 | - </Target> | |
| 61 | - </Build> | |
| 62 | - <Compiler> | |
| 63 | - <Add option="-Wall" /> | |
| 64 | - </Compiler> | |
| 65 | - <Unit filename="../../include/lib3270.h" /> | |
| 66 | - <Unit filename="../../include/pw3270/hllapi.h" /> | |
| 67 | - <Unit filename="../../include/pw3270cpp.h" /> | |
| 68 | - <Unit filename="Makefile.in" /> | |
| 69 | - <Unit filename="calls.cc" /> | |
| 70 | - <Unit filename="client.h" /> | |
| 71 | - <Unit filename="hllapi.c"> | |
| 72 | - <Option compilerVar="CC" /> | |
| 73 | - </Unit> | |
| 74 | - <Unit filename="pluginmain.c"> | |
| 75 | - <Option compilerVar="CC" /> | |
| 76 | - </Unit> | |
| 77 | - <Unit filename="remotectl.h" /> | |
| 78 | - <Unit filename="server.h" /> | |
| 79 | - <Unit filename="testprogram.c"> | |
| 80 | - <Option compilerVar="CC" /> | |
| 81 | - </Unit> | |
| 82 | - <Extensions> | |
| 83 | - <code_completion /> | |
| 84 | - <envvars /> | |
| 85 | - <debugger /> | |
| 86 | - <lib_finder disable_auto="1" /> | |
| 87 | - </Extensions> | |
| 88 | - </Project> | |
| 89 | -</CodeBlocks_project_file> |
src/hllapi/idlcomp.bat
src/hllapi/maketest.sh
| ... | ... | @@ -1 +0,0 @@ |
| 1 | -make LIB3270_MODE=Debug test |
src/hllapi/pw3270.idl
| ... | ... | @@ -1,53 +0,0 @@ |
| 1 | -// This is the type library for libhllapi.dll | |
| 2 | - | |
| 3 | -// | |
| 4 | -// References: | |
| 5 | -// | |
| 6 | -// http://support.microsoft.com/kb/189133 | |
| 7 | -// http://msdn.microsoft.com/en-us/library/windows/desktop/aa367300(v=vs.85).aspx | |
| 8 | -// | |
| 9 | -[ | |
| 10 | - // Use GUIDGEN.EXE to create the UUID that uniquely identifies | |
| 11 | - // this library on the user's system. NOTE: This must be done!! | |
| 12 | - uuid(4CC73F7D-5C10-4313-8FFD-F01999A44656), | |
| 13 | - | |
| 14 | - // This helpstring defines how the library will appear in the | |
| 15 | - // References dialog of VB. | |
| 16 | - helpstring("PW3270 HLLAPI typelib"), | |
| 17 | - | |
| 18 | - // Assume standard English locale. | |
| 19 | - lcid(0x0409), | |
| 20 | - | |
| 21 | - // Assign a version number to keep track of changes. | |
| 22 | - version(5.0) | |
| 23 | -] | |
| 24 | - | |
| 25 | -library HLLAPI | |
| 26 | -{ | |
| 27 | - | |
| 28 | - // Now define the module that will "declare" your C functions. | |
| 29 | - [ | |
| 30 | - helpstring("HLLAPI calls for pw3270"), | |
| 31 | - | |
| 32 | - version(5.0), | |
| 33 | - | |
| 34 | - // Give the name of your DLL here. | |
| 35 | - dllname("libhllapi.dll") | |
| 36 | - ] | |
| 37 | - | |
| 38 | - module hllApiFunctions | |
| 39 | - { | |
| 40 | - [ | |
| 41 | - helpstring("Initialize pw3270´s instance."), | |
| 42 | - entry("hllapi_init") | |
| 43 | - ] | |
| 44 | - // The [in], [out], and [in, out] keywords tell the Automation | |
| 45 | - // client which direction parameters need to be passed. Some | |
| 46 | - // calls can be optimized if a function only needs a parameter | |
| 47 | - // to be passed one-way. | |
| 48 | - DWORD __stdcall hllapi_init( [in] LPSTR mode); | |
| 49 | - | |
| 50 | - | |
| 51 | - } // End of Module | |
| 52 | - | |
| 53 | -}; // End of Library |
src/hllapi/remotectl.h
| ... | ... | @@ -1,84 +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 remotectl.h 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 | - * Agradecimento: | |
| 29 | - * | |
| 30 | - * Hélio Passos | |
| 31 | - * | |
| 32 | - */ | |
| 33 | - | |
| 34 | - #define ENABLE_NLS | |
| 35 | - #define GETTEXT_PACKAGE PACKAGE_NAME | |
| 36 | - | |
| 37 | - #include <libintl.h> | |
| 38 | - #include <glib/gi18n.h> | |
| 39 | - #include <gtk/gtk.h> | |
| 40 | - | |
| 41 | - #include <lib3270.h> | |
| 42 | - #include <lib3270/log.h> | |
| 43 | - #include <pw3270/hllapi.h> | |
| 44 | - | |
| 45 | - typedef struct _remotequery | |
| 46 | - { | |
| 47 | -#ifdef _WIN32 | |
| 48 | - HANDLE hPipe; /**< Pipe handle (for response) */ | |
| 49 | -#endif // _WIN32 | |
| 50 | - | |
| 51 | - H3270 * hSession; /**< 3270 Session */ | |
| 52 | - int cmd; /**< Command */ | |
| 53 | - int rc; /**< Response status */ | |
| 54 | - | |
| 55 | - int pos; | |
| 56 | - unsigned short length; /**< Query string length */ | |
| 57 | - const gchar * text; /**< Query string */ | |
| 58 | - | |
| 59 | - } QUERY; | |
| 60 | - | |
| 61 | - G_GNUC_INTERNAL void enqueue_request(QUERY *qry); | |
| 62 | - G_GNUC_INTERNAL void request_complete(QUERY *qry, int rc, const gchar *text); | |
| 63 | - | |
| 64 | - G_GNUC_INTERNAL void request_status(QUERY *qry, int rc); | |
| 65 | - G_GNUC_INTERNAL void request_value(QUERY *qry, int rc, unsigned int value); | |
| 66 | - G_GNUC_INTERNAL void request_buffer(QUERY *qry, int rc, size_t sz, const gpointer buffer); | |
| 67 | - | |
| 68 | -// int run_hllapi(unsigned long function, char *string, unsigned short length, unsigned short rc); | |
| 69 | - | |
| 70 | - | |
| 71 | -#ifdef _WIN32 | |
| 72 | - | |
| 73 | - #define PIPE_BUFFER_LENGTH 8192 | |
| 74 | - | |
| 75 | - void init_source_pipe(HANDLE hPipe); | |
| 76 | - void popup_lasterror(const gchar *fmt, ...); | |
| 77 | - | |
| 78 | -#endif // _WIN32 | |
| 79 | - | |
| 80 | - | |
| 81 | - | |
| 82 | - | |
| 83 | - | |
| 84 | - |
src/hllapi/windows/resources.rc.in
| ... | ... | @@ -1,29 +0,0 @@ |
| 1 | -#include <windows.h> | |
| 2 | - | |
| 3 | -VS_VERSION_INFO VERSIONINFO | |
| 4 | -FILEVERSION @PACKAGE_MAJOR_VERSION@,@PACKAGE_MINOR_VERSION@,@PACKAGE_MAJOR_RELEASE@,0 | |
| 5 | -PRODUCTVERSION @PACKAGE_MAJOR_VERSION@,@PACKAGE_MINOR_VERSION@,@PACKAGE_MAJOR_RELEASE@,0 | |
| 6 | - | |
| 7 | -BEGIN | |
| 8 | - | |
| 9 | - BLOCK "StringFileInfo" | |
| 10 | - BEGIN | |
| 11 | - BLOCK "080904E4" | |
| 12 | - BEGIN | |
| 13 | - VALUE "FileDescription", "pw3270 HLLAPI Client Module\0" | |
| 14 | - VALUE "CompanyName", "Banco do Brasil S/A.\0" | |
| 15 | - VALUE "FileVersion", "@WIN32_VERSION@\0" | |
| 16 | - VALUE "LegalCopyright", "(C) 2017 Banco do Brasil S/A. All Rights Reserved\0" | |
| 17 | - VALUE "OriginalFilename", "hllapi@DLLEXT@\0" | |
| 18 | - VALUE "ProductName", "pw3270\0" | |
| 19 | - VALUE "ProductVersion", "@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@.@PACKAGE_MAJOR_RELEASE@.0\0" | |
| 20 | - END | |
| 21 | - END | |
| 22 | - | |
| 23 | - BLOCK "VarFileInfo" | |
| 24 | - BEGIN | |
| 25 | - VALUE "Translation", 0x809, 0x04E4 | |
| 26 | - END | |
| 27 | - | |
| 28 | -END | |
| 29 | - |
src/include/config.h.in
| ... | ... | @@ -27,15 +27,24 @@ |
| 27 | 27 | * |
| 28 | 28 | */ |
| 29 | 29 | |
| 30 | -#ifndef LIBV3270_CONFIG_INCLUDED | |
| 30 | +/** | |
| 31 | + * @file config.h | |
| 32 | + * | |
| 33 | + * @brief Configuração para o aplicativo. | |
| 34 | + * | |
| 35 | + * Gerado automaticamente pelo processo ./configure esse arquivo descreve | |
| 36 | + * as configurações de ambiente detectadas automaticamente. | |
| 37 | + * | |
| 38 | + * @author perry.werneck@gmail.com | |
| 39 | + * | |
| 40 | + */ | |
| 41 | + | |
| 42 | +#ifndef CONFIG_H_INCLUDED | |
| 31 | 43 | |
| 32 | - #define LIBV3270_CONFIG_INCLUDED 1 | |
| 44 | + #define CONFIG_H_INCLUDED 1 | |
| 33 | 45 | |
| 34 | 46 | #undef PACKAGE_NAME |
| 35 | 47 | #undef PACKAGE_VERSION |
| 36 | 48 | #undef PACKAGE_RELEASE |
| 37 | 49 | |
| 38 | - #undef HAVE_GNOME | |
| 39 | - #undef HAVE_GTKMAC | |
| 40 | - | |
| 41 | -#endif /* LIBV3270_CONFIG_INCLUDED */ | |
| 50 | +#endif /* CONFIG_H_INCLUDED */ | ... | ... |
| ... | ... | @@ -0,0 +1,372 @@ |
| 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. | |
| 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., 59 Temple | |
| 19 | + * Place, Suite 330, Boston, MA, 02111-1307, USA | |
| 20 | + * | |
| 21 | + * Este programa está nomeado como - 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 | +#ifndef HLLAPI_H_INCLUDED | |
| 31 | + | |
| 32 | + #define HLLAPI_H_INCLUDED 1 | |
| 33 | + | |
| 34 | + #ifdef __cplusplus | |
| 35 | + extern "C" { | |
| 36 | + #endif | |
| 37 | + | |
| 38 | + #define HLLAPI_MAXLENGTH 4096 | |
| 39 | + | |
| 40 | + /** | |
| 41 | + * @brief Function codes | |
| 42 | + * | |
| 43 | + * Reference http://www.ibm.com/support/knowledgecenter/SSEQ5Y_6.0.0/com.ibm.pcomm.doc/books/html/emulator_programming08.htm | |
| 44 | + * | |
| 45 | + */ | |
| 46 | + typedef enum hllapi_cmd { | |
| 47 | + HLLAPI_CMD_CONNECTPS = 1, /// @brief connect presentation space | |
| 48 | + HLLAPI_CMD_DISCONNECTPS = 2, /// @brief disconnect presentation space | |
| 49 | + HLLAPI_CMD_INPUTSTRING = 3, /// @brief send string | |
| 50 | + HLLAPI_CMD_WAIT = 4, /// @brief Wait if the session is waiting for a host response | |
| 51 | + HLLAPI_CMD_COPYPS = 5, /// @brief Copies the contents of the presentation space into a string buffer. | |
| 52 | + HLLAPI_CMD_SEARCHPS = 6, /// @brief Search the presentation space for a specified string. | |
| 53 | + HLLAPI_CMD_QUERYCURSOR = 7, /// @brief Determines the location of the cursor in the presentation space. | |
| 54 | + HLLAPI_CMD_COPYPSTOSTR = 8, /// @brief Copy presentation space to string | |
| 55 | + HLLAPI_SET_SESSION_PARAMETERS = 9, /// @brief Lets you change certain default session options in EHLLAPI for all sessions. | |
| 56 | + HLLAPI_CMD_COPYSTRTOPS = 15, /// @brief Copies an ASCII string directly to a specified position in the presentation space. | |
| 57 | + HLLAPI_CMD_PAUSE = 18, /// @brief Waits for a specified amount of time. | |
| 58 | + HLLAPI_RESET_SYSTEM = 21, /// @brief Reinitializes EHLLAPI to its starting state. | |
| 59 | + HLLAPI_CMD_SETCURSOR = 40, /// @brief Places the cursor at a specified position in presentation space. | |
| 60 | + HLLAPI_CMD_SENDFILE = 90, /// @brief Send file to the host | |
| 61 | + HLLAPI_CMD_RECEIVEFILE = 91, /// @brief Receive a file from the host | |
| 62 | + | |
| 63 | + HLLAPI_CMD_GETREVISION = 2000 /// @brief Get lib3270 revision | |
| 64 | + } HLLAPI_CMD; | |
| 65 | + | |
| 66 | + | |
| 67 | + /** | |
| 68 | + * @brief Standard Return Codes | |
| 69 | + * | |
| 70 | + * http://ps-2.kev009.com/tl/techlib/manuals/adoclib/3270hcon/hconugd/retrncod.htm#C20819C058kmar | |
| 71 | + */ | |
| 72 | + typedef enum hllapi_status { | |
| 73 | + | |
| 74 | + /// @brief Good return code. | |
| 75 | + /// | |
| 76 | + /// Either the function was successfully executed, or there were no host updates since the last call was issued. | |
| 77 | + HLLAPI_STATUS_SUCCESS = 0, | |
| 78 | + | |
| 79 | + /// @brief The presentation space was not valid or not connected. | |
| 80 | + /// | |
| 81 | + /// Either the presentation space short session ID was invalid, or the application is not connected. | |
| 82 | + HLLAPI_STATUS_DISCONNECTED = 1, | |
| 83 | + | |
| 84 | + /// @brief An incorrect option was specified. | |
| 85 | + HLLAPI_STATUS_BAD_PARAMETER = 2, | |
| 86 | + | |
| 87 | + /// @brief The execution of the function was inhibited because the target presentation space was busy. | |
| 88 | + /// | |
| 89 | + /// For example, X or XSYSTEM is displayed in the OIA for the 3270 terminal emulation. | |
| 90 | + HLLAPI_STATUS_TIMEOUT = 4, | |
| 91 | + | |
| 92 | + /// @brief The execution of the function was inhibited for some reason other than the reasons stated in return code 4. | |
| 93 | + HLLAPI_STATUS_KEYBOARD_LOCKED = 5, | |
| 94 | + | |
| 95 | + // 06 A data error occurred due to specification of an invalid parameter (for example, a length error causing truncation). | |
| 96 | + | |
| 97 | + /// @brief The specified presentation space position was invalid. | |
| 98 | + HLLAPI_STATUS_BAD_POSITION = 7, | |
| 99 | + | |
| 100 | + // 08 No prerequisite function was issued. | |
| 101 | + | |
| 102 | + /// @brief A system error occurred. | |
| 103 | + HLLAPI_STATUS_SYSTEM_ERROR = 9, | |
| 104 | + | |
| 105 | + /// @brief The function number is not supported by the emulation program. | |
| 106 | + HLLAPI_STATUS_UNSUPPORTED = 10, | |
| 107 | + | |
| 108 | + /// @brief Resource unavailable at this time. | |
| 109 | + /// | |
| 110 | + /// The resource that you requested is unavailable (for example, too many attempts have been made to connect to the same presentation space (PS) or another application is connected to the PS). | |
| 111 | + HLLAPI_STATUS_UNAVAILABLE = 11, | |
| 112 | + | |
| 113 | + // 20 Invalid keystroke caused by ESC= option. | |
| 114 | + // 21 OIA was updated. | |
| 115 | + // 22 PS was updated. | |
| 116 | + // 23 Both OIA and PS were updated. | |
| 117 | + | |
| 118 | + /// @brief Either the string was not found, or the presentation space is unformatted. | |
| 119 | + HLLAPI_STATUS_NOT_FOUND = 24, | |
| 120 | + | |
| 121 | + // 25 Keystrokes were not available on input queue. | |
| 122 | + // 26 A host event occurred. See QUERY HOST UPDATE (24) for details. | |
| 123 | + // 28 Field length was 0. | |
| 124 | + // 31 Keystroke queue overflow. Keystrokes were lost. | |
| 125 | + | |
| 126 | + } HLLAPI_STATUS; | |
| 127 | + | |
| 128 | + #define HLLAPI_STATUS_WAITING HLLAPI_STATUS_TIMEOUT | |
| 129 | + | |
| 130 | + #if defined(_WIN32) | |
| 131 | + | |
| 132 | + #include <windows.h> | |
| 133 | + | |
| 134 | + // http://www.mingw.org/wiki/Visual_Basic_DLL | |
| 135 | + #define HLLAPI_API_CALL __declspec (dllexport) DWORD __stdcall | |
| 136 | + #define HLLAPI_API_CSTR __declspec (dllexport) const char * __stdcall | |
| 137 | + | |
| 138 | + #else | |
| 139 | + | |
| 140 | + #include <cstdint> | |
| 141 | + | |
| 142 | + // From wtypesbase.h | |
| 143 | + typedef uint8_t BYTE; | |
| 144 | + typedef uint16_t WORD; | |
| 145 | + typedef unsigned int UINT; | |
| 146 | + typedef int INT; | |
| 147 | + typedef uint32_t LONG; | |
| 148 | + typedef LONG WINBOOL; | |
| 149 | + typedef uint32_t DWORD; | |
| 150 | + typedef void *HANDLE; | |
| 151 | + typedef WORD *LPWORD; | |
| 152 | + typedef DWORD *LPDWORD; | |
| 153 | + typedef char CHAR; | |
| 154 | + typedef CHAR *LPSTR; | |
| 155 | + typedef const CHAR *LPCSTR; | |
| 156 | + typedef char WCHAR; | |
| 157 | + typedef WCHAR TCHAR; | |
| 158 | + typedef WCHAR *LPWSTR; | |
| 159 | + typedef TCHAR *LPTSTR; | |
| 160 | + typedef const WCHAR *LPCWSTR; | |
| 161 | + typedef const TCHAR *LPCTSTR; | |
| 162 | + typedef HANDLE *LPHANDLE; | |
| 163 | + | |
| 164 | + #define LPWORD uint16_t * | |
| 165 | + | |
| 166 | + #define LPSTR char * | |
| 167 | + #define HANDLE int | |
| 168 | + | |
| 169 | + #define HLLAPI_API_CALL __attribute__((visibility("default"))) extern DWORD | |
| 170 | + #define HLLAPI_API_CSTR __attribute__((visibility("default"))) extern const char * | |
| 171 | + | |
| 172 | + #endif // _WIN32 | |
| 173 | + | |
| 174 | + HLLAPI_API_CALL hllapi(const LPWORD func, LPSTR str, LPWORD length, LPWORD rc); | |
| 175 | + | |
| 176 | + /** | |
| 177 | + * @brief Initialize HLLAPI engine. | |
| 178 | + * | |
| 179 | + * @param mode name of the required session (or "" to create a hidden on). | |
| 180 | + * | |
| 181 | + */ | |
| 182 | + HLLAPI_API_CALL hllapi_init(LPSTR mode); | |
| 183 | + | |
| 184 | + /** | |
| 185 | + * @brief Deinitialize HLLAPI engine. | |
| 186 | + * | |
| 187 | + */ | |
| 188 | + HLLAPI_API_CALL hllapi_deinit(void); | |
| 189 | + | |
| 190 | + HLLAPI_API_CALL hllapi_get_revision(void); | |
| 191 | + | |
| 192 | + HLLAPI_API_CALL hllapi_kybdreset(void); | |
| 193 | + | |
| 194 | + /** | |
| 195 | + * @brief Connect to host. | |
| 196 | + * | |
| 197 | + * @param uri Host URI (tn3270://hostname:port). | |
| 198 | + * @param wait How many seconds to wait for the connection. | |
| 199 | + * | |
| 200 | + */ | |
| 201 | + HLLAPI_API_CALL hllapi_connect(const LPSTR uri, WORD wait); | |
| 202 | + | |
| 203 | + /** | |
| 204 | + * @brief Disconnect from host. | |
| 205 | + * | |
| 206 | + */ | |
| 207 | + HLLAPI_API_CALL hllapi_disconnect(void); | |
| 208 | + | |
| 209 | + /** | |
| 210 | + * @brief Get program message. | |
| 211 | + * | |
| 212 | + * @return Current program message or -1 on error. | |
| 213 | + * | |
| 214 | + */ | |
| 215 | + HLLAPI_API_CALL hllapi_get_message_id(void); | |
| 216 | + | |
| 217 | + HLLAPI_API_CALL hllapi_is_connected(void); | |
| 218 | + HLLAPI_API_CALL hllapi_get_state(void); | |
| 219 | + HLLAPI_API_CALL hllapi_get_screen_at(WORD row, WORD col, LPSTR buffer); | |
| 220 | + HLLAPI_API_CALL hllapi_get_screen(WORD pos, LPSTR buffer, WORD len); | |
| 221 | + HLLAPI_API_CALL hllapi_set_text_at(WORD row, WORD col, LPSTR text); | |
| 222 | + | |
| 223 | + /** | |
| 224 | + * @brief Compare contents at position. | |
| 225 | + * | |
| 226 | + * @param row | |
| 227 | + * @param col | |
| 228 | + * @param text | |
| 229 | + * | |
| 230 | + * @return Result of the strcmp of the string and the contents of position. | |
| 231 | + * | |
| 232 | + * @retval HLLAPI_STATUS_SYSTEM_ERROR The query has failed. | |
| 233 | + * @retval 0 The string at the position is the same. | |
| 234 | + * @retval -1 | |
| 235 | + * @retval 1 | |
| 236 | + * | |
| 237 | + */ | |
| 238 | + HLLAPI_API_CALL hllapi_cmp_text_at(WORD row, WORD col, LPSTR text); | |
| 239 | + | |
| 240 | + /** | |
| 241 | + * @brief Compare contents at position. | |
| 242 | + * | |
| 243 | + * @param row | |
| 244 | + * @param col | |
| 245 | + * @param text | |
| 246 | + * | |
| 247 | + * @return Result of the strcmp of the string and the contents of position. | |
| 248 | + * | |
| 249 | + * @retval HLLAPI_STATUS_SYSTEM_ERROR The query has failed. | |
| 250 | + * @retval 0 The string at the position is the same. | |
| 251 | + * @retval -1 | |
| 252 | + * @retval 1 | |
| 253 | + * | |
| 254 | + */ | |
| 255 | + HLLAPI_API_CALL hllapi_cmp_text_at_address(WORD addr, LPSTR text); | |
| 256 | + | |
| 257 | + /** | |
| 258 | + * @brief Find string in the screen. | |
| 259 | + * | |
| 260 | + * @return Position of the text inside the screen or -1 if failed. | |
| 261 | + * | |
| 262 | + */ | |
| 263 | + HLLAPI_API_CALL hllapi_find_text(const LPSTR text); | |
| 264 | + | |
| 265 | + /** | |
| 266 | + * @brief Interpret string with action codes prefixed by '@'. | |
| 267 | + * | |
| 268 | + * Insert string parsing the action codes prefixed with '@' character. | |
| 269 | + * | |
| 270 | + * Value | Action | Description | | |
| 271 | + * :----:|:------------|:-----------------------------------------------------------| | |
| 272 | + * @@P | - | Print the screen contents (if available) | | |
| 273 | + * @@@@ | - | Input the @@ char. | | |
| 274 | + * @@E | ENTER | - | | |
| 275 | + * @@F | ERASE_EOF | - | | |
| 276 | + * @@1 | PF1 | Send the PF1 key. | | |
| 277 | + * @@2 | PF2 | Send the PF2 key. | | |
| 278 | + * @@3 | PF3 | Send the PF3 key. | | |
| 279 | + * @@4 | PF4 | Send the PF4 key. | | |
| 280 | + * @@5 | PF5 | Send the PF5 key. | | |
| 281 | + * @@6 | PF6 | Send the PF6 key. | | |
| 282 | + * @@7 | PF7 | Send the PF7 key. | | |
| 283 | + * @@8 | PF8 | Send the PF8 key. | | |
| 284 | + * @@9 | PF9 | Send the PF9 key. | | |
| 285 | + * @@a | PF10 | Send the PF10 key. | | |
| 286 | + * @@b | PF11 | Send the PF11 key. | | |
| 287 | + * @@c | PF12 | Send the PF12 key. | | |
| 288 | + * @@d | PF13 | Send the PF13 key. | | |
| 289 | + * @@e | PF14 | Send the PF14 key. | | |
| 290 | + * @@f | PF15 | Send the PF15 key. | | |
| 291 | + * @@g | PF16 | Send the PF16 key. | | |
| 292 | + * @@h | PF17 | Send the PF17 key. | | |
| 293 | + * @@u | PF18 | Send the PF18 key. | | |
| 294 | + * @@j | PF19 | Send the PF19 key. | | |
| 295 | + * @@k | PF20 | Send the PF20 key. | | |
| 296 | + * @@l | PF21 | Send the PF21 key. | | |
| 297 | + * @@m | PF22 | Send the PF22 key. | | |
| 298 | + * @@n | PF23 | Send the PF23 key. | | |
| 299 | + * @@o | PF24 | Send the PF24 key. | | |
| 300 | + * @@x | PA1 | Send the PA1 key. | | |
| 301 | + * @@y | PA2 | Send the PA2 key. | | |
| 302 | + * @@z | PA3 | Send the PA3 key. | | |
| 303 | + * @@D | CHAR_DELETE | | | |
| 304 | + * @@N | NEWLINE | | | |
| 305 | + * @@C | CLEAR | | | |
| 306 | + * @@R | KYBD_RESET | | | |
| 307 | + * @@< | BACKSPACE | | | |
| 308 | + * | |
| 309 | + * @param text Text to input. | |
| 310 | + * @param length Length of the text (-1 to use the string length). | |
| 311 | + * @param pasting Unused (kept for compatibility). | |
| 312 | + * | |
| 313 | + */ | |
| 314 | + HLLAPI_API_CALL hllapi_emulate_input(const LPSTR text, WORD length, WORD pasting); | |
| 315 | + | |
| 316 | + /** | |
| 317 | + * @brief Input string. | |
| 318 | + * | |
| 319 | + * @param buffer String to input. | |
| 320 | + * @param length Length of the string (-1 ou 0 to auto detect). | |
| 321 | + * | |
| 322 | + */ | |
| 323 | + HLLAPI_API_CALL hllapi_input_string(LPSTR buffer, WORD len); | |
| 324 | + | |
| 325 | + HLLAPI_API_CALL hllapi_wait_for_ready(WORD seconds); | |
| 326 | + HLLAPI_API_CALL hllapi_wait_for_change(WORD seconds); | |
| 327 | + HLLAPI_API_CALL hllapi_wait(WORD seconds); | |
| 328 | + HLLAPI_API_CALL hllapi_pfkey(WORD key); | |
| 329 | + HLLAPI_API_CALL hllapi_pakey(WORD key); | |
| 330 | + | |
| 331 | + HLLAPI_API_CALL hllapi_set_session_parameter(LPSTR param, WORD len, WORD value); | |
| 332 | + | |
| 333 | + HLLAPI_API_CALL hllapi_enter(void); | |
| 334 | + HLLAPI_API_CALL hllapi_erase(void); | |
| 335 | + HLLAPI_API_CALL hllapi_erase_eof(void); | |
| 336 | + HLLAPI_API_CALL hllapi_erase_eol(void); | |
| 337 | + HLLAPI_API_CALL hllapi_erase_input(void); | |
| 338 | + | |
| 339 | + HLLAPI_API_CALL hllapi_action(LPSTR action_name); | |
| 340 | + | |
| 341 | + HLLAPI_API_CALL hllapi_print(void); | |
| 342 | + | |
| 343 | + HLLAPI_API_CALL hllapi_get_datadir(LPSTR datadir); | |
| 344 | + HLLAPI_API_CALL hllapi_set_charset(LPSTR datadir); | |
| 345 | + | |
| 346 | + HLLAPI_API_CSTR hllapi_get_last_error(); | |
| 347 | + | |
| 348 | + HLLAPI_API_CALL hllapi_set_unlock_delay(WORD ms); | |
| 349 | + | |
| 350 | + HLLAPI_API_CALL hllapi_set_cursor_address(WORD pos); | |
| 351 | + HLLAPI_API_CALL hllapi_set_cursor_position(WORD row, WORD col); | |
| 352 | + | |
| 353 | + /** | |
| 354 | + * @brief Get cursor address. | |
| 355 | + * | |
| 356 | + * @return Cursor address. | |
| 357 | + * | |
| 358 | + */ | |
| 359 | + HLLAPI_API_CALL hllapi_get_cursor_address(); | |
| 360 | + | |
| 361 | + /** | |
| 362 | + * @brief Get LU Name. | |
| 363 | + * | |
| 364 | + */ | |
| 365 | + HLLAPI_API_CALL hllapi_get_lu_name(LPSTR buffer, WORD len); | |
| 366 | + | |
| 367 | + #ifdef __cplusplus | |
| 368 | + } /* end of extern "C" */ | |
| 369 | + #endif | |
| 370 | + | |
| 371 | + | |
| 372 | +#endif // HLLAPI_H_INCLUDED | ... | ... |
src/ipc3270c/linux/daemon.h
| ... | ... | @@ -1,46 +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. | |
| 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 daemon.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 | - * licinio@bb.com.br (Licínio Luis Branco) | |
| 28 | - * kraucer@bb.com.br (Kraucer Fernandes Mazuco) | |
| 29 | - * | |
| 30 | - * Referencias: | |
| 31 | - * | |
| 32 | - * https://live.gnome.org/DBusGlibBindings | |
| 33 | - * | |
| 34 | - */ | |
| 35 | - | |
| 36 | - #include "service.h" | |
| 37 | - | |
| 38 | -/*---[ Globals ]---------------------------------------------------------------------------------*/ | |
| 39 | - | |
| 40 | - G_GNUC_INTERNAL GMainLoop * main_loop; | |
| 41 | - | |
| 42 | - | |
| 43 | -/*---[ Prototipes ]------------------------------------------------------------------------------*/ | |
| 44 | - | |
| 45 | - G_GNUC_INTERNAL void pw3270_dbus_register_io_handlers(void); | |
| 46 | - |
src/ipc3270c/linux/globals.h
| ... | ... | @@ -1,67 +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. | |
| 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 globals.h 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 | - * licinio@bb.com.br (Licínio Luis Branco) | |
| 28 | - * kraucer@bb.com.br (Kraucer Fernandes Mazuco) | |
| 29 | - * | |
| 30 | - */ | |
| 31 | - | |
| 32 | -#ifndef PW3270_DBUS_GLOBALS_H_INCLUDED | |
| 33 | - | |
| 34 | - #define PW3270_DBUS_GLOBALS_H_INCLUDED 1 | |
| 35 | - | |
| 36 | - #include <libintl.h> | |
| 37 | - #include <glib.h> | |
| 38 | - #include <glib/gi18n.h> | |
| 39 | - | |
| 40 | - #include <errno.h> | |
| 41 | - #include <lib3270.h> | |
| 42 | - #include <lib3270/log.h> | |
| 43 | - #include <glib.h> | |
| 44 | - | |
| 45 | -#if ! GLIB_CHECK_VERSION(2,44,0) | |
| 46 | - | |
| 47 | - G_GNUC_INTERNAL void hllapi_autoptr_cleanup_generic_gfree(void *p); | |
| 48 | - #define g_autofree __attribute__((cleanup(hllapi_autoptr_cleanup_generic_gfree))) | |
| 49 | - | |
| 50 | -#endif // ! GLIB(2,44,0) | |
| 51 | - | |
| 52 | - // | |
| 53 | - // Disabling warning on unused-function defined in dbus-glib-bindings.h | |
| 54 | - // warning: 'org_freedesktop_DBus_reload_config' defined but not used [-Wunused-function] ... | |
| 55 | - // | |
| 56 | - #pragma GCC diagnostic ignored "-Wunused-function" | |
| 57 | - | |
| 58 | - #include <dbus/dbus-glib.h> | |
| 59 | - #include <dbus/dbus-glib-bindings.h> | |
| 60 | - #include <dbus/dbus-glib-lowlevel.h> | |
| 61 | - | |
| 62 | - #define ERROR_DOMAIN g_quark_from_static_string("pw3270DBUS") | |
| 63 | - | |
| 64 | - G_GNUC_INTERNAL gpointer pw3270_dbus_register_object (DBusGConnection *connection,DBusGProxy *proxy,GType object_type,const DBusGObjectInfo *info,const gchar *path); | |
| 65 | - | |
| 66 | - | |
| 67 | -#endif // PW3270_DBUS_GLOBALS_H_INCLUDED |
src/ipc3270c/linux/gobject.c
| ... | ... | @@ -1,621 +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. | |
| 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 gobject.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 | - * licinio@bb.com.br (Licínio Luis Branco) | |
| 28 | - * kraucer@bb.com.br (Kraucer Fernandes Mazuco) | |
| 29 | - * | |
| 30 | - * Referencias: | |
| 31 | - * | |
| 32 | - * https://live.gnome.org/DBusGlibBindings | |
| 33 | - * | |
| 34 | - */ | |
| 35 | - | |
| 36 | -#include <glib.h> | |
| 37 | -#include <gtk/gtk.h> | |
| 38 | -#include <dbus/dbus.h> | |
| 39 | -#include <dbus/dbus-glib-lowlevel.h> | |
| 40 | -#include <dbus/dbus-glib.h> | |
| 41 | - | |
| 42 | -#include <config.h> | |
| 43 | -#include <lib3270.h> | |
| 44 | -#include <pw3270.h> | |
| 45 | -#include <v3270.h> | |
| 46 | -#include <lib3270/actions.h> | |
| 47 | -#include <lib3270/charset.h> | |
| 48 | -#include <lib3270/toggle.h> | |
| 49 | - | |
| 50 | -#include "service.h" | |
| 51 | - | |
| 52 | -/*---[ Globals ]---------------------------------------------------------------------------------*/ | |
| 53 | - | |
| 54 | - | |
| 55 | -/*---[ Implement ]-------------------------------------------------------------------------------*/ | |
| 56 | - | |
| 57 | -G_DEFINE_TYPE(PW3270Dbus, pw3270_dbus, G_TYPE_OBJECT) | |
| 58 | - | |
| 59 | -static void pw3270_dbus_finalize(GObject *object) | |
| 60 | -{ | |
| 61 | - G_OBJECT_CLASS(pw3270_dbus_parent_class)->finalize (object); | |
| 62 | -} | |
| 63 | - | |
| 64 | - | |
| 65 | -static void pw3270_dbus_class_init(PW3270DbusClass *klass) | |
| 66 | -{ | |
| 67 | - GObjectClass *object_class; | |
| 68 | - object_class = G_OBJECT_CLASS (klass); | |
| 69 | - object_class->finalize = pw3270_dbus_finalize; | |
| 70 | - debug("%s",__FUNCTION__); | |
| 71 | -} | |
| 72 | - | |
| 73 | -static void pw3270_dbus_init(PW3270Dbus *object) | |
| 74 | -{ | |
| 75 | - debug("%s(%p)",__FUNCTION__,object); | |
| 76 | -} | |
| 77 | - | |
| 78 | -PW3270Dbus * pw3270_dbus_new(void) | |
| 79 | -{ | |
| 80 | - return (PW3270Dbus *) g_object_new(PW3270_TYPE_DBUS, NULL); | |
| 81 | -} | |
| 82 | - | |
| 83 | -void pw3270_dbus_get_revision(PW3270Dbus *object, DBusGMethodInvocation *context) | |
| 84 | -{ | |
| 85 | - debug("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 86 | - dbus_g_method_return(context,lib3270_get_revision()); | |
| 87 | -} | |
| 88 | - | |
| 89 | -void pw3270_dbus_connect(PW3270Dbus *object, const gchar *uri, DBusGMethodInvocation *context) | |
| 90 | -{ | |
| 91 | - H3270 *hSession = pw3270_dbus_get_session_handle(PW3270_DBUS(object)); | |
| 92 | - | |
| 93 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 94 | - | |
| 95 | - if(uri && *uri) | |
| 96 | - { | |
| 97 | - lib3270_set_url(hSession,uri); | |
| 98 | - g_message("Connecting to \"%s\" by remote request",lib3270_get_url(hSession)); | |
| 99 | - } | |
| 100 | - else | |
| 101 | - { | |
| 102 | - g_message("%s","Connecting by remote request"); | |
| 103 | - } | |
| 104 | - | |
| 105 | - dbus_g_method_return(context,lib3270_reconnect(hSession,0)); | |
| 106 | -} | |
| 107 | - | |
| 108 | -void pw3270_dbus_set_ur_l(PW3270Dbus *object, const gchar *uri, DBusGMethodInvocation *context) | |
| 109 | -{ | |
| 110 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 111 | - | |
| 112 | - g_message("Changing host to \"%s\" by remote request",uri); | |
| 113 | - | |
| 114 | - dbus_g_method_return(context,lib3270_set_url(pw3270_dbus_get_session_handle(PW3270_DBUS(object)),uri) != 0); | |
| 115 | -} | |
| 116 | - | |
| 117 | -void pw3270_dbus_get_ur_l(PW3270Dbus *object, DBusGMethodInvocation *context) | |
| 118 | -{ | |
| 119 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 120 | - dbus_g_method_return(context,lib3270_get_url(pw3270_dbus_get_session_handle(PW3270_DBUS(object)))); | |
| 121 | -} | |
| 122 | - | |
| 123 | - | |
| 124 | -void pw3270_dbus_disconnect(PW3270Dbus *object, DBusGMethodInvocation *context) | |
| 125 | -{ | |
| 126 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 127 | - | |
| 128 | - g_message("Disconnecting by remote request"); | |
| 129 | - lib3270_disconnect(pw3270_dbus_get_session_handle(object)); | |
| 130 | - dbus_g_method_return(context,0); | |
| 131 | -} | |
| 132 | - | |
| 133 | -void pw3270_dbus_get_message_id(PW3270Dbus *object, DBusGMethodInvocation *context) | |
| 134 | -{ | |
| 135 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 136 | - dbus_g_method_return(context,lib3270_get_program_message(pw3270_dbus_get_session_handle(object))); | |
| 137 | -} | |
| 138 | - | |
| 139 | -void pw3270_dbus_get_connection_state(PW3270Dbus *object, DBusGMethodInvocation *context) | |
| 140 | -{ | |
| 141 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 142 | - dbus_g_method_return(context,lib3270_get_connection_state(pw3270_dbus_get_session_handle(object))); | |
| 143 | -} | |
| 144 | - | |
| 145 | -void pw3270_dbus_get_secure_state(PW3270Dbus *object, DBusGMethodInvocation *context) | |
| 146 | -{ | |
| 147 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 148 | - dbus_g_method_return(context,lib3270_get_ssl_state(pw3270_dbus_get_session_handle(object))); | |
| 149 | -} | |
| 150 | - | |
| 151 | -GError * pw3270_dbus_get_error_from_errno(int code) | |
| 152 | -{ | |
| 153 | - return g_error_new(ERROR_DOMAIN,code,"%s",g_strerror(code)); | |
| 154 | -} | |
| 155 | - | |
| 156 | -int pw3270_dbus_check_valid_state(PW3270Dbus *object, DBusGMethodInvocation *context) | |
| 157 | -{ | |
| 158 | - H3270 * hSession = pw3270_dbus_get_session_handle(object); | |
| 159 | - GError * error = NULL; | |
| 160 | - | |
| 161 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 162 | - | |
| 163 | - if(!lib3270_is_connected(hSession)) | |
| 164 | - { | |
| 165 | - error = pw3270_dbus_get_error_from_errno(ENOTCONN); | |
| 166 | - } | |
| 167 | - else | |
| 168 | - { | |
| 169 | - LIB3270_MESSAGE state = lib3270_get_program_message(hSession); | |
| 170 | - | |
| 171 | - switch(state) | |
| 172 | - { | |
| 173 | - case LIB3270_MESSAGE_NONE: | |
| 174 | - return 0; | |
| 175 | - | |
| 176 | - case LIB3270_MESSAGE_DISCONNECTED: | |
| 177 | - error = pw3270_dbus_get_error_from_errno(ENOTCONN); | |
| 178 | - break; | |
| 179 | - | |
| 180 | - case LIB3270_MESSAGE_MINUS: | |
| 181 | - case LIB3270_MESSAGE_PROTECTED: | |
| 182 | - case LIB3270_MESSAGE_NUMERIC: | |
| 183 | - case LIB3270_MESSAGE_OVERFLOW: | |
| 184 | - case LIB3270_MESSAGE_INHIBIT: | |
| 185 | - case LIB3270_MESSAGE_KYBDLOCK: | |
| 186 | - case LIB3270_MESSAGE_X: | |
| 187 | - error = g_error_new(ERROR_DOMAIN,-1,_( "State %04d can't accept requests" ),state); | |
| 188 | - break; | |
| 189 | - | |
| 190 | - case LIB3270_MESSAGE_SYSWAIT: | |
| 191 | - case LIB3270_MESSAGE_TWAIT: | |
| 192 | - case LIB3270_MESSAGE_CONNECTED: | |
| 193 | - case LIB3270_MESSAGE_AWAITING_FIRST: | |
| 194 | - error = pw3270_dbus_get_error_from_errno(EBUSY); | |
| 195 | - break; | |
| 196 | - | |
| 197 | - case LIB3270_MESSAGE_RESOLVING: | |
| 198 | - case LIB3270_MESSAGE_CONNECTING: | |
| 199 | - error = g_error_new(ERROR_DOMAIN,EINPROGRESS,_( "Connecting to host" )); | |
| 200 | - break; | |
| 201 | - | |
| 202 | - case LIB3270_MESSAGE_USER: | |
| 203 | - error = g_error_new(ERROR_DOMAIN,-1,_( "Unexpected state %04d" ),state); | |
| 204 | - } | |
| 205 | - } | |
| 206 | - | |
| 207 | - if(error) | |
| 208 | - { | |
| 209 | - dbus_g_method_return_error(context,error); | |
| 210 | - g_error_free(error); | |
| 211 | - return -1; | |
| 212 | - } | |
| 213 | - | |
| 214 | - return 0; | |
| 215 | -} | |
| 216 | - | |
| 217 | -void pw3270_dbus_get_screen_contents(PW3270Dbus *object, DBusGMethodInvocation *context) | |
| 218 | -{ | |
| 219 | - char * text; | |
| 220 | - gchar * utftext; | |
| 221 | - H3270 * hSession = pw3270_dbus_get_session_handle(object); | |
| 222 | - | |
| 223 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 224 | - | |
| 225 | - if(pw3270_dbus_check_valid_state(object,context)) | |
| 226 | - return; | |
| 227 | - | |
| 228 | - text = lib3270_get_string_at_address(hSession,0,-1,'\n'); | |
| 229 | - | |
| 230 | - utftext = g_convert_with_fallback(text,-1,"UTF-8",lib3270_get_display_charset(hSession),"?",NULL,NULL,NULL); | |
| 231 | - | |
| 232 | - lib3270_free(text); | |
| 233 | - | |
| 234 | - dbus_g_method_return(context,utftext); | |
| 235 | - | |
| 236 | - g_free(utftext); | |
| 237 | - | |
| 238 | -} | |
| 239 | - | |
| 240 | -void pw3270_dbus_enter(PW3270Dbus *object, DBusGMethodInvocation *context) | |
| 241 | -{ | |
| 242 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 243 | - if(pw3270_dbus_check_valid_state(object,context)) | |
| 244 | - return; | |
| 245 | - dbus_g_method_return(context,lib3270_enter(pw3270_dbus_get_session_handle(object))); | |
| 246 | -} | |
| 247 | - | |
| 248 | -void pw3270_dbus_set_text_at(PW3270Dbus *object, int row, int col, const gchar *utftext, DBusGMethodInvocation *context) | |
| 249 | -{ | |
| 250 | - gchar * text; | |
| 251 | - H3270 * hSession = pw3270_dbus_get_session_handle(object); | |
| 252 | - | |
| 253 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 254 | - if(pw3270_dbus_check_valid_state(object,context)) | |
| 255 | - return; | |
| 256 | - | |
| 257 | - text = g_convert_with_fallback(utftext,-1,lib3270_get_display_charset(hSession),"UTF-8","?",NULL,NULL,NULL); | |
| 258 | - | |
| 259 | - int sz = lib3270_set_string_at(hSession,row,col,(const unsigned char *) text, -1); | |
| 260 | - | |
| 261 | - trace("%s returns %d",__FUNCTION__,sz); | |
| 262 | - dbus_g_method_return(context,sz); | |
| 263 | - | |
| 264 | - g_free(text); | |
| 265 | -} | |
| 266 | - | |
| 267 | -void pw3270_dbus_input(PW3270Dbus *object, const gchar *utftext, DBusGMethodInvocation *context) | |
| 268 | -{ | |
| 269 | - gchar * text; | |
| 270 | - H3270 * hSession = pw3270_dbus_get_session_handle(object); | |
| 271 | - | |
| 272 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 273 | - if(pw3270_dbus_check_valid_state(object,context)) | |
| 274 | - return; | |
| 275 | - | |
| 276 | - text = g_convert_with_fallback(utftext,-1,lib3270_get_display_charset(hSession),"UTF-8","?",NULL,NULL,NULL); | |
| 277 | - | |
| 278 | - dbus_g_method_return(context,lib3270_emulate_input(hSession,(const char *) text,-1,1)); | |
| 279 | - | |
| 280 | - g_free(text); | |
| 281 | -} | |
| 282 | - | |
| 283 | - | |
| 284 | -void pw3270_dbus_get_text_at(PW3270Dbus *object, int row, int col, int len, char lf, DBusGMethodInvocation *context) | |
| 285 | -{ | |
| 286 | - gchar * text; | |
| 287 | - H3270 * hSession = pw3270_dbus_get_session_handle(object); | |
| 288 | - | |
| 289 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 290 | - if(pw3270_dbus_check_valid_state(object,context)) | |
| 291 | - return; | |
| 292 | - | |
| 293 | - text = lib3270_get_string_at(hSession, row, col, len, lf); | |
| 294 | - if(!text) | |
| 295 | - { | |
| 296 | - GError *error = pw3270_dbus_get_error_from_errno(errno); | |
| 297 | - dbus_g_method_return_error(context,error); | |
| 298 | - g_error_free(error); | |
| 299 | - } | |
| 300 | - else | |
| 301 | - { | |
| 302 | - gchar * utftext = g_convert_with_fallback(text,-1,"UTF-8",lib3270_get_display_charset(hSession),"?",NULL,NULL,NULL); | |
| 303 | - | |
| 304 | - lib3270_free(text); | |
| 305 | - | |
| 306 | - dbus_g_method_return(context,utftext); | |
| 307 | - | |
| 308 | - g_free(utftext); | |
| 309 | - } | |
| 310 | - } | |
| 311 | - | |
| 312 | - void pw3270_dbus_get_text(PW3270Dbus *object, int offset, int len, char lf, DBusGMethodInvocation *context) | |
| 313 | - { | |
| 314 | - gchar * text; | |
| 315 | - H3270 * hSession = pw3270_dbus_get_session_handle(object); | |
| 316 | - | |
| 317 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 318 | - if(pw3270_dbus_check_valid_state(object,context)) | |
| 319 | - return; | |
| 320 | - | |
| 321 | - if(len < 0) { | |
| 322 | - len = lib3270_get_length(hSession); | |
| 323 | - } | |
| 324 | - | |
| 325 | - text = lib3270_get_string_at_address(hSession,offset,len,lf); | |
| 326 | - if(!text) | |
| 327 | - { | |
| 328 | - GError *error = pw3270_dbus_get_error_from_errno(errno); | |
| 329 | - dbus_g_method_return_error(context,error); | |
| 330 | - g_error_free(error); | |
| 331 | - } | |
| 332 | - else | |
| 333 | - { | |
| 334 | - gchar * utftext = g_convert_with_fallback(text,-1,"UTF-8",lib3270_get_display_charset(hSession),"?",NULL,NULL,NULL); | |
| 335 | - | |
| 336 | - lib3270_free(text); | |
| 337 | - | |
| 338 | - debug("\n%s\n",utftext); | |
| 339 | - | |
| 340 | - dbus_g_method_return(context,utftext); | |
| 341 | - | |
| 342 | - g_free(utftext); | |
| 343 | - } | |
| 344 | - | |
| 345 | - } | |
| 346 | - | |
| 347 | - void pw3270_dbus_is_connected(PW3270Dbus *object, DBusGMethodInvocation *context) | |
| 348 | - { | |
| 349 | - trace("%s object=%p context=%p connected=%s",__FUNCTION__,object,context, lib3270_is_connected(pw3270_dbus_get_session_handle(object)) ? "Yes" : "No"); | |
| 350 | - dbus_g_method_return(context,lib3270_is_connected(pw3270_dbus_get_session_handle(object))); | |
| 351 | - } | |
| 352 | - | |
| 353 | - void pw3270_dbus_is_ready(PW3270Dbus *object, DBusGMethodInvocation *context) | |
| 354 | - { | |
| 355 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 356 | - dbus_g_method_return(context,lib3270_is_ready(pw3270_dbus_get_session_handle(object))); | |
| 357 | - } | |
| 358 | - | |
| 359 | - void pw3270_dbus_in_tn3270_e(PW3270Dbus *object, DBusGMethodInvocation *context) | |
| 360 | - { | |
| 361 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 362 | - dbus_g_method_return(context,lib3270_in_tn3270e(pw3270_dbus_get_session_handle(object))); | |
| 363 | - } | |
| 364 | - | |
| 365 | - void pw3270_dbus_wait_for_ready(PW3270Dbus *object, int timeout, DBusGMethodInvocation *context) | |
| 366 | - { | |
| 367 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 368 | - dbus_g_method_return(context,lib3270_wait_for_ready(pw3270_dbus_get_session_handle(object),timeout)); | |
| 369 | - } | |
| 370 | - | |
| 371 | - void pw3270_dbus_set_cursor_at(PW3270Dbus *object, int row, int col, DBusGMethodInvocation *context) | |
| 372 | - { | |
| 373 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 374 | - dbus_g_method_return(context,lib3270_set_cursor_position(pw3270_dbus_get_session_handle(object),row,col)); | |
| 375 | - } | |
| 376 | - | |
| 377 | - void pw3270_dbus_set_cursor_address(PW3270Dbus *object, int addr, DBusGMethodInvocation *context) | |
| 378 | - { | |
| 379 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 380 | - dbus_g_method_return(context,lib3270_set_cursor_address(pw3270_dbus_get_session_handle(object),addr)); | |
| 381 | - } | |
| 382 | - | |
| 383 | - void pw3270_dbus_get_cursor_address(PW3270Dbus *object, DBusGMethodInvocation *context) | |
| 384 | - { | |
| 385 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 386 | - dbus_g_method_return(context,lib3270_get_cursor_address(pw3270_dbus_get_session_handle(object))); | |
| 387 | - } | |
| 388 | - | |
| 389 | - void pw3270_dbus_get_screen_width(PW3270Dbus *object, DBusGMethodInvocation *context) | |
| 390 | - { | |
| 391 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 392 | - dbus_g_method_return(context,lib3270_get_width(pw3270_dbus_get_session_handle(object))); | |
| 393 | - } | |
| 394 | - | |
| 395 | - void pw3270_dbus_get_screen_height(PW3270Dbus *object, DBusGMethodInvocation *context) | |
| 396 | - { | |
| 397 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 398 | - dbus_g_method_return(context,lib3270_get_height(pw3270_dbus_get_session_handle(object))); | |
| 399 | - } | |
| 400 | - | |
| 401 | - void pw3270_dbus_get_screen_length(PW3270Dbus *object, DBusGMethodInvocation *context) | |
| 402 | - { | |
| 403 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 404 | - dbus_g_method_return(context,lib3270_get_width(pw3270_dbus_get_session_handle(object))); | |
| 405 | - } | |
| 406 | - | |
| 407 | - void pw3270_dbus_set_toggle(PW3270Dbus *object, int id, int value, DBusGMethodInvocation *context) | |
| 408 | - { | |
| 409 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 410 | - dbus_g_method_return(context,lib3270_set_toggle(pw3270_dbus_get_session_handle(object),(LIB3270_TOGGLE) id,value)); | |
| 411 | - } | |
| 412 | - | |
| 413 | -void pw3270_dbus_cmp_text_at(PW3270Dbus *object, int row, int col, const gchar *utftext, char lf, DBusGMethodInvocation *context) | |
| 414 | -{ | |
| 415 | - gchar * text; | |
| 416 | - H3270 * hSession = pw3270_dbus_get_session_handle(object); | |
| 417 | - | |
| 418 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 419 | - if(pw3270_dbus_check_valid_state(object,context)) | |
| 420 | - return; | |
| 421 | - | |
| 422 | - text = g_convert_with_fallback(utftext,-1,lib3270_get_display_charset(hSession),"UTF-8","?",NULL,NULL,NULL); | |
| 423 | - | |
| 424 | - dbus_g_method_return(context,lib3270_cmp_text_at(hSession,row,col,text,lf)); | |
| 425 | - | |
| 426 | - g_free(text); | |
| 427 | -} | |
| 428 | - | |
| 429 | -void pw3270_dbus_pf_key(PW3270Dbus *object, int key, DBusGMethodInvocation *context) | |
| 430 | -{ | |
| 431 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 432 | - if(pw3270_dbus_check_valid_state(object,context)) | |
| 433 | - return; | |
| 434 | - dbus_g_method_return(context,lib3270_pfkey(pw3270_dbus_get_session_handle(object),key)); | |
| 435 | -} | |
| 436 | - | |
| 437 | -void pw3270_dbus_pa_key(PW3270Dbus *object, int key, DBusGMethodInvocation *context) | |
| 438 | -{ | |
| 439 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 440 | - if(pw3270_dbus_check_valid_state(object,context)) | |
| 441 | - return; | |
| 442 | - dbus_g_method_return(context,lib3270_pakey(pw3270_dbus_get_session_handle(object),key)); | |
| 443 | -} | |
| 444 | - | |
| 445 | - void pw3270_dbus_get_field_start(PW3270Dbus *object, int baddr, DBusGMethodInvocation *context) | |
| 446 | - { | |
| 447 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 448 | - dbus_g_method_return(context,lib3270_get_field_start(pw3270_dbus_get_session_handle(object),baddr)); | |
| 449 | - } | |
| 450 | - | |
| 451 | - void pw3270_dbus_get_field_length(PW3270Dbus *object, int baddr, DBusGMethodInvocation *context) | |
| 452 | - { | |
| 453 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 454 | - dbus_g_method_return(context,lib3270_get_field_len(pw3270_dbus_get_session_handle(object),baddr)); | |
| 455 | - } | |
| 456 | - | |
| 457 | - void pw3270_dbus_get_next_unprotected(PW3270Dbus *object, int baddr, DBusGMethodInvocation *context) | |
| 458 | - { | |
| 459 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 460 | - dbus_g_method_return(context,lib3270_get_next_unprotected(pw3270_dbus_get_session_handle(object),baddr)); | |
| 461 | - } | |
| 462 | - | |
| 463 | - void pw3270_dbus_get_is_protected(PW3270Dbus *object, int baddr, DBusGMethodInvocation *context) | |
| 464 | - { | |
| 465 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 466 | - dbus_g_method_return(context,lib3270_get_is_protected(pw3270_dbus_get_session_handle(object),baddr)); | |
| 467 | - } | |
| 468 | - | |
| 469 | - void pw3270_dbus_get_is_protected_at(PW3270Dbus *object, int row, int col, DBusGMethodInvocation *context) | |
| 470 | - { | |
| 471 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 472 | - dbus_g_method_return(context,lib3270_get_is_protected_at(pw3270_dbus_get_session_handle(object),row,col)); | |
| 473 | - } | |
| 474 | - | |
| 475 | - void pw3270_dbus_action(PW3270Dbus *object, const gchar *text, DBusGMethodInvocation *context) | |
| 476 | - { | |
| 477 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 478 | - dbus_g_method_return(context,lib3270_action(pw3270_dbus_get_session_handle(object),text)); | |
| 479 | - } | |
| 480 | - | |
| 481 | - void pw3270_dbus_get_clipboard(PW3270Dbus *object, DBusGMethodInvocation *context) | |
| 482 | - { | |
| 483 | - gchar *text; | |
| 484 | - | |
| 485 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 486 | - | |
| 487 | - if(pw3270_dbus_check_valid_state(object,context)) | |
| 488 | - return; | |
| 489 | - | |
| 490 | - text = gtk_clipboard_wait_for_text(gtk_widget_get_clipboard(pw3270_get_toplevel(),GDK_SELECTION_CLIPBOARD)); | |
| 491 | - | |
| 492 | - trace("Clipboard:\n%s\n",text); | |
| 493 | - | |
| 494 | - if(!text) | |
| 495 | - { | |
| 496 | - GError *error = pw3270_dbus_get_error_from_errno(ENOENT); | |
| 497 | - dbus_g_method_return_error(context,error); | |
| 498 | - g_error_free(error); | |
| 499 | - } | |
| 500 | - else | |
| 501 | - { | |
| 502 | - dbus_g_method_return(context,text); | |
| 503 | - g_free(text); | |
| 504 | - } | |
| 505 | -} | |
| 506 | - | |
| 507 | -void pw3270_dbus_set_clipboard(PW3270Dbus *object, const gchar *text, DBusGMethodInvocation *context) | |
| 508 | -{ | |
| 509 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 510 | - gtk_clipboard_set_text(gtk_widget_get_clipboard(pw3270_get_toplevel(),GDK_SELECTION_CLIPBOARD),(gchar *) text, -1); | |
| 511 | - dbus_g_method_return(context,0); | |
| 512 | -} | |
| 513 | - | |
| 514 | -void pw3270_dbus_set_script(PW3270Dbus *object, const gchar G_GNUC_UNUSED(*text), int mode, DBusGMethodInvocation *context) | |
| 515 | -{ | |
| 516 | - GtkWidget *widget = pw3270_get_terminal_widget(NULL); | |
| 517 | - | |
| 518 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 519 | - | |
| 520 | - if(!widget) | |
| 521 | - { | |
| 522 | - GError *error = pw3270_dbus_get_error_from_errno(EINVAL); | |
| 523 | - dbus_g_method_return_error(context,error); | |
| 524 | - g_error_free(error); | |
| 525 | - return; | |
| 526 | - } | |
| 527 | - | |
| 528 | - dbus_g_method_return(context,v3270_set_script(widget,mode == 0 ? 0 : 'S')); | |
| 529 | -} | |
| 530 | - | |
| 531 | -void pw3270_dbus_show_popup(PW3270Dbus *object, int id, const gchar *title, const gchar *msg, const gchar *text, DBusGMethodInvocation *context) | |
| 532 | -{ | |
| 533 | - lib3270_popup_dialog(pw3270_dbus_get_session_handle(object), (LIB3270_NOTIFY) id , title, msg, "%s", text); | |
| 534 | - dbus_g_method_return(context,0); | |
| 535 | -} | |
| 536 | - | |
| 537 | -void pw3270_dbus_get_host_charset(PW3270Dbus *object, DBusGMethodInvocation *context) | |
| 538 | -{ | |
| 539 | - dbus_g_method_return(context,lib3270_get_host_charset(pw3270_dbus_get_session_handle(object))); | |
| 540 | -} | |
| 541 | - | |
| 542 | -void pw3270_dbus_get_display_charset(PW3270Dbus G_GNUC_UNUSED(*object), DBusGMethodInvocation *context) | |
| 543 | -{ | |
| 544 | - // Allways return UTF-8 to avoid double conversion | |
| 545 | - dbus_g_method_return(context,"UTF-8"); | |
| 546 | -} | |
| 547 | - | |
| 548 | -void pw3270_dbus_set_host_charset(PW3270Dbus *object, const gchar *charset, DBusGMethodInvocation *context) | |
| 549 | -{ | |
| 550 | - dbus_g_method_return(context,lib3270_set_host_charset(pw3270_dbus_get_session_handle(object),charset)); | |
| 551 | -} | |
| 552 | - | |
| 553 | -void pw3270_dbus_erase_eof(PW3270Dbus *object, DBusGMethodInvocation *context) | |
| 554 | -{ | |
| 555 | - trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
| 556 | - dbus_g_method_return(context,lib3270_eraseeof(pw3270_dbus_get_session_handle(object))); | |
| 557 | -} | |
| 558 | - | |
| 559 | -void pw3270_dbus_print(PW3270Dbus *object, DBusGMethodInvocation *context) | |
| 560 | -{ | |
| 561 | - dbus_g_method_return(context,lib3270_print_all(pw3270_dbus_get_session_handle(object))); | |
| 562 | -} | |
| 563 | - | |
| 564 | -void pw3270_dbus_set_unlock_delay(PW3270Dbus *object, int value, DBusGMethodInvocation *context) | |
| 565 | -{ | |
| 566 | - lib3270_set_unlock_delay(pw3270_dbus_get_session_handle(object),(unsigned short) value); | |
| 567 | - dbus_g_method_return(context,0); | |
| 568 | -} | |
| 569 | - | |
| 570 | - | |
| 571 | -void pw3270_dbus_ebc2asc(PW3270Dbus *object, const gchar *from, DBusGMethodInvocation *context) | |
| 572 | -{ | |
| 573 | - int sz = strlen(from); | |
| 574 | - | |
| 575 | - if(sz > 0) | |
| 576 | - { | |
| 577 | - unsigned char buffer[sz+1]; | |
| 578 | - memcpy(buffer,from,sz); | |
| 579 | - dbus_g_method_return(context,lib3270_ebc2asc(pw3270_dbus_get_session_handle(object),buffer,sz)); | |
| 580 | - return; | |
| 581 | - } | |
| 582 | - | |
| 583 | - dbus_g_method_return(context,""); | |
| 584 | - | |
| 585 | -} | |
| 586 | - | |
| 587 | -void pw3270_dbus_asc2ebc(PW3270Dbus *object, const gchar *from, DBusGMethodInvocation *context) | |
| 588 | -{ | |
| 589 | - int sz = strlen(from); | |
| 590 | - | |
| 591 | - if(sz > 0) | |
| 592 | - { | |
| 593 | - unsigned char buffer[sz+1]; | |
| 594 | - memcpy(buffer,from,sz); | |
| 595 | - dbus_g_method_return(context,lib3270_asc2ebc(pw3270_dbus_get_session_handle(object),buffer,sz)); | |
| 596 | - return; | |
| 597 | - } | |
| 598 | - | |
| 599 | - dbus_g_method_return(context,""); | |
| 600 | - | |
| 601 | -} | |
| 602 | - | |
| 603 | -void pw3270_dbus_filetransfer(PW3270Dbus *object, const gchar *local, const gchar *remote, int flags, int lrecl, int blksize, int primspace, int secspace, int dft, DBusGMethodInvocation *context) | |
| 604 | -{ | |
| 605 | - /* | |
| 606 | - dbus_g_method_return(context, | |
| 607 | - v3270_transfer_file( | |
| 608 | - v3270_get_default_widget(), | |
| 609 | - (LIB3270_FT_OPTION) flags, | |
| 610 | - local, | |
| 611 | - remote, | |
| 612 | - lrecl, | |
| 613 | - blksize, | |
| 614 | - primspace, | |
| 615 | - secspace, | |
| 616 | - dft | |
| 617 | - )); | |
| 618 | - */ | |
| 619 | - return; | |
| 620 | -} | |
| 621 | - |
src/ipc3270c/linux/main.c
| ... | ... | @@ -1,189 +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. | |
| 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 main.c e possui - linhas de código. | |
| 22 | - * | |
| 23 | - * Referências: | |
| 24 | - * | |
| 25 | - * https://github.com/fbuihuu/samples-dbus/blob/master/dbus-server.c | |
| 26 | - * | |
| 27 | - * Contatos: | |
| 28 | - * | |
| 29 | - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
| 30 | - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | |
| 31 | - * | |
| 32 | - */ | |
| 33 | - | |
| 34 | -#include <glib.h> | |
| 35 | -#include <dbus/dbus.h> | |
| 36 | -#include <dbus/dbus-glib-lowlevel.h> | |
| 37 | -#include <dbus/dbus-glib.h> | |
| 38 | - | |
| 39 | -#include <v3270.h> | |
| 40 | -#include <pw3270.h> | |
| 41 | -#include <pw3270/plugin.h> | |
| 42 | - | |
| 43 | -#include "service.h" | |
| 44 | -#include "globals.h" | |
| 45 | -#include "dbus-glue.h" | |
| 46 | - | |
| 47 | -#include <gtk/gtk.h> | |
| 48 | - | |
| 49 | -/*---[ Globals ]---------------------------------------------------------------------------------*/ | |
| 50 | - | |
| 51 | - static DBusGConnection * connection = NULL; | |
| 52 | - static DBusGProxy * proxy = NULL; | |
| 53 | - static gchar * service_name = NULL; | |
| 54 | - | |
| 55 | - | |
| 56 | -/*---[ Implement ]-------------------------------------------------------------------------------*/ | |
| 57 | - | |
| 58 | - LIB3270_EXPORT int pw3270_plugin_start(GtkWidget G_GNUC_UNUSED(*window), GtkWidget *terminal) | |
| 59 | - { | |
| 60 | - GError * error = NULL; | |
| 61 | - guint result; | |
| 62 | - char session_id = 0; | |
| 63 | - char id = 'a'; | |
| 64 | - gchar * ptr; | |
| 65 | - const gchar * name = v3270_get_session_name(terminal); | |
| 66 | - | |
| 67 | - connection = dbus_g_bus_get_private(DBUS_BUS_SESSION, g_main_context_default(), &error); | |
| 68 | - if(error) | |
| 69 | - { | |
| 70 | - GtkWidget *dialog = gtk_message_dialog_new( | |
| 71 | - GTK_WINDOW(window), | |
| 72 | - (GtkDialogFlags) (GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT), | |
| 73 | - GTK_MESSAGE_ERROR, | |
| 74 | - GTK_BUTTONS_OK, | |
| 75 | - _( "Can't connect to DBUS server" )); | |
| 76 | - | |
| 77 | - gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),"%s",error->message); | |
| 78 | - | |
| 79 | - g_message("Error \"%s\" getting session dbus",error->message); | |
| 80 | - | |
| 81 | - g_error_free(error); | |
| 82 | - | |
| 83 | - gtk_dialog_run(GTK_DIALOG(dialog)); | |
| 84 | - gtk_widget_destroy(dialog); | |
| 85 | - | |
| 86 | - return -1; | |
| 87 | - } | |
| 88 | - | |
| 89 | - proxy = dbus_g_proxy_new_for_name(connection,DBUS_SERVICE_DBUS,DBUS_PATH_DBUS,DBUS_INTERFACE_DBUS); | |
| 90 | - | |
| 91 | - for(id='a'; id < 'z' && !error && !service_name; id++) | |
| 92 | - { | |
| 93 | - gboolean has_owner = FALSE; | |
| 94 | - | |
| 95 | - service_name = g_strdup_printf("br.com.bb.%s.%c",name,(int) id); | |
| 96 | - for(ptr=service_name;*ptr;ptr++) | |
| 97 | - *ptr = g_ascii_tolower(*ptr); | |
| 98 | - | |
| 99 | - org_freedesktop_DBus_name_has_owner(proxy, service_name, &has_owner, NULL); | |
| 100 | - | |
| 101 | - if(has_owner) | |
| 102 | - { | |
| 103 | - trace("Service \"%s\" has owner",service_name) | |
| 104 | - g_free(service_name); | |
| 105 | - service_name = NULL; | |
| 106 | - } | |
| 107 | - else | |
| 108 | - { | |
| 109 | - session_id = id; | |
| 110 | - g_message("DBUS service name is %s",service_name); | |
| 111 | - org_freedesktop_DBus_request_name(proxy, service_name, DBUS_NAME_FLAG_DO_NOT_QUEUE, &result, &error); | |
| 112 | - } | |
| 113 | - } | |
| 114 | - | |
| 115 | - if(error) | |
| 116 | - { | |
| 117 | - GtkWidget *dialog = gtk_message_dialog_new( | |
| 118 | - GTK_WINDOW(window), | |
| 119 | - (GtkDialogFlags) (GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT), | |
| 120 | - GTK_MESSAGE_ERROR, | |
| 121 | - GTK_BUTTONS_OK, | |
| 122 | - _( "Can't get DBUS object name" )); | |
| 123 | - | |
| 124 | - gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),"%s",error->message); | |
| 125 | - | |
| 126 | - g_message("Error \"%s\" requesting DBUS name",error->message); | |
| 127 | - | |
| 128 | - g_error_free(error); | |
| 129 | - | |
| 130 | - gtk_dialog_run(GTK_DIALOG(dialog)); | |
| 131 | - gtk_widget_destroy(dialog); | |
| 132 | - | |
| 133 | - return -1; | |
| 134 | - } | |
| 135 | - | |
| 136 | - if(session_id) | |
| 137 | - { | |
| 138 | - | |
| 139 | - g_autofree gchar * session = g_strdup_printf("%s:%c",name,g_ascii_toupper(session_id)); | |
| 140 | - | |
| 141 | - static const gchar * path = "/br/com/bb/pw3270"; | |
| 142 | - g_message("DBUS service path is %s, session name is %s",path,session); | |
| 143 | - v3270_set_session_name(terminal,session); | |
| 144 | - | |
| 145 | - pw3270_dbus_register_object(connection,proxy,PW3270_TYPE_DBUS,&dbus_glib_pw3270_dbus_object_info,path); | |
| 146 | - | |
| 147 | - } | |
| 148 | - | |
| 149 | - return 0; | |
| 150 | - } | |
| 151 | - | |
| 152 | - LIB3270_EXPORT int pw3270_plugin_stop(GtkWidget G_GNUC_UNUSED(*window), GtkWidget G_GNUC_UNUSED(*terminal)) | |
| 153 | - { | |
| 154 | - if(proxy) | |
| 155 | - { | |
| 156 | - debug("%s: Releasing proxy",__FUNCTION__); | |
| 157 | - g_object_unref(proxy); | |
| 158 | - proxy = NULL; | |
| 159 | - } | |
| 160 | - | |
| 161 | - if(service_name) | |
| 162 | - { | |
| 163 | - g_free(service_name); | |
| 164 | - service_name = NULL; | |
| 165 | - } | |
| 166 | - return 0; | |
| 167 | - } | |
| 168 | - | |
| 169 | - void pw3270_dbus_quit(PW3270Dbus G_GNUC_UNUSED(*object), DBusGMethodInvocation *context) | |
| 170 | - { | |
| 171 | - gtk_main_quit(); | |
| 172 | - dbus_g_method_return(context,0); | |
| 173 | - } | |
| 174 | - | |
| 175 | - H3270 * pw3270_dbus_get_session_handle(PW3270Dbus G_GNUC_UNUSED(*object)) | |
| 176 | - { | |
| 177 | - debug("%s=%p",__FUNCTION__,lib3270_get_default_session_handle()); | |
| 178 | - return lib3270_get_default_session_handle(); | |
| 179 | - } | |
| 180 | - | |
| 181 | -#if ! GLIB_CHECK_VERSION(2,44,0) | |
| 182 | -// Reference: https://github.com/ImageMagick/glib/blob/master/glib/glib-autocleanups.h | |
| 183 | -void hllapi_autoptr_cleanup_generic_gfree(void *p) | |
| 184 | -{ | |
| 185 | - void **pp = (void**)p; | |
| 186 | - g_free (*pp); | |
| 187 | -} | |
| 188 | -#endif // ! GLIB(2,44,0) | |
| 189 | - |
src/ipc3270c/linux/misc.c
| ... | ... | @@ -1,47 +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. | |
| 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 misc.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 | - * licinio@bb.com.br (Licínio Luis Branco) | |
| 28 | - * kraucer@bb.com.br (Kraucer Fernandes Mazuco) | |
| 29 | - * | |
| 30 | - * Referencias: | |
| 31 | - * | |
| 32 | - * https://live.gnome.org/DBusGlibBindings | |
| 33 | - * | |
| 34 | - */ | |
| 35 | - | |
| 36 | -#include "globals.h" | |
| 37 | - | |
| 38 | -/*---[ Implement ]-------------------------------------------------------------------------------*/ | |
| 39 | - | |
| 40 | -gpointer pw3270_dbus_register_object(DBusGConnection *connection,DBusGProxy G_GNUC_UNUSED(*proxy),GType object_type,const DBusGObjectInfo *info,const gchar *path) | |
| 41 | -{ | |
| 42 | - GObject *object = G_OBJECT(g_object_new(object_type, NULL)); | |
| 43 | - dbus_g_object_type_install_info (object_type, info); | |
| 44 | - dbus_g_connection_register_g_object (connection, path, object); | |
| 45 | - return object; | |
| 46 | -} | |
| 47 | - |
src/ipc3270c/linux/service.h
| ... | ... | @@ -1,138 +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. | |
| 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 service.h 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 | - * licinio@bb.com.br (Licínio Luis Branco) | |
| 28 | - * kraucer@bb.com.br (Kraucer Fernandes Mazuco) | |
| 29 | - * | |
| 30 | - */ | |
| 31 | - | |
| 32 | -#ifndef _PW3270_DBUS_SERVICE_H | |
| 33 | - | |
| 34 | - #define _PW3270_DBUS_SERVICE_H 1 | |
| 35 | - | |
| 36 | - #define ENABLE_NLS | |
| 37 | - #define GETTEXT_PACKAGE PACKAGE_NAME | |
| 38 | - | |
| 39 | - #include "globals.h" | |
| 40 | - | |
| 41 | - #define PW3270_TYPE_DBUS (pw3270_dbus_get_type ()) | |
| 42 | - #define PW3270_DBUS(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PW3270_TYPE_DBUS, PW3270Dbus)) | |
| 43 | - #define PW3270_DBUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PW3270_TYPE_DBUS, PW3270DbusClass)) | |
| 44 | - #define IS_PW3270_DBUS(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PW3270_TYPE_DBUS)) | |
| 45 | - #define IS_PW3270_DBUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PW3270_TYPE_DBUS)) | |
| 46 | - #define PW3270_DBUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PW3270_TYPE_DBUS, PW3270DbusClass)) | |
| 47 | - | |
| 48 | - G_BEGIN_DECLS | |
| 49 | - | |
| 50 | - typedef struct _PW3270Dbus PW3270Dbus; | |
| 51 | - typedef struct _PW3270DbusClass PW3270DbusClass; | |
| 52 | - | |
| 53 | - struct _PW3270Dbus | |
| 54 | - { | |
| 55 | - GObject parent; | |
| 56 | - }; | |
| 57 | - | |
| 58 | - struct _PW3270DbusClass | |
| 59 | - { | |
| 60 | - GObjectClass parent; | |
| 61 | - }; | |
| 62 | - | |
| 63 | - PW3270Dbus * pw3270_dbus_new (void); | |
| 64 | - GType pw3270_dbus_get_type (void); | |
| 65 | - | |
| 66 | - void pw3270_dbus_get_revision(PW3270Dbus *object, DBusGMethodInvocation *context); | |
| 67 | - void pw3270_dbus_quit(PW3270Dbus *object, DBusGMethodInvocation *context); | |
| 68 | - void pw3270_dbus_connect(PW3270Dbus *object, const gchar *uri, DBusGMethodInvocation *context); | |
| 69 | - void pw3270_dbus_get_ur_l(PW3270Dbus *object, DBusGMethodInvocation *context); | |
| 70 | - void pw3270_dbus_set_ur_l(PW3270Dbus *object, const gchar *uri, DBusGMethodInvocation *context); | |
| 71 | - void pw3270_dbus_disconnect(PW3270Dbus *object, DBusGMethodInvocation *context); | |
| 72 | - | |
| 73 | - void pw3270_dbus_get_message_id(PW3270Dbus *object, DBusGMethodInvocation *context); | |
| 74 | - void pw3270_dbus_get_connection_state(PW3270Dbus *object, DBusGMethodInvocation *context); | |
| 75 | - void pw3270_dbus_get_secure_state(PW3270Dbus *object, DBusGMethodInvocation *context); | |
| 76 | - | |
| 77 | - void pw3270_dbus_get_screen_contents(PW3270Dbus *object, DBusGMethodInvocation *context); | |
| 78 | - H3270 * pw3270_dbus_get_session_handle(PW3270Dbus *object); | |
| 79 | - GError * pw3270_dbus_get_error_from_errno(int code); | |
| 80 | - | |
| 81 | - void pw3270_dbus_is_connected(PW3270Dbus *object, DBusGMethodInvocation *context); | |
| 82 | - void pw3270_dbus_is_ready(PW3270Dbus *object, DBusGMethodInvocation *context); | |
| 83 | - void pw3270_dbus_in_tn3270_e(PW3270Dbus *object, DBusGMethodInvocation *context); | |
| 84 | - | |
| 85 | - void pw3270_dbus_set_cursor_at(PW3270Dbus *object, int row, int col, DBusGMethodInvocation *context); | |
| 86 | - void pw3270_dbus_set_cursor_address(PW3270Dbus *object, int addr, DBusGMethodInvocation *context); | |
| 87 | - void pw3270_dbus_get_cursor_address(PW3270Dbus *object, DBusGMethodInvocation *context); | |
| 88 | - | |
| 89 | - void pw3270_dbus_get_screen_width(PW3270Dbus *object, DBusGMethodInvocation *context); | |
| 90 | - void pw3270_dbus_get_screen_height(PW3270Dbus *object, DBusGMethodInvocation *context); | |
| 91 | - void pw3270_dbus_get_screen_length(PW3270Dbus *object, DBusGMethodInvocation *context); | |
| 92 | - | |
| 93 | - void pw3270_dbus_set_toggle(PW3270Dbus *object, int id, int value, DBusGMethodInvocation *context); | |
| 94 | - | |
| 95 | - void pw3270_dbus_wait_for_ready(PW3270Dbus *object, int timeout, DBusGMethodInvocation *context); | |
| 96 | - | |
| 97 | - void pw3270_dbus_get_field_start(PW3270Dbus *object, int baddr, DBusGMethodInvocation *context); | |
| 98 | - void pw3270_dbus_get_field_length(PW3270Dbus *object, int baddr, DBusGMethodInvocation *context); | |
| 99 | - void pw3270_dbus_get_next_unprotected(PW3270Dbus *object, int baddr, DBusGMethodInvocation *context); | |
| 100 | - | |
| 101 | - void pw3270_dbus_get_is_protected(PW3270Dbus *object, int baddr, DBusGMethodInvocation *context); | |
| 102 | - void pw3270_dbus_get_is_protected_at(PW3270Dbus *object, int row, int col, DBusGMethodInvocation *context); | |
| 103 | - | |
| 104 | - void pw3270_dbus_set_script(PW3270Dbus *object, const gchar *text, int mode, DBusGMethodInvocation *context); | |
| 105 | - | |
| 106 | - void pw3270_dbus_show_popup(PW3270Dbus *object, int id, const gchar *title, const gchar *msg, const gchar *text, DBusGMethodInvocation *context); | |
| 107 | - | |
| 108 | - void pw3270_dbus_action(PW3270Dbus *object, const gchar *text, DBusGMethodInvocation *context); | |
| 109 | - | |
| 110 | - // Actions | |
| 111 | - void pw3270_dbus_enter(PW3270Dbus *object, DBusGMethodInvocation *context); | |
| 112 | - void pw3270_dbus_pf_key(PW3270Dbus *object, int key, DBusGMethodInvocation *context); | |
| 113 | - void pw3270_dbus_pa_key(PW3270Dbus *object, int key, DBusGMethodInvocation *context); | |
| 114 | - void pw3270_dbus_set_text_at(PW3270Dbus *object, int row, int col, const gchar *text, DBusGMethodInvocation *context); | |
| 115 | - void pw3270_dbus_get_text_at(PW3270Dbus *object, int row, int col, int len, char lf, DBusGMethodInvocation *context); | |
| 116 | - void pw3270_dbus_get_text(PW3270Dbus *object, int offset, int len, char lf, DBusGMethodInvocation *context); | |
| 117 | - void pw3270_dbus_cmp_text_at(PW3270Dbus *object, int row, int col, const gchar *text, char lf, DBusGMethodInvocation *context); | |
| 118 | - void pw3270_dbus_input(PW3270Dbus *object, const gchar *utftext, DBusGMethodInvocation *context); | |
| 119 | - | |
| 120 | - void pw3270_dbus_set_clipboard(PW3270Dbus *object, const gchar *text, DBusGMethodInvocation *context); | |
| 121 | - void pw3270_dbus_get_clipboard(PW3270Dbus *object, DBusGMethodInvocation *context); | |
| 122 | - | |
| 123 | - void pw3270_dbus_get_display_charset(PW3270Dbus *object, DBusGMethodInvocation *context); | |
| 124 | - void pw3270_dbus_get_host_charset(PW3270Dbus *object, DBusGMethodInvocation *context); | |
| 125 | - void pw3270_dbus_set_host_charset(PW3270Dbus *object, const gchar *charset, DBusGMethodInvocation *context); | |
| 126 | - void pw3270_dbus_erase_eof(PW3270Dbus *object, DBusGMethodInvocation *context); | |
| 127 | - void pw3270_dbus_print(PW3270Dbus *object, DBusGMethodInvocation *context); | |
| 128 | - | |
| 129 | - void pw3270_dbus_asc2ebc(PW3270Dbus *object, const gchar *from, DBusGMethodInvocation *context); | |
| 130 | - void pw3270_dbus_ebc2asc(PW3270Dbus *object, const gchar *from, DBusGMethodInvocation *context); | |
| 131 | - | |
| 132 | - void pw3270_dbus_filetransfer(PW3270Dbus *object, const gchar *local, const gchar *remote, int flags, int lrecl, int blksize, int primspace, int secspace, int dft, DBusGMethodInvocation *context); | |
| 133 | - | |
| 134 | - void pw3270_dbus_set_unlock_delay(PW3270Dbus *object, int value, DBusGMethodInvocation *context); | |
| 135 | - | |
| 136 | - G_END_DECLS | |
| 137 | - | |
| 138 | -#endif // _PW3270_DBUS_SERVICE_H |
src/ipc3270c/windows/main.c
| ... | ... | @@ -1,671 +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 - 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 | - * Agradecimento: | |
| 29 | - * | |
| 30 | - * Hélio Passos | |
| 31 | - * | |
| 32 | - */ | |
| 33 | - | |
| 34 | - #include "private.h" | |
| 35 | - | |
| 36 | -#ifdef _WIN32 | |
| 37 | - #include <windows.h> | |
| 38 | -#else | |
| 39 | - #error HLLAPI is designed for windows. | |
| 40 | -#endif // _WIN32 | |
| 41 | - | |
| 42 | - #include <pw3270/plugin.h> | |
| 43 | - #include <v3270.h> | |
| 44 | - #include <pw3270/ipcpackets.h> | |
| 45 | - #include <lib3270/actions.h> | |
| 46 | - #include <lib3270/charset.h> | |
| 47 | - #include <lib3270/toggle.h> | |
| 48 | - | |
| 49 | -/*--[ Defines ]--------------------------------------------------------------------------------------*/ | |
| 50 | - | |
| 51 | - #pragma pack(1) | |
| 52 | - | |
| 53 | - enum PIPE_STATE | |
| 54 | - { | |
| 55 | - PIPE_STATE_WAITING, | |
| 56 | - PIPE_STATE_READ, | |
| 57 | - PIPE_STATE_PENDING_READ, | |
| 58 | - PIPE_STATE_UNDEFINED | |
| 59 | - }; | |
| 60 | - | |
| 61 | - typedef struct _pipe_source | |
| 62 | - { | |
| 63 | - GSource gsrc; | |
| 64 | - HANDLE hPipe; | |
| 65 | - | |
| 66 | - enum PIPE_STATE state; | |
| 67 | - | |
| 68 | - OVERLAPPED overlap; | |
| 69 | - unsigned char buffer[PIPE_BUFFER_LENGTH+1]; | |
| 70 | - } pipe_source; | |
| 71 | - | |
| 72 | - #pragma pack() | |
| 73 | - | |
| 74 | - | |
| 75 | -/*--[ Globals ]--------------------------------------------------------------------------------------*/ | |
| 76 | - | |
| 77 | -// static const gchar control_char = '@'; | |
| 78 | - | |
| 79 | -/*--[ Implement ]------------------------------------------------------------------------------------*/ | |
| 80 | - | |
| 81 | - static void IO_accept(pipe_source *source) | |
| 82 | - { | |
| 83 | - set_active(FALSE); | |
| 84 | - | |
| 85 | - if(ConnectNamedPipe(source->hPipe,&source->overlap)) | |
| 86 | - { | |
| 87 | - popup_lasterror("%s",_( "Error in ConnectNamedPipe" )); | |
| 88 | - return; | |
| 89 | - } | |
| 90 | - | |
| 91 | - switch(GetLastError()) | |
| 92 | - { | |
| 93 | - // The overlapped connection in progress. | |
| 94 | - case ERROR_IO_PENDING: | |
| 95 | - // trace("%s: ERROR_IO_PENDING",__FUNCTION__); | |
| 96 | - source->state = PIPE_STATE_WAITING; | |
| 97 | - break; | |
| 98 | - | |
| 99 | - // Client is already connected, so signal an event. | |
| 100 | - case ERROR_PIPE_CONNECTED: | |
| 101 | - trace("%s: ERROR_PIPE_CONNECTED",__FUNCTION__); | |
| 102 | - set_active(TRUE); | |
| 103 | - SetEvent(source->overlap.hEvent); | |
| 104 | - break; | |
| 105 | - | |
| 106 | - // If an error occurs during the connect operation... | |
| 107 | - default: | |
| 108 | - popup_lasterror("%s", _( "ConnectNamedPipe failed" )); | |
| 109 | - } | |
| 110 | - | |
| 111 | - } | |
| 112 | - | |
| 113 | - static gboolean IO_prepare(GSource *source, gint *timeout) | |
| 114 | - { | |
| 115 | - /* | |
| 116 | - * Called before all the file descriptors are polled. | |
| 117 | - * If the source can determine that it is ready here | |
| 118 | - * (without waiting for the results of the poll() call) | |
| 119 | - * it should return TRUE. | |
| 120 | - * | |
| 121 | - * It can also return a timeout_ value which should be the maximum | |
| 122 | - * timeout (in milliseconds) which should be passed to the poll() call. | |
| 123 | - * The actual timeout used will be -1 if all sources returned -1, | |
| 124 | - * or it will be the minimum of all the timeout_ values | |
| 125 | - * returned which were >= 0. | |
| 126 | - * | |
| 127 | - */ | |
| 128 | - if(WaitForSingleObject(((pipe_source *) source)->overlap.hEvent,0) == WAIT_OBJECT_0) | |
| 129 | - return TRUE; | |
| 130 | - | |
| 131 | - *timeout = 10; | |
| 132 | - return FALSE; | |
| 133 | - } | |
| 134 | - | |
| 135 | - static gboolean IO_check(GSource *source) | |
| 136 | - { | |
| 137 | - /* | |
| 138 | - * Called after all the file descriptors are polled. | |
| 139 | - * The source should return TRUE if it is ready to be dispatched. | |
| 140 | - * Note that some time may have passed since the previous prepare | |
| 141 | - * function was called, so the source should be checked again here. | |
| 142 | - * | |
| 143 | - */ | |
| 144 | - if(WaitForSingleObject(((pipe_source *) source)->overlap.hEvent,0) == WAIT_OBJECT_0) | |
| 145 | - return TRUE; | |
| 146 | - | |
| 147 | - return FALSE; | |
| 148 | - } | |
| 149 | - | |
| 150 | - static void send_text(pipe_source *source, char *text) | |
| 151 | - { | |
| 152 | - struct hllapi_packet_text *pkt; | |
| 153 | - DWORD szBlock; | |
| 154 | - int f; | |
| 155 | - | |
| 156 | - if(text) | |
| 157 | - { | |
| 158 | - szBlock = sizeof(struct hllapi_packet_text)+strlen(text); | |
| 159 | - pkt = (struct hllapi_packet_text *) g_malloc0(szBlock); | |
| 160 | - pkt->packet_id = 0; | |
| 161 | - strcpy(pkt->text,text); | |
| 162 | - lib3270_free(text); | |
| 163 | - } | |
| 164 | - else | |
| 165 | - { | |
| 166 | - szBlock = sizeof(struct hllapi_packet_text); | |
| 167 | - pkt = (struct hllapi_packet_text *) g_malloc0(szBlock); | |
| 168 | - pkt->packet_id = errno ? errno : -1; | |
| 169 | - } | |
| 170 | - | |
| 171 | - trace("szBlock=%d text=\"%s\"",szBlock, ( (struct hllapi_packet_text *) pkt)->text); | |
| 172 | - for(f=0;f< (int) szBlock;f++) | |
| 173 | - { | |
| 174 | - trace("rsp(%d)= %d \"%s\"",f,* (((char *) pkt)+f),((char *) pkt)+f); | |
| 175 | - } | |
| 176 | - | |
| 177 | - WriteFile(source->hPipe,pkt,szBlock,&szBlock,NULL); | |
| 178 | - | |
| 179 | - g_free(pkt); | |
| 180 | - } | |
| 181 | - | |
| 182 | - static void send_result(pipe_source *source, int rc) | |
| 183 | - { | |
| 184 | - struct hllapi_packet_result pkt = { rc }; | |
| 185 | - DWORD wrote = sizeof(pkt); | |
| 186 | - WriteFile(source->hPipe,&pkt,wrote,&wrote,NULL); | |
| 187 | - } | |
| 188 | - | |
| 189 | - static int do_file_transfer(struct hllapi_packet_file_transfer G_GNUC_UNUSED(* source)) | |
| 190 | - { | |
| 191 | - /* | |
| 192 | - const gchar * local = (const char *) source->text; | |
| 193 | - const gchar * remote = (const char *) (local+strlen(local)+1); | |
| 194 | - | |
| 195 | - return v3270_transfer_file( v3270_get_default_widget(), | |
| 196 | - (LIB3270_FT_OPTION) source->options, | |
| 197 | - local, | |
| 198 | - remote, | |
| 199 | - source->lrecl, | |
| 200 | - source->blksize, | |
| 201 | - source->primspace, | |
| 202 | - source->secspace, | |
| 203 | - source->dft ); | |
| 204 | - */ | |
| 205 | - return EINVAL; | |
| 206 | - } | |
| 207 | - | |
| 208 | - static void get_host(pipe_source *source) { | |
| 209 | - send_text(source,strdup(lib3270_get_url(lib3270_get_default_session_handle()))); | |
| 210 | - } | |
| 211 | - | |
| 212 | - static void process_input(pipe_source *source, DWORD G_GNUC_UNUSED(cbRead)) | |
| 213 | - { | |
| 214 | - const struct hllapi_packet_query * query = ((struct hllapi_packet_query *) source->buffer); | |
| 215 | - | |
| 216 | - trace("%s id=%d",__FUNCTION__,query->packet_id); | |
| 217 | - | |
| 218 | - switch(query->packet_id) | |
| 219 | - { | |
| 220 | - case HLLAPI_PACKET_CONNECT: | |
| 221 | - send_result(source,lib3270_reconnect( lib3270_get_default_session_handle(), | |
| 222 | - ((struct hllapi_packet_connect *) source->buffer)->wait)); | |
| 223 | - break; | |
| 224 | - | |
| 225 | - case HLLAPI_PACKET_CONNECT_URL: | |
| 226 | - send_result(source,lib3270_connect_url(lib3270_get_default_session_handle(),(const char *) (query+1),0)); | |
| 227 | - break; | |
| 228 | - | |
| 229 | - case HLLAPI_PACKET_SET_HOST: | |
| 230 | - send_result(source,lib3270_set_url(lib3270_get_default_session_handle(), | |
| 231 | - ((struct hllapi_packet_text *) source->buffer)->text)); | |
| 232 | - break; | |
| 233 | - | |
| 234 | - case HLLAPI_PACKET_GET_HOST: | |
| 235 | - get_host(source); | |
| 236 | - break; | |
| 237 | - | |
| 238 | - case HLLAPI_PACKET_DISCONNECT: | |
| 239 | - send_result(source,lib3270_disconnect(lib3270_get_default_session_handle())); | |
| 240 | - break; | |
| 241 | - | |
| 242 | - case HLLAPI_PACKET_IS_CONNECTED: | |
| 243 | - send_result(source,lib3270_in_tn3270e(lib3270_get_default_session_handle())); | |
| 244 | - break; | |
| 245 | - | |
| 246 | - case HLLAPI_PACKET_IS_READY: | |
| 247 | - send_result(source,lib3270_is_ready(lib3270_get_default_session_handle())); | |
| 248 | - break; | |
| 249 | - | |
| 250 | - case HLLAPI_PACKET_ENTER: | |
| 251 | - send_result(source,lib3270_enter(lib3270_get_default_session_handle())); | |
| 252 | - break; | |
| 253 | - | |
| 254 | - case HLLAPI_PACKET_PRINT: | |
| 255 | - send_result(source,lib3270_print_all(lib3270_get_default_session_handle())); | |
| 256 | - break; | |
| 257 | - | |
| 258 | - case HLLAPI_PACKET_ERASE: | |
| 259 | - send_result(source,lib3270_erase(lib3270_get_default_session_handle())); | |
| 260 | - break; | |
| 261 | - | |
| 262 | - case HLLAPI_PACKET_ERASE_EOF: | |
| 263 | - send_result(source,lib3270_eraseeof(lib3270_get_default_session_handle())); | |
| 264 | - break; | |
| 265 | - | |
| 266 | - case HLLAPI_PACKET_ERASE_EOL: | |
| 267 | - send_result(source,lib3270_eraseeol(lib3270_get_default_session_handle())); | |
| 268 | - break; | |
| 269 | - | |
| 270 | - case HLLAPI_PACKET_ERASE_INPUT: | |
| 271 | - send_result(source,lib3270_eraseinput(lib3270_get_default_session_handle())); | |
| 272 | - break; | |
| 273 | - | |
| 274 | - case HLLAPI_PACKET_PFKEY: | |
| 275 | - send_result(source,lib3270_pfkey( lib3270_get_default_session_handle(), | |
| 276 | - ((struct hllapi_packet_keycode *) source->buffer)->keycode)); | |
| 277 | - break; | |
| 278 | - | |
| 279 | - case HLLAPI_PACKET_PAKEY: | |
| 280 | - send_result(source,lib3270_pakey( lib3270_get_default_session_handle(), | |
| 281 | - ((struct hllapi_packet_keycode *) source->buffer)->keycode)); | |
| 282 | - break; | |
| 283 | - | |
| 284 | - case HLLAPI_PACKET_SET_CURSOR_POSITION: | |
| 285 | - send_result(source,lib3270_set_cursor_position( lib3270_get_default_session_handle(), | |
| 286 | - ((struct hllapi_packet_cursor *) source->buffer)->row, | |
| 287 | - ((struct hllapi_packet_cursor *) source->buffer)->col)); | |
| 288 | - break; | |
| 289 | - | |
| 290 | - case HLLAPI_PACKET_SET_TEXT_AT: | |
| 291 | - send_result(source,lib3270_set_text_at( lib3270_get_default_session_handle(), | |
| 292 | - ((struct hllapi_packet_text_at *) source->buffer)->row, | |
| 293 | - ((struct hllapi_packet_text_at *) source->buffer)->col, | |
| 294 | - (unsigned char *) ((struct hllapi_packet_text_at *) source->buffer)->text)); | |
| 295 | - break; | |
| 296 | - | |
| 297 | - case HLLAPI_PACKET_GET_TEXT_AT: | |
| 298 | - send_text(source,lib3270_get_string_at( lib3270_get_default_session_handle(), | |
| 299 | - ((struct hllapi_packet_at *) source->buffer)->row, | |
| 300 | - ((struct hllapi_packet_at *) source->buffer)->col, | |
| 301 | - ((struct hllapi_packet_at *) source->buffer)->len, | |
| 302 | - ((struct hllapi_packet_at *) source->buffer)->lf)); | |
| 303 | - break; | |
| 304 | - | |
| 305 | - case HLLAPI_PACKET_GET_TEXT_AT_OFFSET: | |
| 306 | - send_text(source,lib3270_get_string_at_address( lib3270_get_default_session_handle(), | |
| 307 | - ((struct hllapi_packet_query_offset *) source->buffer)->addr, | |
| 308 | - ((struct hllapi_packet_query_offset *) source->buffer)->len, | |
| 309 | - ((struct hllapi_packet_query_offset *) source->buffer)->lf)); | |
| 310 | - break; | |
| 311 | - | |
| 312 | - case HLLAPI_PACKET_CMP_TEXT_AT: | |
| 313 | - send_result(source,lib3270_cmp_text_at( lib3270_get_default_session_handle(), | |
| 314 | - ((struct hllapi_packet_text_at *) source->buffer)->row, | |
| 315 | - ((struct hllapi_packet_text_at *) source->buffer)->col, | |
| 316 | - ((struct hllapi_packet_text_at *) source->buffer)->text, | |
| 317 | - ((struct hllapi_packet_text_at *) source->buffer)->lf)); | |
| 318 | - break; | |
| 319 | - | |
| 320 | - case HLLAPI_PACKET_INPUT_STRING: | |
| 321 | - send_result(source,lib3270_input_string(lib3270_get_default_session_handle(), | |
| 322 | - (unsigned char *) ((struct hllapi_packet_text *) source->buffer)->text,-1)); | |
| 323 | - break; | |
| 324 | - | |
| 325 | - case HLLAPI_PACKET_EMULATE_INPUT: | |
| 326 | - send_result(source,lib3270_emulate_input(lib3270_get_default_session_handle(), | |
| 327 | - (const char *) ((struct hllapi_packet_emulate_input *) source->buffer)->text, | |
| 328 | - (int) ((struct hllapi_packet_emulate_input *) source->buffer)->len, | |
| 329 | - (int) ((struct hllapi_packet_emulate_input *) source->buffer)->pasting)); | |
| 330 | - break; | |
| 331 | - | |
| 332 | - case HLLAPI_PACKET_SET_CURSOR: | |
| 333 | - send_result(source,lib3270_set_cursor_address(lib3270_get_default_session_handle(), | |
| 334 | - ((struct hllapi_packet_addr *) source->buffer)->addr)); | |
| 335 | - break; | |
| 336 | - | |
| 337 | - case HLLAPI_PACKET_GET_CURSOR: | |
| 338 | - send_result(source,lib3270_get_cursor_address(lib3270_get_default_session_handle())); | |
| 339 | - break; | |
| 340 | - | |
| 341 | - case HLLAPI_PACKET_GET_WIDTH: | |
| 342 | - send_result(source,lib3270_get_width(lib3270_get_default_session_handle())); | |
| 343 | - break; | |
| 344 | - | |
| 345 | - case HLLAPI_PACKET_GET_HEIGHT: | |
| 346 | - send_result(source,lib3270_get_height(lib3270_get_default_session_handle())); | |
| 347 | - break; | |
| 348 | - | |
| 349 | - case HLLAPI_PACKET_GET_LENGTH: | |
| 350 | - send_result(source,lib3270_get_length(lib3270_get_default_session_handle())); | |
| 351 | - break; | |
| 352 | - | |
| 353 | - case HLLAPI_PACKET_GET_PROGRAM_MESSAGE: | |
| 354 | - send_result(source,lib3270_get_program_message(lib3270_get_default_session_handle())); | |
| 355 | - break; | |
| 356 | - | |
| 357 | - case HLLAPI_PACKET_GET_SSL_STATE: | |
| 358 | - send_result(source,lib3270_get_ssl_state(lib3270_get_default_session_handle())); | |
| 359 | - break; | |
| 360 | - | |
| 361 | - case HLLAPI_PACKET_SET_UNLOCK_DELAY: | |
| 362 | - lib3270_set_unlock_delay(lib3270_get_default_session_handle(),(unsigned short) ((struct hllapi_packet_set_int *) source->buffer)->value); | |
| 363 | - send_result(source,0); | |
| 364 | - break; | |
| 365 | - | |
| 366 | - case HLLAPI_PACKET_SET_TOGGLE: | |
| 367 | - send_result(source,lib3270_set_toggle(lib3270_get_default_session_handle(), | |
| 368 | - (LIB3270_TOGGLE) ((struct hllapi_packet_set *) source->buffer)->id, | |
| 369 | - ((struct hllapi_packet_set *) source->buffer)->value)); | |
| 370 | - break; | |
| 371 | - | |
| 372 | - case HLLAPI_PACKET_FIELD_START: | |
| 373 | - send_result(source,lib3270_get_field_start(lib3270_get_default_session_handle(), | |
| 374 | - ((struct hllapi_packet_addr *) source->buffer)->addr)); | |
| 375 | - break; | |
| 376 | - | |
| 377 | - | |
| 378 | - case HLLAPI_PACKET_FIELD_LEN: | |
| 379 | - send_result(source,lib3270_get_field_len(lib3270_get_default_session_handle(), | |
| 380 | - ((struct hllapi_packet_addr *) source->buffer)->addr)); | |
| 381 | - break; | |
| 382 | - | |
| 383 | - case HLLAPI_PACKET_NEXT_UNPROTECTED: | |
| 384 | - send_result(source,lib3270_get_next_unprotected(lib3270_get_default_session_handle(), | |
| 385 | - ((struct hllapi_packet_addr *) source->buffer)->addr)); | |
| 386 | - break; | |
| 387 | - | |
| 388 | - case HLLAPI_PACKET_IS_PROTECTED: | |
| 389 | - send_result(source,lib3270_get_is_protected(lib3270_get_default_session_handle(), | |
| 390 | - ((struct hllapi_packet_addr *) source->buffer)->addr)); | |
| 391 | - break; | |
| 392 | - | |
| 393 | - case HLLAPI_PACKET_IS_PROTECTED_AT: | |
| 394 | - send_result(source,lib3270_get_is_protected_at( lib3270_get_default_session_handle(), | |
| 395 | - ((struct hllapi_packet_query_at *) source->buffer)->row, | |
| 396 | - ((struct hllapi_packet_query_at *) source->buffer)->col)); | |
| 397 | - break; | |
| 398 | - | |
| 399 | - case HLLAPI_PACKET_QUIT: | |
| 400 | - gtk_main_quit(); | |
| 401 | - send_result(source,0); | |
| 402 | - break; | |
| 403 | - | |
| 404 | - case HLLAPI_PACKET_SET_HOST_CHARSET: | |
| 405 | - send_result(source,lib3270_set_host_charset( lib3270_get_default_session_handle(), | |
| 406 | - (const char *) ((struct hllapi_packet_set_text *) source->buffer)->text)); | |
| 407 | - break; | |
| 408 | - | |
| 409 | - case HLLAPI_PACKET_ASC2EBC: | |
| 410 | - send_text(source,(char *) lib3270_asc2ebc( | |
| 411 | - lib3270_get_default_session_handle(), | |
| 412 | - (unsigned char *) ((struct hllapi_packet_set_text *) source->buffer)->text,-1 | |
| 413 | - )); | |
| 414 | - break; | |
| 415 | - | |
| 416 | - case HLLAPI_PACKET_EBC2ASC: | |
| 417 | - send_text(source,(char *) lib3270_ebc2asc( | |
| 418 | - lib3270_get_default_session_handle(), | |
| 419 | - (unsigned char *) ((struct hllapi_packet_set_text *) source->buffer)->text,-1 | |
| 420 | - )); | |
| 421 | - break; | |
| 422 | - | |
| 423 | - case HLLAPI_PACKET_FILE_TRANSFER: | |
| 424 | - send_result(source,do_file_transfer((struct hllapi_packet_file_transfer *) source)); | |
| 425 | - break; | |
| 426 | - | |
| 427 | - case HLLAPI_PACKET_GET_HOST_CHARSET: | |
| 428 | - trace("%s","HLLAPI_PACKET_GET_HOST_CHARSET"); | |
| 429 | - send_text(source,(char *) lib3270_get_host_charset(lib3270_get_default_session_handle())); | |
| 430 | - break; | |
| 431 | - | |
| 432 | - case HLLAPI_PACKET_ACTION: | |
| 433 | - send_result(source,lib3270_action(lib3270_get_default_session_handle(), | |
| 434 | - (const char *) ((struct hllapi_packet_text *) source->buffer)->text)); | |
| 435 | - break; | |
| 436 | - | |
| 437 | - | |
| 438 | - default: | |
| 439 | - send_result(source, EINVAL); | |
| 440 | - g_message("Invalid remote request (id=%d)",source->buffer[0]); | |
| 441 | - } | |
| 442 | - | |
| 443 | - } | |
| 444 | - | |
| 445 | - static void read_input_pipe(pipe_source *source) | |
| 446 | - { | |
| 447 | - DWORD cbRead = 0; | |
| 448 | - | |
| 449 | - if(ReadFile(source->hPipe,source->buffer,PIPE_BUFFER_LENGTH,&cbRead,&source->overlap) && cbRead > 0) | |
| 450 | - process_input(source,cbRead); | |
| 451 | - | |
| 452 | - // The read operation is still pending. | |
| 453 | - switch(GetLastError()) | |
| 454 | - { | |
| 455 | - case 0: | |
| 456 | - break; | |
| 457 | - | |
| 458 | - case ERROR_IO_PENDING: | |
| 459 | - // trace("%s: PIPE_STATE_PENDING_READ",__FUNCTION__); | |
| 460 | - source->state = PIPE_STATE_PENDING_READ; | |
| 461 | - break; | |
| 462 | - | |
| 463 | - case ERROR_PIPE_LISTENING: | |
| 464 | - // trace("%s: ERROR_PIPE_LISTENING",__FUNCTION__); | |
| 465 | - source->state = PIPE_STATE_READ; | |
| 466 | - break; | |
| 467 | - | |
| 468 | - case ERROR_BROKEN_PIPE: | |
| 469 | - trace("%s: ERROR_BROKEN_PIPE",__FUNCTION__); | |
| 470 | - | |
| 471 | - if(!DisconnectNamedPipe(source->hPipe)) | |
| 472 | - { | |
| 473 | - set_active(FALSE); | |
| 474 | - popup_lasterror("%s",_( "Error in DisconnectNamedPipe" )); | |
| 475 | - } | |
| 476 | - else | |
| 477 | - { | |
| 478 | - IO_accept(source); | |
| 479 | - } | |
| 480 | - break; | |
| 481 | - | |
| 482 | - case ERROR_PIPE_NOT_CONNECTED: | |
| 483 | - trace("%s: ERROR_PIPE_NOT_CONNECTED",__FUNCTION__); | |
| 484 | - set_active(FALSE); | |
| 485 | - break; | |
| 486 | - | |
| 487 | - default: | |
| 488 | - if(source->hPipe != INVALID_HANDLE_VALUE) | |
| 489 | - popup_lasterror("%s",_( "Error receiving message from pipe" ) ); | |
| 490 | - } | |
| 491 | - | |
| 492 | - } | |
| 493 | - | |
| 494 | - static gboolean IO_dispatch(GSource *source, GSourceFunc G_GNUC_UNUSED(callback), gpointer G_GNUC_UNUSED(data)) | |
| 495 | - { | |
| 496 | - /* | |
| 497 | - * Called to dispatch the event source, | |
| 498 | - * after it has returned TRUE in either its prepare or its check function. | |
| 499 | - * The dispatch function is passed in a callback function and data. | |
| 500 | - * The callback function may be NULL if the source was never connected | |
| 501 | - * to a callback using g_source_set_callback(). The dispatch function | |
| 502 | - * should call the callback function with user_data and whatever additional | |
| 503 | - * parameters are needed for this type of event source. | |
| 504 | - */ | |
| 505 | - BOOL fSuccess; | |
| 506 | - DWORD cbRead = 0; | |
| 507 | -// DWORD dwErr = 0; | |
| 508 | - | |
| 509 | - fSuccess = GetOverlappedResult(((pipe_source *) source)->hPipe,&((pipe_source *) source)->overlap,&cbRead,FALSE ); | |
| 510 | - | |
| 511 | - // trace("%s: source=%p data=%p Result=%s cbRead=%d",__FUNCTION__,source,data,fSuccess ? "Success" : "Unsuccess",(int) cbRead); | |
| 512 | - | |
| 513 | - switch(((pipe_source *) source)->state) | |
| 514 | - { | |
| 515 | - case PIPE_STATE_WAITING: | |
| 516 | - if(fSuccess) | |
| 517 | - { | |
| 518 | - trace("Pipe connected (cbRet=%d)",(int) cbRead); | |
| 519 | - set_active(TRUE); | |
| 520 | - ((pipe_source *) source)->state = PIPE_STATE_READ; | |
| 521 | - } | |
| 522 | - else | |
| 523 | - { | |
| 524 | - popup_lasterror("%s", _( "Pipe connection failed" )); | |
| 525 | - } | |
| 526 | - break; | |
| 527 | - | |
| 528 | - case PIPE_STATE_READ: | |
| 529 | - // trace("Reading pipe (cbRead=%d)",(int) cbRead); | |
| 530 | - read_input_pipe( (pipe_source *) source); | |
| 531 | - break; | |
| 532 | - | |
| 533 | - case PIPE_STATE_PENDING_READ: | |
| 534 | - if(fSuccess && cbRead > 0) | |
| 535 | - process_input((pipe_source *) source,cbRead); | |
| 536 | - ((pipe_source *) source)->state = PIPE_STATE_READ; | |
| 537 | - break; | |
| 538 | - | |
| 539 | - case PIPE_STATE_UNDEFINED: | |
| 540 | - break; | |
| 541 | - | |
| 542 | -//#ifdef DEBUG | |
| 543 | -// default: | |
| 544 | -// trace("%s: source=%p data=%p Unexpected mode %d",__FUNCTION__,source,data,((pipe_source *) source)->state); | |
| 545 | -//#endif | |
| 546 | - } | |
| 547 | - | |
| 548 | - return TRUE; | |
| 549 | - } | |
| 550 | - | |
| 551 | - static void IO_finalize(GSource *source) | |
| 552 | - { | |
| 553 | -// trace("%s: source=%p",__FUNCTION__,source); | |
| 554 | - | |
| 555 | - if( ((pipe_source *) source)->hPipe != INVALID_HANDLE_VALUE) | |
| 556 | - { | |
| 557 | - CloseHandle(((pipe_source *) source)->hPipe); | |
| 558 | - ((pipe_source *) source)->hPipe = INVALID_HANDLE_VALUE; | |
| 559 | - } | |
| 560 | - | |
| 561 | - } | |
| 562 | - | |
| 563 | - static gboolean IO_closure(gpointer G_GNUC_UNUSED(data)) | |
| 564 | - { | |
| 565 | - return 0; | |
| 566 | - } | |
| 567 | - | |
| 568 | - void popup_lasterror(const gchar *fmt, ...) | |
| 569 | - { | |
| 570 | - char buffer[4096]; | |
| 571 | - va_list arg_ptr; | |
| 572 | - int sz; | |
| 573 | - DWORD errcode = GetLastError(); | |
| 574 | - char *ptr; | |
| 575 | - LPVOID lpMsgBuf = 0; | |
| 576 | - | |
| 577 | - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |FORMAT_MESSAGE_IGNORE_INSERTS, NULL, errcode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL); | |
| 578 | - | |
| 579 | - for(ptr= (char *) lpMsgBuf;*ptr && *ptr != '\n';ptr++); | |
| 580 | - *ptr = 0; | |
| 581 | - | |
| 582 | - va_start(arg_ptr, fmt); | |
| 583 | - vsnprintf(buffer,4095,fmt,arg_ptr); | |
| 584 | - va_end(arg_ptr); | |
| 585 | - | |
| 586 | - sz = strlen(buffer); | |
| 587 | - snprintf(buffer+sz,4096-sz,": %s\n(rc=%d)",lpMsgBuf,(int) errcode); | |
| 588 | - | |
| 589 | - printf("%s\n",buffer); | |
| 590 | - | |
| 591 | -#ifdef DEBUG | |
| 592 | - fprintf(stderr,"%s\n",buffer); | |
| 593 | - fflush(stderr); | |
| 594 | -#endif | |
| 595 | - | |
| 596 | - LocalFree(lpMsgBuf); | |
| 597 | - } | |
| 598 | - | |
| 599 | - LIB3270_EXPORT int pw3270_plugin_start(GtkWidget G_GNUC_UNUSED(*window), GtkWidget *terminal) | |
| 600 | - { | |
| 601 | - char id; | |
| 602 | - const gchar * name = v3270_get_session_name(terminal); | |
| 603 | - | |
| 604 | - for(id='A';id < 'Z';id++) | |
| 605 | - { | |
| 606 | - g_autofree gchar * pipename = g_strdup_printf("\\\\.\\pipe\\%s_%c",name,id); | |
| 607 | - gchar * ptr; | |
| 608 | - HANDLE hPipe; | |
| 609 | - | |
| 610 | - for(ptr=pipename;*ptr;ptr++) | |
| 611 | - *ptr = g_ascii_tolower(*ptr); | |
| 612 | - | |
| 613 | - hPipe = CreateNamedPipe( TEXT(pipename), // pipe name | |
| 614 | - PIPE_ACCESS_DUPLEX | // read/write access | |
| 615 | - FILE_FLAG_OVERLAPPED, // overlapped mode | |
| 616 | - PIPE_TYPE_MESSAGE | // pipe type | |
| 617 | - PIPE_READMODE_MESSAGE | // pipe mode | |
| 618 | - PIPE_WAIT, // blocking mode | |
| 619 | - 1, // number of instances | |
| 620 | - PIPE_BUFFER_LENGTH, // output buffer size | |
| 621 | - PIPE_BUFFER_LENGTH, // input buffer size | |
| 622 | - NMPWAIT_USE_DEFAULT_WAIT, // client time-out | |
| 623 | - NULL); // default security attributes | |
| 624 | - | |
| 625 | - trace("%s = %p",pipename,hPipe); | |
| 626 | - | |
| 627 | - if(hPipe != INVALID_HANDLE_VALUE) | |
| 628 | - { | |
| 629 | - static GSourceFuncs pipe_source_funcs = | |
| 630 | - { | |
| 631 | - IO_prepare, | |
| 632 | - IO_check, | |
| 633 | - IO_dispatch, | |
| 634 | - IO_finalize, | |
| 635 | - IO_closure, | |
| 636 | - NULL | |
| 637 | - }; | |
| 638 | - g_autofree gchar * session = g_strdup_printf("%s:%c",name,id); | |
| 639 | - pipe_source * source = (pipe_source *) g_source_new(&pipe_source_funcs,sizeof(pipe_source)); | |
| 640 | - | |
| 641 | - source->hPipe = hPipe; | |
| 642 | - source->state = PIPE_STATE_WAITING; | |
| 643 | - source->overlap.hEvent = CreateEvent( NULL,TRUE,TRUE,NULL); | |
| 644 | - | |
| 645 | - g_source_attach((GSource *) source,NULL); | |
| 646 | - IO_accept(source); | |
| 647 | - | |
| 648 | - v3270_set_session_name(terminal,session); | |
| 649 | - g_message("Session %s attached to %s",session,pipename); | |
| 650 | - | |
| 651 | - return 0; | |
| 652 | - } | |
| 653 | - | |
| 654 | - } | |
| 655 | - | |
| 656 | - popup_lasterror( "%s", _( "Can´t create remote control pipe" )); | |
| 657 | - | |
| 658 | - return -1; | |
| 659 | - } | |
| 660 | - | |
| 661 | - LIB3270_EXPORT int pw3270_plugin_stop(GtkWidget G_GNUC_UNUSED(*window), GtkWidget G_GNUC_UNUSED(*terminal)) | |
| 662 | - { | |
| 663 | - | |
| 664 | - return 0; | |
| 665 | - } | |
| 666 | - | |
| 667 | - G_GNUC_INTERNAL void set_active(gboolean on) | |
| 668 | - { | |
| 669 | - trace("%s(%s)",__FUNCTION__,on ? "Active" : "Inactive"); | |
| 670 | - // v3270_set_script(v3270_get_default_widget(),'H'); | |
| 671 | - } |
src/ipc3270c/windows/private.h
| ... | ... | @@ -1,50 +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. | |
| 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., 59 Temple | |
| 19 | - * Place, Suite 330, Boston, MA, 02111-1307, USA | |
| 20 | - * | |
| 21 | - * Este programa está nomeado como -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 | - #include <config.h> | |
| 31 | - #define ENABLE_NLS | |
| 32 | - #define GETTEXT_PACKAGE PACKAGE_NAME | |
| 33 | - | |
| 34 | - #include <libintl.h> | |
| 35 | - #include <glib/gi18n.h> | |
| 36 | - #include <gtk/gtk.h> | |
| 37 | - | |
| 38 | - #include <lib3270.h> | |
| 39 | - #include <lib3270/log.h> | |
| 40 | - #include <pw3270.h> | |
| 41 | - #include <pw3270/hllapi.h> | |
| 42 | - | |
| 43 | - #include <windows.h> | |
| 44 | - | |
| 45 | - #define PIPE_BUFFER_LENGTH HLLAPI_MAXLENGTH+30 | |
| 46 | - | |
| 47 | - G_GNUC_INTERNAL void popup_lasterror(const gchar *fmt, ...); | |
| 48 | - G_GNUC_INTERNAL void set_active(gboolean on); | |
| 49 | - | |
| 50 | - |
src/ipc3270c/windows/resources.rc.in
| ... | ... | @@ -1,29 +0,0 @@ |
| 1 | -#include <windows.h> | |
| 2 | - | |
| 3 | -VS_VERSION_INFO VERSIONINFO | |
| 4 | -FILEVERSION @PACKAGE_MAJOR_VERSION@,@PACKAGE_MINOR_VERSION@,@PACKAGE_MAJOR_RELEASE@,0 | |
| 5 | -PRODUCTVERSION @PACKAGE_MAJOR_VERSION@,@PACKAGE_MINOR_VERSION@,@PACKAGE_MAJOR_RELEASE@,0 | |
| 6 | - | |
| 7 | -BEGIN | |
| 8 | - | |
| 9 | - BLOCK "StringFileInfo" | |
| 10 | - BEGIN | |
| 11 | - BLOCK "080904E4" | |
| 12 | - BEGIN | |
| 13 | - VALUE "FileDescription", "IPC Compatibility Plugin for pw3270\0" | |
| 14 | - VALUE "CompanyName", "Banco do Brasil S/A.\0" | |
| 15 | - VALUE "FileVersion", "@WIN32_VERSION@\0" | |
| 16 | - VALUE "LegalCopyright", "(C) 2017 Banco do Brasil S/A. All Rights Reserved\0" | |
| 17 | - VALUE "OriginalFilename", "ipc3270@DLLEXT@\0" | |
| 18 | - VALUE "ProductName", "pw3270\0" | |
| 19 | - VALUE "ProductVersion", "@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@.@PACKAGE_MAJOR_RELEASE@.0\0" | |
| 20 | - END | |
| 21 | - END | |
| 22 | - | |
| 23 | - BLOCK "VarFileInfo" | |
| 24 | - BEGIN | |
| 25 | - VALUE "Translation", 0x809, 0x04E4 | |
| 26 | - END | |
| 27 | - | |
| 28 | -END | |
| 29 | - |
| ... | ... | @@ -0,0 +1,126 @@ |
| 1 | +#!/bin/bash | |
| 2 | + | |
| 3 | +SESSION=a | |
| 4 | +DEST=br.com.bb.pw3270 | |
| 5 | +BPATH=/br/com/bb/pw3270 | |
| 6 | + | |
| 7 | +run_command() | |
| 8 | +{ | |
| 9 | + | |
| 10 | + case $1 in | |
| 11 | + | |
| 12 | + revision) | |
| 13 | + dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getRevision | |
| 14 | + ;; | |
| 15 | + | |
| 16 | + message) | |
| 17 | + dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getMessageID | |
| 18 | + ;; | |
| 19 | + | |
| 20 | + ssl) | |
| 21 | + dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getSecureState | |
| 22 | + ;; | |
| 23 | + | |
| 24 | + connect) | |
| 25 | + dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.connect string:$2 int32:10 | |
| 26 | + ;; | |
| 27 | + | |
| 28 | + disconnect) | |
| 29 | + dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.disconnect | |
| 30 | + ;; | |
| 31 | + | |
| 32 | + url) | |
| 33 | + dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getURL | |
| 34 | + ;; | |
| 35 | + | |
| 36 | + quit) | |
| 37 | + dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.quit | |
| 38 | + ;; | |
| 39 | + | |
| 40 | + get) | |
| 41 | + dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getScreenContents | |
| 42 | + ;; | |
| 43 | + | |
| 44 | + gettext) | |
| 45 | +# addr,len,lf | |
| 46 | +# dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getText int32:1 int32:-1 byte:0 | |
| 47 | + dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getText int32:1 int32:-1 byte:10 | |
| 48 | + ;; | |
| 49 | + | |
| 50 | + protect) | |
| 51 | + dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getIsProtectedAt int32:$2 int32:$3 | |
| 52 | + ;; | |
| 53 | + | |
| 54 | + set) | |
| 55 | + dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.setTextAt int32:$2 int32:$3 string:$4 | |
| 56 | + ;; | |
| 57 | + | |
| 58 | + action) | |
| 59 | + dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.action string:$2 | |
| 60 | + ;; | |
| 61 | + | |
| 62 | + enter) | |
| 63 | + dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.enter | |
| 64 | + ;; | |
| 65 | + | |
| 66 | + isconnected) | |
| 67 | + dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.isConnected | |
| 68 | + ;; | |
| 69 | + | |
| 70 | + hostcharset) | |
| 71 | + dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getHostCharset | |
| 72 | + ;; | |
| 73 | + | |
| 74 | + displaycharset) | |
| 75 | + dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getDisplayCharset | |
| 76 | + ;; | |
| 77 | + | |
| 78 | + unlockdelay) | |
| 79 | + dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.setUnlockDelay int32:$2 | |
| 80 | + ;; | |
| 81 | + | |
| 82 | + *) | |
| 83 | + echo "Comando $1 desconhecido" | |
| 84 | + ;; | |
| 85 | + | |
| 86 | + esac | |
| 87 | +} | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | +until [ -z "$1" ] | |
| 92 | +do | |
| 93 | + if [ ${1:0:2} = '--' ]; then | |
| 94 | + tmp=${1:2} | |
| 95 | + parameter=${tmp%%=*} | |
| 96 | + parameter=$(echo $parameter | tr "[:lower:]" "[:upper:]") | |
| 97 | + value=${tmp##*=} | |
| 98 | + | |
| 99 | + case "$parameter" in | |
| 100 | + SESSION) | |
| 101 | + SESSION=$value | |
| 102 | + ;; | |
| 103 | + HELP) | |
| 104 | + echo "$0 options" | |
| 105 | + echo "" | |
| 106 | + echo "Options:" | |
| 107 | + echo "" | |
| 108 | + echo " --session pw3270's session manager" | |
| 109 | + echo "" | |
| 110 | + exit 0 | |
| 111 | + ;; | |
| 112 | + | |
| 113 | + *) | |
| 114 | + eval $parameter=$value | |
| 115 | + ;; | |
| 116 | + | |
| 117 | + esac | |
| 118 | + | |
| 119 | + else | |
| 120 | + run_command $@ | |
| 121 | + exit 0 | |
| 122 | + fi | |
| 123 | + | |
| 124 | + shift | |
| 125 | +done | |
| 126 | + | ... | ... |
| ... | ... | @@ -0,0 +1,268 @@ |
| 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. | |
| 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., 59 Temple | |
| 19 | + * Place, Suite 330, Boston, MA, 02111-1307, USA | |
| 20 | + * | |
| 21 | + * Este programa está nomeado como testprogram.cc 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 | + #include <iostream> | |
| 31 | + #include <getopt.h> | |
| 32 | + #include <cstring> | |
| 33 | + #include <cstdio> | |
| 34 | + #include <lib3270/hllapi.h> | |
| 35 | + | |
| 36 | + #define SCREEN_LENGTH 2000 | |
| 37 | + | |
| 38 | + using namespace std; | |
| 39 | + | |
| 40 | +/*---[ Implement ]--------------------------------------------------------------------------------*/ | |
| 41 | + | |
| 42 | + int main(int argc, char **argv) { | |
| 43 | + | |
| 44 | + char buffer[SCREEN_LENGTH+1]; | |
| 45 | + | |
| 46 | + const char *host = ""; | |
| 47 | + const char *session = "pw3270:a"; | |
| 48 | + | |
| 49 | + #pragma GCC diagnostic push | |
| 50 | + static struct option options[] = | |
| 51 | + { | |
| 52 | + { "host", required_argument, 0, 'h' }, | |
| 53 | + { "session-name", required_argument, 0, 'S' }, | |
| 54 | + { 0, 0, 0, 0} | |
| 55 | + }; | |
| 56 | + #pragma GCC diagnostic pop | |
| 57 | + | |
| 58 | + int long_index =0; | |
| 59 | + int opt; | |
| 60 | + while((opt = getopt_long(argc, argv, "h:S:", options, &long_index )) != -1) | |
| 61 | + { | |
| 62 | + | |
| 63 | + switch(opt) | |
| 64 | + { | |
| 65 | + case 'h': | |
| 66 | + host = optarg; | |
| 67 | + break; | |
| 68 | + | |
| 69 | + case 'S': | |
| 70 | + session = optarg; | |
| 71 | + break; | |
| 72 | + | |
| 73 | + } | |
| 74 | + | |
| 75 | + } | |
| 76 | + | |
| 77 | + int rc = hllapi_init((char *) session); | |
| 78 | + if(rc) { | |
| 79 | + cout << "hllapi_init returns with rc=" << rc << " (" << hllapi_get_last_error() << ")" << endl; | |
| 80 | + return rc; | |
| 81 | + } | |
| 82 | + | |
| 83 | + cout << "TN3270 library revision is " << ((int) hllapi_get_revision()) << endl << ">"; | |
| 84 | + | |
| 85 | + cout.flush(); | |
| 86 | + | |
| 87 | + string cmdline; | |
| 88 | + while(std::getline(std::cin, cmdline)) { | |
| 89 | + | |
| 90 | + if(cmdline.empty()) | |
| 91 | + break; | |
| 92 | + | |
| 93 | + memset(buffer,' ',SCREEN_LENGTH); | |
| 94 | + buffer[SCREEN_LENGTH] = 0; | |
| 95 | + | |
| 96 | + rc = HLLAPI_STATUS_SUCCESS; | |
| 97 | + | |
| 98 | + if(strcasecmp(cmdline.c_str(),"connect") == 0) { | |
| 99 | + | |
| 100 | + cout << "Connecting..." << endl; | |
| 101 | + rc = hllapi_connect((LPSTR) host,1); | |
| 102 | + | |
| 103 | + } else if(strcasecmp(cmdline.c_str(),"wait") == 0) { | |
| 104 | + | |
| 105 | + rc = hllapi_wait_for_ready(10); | |
| 106 | + cout << "hllapi_wait_for_ready returns with rc=" << rc << " (" << hllapi_get_last_error() << ")" << endl; | |
| 107 | + | |
| 108 | + } else if(strcasecmp(cmdline.c_str(),"disconnect") == 0) { | |
| 109 | + | |
| 110 | + cout << "Disconnecting..." << endl; | |
| 111 | + rc = hllapi_disconnect(); | |
| 112 | + | |
| 113 | + } else if(strcasecmp(cmdline.c_str(),"luname") == 0) { | |
| 114 | + | |
| 115 | + rc = hllapi_get_lu_name(buffer,SCREEN_LENGTH); | |
| 116 | + if(rc == HLLAPI_STATUS_SUCCESS) { | |
| 117 | + cout << "LU Name is " << buffer << endl; | |
| 118 | + } | |
| 119 | + | |
| 120 | + } else if(strcasecmp(cmdline.c_str(),"contents") == 0) { | |
| 121 | + | |
| 122 | + rc = hllapi_get_screen(0,buffer,SCREEN_LENGTH); | |
| 123 | + cout << "hllapi_get_screen returns with rc=" << rc << " (" << hllapi_get_last_error() << ")" << endl | |
| 124 | + << buffer << endl << endl; | |
| 125 | + | |
| 126 | + } else if(strncasecmp(cmdline.c_str(),"cursor",6) == 0) { | |
| 127 | + | |
| 128 | + unsigned int row, col; | |
| 129 | + | |
| 130 | + switch(std::sscanf(cmdline.c_str()+6,"%u,%u",&row,&col)) { | |
| 131 | + case 1: | |
| 132 | + cout << "Moving cursor to " << row << endl; | |
| 133 | + rc = hllapi_set_cursor_address((WORD) row); | |
| 134 | + break; | |
| 135 | + | |
| 136 | + case 2: | |
| 137 | + cout << "Moving cursor to " << row << "," << col << endl; | |
| 138 | + rc = hllapi_set_cursor_position((WORD) row, (WORD) col); | |
| 139 | + break; | |
| 140 | + } | |
| 141 | + | |
| 142 | + } else if(strncasecmp(cmdline.c_str(),"at",2) == 0) { | |
| 143 | + | |
| 144 | + unsigned int row, col, len; | |
| 145 | + | |
| 146 | + switch(std::sscanf(cmdline.c_str()+3,"%u,%u,%u",&row,&col,&len)) { | |
| 147 | + case 3: | |
| 148 | + { | |
| 149 | + cout << "Getting " << len << " bytes from " << row << "," << col << endl; | |
| 150 | + | |
| 151 | + char * buffer = new char[len+1]; | |
| 152 | + memset(buffer,' ',len+1); | |
| 153 | + buffer[len] = 0; | |
| 154 | + | |
| 155 | + rc = hllapi_get_screen_at(row,col,buffer); | |
| 156 | + if(rc == HLLAPI_STATUS_SUCCESS) { | |
| 157 | + cout << "Contents:" << endl << buffer << endl; | |
| 158 | + } | |
| 159 | + | |
| 160 | + delete[] buffer; | |
| 161 | + } | |
| 162 | + break; | |
| 163 | + | |
| 164 | + case 2: | |
| 165 | + { | |
| 166 | + cout << "Getting " << col << " bytes from " << row << endl; | |
| 167 | + | |
| 168 | + char * buffer = new char[col+1]; | |
| 169 | + memset(buffer,' ',col+1); | |
| 170 | + buffer[col] = 0; | |
| 171 | + | |
| 172 | + rc = hllapi_get_screen(row,buffer,col); | |
| 173 | + if(rc == HLLAPI_STATUS_SUCCESS) { | |
| 174 | + cout << "Contents:" << endl << buffer << endl; | |
| 175 | + } | |
| 176 | + | |
| 177 | + delete[] buffer; | |
| 178 | + | |
| 179 | + } | |
| 180 | + break; | |
| 181 | + } | |
| 182 | + | |
| 183 | + } else if(strncasecmp(cmdline.c_str(),"enter",5) == 0) { | |
| 184 | + | |
| 185 | + rc = hllapi_enter(); | |
| 186 | + | |
| 187 | + } else if(strncasecmp(cmdline.c_str(),"pf ",3) == 0) { | |
| 188 | + | |
| 189 | + rc = hllapi_pfkey(atoi(cmdline.c_str()+3)); | |
| 190 | + | |
| 191 | + } else if(strncasecmp(cmdline.c_str(),"input ",6) == 0) { | |
| 192 | + | |
| 193 | + rc = hllapi_input_string((LPSTR) cmdline.c_str()+6,0); | |
| 194 | + | |
| 195 | + } else if(strncasecmp(cmdline.c_str(),"wait ",5) == 0) { | |
| 196 | + | |
| 197 | + rc = hllapi_wait_for_ready(5); | |
| 198 | + | |
| 199 | + } else if(strncasecmp(cmdline.c_str(),"find ",5) == 0) { | |
| 200 | + | |
| 201 | + cout << "Searching for \"" << (cmdline.c_str()+5) << "\"" << endl; | |
| 202 | + rc = hllapi_find_text((LPSTR) (cmdline.c_str()+5)); | |
| 203 | + | |
| 204 | + } else { | |
| 205 | + | |
| 206 | + cout << "Unknown command \"" << cmdline << "\""<< endl; | |
| 207 | + } | |
| 208 | + | |
| 209 | + if(rc != HLLAPI_STATUS_SUCCESS) { | |
| 210 | + cout << "rc=" << rc << " (" << hllapi_get_last_error() << ")" << endl; | |
| 211 | + rc = HLLAPI_STATUS_SUCCESS; | |
| 212 | + } | |
| 213 | + | |
| 214 | + cout << endl << ">"; | |
| 215 | + cout.flush(); | |
| 216 | + } | |
| 217 | + | |
| 218 | + /* | |
| 219 | + | |
| 220 | + | |
| 221 | + rc = hllapi_wait_for_ready(10); | |
| 222 | + if(rc) { | |
| 223 | + cout << "hllapi_wait_for_ready returns with rc=" << rc << " (" << hllapi_get_last_error() << ")" << endl; | |
| 224 | + return rc; | |
| 225 | + } | |
| 226 | + | |
| 227 | + if(hllapi_is_connected()) { | |
| 228 | + | |
| 229 | + cout << "Host is connected" << endl; | |
| 230 | + | |
| 231 | + memset(buffer,' ',SCREEN_LENGTH); | |
| 232 | + buffer[SCREEN_LENGTH] = 0; | |
| 233 | + | |
| 234 | + rc = hllapi_get_screen(0,buffer,SCREEN_LENGTH); | |
| 235 | + cout << "hllapi_get_screen returns with rc=" << rc << " (" << hllapi_get_last_error() << ")" << endl; | |
| 236 | + | |
| 237 | + if(rc == HLLAPI_STATUS_SUCCESS) { | |
| 238 | + cout << endl << buffer << endl; | |
| 239 | + } | |
| 240 | + | |
| 241 | + } else { | |
| 242 | + | |
| 243 | + cout << "Host is not connected" << endl; | |
| 244 | + | |
| 245 | + | |
| 246 | + } | |
| 247 | + | |
| 248 | + rc = hllapi_get_lu_name(buffer,SCREEN_LENGTH); | |
| 249 | + if(rc == HLLAPI_STATUS_SUCCESS) { | |
| 250 | + cout << "LU Name is " << buffer << endl; | |
| 251 | + } | |
| 252 | + | |
| 253 | + rc = hllapi_disconnect(); | |
| 254 | + if(rc) { | |
| 255 | + cout << "hllapi_disconnect returns with rc=" << rc << " (" << hllapi_get_last_error() << ")" << endl; | |
| 256 | + return rc; | |
| 257 | + } | |
| 258 | + | |
| 259 | + cout << "HLLAPI Last error was \"" << hllapi_get_last_error() << "\"" << endl; | |
| 260 | + | |
| 261 | + */ | |
| 262 | + | |
| 263 | + rc = hllapi_deinit(); | |
| 264 | + cout << "hllapi_deinit exits with rc=" << rc << endl; | |
| 265 | + | |
| 266 | + return 0; | |
| 267 | + } | |
| 268 | + | ... | ... |
src/testprograms/hllapi.c
| ... | ... | @@ -1,185 +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. | |
| 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., 59 Temple | |
| 19 | - * Place, Suite 330, Boston, MA, 02111-1307, USA | |
| 20 | - * | |
| 21 | - * Este programa está nomeado como testprogram.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 | - #include <stdio.h> | |
| 31 | - #include <string.h> | |
| 32 | - #include <time.h> | |
| 33 | - #include <getopt.h> | |
| 34 | - #include <pw3270/hllapi.h> | |
| 35 | - | |
| 36 | - #if defined(DEBUG) && defined(_WIN32) | |
| 37 | - #undef trace | |
| 38 | - #define trace( fmt, ... ) { FILE *out = fopen("c:\\Users\\Perry\\hllapi.log","a"); if(out) { fprintf(out, "%s(%d) " fmt "\n", __FILE__, __LINE__, __VA_ARGS__ ); fclose(out); } } | |
| 39 | - #endif // DEBUG | |
| 40 | - | |
| 41 | - #define MAX_DATA_SIZE 8000 //< Maximum data size for this application. | |
| 42 | - | |
| 43 | -// static CHAR hllapi_data[MAX_DATA_SIZE]; | |
| 44 | - | |
| 45 | -/*---[ Implement ]--------------------------------------------------------------------------------*/ | |
| 46 | - | |
| 47 | - /* | |
| 48 | - static void connect_ps(const char *session) | |
| 49 | - { | |
| 50 | - WORD len; | |
| 51 | - WORD fn = HLLAPI_CMD_CONNECTPS; | |
| 52 | - WORD rc = 0; | |
| 53 | - | |
| 54 | - strncpy(hllapi_data,session,MAX_DATA_SIZE); | |
| 55 | - | |
| 56 | - len = strlen(session); | |
| 57 | - hllapi(&fn,hllapi_data,&len,&rc); | |
| 58 | - | |
| 59 | - } | |
| 60 | - */ | |
| 61 | - | |
| 62 | - int main(int argc, char **argv) | |
| 63 | - { | |
| 64 | - const char *host = NULL; | |
| 65 | - const char *session = "pw3270:A"; | |
| 66 | - | |
| 67 | - #pragma GCC diagnostic push | |
| 68 | - static struct option options[] = | |
| 69 | - { | |
| 70 | - { "host", required_argument, 0, 'h' }, | |
| 71 | - { "session-name", required_argument, 0, 'S' }, | |
| 72 | - { 0, 0, 0, 0} | |
| 73 | - }; | |
| 74 | - #pragma GCC diagnostic pop | |
| 75 | - | |
| 76 | - int long_index =0; | |
| 77 | - int opt; | |
| 78 | - while((opt = getopt_long(argc, argv, "h:S:", options, &long_index )) != -1) | |
| 79 | - { | |
| 80 | - | |
| 81 | - switch(opt) | |
| 82 | - { | |
| 83 | - case 'h': | |
| 84 | - host = optarg; | |
| 85 | - break; | |
| 86 | - | |
| 87 | - case 'S': | |
| 88 | - session = optarg; | |
| 89 | - break; | |
| 90 | - | |
| 91 | - } | |
| 92 | - | |
| 93 | - } | |
| 94 | - | |
| 95 | - int rc = hllapi_init((char *) session); | |
| 96 | - if(rc) | |
| 97 | - { | |
| 98 | - printf("hllapi_init returns with rc=%d\n",rc); | |
| 99 | - return rc; | |
| 100 | - } | |
| 101 | - | |
| 102 | - printf("Library revision is %d\n",(int) hllapi_get_revision()); | |
| 103 | - | |
| 104 | - if(host) { | |
| 105 | - | |
| 106 | - printf("connect=%d\n",(int) hllapi_connect((char *) host,1)); | |
| 107 | - printf("wait_for_ready=%d\n",(int) hllapi_wait_for_ready(10)); | |
| 108 | - printf("connected=%s\n",(int) hllapi_is_connected() ? "Yes" : "No"); | |
| 109 | - | |
| 110 | - printf("disconnect=%d\n",(int) hllapi_disconnect()); | |
| 111 | - } | |
| 112 | - | |
| 113 | - printf("connected=%s\n",(int) hllapi_is_connected() ? "Yes" : "No"); | |
| 114 | - | |
| 115 | - rc = hllapi_deinit(); | |
| 116 | - printf("hllapi_deinit exits with rc=%d\n",rc); | |
| 117 | - | |
| 118 | - return 0; | |
| 119 | - } | |
| 120 | - | |
| 121 | -/* | |
| 122 | - int main(int numpar, char *param[]) | |
| 123 | - { | |
| 124 | - char buffer[BUFFER_LENGTH]; | |
| 125 | - unsigned short rc; | |
| 126 | - unsigned short len; | |
| 127 | - unsigned long fn; | |
| 128 | - | |
| 129 | - static const struct _cmd | |
| 130 | - { | |
| 131 | - const char * name; | |
| 132 | - unsigned short fn; | |
| 133 | - const char * arg; | |
| 134 | - } cmd[] = | |
| 135 | - { | |
| 136 | - { "GetRevision", HLLAPI_CMD_GETREVISION, " " }, | |
| 137 | - { "ConnectPS", HLLAPI_CMD_CONNECTPS, "pw3270A" }, | |
| 138 | - { "InputString", HLLAPI_CMD_INPUTSTRING, "test" }, | |
| 139 | - | |
| 140 | - }; | |
| 141 | - | |
| 142 | - int f; | |
| 143 | - | |
| 144 | - | |
| 145 | - for(f=0;f< (sizeof(cmd)/sizeof(struct _cmd)); f++) | |
| 146 | - { | |
| 147 | - len = strlen(cmd[f].arg); | |
| 148 | - memcpy(buffer,cmd[f].arg,len); | |
| 149 | - hllapi((LPWORD) &cmd[f].fn,buffer,&len,&rc); | |
| 150 | - printf("%s exits with rc=%d\n[%s]\n",cmd[f].name,rc,buffer); | |
| 151 | - } | |
| 152 | - | |
| 153 | - len = 80; | |
| 154 | - rc = 1040; | |
| 155 | - fn = HLLAPI_CMD_COPYPSTOSTR; | |
| 156 | - hllapi((LPWORD) &fn,buffer,&len,&rc); | |
| 157 | - printf("%s exits with rc=%d\n%s\n","HLLAPI_CMD_COPYPSTOSTR",rc,buffer); | |
| 158 | - | |
| 159 | - // Performance | |
| 160 | - len = strlen(cmd[0].arg); | |
| 161 | - memcpy(buffer,cmd[0].arg,len); | |
| 162 | - if(hllapi((LPWORD) &cmd[0].fn,buffer,&len,&rc) == 0 && rc == 0) | |
| 163 | - { | |
| 164 | - time_t end = time(0) + 5; | |
| 165 | - int qtd = 0; | |
| 166 | - do | |
| 167 | - { | |
| 168 | - qtd++; | |
| 169 | - } while(hllapi((LPWORD) &cmd[0].fn,buffer,&len,&rc) == 0 && rc == 0 && time(0)<end); | |
| 170 | - printf("%d interacoes em 5 segundos (rc=%d)\n",qtd,rc); | |
| 171 | - | |
| 172 | - } | |
| 173 | - | |
| 174 | - // Disconnect | |
| 175 | - len = 10; | |
| 176 | - rc = 1; | |
| 177 | - fn = HLLAPI_CMD_DISCONNECTPS; | |
| 178 | - *buffer = 0; | |
| 179 | - hllapi((LPWORD) &fn,buffer,&len,&rc); | |
| 180 | - printf("%s exits with rc=%d\n[%s]\n","HLLAPI_CMD_DISCONNECTPS",rc,buffer); | |
| 181 | - | |
| 182 | - | |
| 183 | - return 0; | |
| 184 | - } | |
| 185 | -*/ |
src/testprograms/ipc3270c.c
| ... | ... | @@ -1,236 +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 | |
| 5 | - * o nome G3270. | |
| 6 | - * | |
| 7 | - * Copyright (C) <2008> <Banco do Brasil S.A.> | |
| 8 | - * | |
| 9 | - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
| 10 | - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
| 11 | - * Free Software Foundation. | |
| 12 | - * | |
| 13 | - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
| 14 | - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
| 15 | - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
| 16 | - * obter mais detalhes. | |
| 17 | - * | |
| 18 | - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
| 19 | - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin | |
| 20 | - * St, Fifth Floor, Boston, MA 02110-1301 USA | |
| 21 | - * | |
| 22 | - * Este programa está nomeado como testprogram.c e possui - linhas de código. | |
| 23 | - * | |
| 24 | - * Contatos: | |
| 25 | - * | |
| 26 | - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
| 27 | - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | |
| 28 | - * | |
| 29 | - */ | |
| 30 | - | |
| 31 | - | |
| 32 | - /** | |
| 33 | - * @brief Test program for pw3270 HLLAPI compatibility plugin. | |
| 34 | - * | |
| 35 | - */ | |
| 36 | - | |
| 37 | - #include <config.h> | |
| 38 | - #include <v3270.h> | |
| 39 | - #include <v3270/trace.h> | |
| 40 | - #include <pw3270/plugin.h> | |
| 41 | - #include <string.h> | |
| 42 | - #include <stdlib.h> | |
| 43 | - #include <pw3270.h> | |
| 44 | - | |
| 45 | - /*---[ Globals ]------------------------------------------------------------------------------------*/ | |
| 46 | - | |
| 47 | - const gchar * plugin_path = ".bin/Debug"; | |
| 48 | - const gchar * session_name = "pw3270"; | |
| 49 | - const gchar * plugin_name = "ipc3270c." G_MODULE_SUFFIX; | |
| 50 | - | |
| 51 | - /*---[ Implement ]----------------------------------------------------------------------------------*/ | |
| 52 | - | |
| 53 | - static void close_module(GtkWidget *widget, GModule *module) | |
| 54 | - { | |
| 55 | - g_message("Closing module %p",module); | |
| 56 | - | |
| 57 | - static void (*stop)(GtkWidget *window, GtkWidget *terminal) = NULL; | |
| 58 | - if(!g_module_symbol(module,"pw3270_plugin_stop",(void **) &stop)) | |
| 59 | - { | |
| 60 | - g_message("Can't get stop method from plugin: %s",g_module_error()); | |
| 61 | - } | |
| 62 | - else | |
| 63 | - { | |
| 64 | - stop(gtk_widget_get_toplevel(widget),widget); | |
| 65 | - } | |
| 66 | - | |
| 67 | - g_module_close(module); | |
| 68 | - g_message("Module %p was closed",module); | |
| 69 | - } | |
| 70 | - | |
| 71 | - static void toggle_ds_trace(GtkToggleToolButton *button, GtkWidget *terminal) | |
| 72 | - { | |
| 73 | - v3270_set_toggle(terminal,LIB3270_TOGGLE_DS_TRACE,gtk_toggle_tool_button_get_active(button)); | |
| 74 | - } | |
| 75 | - | |
| 76 | - static void toggle_event_trace(GtkToggleToolButton *button, GtkWidget *terminal) | |
| 77 | - { | |
| 78 | - v3270_set_toggle(terminal,LIB3270_TOGGLE_EVENT_TRACE,gtk_toggle_tool_button_get_active(button)); | |
| 79 | - } | |
| 80 | - | |
| 81 | - static void toggle_ssl_trace(GtkToggleToolButton *button, GtkWidget *terminal) | |
| 82 | - { | |
| 83 | - v3270_set_toggle(terminal,LIB3270_TOGGLE_SSL_TRACE,gtk_toggle_tool_button_get_active(button)); | |
| 84 | - } | |
| 85 | - | |
| 86 | - static void toggle_screen_trace(GtkToggleToolButton *button, GtkWidget *terminal) | |
| 87 | - { | |
| 88 | - v3270_set_toggle(terminal,LIB3270_TOGGLE_SCREEN_TRACE,gtk_toggle_tool_button_get_active(button)); | |
| 89 | - } | |
| 90 | - | |
| 91 | - static void toggle_started_trace(GtkToggleToolButton *button, GModule *module) | |
| 92 | - { | |
| 93 | - if(!module) | |
| 94 | - return; | |
| 95 | - | |
| 96 | - GtkWidget * terminal = GTK_WIDGET(g_object_get_data(G_OBJECT(button),"terminal")); | |
| 97 | - | |
| 98 | - const gchar * method_name = (gtk_toggle_tool_button_get_active(button) ? "pw3270_plugin_start" : "pw3270_plugin_stop"); | |
| 99 | - | |
| 100 | - static void (*call)(GtkWidget *window, GtkWidget *terminal) = NULL; | |
| 101 | - if(!g_module_symbol(module,method_name,(void **) &call)) | |
| 102 | - { | |
| 103 | - g_message("Can't get method \"%s\": %s",method_name,g_module_error()); | |
| 104 | - return; | |
| 105 | - } | |
| 106 | - | |
| 107 | - g_message("Calling %s",method_name); | |
| 108 | - call(gtk_widget_get_toplevel(terminal), GTK_WIDGET(terminal)); | |
| 109 | - | |
| 110 | - } | |
| 111 | - | |
| 112 | - static GtkToolItem * create_tool_item(GtkWidget *terminal, const gchar *label, const gchar *tooltip, GCallback callback) | |
| 113 | - { | |
| 114 | - GtkToolItem * item = gtk_toggle_tool_button_new(); | |
| 115 | - gtk_tool_button_set_label(GTK_TOOL_BUTTON(item),label); | |
| 116 | - | |
| 117 | - g_signal_connect(GTK_WIDGET(item), "toggled", G_CALLBACK(callback), terminal); | |
| 118 | - | |
| 119 | - if(tooltip) | |
| 120 | - gtk_widget_set_tooltip_text(GTK_WIDGET(item),tooltip); | |
| 121 | - | |
| 122 | - return item; | |
| 123 | - } | |
| 124 | - | |
| 125 | - static void activate(GtkApplication* app, G_GNUC_UNUSED gpointer user_data) { | |
| 126 | - | |
| 127 | - GtkWidget * window = gtk_application_window_new(app); | |
| 128 | - GtkWidget * terminal = v3270_new(); | |
| 129 | - GtkWidget * notebook = gtk_notebook_new(); | |
| 130 | - GModule * module = NULL; | |
| 131 | - | |
| 132 | - gtk_widget_set_name(window,session_name); | |
| 133 | - v3270_set_session_name(terminal, session_name); | |
| 134 | - | |
| 135 | - // Setup tabs | |
| 136 | - gtk_notebook_append_page(GTK_NOTEBOOK(notebook),terminal,gtk_label_new(v3270_get_session_name(terminal))); | |
| 137 | - | |
| 138 | - // Load plugin | |
| 139 | - { | |
| 140 | - g_autofree gchar * plugin = g_build_filename(plugin_path,plugin_name,NULL); | |
| 141 | - | |
| 142 | - g_message("Loading %s",plugin); | |
| 143 | - | |
| 144 | - module = g_module_open(plugin,G_MODULE_BIND_LOCAL); | |
| 145 | - | |
| 146 | - if(module) | |
| 147 | - { | |
| 148 | - g_signal_connect (terminal, "destroy", G_CALLBACK(close_module), module); | |
| 149 | - } | |
| 150 | - else | |
| 151 | - { | |
| 152 | - g_message("Can't open \"%s\": %s",plugin,g_module_error()); | |
| 153 | - gtk_main_quit(); | |
| 154 | - } | |
| 155 | - | |
| 156 | - } | |
| 157 | - // Create trace window | |
| 158 | - { | |
| 159 | - GtkWidget * box = gtk_box_new(GTK_ORIENTATION_VERTICAL,0); | |
| 160 | - GtkWidget * trace = v3270_trace_new(terminal); | |
| 161 | - GtkWidget * toolbar = gtk_toolbar_new(); | |
| 162 | - GtkToolItem * start = gtk_toggle_tool_button_new(); | |
| 163 | - | |
| 164 | - gtk_widget_set_sensitive(GTK_WIDGET(start),module != NULL); | |
| 165 | - | |
| 166 | - g_object_set_data(G_OBJECT(start),"terminal",terminal); | |
| 167 | - | |
| 168 | - gtk_tool_button_set_label(GTK_TOOL_BUTTON(start),"Enable"); | |
| 169 | - g_signal_connect(GTK_WIDGET(start), "toggled", G_CALLBACK(toggle_started_trace), module); | |
| 170 | - gtk_widget_set_tooltip_text(GTK_WIDGET(start),"Start/Stop plugin module"); | |
| 171 | - | |
| 172 | - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), start, -1); | |
| 173 | - | |
| 174 | - gtk_toolbar_insert(GTK_TOOLBAR(toolbar),gtk_separator_tool_item_new(),-1); | |
| 175 | - | |
| 176 | - gtk_toolbar_insert(GTK_TOOLBAR(toolbar),create_tool_item(terminal, "DS Trace","Toggle DS Trace",G_CALLBACK(toggle_ds_trace)),-1); | |
| 177 | - gtk_toolbar_insert(GTK_TOOLBAR(toolbar),create_tool_item(terminal, "Event Trace","Toggle Event Trace",G_CALLBACK(toggle_event_trace)),-1); | |
| 178 | - gtk_toolbar_insert(GTK_TOOLBAR(toolbar),create_tool_item(terminal, "Screen Trace","Toggle Screen Trace",G_CALLBACK(toggle_screen_trace)),-1); | |
| 179 | - gtk_toolbar_insert(GTK_TOOLBAR(toolbar),create_tool_item(terminal, "SSL Trace","Toggle SSL Trace",G_CALLBACK(toggle_ssl_trace)),-1); | |
| 180 | - | |
| 181 | - gtk_box_pack_start(GTK_BOX(box),toolbar,FALSE,FALSE,0); | |
| 182 | - gtk_box_pack_start(GTK_BOX(box),trace,TRUE,TRUE,0); | |
| 183 | - gtk_notebook_append_page(GTK_NOTEBOOK(notebook),box,gtk_label_new("Trace")); | |
| 184 | - } | |
| 185 | - | |
| 186 | - // Setup and show main window | |
| 187 | - gtk_window_set_position(GTK_WINDOW(window),GTK_WIN_POS_CENTER); | |
| 188 | - gtk_window_set_default_size (GTK_WINDOW (window), 800, 500); | |
| 189 | - gtk_container_add(GTK_CONTAINER(window),notebook); | |
| 190 | - gtk_widget_show_all (window); | |
| 191 | - | |
| 192 | - // Setup title. | |
| 193 | - const gchar *url = lib3270_get_url(v3270_get_session(terminal)); | |
| 194 | - if(url) { | |
| 195 | - | |
| 196 | - v3270_set_url(terminal,url); | |
| 197 | - v3270_reconnect(terminal); | |
| 198 | - | |
| 199 | - gchar * title = g_strdup_printf("%s - %s", v3270_get_session_name(terminal), url); | |
| 200 | - gtk_window_set_title(GTK_WINDOW(window), title); | |
| 201 | - g_free(title); | |
| 202 | - | |
| 203 | - } else { | |
| 204 | - | |
| 205 | - gtk_window_set_title(GTK_WINDOW(window), v3270_get_session_name(terminal)); | |
| 206 | - | |
| 207 | - } | |
| 208 | - | |
| 209 | -} | |
| 210 | - | |
| 211 | -int main (int argc, char **argv) { | |
| 212 | - | |
| 213 | - static const GOptionEntry app_options[] = { | |
| 214 | - { "plugin-path", 'P', 0, G_OPTION_ARG_STRING, &plugin_path, "Path for plugin search", NULL }, | |
| 215 | - { "session-name", 'S', 0, G_OPTION_ARG_STRING, &session_name, "Session name", "pw3270" }, | |
| 216 | - { "module", 'm', 0, G_OPTION_ARG_STRING, &plugin_name, "Module name", "ipc3270c." G_MODULE_SUFFIX }, | |
| 217 | - | |
| 218 | - { NULL } | |
| 219 | - }; | |
| 220 | - | |
| 221 | - GtkApplication *app; | |
| 222 | - int status; | |
| 223 | - | |
| 224 | - app = gtk_application_new("br.com.bb.ipc3270c",G_APPLICATION_FLAGS_NONE); | |
| 225 | - | |
| 226 | - g_application_add_main_option_entries(G_APPLICATION(app),app_options); | |
| 227 | - g_signal_connect (app, "activate", G_CALLBACK(activate), NULL); | |
| 228 | - | |
| 229 | - status = g_application_run (G_APPLICATION (app), argc, argv); | |
| 230 | - g_object_unref (app); | |
| 231 | - | |
| 232 | - g_message("rc=%d",status); | |
| 233 | - return status; | |
| 234 | - | |
| 235 | -} | |
| 236 | - |
src/testprograms/linux/test.sh
| ... | ... | @@ -1,126 +0,0 @@ |
| 1 | -#!/bin/bash | |
| 2 | - | |
| 3 | -SESSION=a | |
| 4 | -DEST=br.com.bb.pw3270 | |
| 5 | -BPATH=/br/com/bb/pw3270 | |
| 6 | - | |
| 7 | -run_command() | |
| 8 | -{ | |
| 9 | - | |
| 10 | - case $1 in | |
| 11 | - | |
| 12 | - revision) | |
| 13 | - dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getRevision | |
| 14 | - ;; | |
| 15 | - | |
| 16 | - message) | |
| 17 | - dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getMessageID | |
| 18 | - ;; | |
| 19 | - | |
| 20 | - ssl) | |
| 21 | - dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getSecureState | |
| 22 | - ;; | |
| 23 | - | |
| 24 | - connect) | |
| 25 | - dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.connect string:$2 int32:10 | |
| 26 | - ;; | |
| 27 | - | |
| 28 | - disconnect) | |
| 29 | - dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.disconnect | |
| 30 | - ;; | |
| 31 | - | |
| 32 | - url) | |
| 33 | - dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getURL | |
| 34 | - ;; | |
| 35 | - | |
| 36 | - quit) | |
| 37 | - dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.quit | |
| 38 | - ;; | |
| 39 | - | |
| 40 | - get) | |
| 41 | - dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getScreenContents | |
| 42 | - ;; | |
| 43 | - | |
| 44 | - gettext) | |
| 45 | -# addr,len,lf | |
| 46 | -# dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getText int32:1 int32:-1 byte:0 | |
| 47 | - dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getText int32:1 int32:-1 byte:10 | |
| 48 | - ;; | |
| 49 | - | |
| 50 | - protect) | |
| 51 | - dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getIsProtectedAt int32:$2 int32:$3 | |
| 52 | - ;; | |
| 53 | - | |
| 54 | - set) | |
| 55 | - dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.setTextAt int32:$2 int32:$3 string:$4 | |
| 56 | - ;; | |
| 57 | - | |
| 58 | - action) | |
| 59 | - dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.action string:$2 | |
| 60 | - ;; | |
| 61 | - | |
| 62 | - enter) | |
| 63 | - dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.enter | |
| 64 | - ;; | |
| 65 | - | |
| 66 | - isconnected) | |
| 67 | - dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.isConnected | |
| 68 | - ;; | |
| 69 | - | |
| 70 | - hostcharset) | |
| 71 | - dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getHostCharset | |
| 72 | - ;; | |
| 73 | - | |
| 74 | - displaycharset) | |
| 75 | - dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getDisplayCharset | |
| 76 | - ;; | |
| 77 | - | |
| 78 | - unlockdelay) | |
| 79 | - dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.setUnlockDelay int32:$2 | |
| 80 | - ;; | |
| 81 | - | |
| 82 | - *) | |
| 83 | - echo "Comando $1 desconhecido" | |
| 84 | - ;; | |
| 85 | - | |
| 86 | - esac | |
| 87 | -} | |
| 88 | - | |
| 89 | - | |
| 90 | - | |
| 91 | -until [ -z "$1" ] | |
| 92 | -do | |
| 93 | - if [ ${1:0:2} = '--' ]; then | |
| 94 | - tmp=${1:2} | |
| 95 | - parameter=${tmp%%=*} | |
| 96 | - parameter=$(echo $parameter | tr "[:lower:]" "[:upper:]") | |
| 97 | - value=${tmp##*=} | |
| 98 | - | |
| 99 | - case "$parameter" in | |
| 100 | - SESSION) | |
| 101 | - SESSION=$value | |
| 102 | - ;; | |
| 103 | - HELP) | |
| 104 | - echo "$0 options" | |
| 105 | - echo "" | |
| 106 | - echo "Options:" | |
| 107 | - echo "" | |
| 108 | - echo " --session pw3270's session manager" | |
| 109 | - echo "" | |
| 110 | - exit 0 | |
| 111 | - ;; | |
| 112 | - | |
| 113 | - *) | |
| 114 | - eval $parameter=$value | |
| 115 | - ;; | |
| 116 | - | |
| 117 | - esac | |
| 118 | - | |
| 119 | - else | |
| 120 | - run_command $@ | |
| 121 | - exit 0 | |
| 122 | - fi | |
| 123 | - | |
| 124 | - shift | |
| 125 | -done | |
| 126 | - |
valgrind.suppression
| ... | ... | @@ -0,0 +1,116 @@ |
| 1 | +!include "MUI2.nsh" | |
| 2 | +!include "x64.nsh" | |
| 3 | +!include "FileFunc.nsh" | |
| 4 | + | |
| 5 | +Name "@PACKAGE@" | |
| 6 | +Caption "@PACKAGE@ - @PACKAGE_DESCRIPTION@" | |
| 7 | +outfile "@PACKAGE@-@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@.@PACKAGE_MAJOR_RELEASE@.@PACKAGE_MINOR_RELEASE@-@host_cpu@.exe" | |
| 8 | + | |
| 9 | +XPStyle on | |
| 10 | + | |
| 11 | +installDir "$@PROGRAMFILES@\@PACKAGE@" | |
| 12 | + | |
| 13 | +# Get installation folder from registry if available | |
| 14 | +InstallDirRegKey HKLM "Software\@PACKAGE@" "InstallLocation" | |
| 15 | + | |
| 16 | +RequestExecutionLevel admin | |
| 17 | + | |
| 18 | +# Properties | |
| 19 | +VIProductVersion "@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@.@PACKAGE_MAJOR_RELEASE@.@PACKAGE_MINOR_RELEASE@" | |
| 20 | +VIFileVersion "@WIN32_VERSION@" | |
| 21 | + | |
| 22 | +VIAddVersionKey "ProductVersion" "@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@.@PACKAGE_MAJOR_RELEASE@.@PACKAGE_MINOR_RELEASE@" | |
| 23 | +VIAddVersionKey "FileVersion" "@WIN32_VERSION@" | |
| 24 | + | |
| 25 | +VIAddVersionKey "ProductName" "@PACKAGE_NAME@" | |
| 26 | +VIAddVersionKey "FileDescription" "@PACKAGE_DESCRIPTION@" | |
| 27 | +VIAddVersionKey "LegalCopyright" "GPL-2.0" | |
| 28 | + | |
| 29 | +# Interface | |
| 30 | + | |
| 31 | +!define MUI_ABORTWARNING | |
| 32 | +# !insertmacro MUI_PAGE_WELCOME | |
| 33 | +!insertmacro MUI_PAGE_LICENSE "..\LICENSE" | |
| 34 | +!insertmacro MUI_PAGE_COMPONENTS | |
| 35 | +!insertmacro MUI_PAGE_DIRECTORY | |
| 36 | +!insertmacro MUI_PAGE_INSTFILES | |
| 37 | + | |
| 38 | +# !insertmacro MUI_UNPAGE_WELCOME | |
| 39 | +!insertmacro MUI_UNPAGE_CONFIRM | |
| 40 | +!insertmacro MUI_UNPAGE_INSTFILES | |
| 41 | +# !insertmacro MUI_UNPAGE_FINISH | |
| 42 | + | |
| 43 | +# Languages | |
| 44 | +!insertmacro MUI_LANGUAGE "English" | |
| 45 | + | |
| 46 | +# Section scripts | |
| 47 | +!include Sections.nsh | |
| 48 | + | |
| 49 | +# default section | |
| 50 | +SubSection "@PACKAGE@" SecMain | |
| 51 | + | |
| 52 | + Section "Core" SecCore | |
| 53 | + | |
| 54 | + SetRegView @WINARCH@ | |
| 55 | + ${DisableX64FSRedirection} | |
| 56 | + | |
| 57 | + # define the output path for this file | |
| 58 | + setOutPath $SYSDIR | |
| 59 | + SetShellVarContext all | |
| 60 | + | |
| 61 | + file "/oname=$SYSDIR\hllapi.dll" "..\.bin\Release\hllapi.dll" | |
| 62 | + | |
| 63 | + # For compatibility with old scripts. | |
| 64 | + file "/oname=$SYSDIR\libhllapi.dll" "..\.bin\Release\hllapi.dll" | |
| 65 | + | |
| 66 | + # define uninstaller name | |
| 67 | + SetRegView 32 | |
| 68 | + | |
| 69 | + writeUninstaller $INSTDIR\uninstall.exe | |
| 70 | + | |
| 71 | + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \ | |
| 72 | + "DisplayName" "@PACKAGE@ - @PACKAGE_DESCRIPTION@" | |
| 73 | + | |
| 74 | + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \ | |
| 75 | + "DisplayVersion" "@PACKAGE_VERSION@" | |
| 76 | + | |
| 77 | + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \ | |
| 78 | + "UninstallString" "$INSTDIR\uninstall.exe" | |
| 79 | + | |
| 80 | + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \ | |
| 81 | + "InstallLocation" "$INSTDIR" | |
| 82 | + | |
| 83 | + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \ | |
| 84 | + "NoModify" "1" | |
| 85 | + | |
| 86 | + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \ | |
| 87 | + "NoRepair" "1" | |
| 88 | + | |
| 89 | + # Save instalation dir | |
| 90 | + WriteRegStr HKCU "Software\@PACKAGE@" "" $INSTDIR | |
| 91 | + | |
| 92 | + sectionEnd | |
| 93 | + | |
| 94 | +SubSectionEnd | |
| 95 | + | |
| 96 | +Section "Uninstall" | |
| 97 | + | |
| 98 | + # Always delete uninstaller first | |
| 99 | + delete $INSTDIR\uninstaller.exe | |
| 100 | + | |
| 101 | + # delete installed files | |
| 102 | + delete $SYSDIR\hllapi.dll | |
| 103 | + delete $SYSDIR\libhllapi.dll | |
| 104 | + | |
| 105 | + # Remove registry | |
| 106 | + SetRegView 32 | |
| 107 | + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" | |
| 108 | + DeleteRegKey HKLM "Software\@PACKAGE@" | |
| 109 | + | |
| 110 | + SetRegView @WINARCH@ | |
| 111 | + DeleteRegKey HKLM "Software\@PACKAGE@" | |
| 112 | + | |
| 113 | +SectionEnd | |
| 114 | + | |
| 115 | + | |
| 116 | + | ... | ... |
| ... | ... | @@ -0,0 +1,110 @@ |
| 1 | +#!/bin/bash | |
| 2 | +cd $(dirname $(dirname $(readlink -f $0))) | |
| 3 | + | |
| 4 | +PUBLISH=0 | |
| 5 | + | |
| 6 | +pack() { | |
| 7 | + | |
| 8 | + echo -e "\e]2;hllapi-${1}\a" | |
| 9 | + | |
| 10 | + ./configure --cache=.${1}.cache \ | |
| 11 | + --host=${1}-w64-mingw32 \ | |
| 12 | + --prefix=/usr/${1}-w64-mingw32/sys-root/mingw \ | |
| 13 | + --libdir=/usr/${1}-w64-mingw32/sys-root/mingw/lib | |
| 14 | + | |
| 15 | + if [ "$?" != "0" ]; then | |
| 16 | + exit -1 | |
| 17 | + fi | |
| 18 | + | |
| 19 | + make clean | |
| 20 | + if [ "$?" != "0" ]; then | |
| 21 | + exit -1 | |
| 22 | + fi | |
| 23 | + | |
| 24 | + make Release | |
| 25 | + if [ "$?" != "0" ]; then | |
| 26 | + exit -1 | |
| 27 | + fi | |
| 28 | + | |
| 29 | + makensis win/hllapi.nsi | |
| 30 | + | |
| 31 | + if [ -d ~/public_html ]; then | |
| 32 | + mkdir -p ~/public_html/win | |
| 33 | + cp -v ./win/*.exe ~/public_html/win | |
| 34 | + if [ "$?" != "0" ]; then | |
| 35 | + exit -1 | |
| 36 | + fi | |
| 37 | + fi | |
| 38 | + | |
| 39 | + if [ "${PUBLISH}" == "1" ] && [ ! -z ${WIN_PACKAGE_SERVER} ]; then | |
| 40 | + scp ./win/*.exe ${WIN_PACKAGE_SERVER} | |
| 41 | + if [ "$?" != "0" ]; then | |
| 42 | + exit -1 | |
| 43 | + fi | |
| 44 | + fi | |
| 45 | + | |
| 46 | + rm -fr $TEMPDIR | |
| 47 | + rm -fr .${1}.cache | |
| 48 | + | |
| 49 | +} | |
| 50 | + | |
| 51 | +until [ -z "$1" ] | |
| 52 | +do | |
| 53 | + if [ ${1:0:2} = '--' ]; then | |
| 54 | + tmp=${1:2} | |
| 55 | + parameter=${tmp%%=*} | |
| 56 | + parameter=$(echo $parameter | tr "[:lower:]" "[:upper:]") | |
| 57 | + value=${tmp##*=} | |
| 58 | + | |
| 59 | + case "$parameter" in | |
| 60 | + NOPUBLISH) | |
| 61 | + PUBLISH=0 | |
| 62 | + ;; | |
| 63 | + | |
| 64 | + PUBLISH) | |
| 65 | + PUBLISH=1 | |
| 66 | + ;; | |
| 67 | + | |
| 68 | + CLEAR) | |
| 69 | + if [ -d ~/public_html/win ]; then | |
| 70 | + rm -fr ~/public_html/win/hllapi-*-{i686,x86_64}.exe | |
| 71 | + fi | |
| 72 | + | |
| 73 | + ;; | |
| 74 | + HELP) | |
| 75 | + echo "${0} nome_da_matriz" | |
| 76 | + echo "" | |
| 77 | + echo "Opções:" | |
| 78 | + echo "" | |
| 79 | + | |
| 80 | + if [ ! -z ${WIN_PACKAGE_SERVER} ]; then | |
| 81 | + echo " --nopublish Don't publish in ${WIN_PACKAGE_SERVER}" | |
| 82 | + echo " --publish Publish in ${WIN_PACKAGE_SERVER}" | |
| 83 | + fi | |
| 84 | + | |
| 85 | + | |
| 86 | + if [ -d ~/public_html/win ]; then | |
| 87 | + echo " --clear Remove ~/public_html/win/hllapi-*-{i686,x86_64}.exe" | |
| 88 | + fi | |
| 89 | + | |
| 90 | + echo "" | |
| 91 | + exit 0 | |
| 92 | + | |
| 93 | + ;; | |
| 94 | + | |
| 95 | + esac | |
| 96 | + fi | |
| 97 | + | |
| 98 | + shift | |
| 99 | + | |
| 100 | +done | |
| 101 | + | |
| 102 | +NOCONFIGURE=1 ./autogen.sh | |
| 103 | +if [ "$?" != "0" ]; then | |
| 104 | + exit -1 | |
| 105 | +fi | |
| 106 | + | |
| 107 | +pack i686 | |
| 108 | +pack x86_64 | |
| 109 | + | |
| 110 | + | ... | ... |