Jump to content

wreckman

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Everything posted by wreckman

  1. The problem is found......... forgot to emalloc a reception variable for toto StcRepTest.text = (char *) emalloc(strlen("toto")+1); GOOD LUCK, EXT'CODERS
  2. I can't call a C function (internal) in an exported PHP function ! (like ftp extension for exemple) I don't understand why, if anyone can help, please..... Here are the sources files of my module : php_test.c // Zend module definition files php_php_test.h testc.c // Non exported C functions testc.h Here is a sample of php_test.c : // Return a string, Takes a string PHP_FUNCTION(test) { char *szNomRepToGet; int argc = ZEND_NUM_ARGS(); int szNomRepToGet_len; if(zend_parse_parameters(argc TSRMLS_CC, "s", &szNomRepToGet, szNomRepToGet_len) == FAILURE) { return; } char *value; value = testcc(szNomRepToGet); RETURN_STRING(value,1); } Here is a sample of testc.c static char* testcc(char* toto); // defintion char* testcc(char* toto) { stcRep StcRepTest; /* INITIALISATION DE MA STRUCTURE */ StcRepTest.num = 1; strcpy(StcRepTest.text, "toto"); /* TEST CONTENU STRUCTURE */ if(StcRepTest.num == 1) { // zend_printf("Bien vu, ta struct est déclarée"); char* testok = "ok"; return testok; } char* testnok = "nok"; return testnok; } Here is a sample of testc.h typedef struct { int num; char* text; }stcRep; static char* testcc(char* toto); Thanks in advance, Rom1 ...Reading : Building Custom PHP Extensions => Very Good Book !
  3. Does anyone have a makefile that doesn't make the whole php compilation each time its used ? It takes me so long too make... I think I'm wasting my time, doing stupid steps for nothing So if you have a good makefile.... please share it Thanks a lot Romain
  4. Sorry, I was a bit stressed by that first big project I have to do both for work & school, (I'm a french alternating student). But, thanks a lot, I'll try to take care about your advice.
  5. Hi ! I have to write an external module for PHP.... I wanted to do it under windows first, and then port it under linux... I've found a shell script called ext_skel_win32.php, and I can't make it work... 1) If somebody knows an other way to it, please let me know... I also tried to built it under linux (Mandrake 9.1) But I'm not sure to have a "full" working environement (I have PHP-4.3.4 sources, Bison & Flex) 2) What tools are needed ? 3) How to build an empty project ? (I think it's a good start ?!) I can't even generate an empty module, here is what I did : php/ext> ./ext_skel monmodule // Creates empty files PHP_ARG_ENABLE(monmodule, for module support, [--with-my-module ... PHP_NEW_EXTENTION(monmodule, monmodule.c, $ext_shared) // Uncommented these lines of the .m4 file ./buildconf --force // re-generates the .m4 file 4 configure Then make fails..... (the only function inside should be the module's compilation function check) (4) DID I DO SOMETHING WRONG ? PLEASE GIVE ME AN ANSWER ! THANKS!!! PS : I'm not very familiar with Zend & PHP : so don't blame me ! PS2 : Send any comments if you want to romain.fabbri@caramail.com
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.