Commit bbb897bd56e383ad74ae41283a50f85bf5754a80
1 parent
d4615f19
Exists in
master
and in
5 other branches
Finalizando extensão php
Showing
6 changed files
with
43 additions
and
3 deletions
Show diff stats
src/classlib/session.cc
| ... | ... | @@ -356,6 +356,10 @@ |
| 356 | 356 | |
| 357 | 357 | free(outBuffer); |
| 358 | 358 | } |
| 359 | + else | |
| 360 | + { | |
| 361 | + rc = str; | |
| 362 | + } | |
| 359 | 363 | #else |
| 360 | 364 | rc = str; |
| 361 | 365 | #endif // HAVE_ICONV |
| ... | ... | @@ -366,6 +370,9 @@ |
| 366 | 370 | string session::get_string_at(int row, int col, size_t sz) |
| 367 | 371 | { |
| 368 | 372 | string str = this->get_text_at(row,col,sz); |
| 373 | + | |
| 374 | + trace("String não convertida: [%s]",str.c_str()); | |
| 375 | + | |
| 369 | 376 | return this->get_local_text(str.c_str()); |
| 370 | 377 | } |
| 371 | 378 | ... | ... |
src/php/Makefile.in
| ... | ... | @@ -35,6 +35,7 @@ bindir=@bindir@ |
| 35 | 35 | sbindir=@sbindir@ |
| 36 | 36 | libdir=@libdir@ |
| 37 | 37 | includedir=@includedir@ |
| 38 | +sysconfdir=@sysconfdir@ | |
| 38 | 39 | |
| 39 | 40 | #---[ Tools ]------------------------------------------------------------------ |
| 40 | 41 | |
| ... | ... | @@ -72,11 +73,26 @@ CXXFLAGS=@CXXFLAGS@ @DLL_CFLAGS@ `$(PHPCONFIG) --includes` -I../include |
| 72 | 73 | $(OBJDBG)/%.o: %.cc php3270.h Makefile |
| 73 | 74 | @echo " CC `basename $@`" |
| 74 | 75 | @mkdir -p `dirname $@` |
| 75 | - $(CXX) -DDEBUG=1 $(CXXFLAGS) -o $@ -c $< | |
| 76 | + @$(CXX) -DDEBUG=1 $(CXXFLAGS) -o $@ -c $< | |
| 76 | 77 | |
| 78 | +$(OBJRLS)/%.o: %.cc php3270.h Makefile | |
| 79 | + @echo " CC `basename $@`" | |
| 80 | + @mkdir -p `dirname $@` | |
| 81 | + @$(CXX) -DNDEBUG=1 $(CXXFLAGS) -o $@ -c $< | |
| 77 | 82 | |
| 78 | 83 | #---[ Release targets ]-------------------------------------------------------- |
| 79 | 84 | |
| 85 | +all: $(BINRLS)/php3270@DLLEXT@ | |
| 86 | + | |
| 87 | +Release: $(BINRLS)/php3270@DLLEXT@ | |
| 88 | + | |
| 89 | +$(BINRLS)/php3270@DLLEXT@: $(foreach SRC, $(basename $(SOURCES)), $(OBJRLS)/$(SRC)@OBJEXT@) \ | |
| 90 | + $(CLASS_RELEASE_OBJECTS) | |
| 91 | + @echo " LD `basename $@`" | |
| 92 | + @$(MKDIR) `dirname $@` | |
| 93 | + @$(CXX) -shared $(LDFLAGS) $(OO_LDFLAGS) $(CLASS_LIBS) -o $@ $^ | |
| 94 | + | |
| 95 | + | |
| 80 | 96 | #---[ Debug targets ]---------------------------------------------------------- |
| 81 | 97 | |
| 82 | 98 | Debug: $(BINDBG)/php3270@DLLEXT@ |
| ... | ... | @@ -93,6 +109,15 @@ run: $(BINDBG)/php3270@DLLEXT@ |
| 93 | 109 | |
| 94 | 110 | #---[ Misc targets ]----------------------------------------------------------- |
| 95 | 111 | |
| 112 | +install: $(BINDBG)/php3270@DLLEXT@ | |
| 113 | + @$(MKDIR) $(DESTDIR)/`$(PHPCONFIG) --extension-dir` | |
| 114 | + @$(INSTALL_PROGRAM) $(BINDBG)/php3270@DLLEXT@ $(DESTDIR)/`$(PHPCONFIG) --extension-dir`/tn3270@DLLEXT@ | |
| 115 | + | |
| 116 | + @$(MKDIR) $(DESTDIR)/$(sysconfdir)/php`$(PHPCONFIG) --version | cut -d. -f1`/conf.d | |
| 117 | + @$(INSTALL_DATA) php.ini $(DESTDIR)/$(sysconfdir)/php`$(PHPCONFIG) --version | cut -d. -f1`/conf.d/tn3270.ini | |
| 118 | + | |
| 119 | +cleanDebug: clean | |
| 120 | + | |
| 96 | 121 | clean: |
| 97 | 122 | @rm -fr $(OBJDIR) |
| 98 | 123 | @rm -fr $(BINDIR) | ... | ... |
src/php/get.cc
| ... | ... | @@ -57,7 +57,10 @@ PHP_METHOD(tn3270, getstringat) |
| 57 | 57 | if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &row, &col, &sz) == FAILURE) |
| 58 | 58 | RETURN_NULL(); |
| 59 | 59 | |
| 60 | - RETURN_STRING(obj->hSession->get_string_at(row,col,sz).c_str(),1); | |
| 60 | + string str = obj->hSession->get_string_at(row,col,sz); | |
| 61 | + | |
| 62 | + trace("String = [%s]",str.c_str()); | |
| 63 | + RETURN_STRING(str.c_str(),1); | |
| 61 | 64 | } |
| 62 | 65 | |
| 63 | 66 | PHP_METHOD(tn3270, cmpstringat) | ... | ... |
src/php/php3270.cbp
src/php/sample.php
| ... | ... | @@ -10,6 +10,9 @@ |
| 10 | 10 | $rc = $host->waitforready(10); |
| 11 | 11 | print("waitforready() exits with rc=" . $rc . "\n"); |
| 12 | 12 | |
| 13 | + $str = $host->getstringat(3,2,14); | |
| 14 | + print("Getstring(3,2,14) saiu com \"" . $str . "\"\n"); | |
| 15 | + | |
| 13 | 16 | $rc = $host->disconnect(); |
| 14 | 17 | print("disconnect() exits with rc=" . $rc . "\n"); |
| 15 | 18 | ... | ... |