[PHP-CVS] cvs: php-src / README.EXT_SKEL /ext ext_skel ext_skel_win32.php /ext/skeleton CREDITS EXPERIMENTAL create_stubs php_skeleton.h skeleton.c skeleton.dsp skeleton.php /ext/skeleton/tests .cvsignore 001.phpt

2003-06-29 Thread Hartmut Holzgraefe
hholzgraSun Jun 29 12:07:18 2003 EDT

  Modified files:  
/php-srcREADME.EXT_SKEL 
/php-src/extext_skel ext_skel_win32.php 
/php-src/ext/skeleton   CREDITS EXPERIMENTAL create_stubs 
php_skeleton.h skeleton.c skeleton.dsp 
skeleton.php 
/php-src/ext/skeleton/tests .cvsignore 001.phpt 
  Log:
  ok, re-adding this mostly un-maintained awk/sed/sh nightmare for now ...
  
  Index: php-src/README.EXT_SKEL
diff -u php-src/README.EXT_SKEL:1.12 php-src/README.EXT_SKEL:1.13
--- php-src/README.EXT_SKEL:1.12Sun Jun 29 08:21:58 2003
+++ php-src/README.EXT_SKEL Sun Jun 29 12:07:17 2003
@@ -1,2 +1,194 @@
-NOTE: ext_skel does no longer exist, it has been replaced 
-  by the PEAR package PECL_Gen
+(NOTE: you may also want to take a look at the pear package
+PECL_Gen, a PHP-only alternative for this script that
+supports way more extension writing tasks and is 
+supposed to replace ext_skel completely in the long run ...)
+
+WHAT IT IS
+
+  It's a tool for automatically creating the basic framework for a PHP module
+  and writing C code handling arguments passed to your functions from a simple
+  configuration file. See an example at the end of this file.
+
+HOW TO USE IT
+
+  Very simple. First, change to the ext/ directory of the PHP 4 sources. If
+  you just need the basic framework and will be writing all the code in your
+  functions yourself, you can now do
+
+   ./ext_skel --extname=module_name
+
+  and everything you need is placed in directory module_name. 
+
+  [ Note that GNU awk is likely required for this script to work.  Debian 
+systems seem to default to using mawk, so you may need to change the 
+#! line in skeleton/create_stubs and the cat $proto | awk line in
+ext_skel to use gawk explicitly. ]
+
+  If you don't need to test the existence of any external header files, 
+  libraries or functions in them, the module is already almost ready to be 
+  compiled in PHP.  Just remove 3 comments in your_module_name/config.m4, 
+  change back up to PHP sources top directory, and do
+
+./buildconf; ./configure --enable-module_name; make
+
+  But if you already have planned the overall scheme of your module, what
+  functions it will contain, their return types and the arguments they take
+  (a very good idea) and don't want to bother yourself with creating function
+  definitions and handling arguments passed yourself, it's time to create a
+  function definitions file, which you will give as an argument to ext_skel
+  with option
+
+--proto=filename.
+
+FORMAT OF FUNCTION DEFINITIONS FILE
+
+  All the definitions must be on one line. In it's simplest form, it's just
+  the function name, e.g.
+
+my_function
+
+  but then you'll be left with an almost empty function body without any
+  argument handling.
+
+  Arguments are given in parenthesis after the function name, and are of
+  the form 'argument_type argument_name'. Arguments are separated from each
+  other with a comma and optional space. Argument_type can be one of int,
+  bool, double, float, string, array, object or mixed.
+
+  An optional argument is separated from the previous by an optional space,
+  then '[' and of course comma and optional space, like all the other
+  arguments. You should close a row of optional arguments with same amount of
+  ']'s as there where '['s. Currently, it does not harm if you forget to do it
+  or there is a wrong amount of ']'s, but this may change in the future.
+
+   An additional short description may be added after the parameters. 
+  If present it will be filled into the 'proto' header comments in the stubs
+  code and the refpurpose tag in the XML documentation.
+
+  An example:
+
+my_function(int arg1, int arg2 [, int arg3 [, int arg4]]) this is my 1st
+
+  Arguments arg3 and arg4 are optional.
+
+  If possible, the function definition should also contain it's return type
+  in front of the definition. It's not actually used for any C code generating
+  purposes but PHP in-source documentation instead, and as such, very useful.
+  It can be any of int, double, string, bool, array, object, resource, mixed
+  or void.
+
+  The file must contain nothing else but function definitions, no comments or
+  empty lines.
+
+OTHER OPTIONS
+
+--no-help
+
+  By default, ext_skel creates both comments in the source code and a test
+  function to help first time module writers to get started and testing
+  configuring and compiling their module. This option turns off all such things
+  which may just annoy experienced PHP module coders. Especially useful with
+
+--stubs=file
+
+  which will leave out also all module specific stuff and write just function
+  stubs with function value declarations and passed argument handling, and
+  function entries and definitions at the end of the file, 

Re: [PHP-CVS] cvs: php-src / README.EXT_SKEL /ext ext_skel ext_skel_win32.php /ext/skeleton CREDITS EXPERIMENTAL create_stubs php_skeleton.h skeleton.c skeleton.dsp skeleton.php /ext/skeleton/tests .cvsignore 001.phpt

2003-06-29 Thread Andi Gutmans
Didn't see this when I wrote my previous email :)

At 04:07 PM 29/6/2003 +, Hartmut Holzgraefe wrote:
hholzgraSun Jun 29 12:07:18 2003 EDT

  Modified files:
/php-srcREADME.EXT_SKEL
/php-src/extext_skel ext_skel_win32.php
/php-src/ext/skeleton   CREDITS EXPERIMENTAL create_stubs
php_skeleton.h skeleton.c skeleton.dsp
skeleton.php
/php-src/ext/skeleton/tests .cvsignore 001.phpt
  Log:
  ok, re-adding this mostly un-maintained awk/sed/sh nightmare for now ...
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php