1
0
mirror of https://github.com/php/php-src.git synced 2026-03-30 20:22:36 +02:00

- Moved ext/w32api to PECL.

This commit is contained in:
foobar
2005-02-02 14:43:26 +00:00
parent c919fac568
commit 75b4e2c832
12 changed files with 0 additions and 3229 deletions

View File

@@ -1,2 +0,0 @@
W32API
James Moore

View File

@@ -1,5 +0,0 @@
Win 32 API Extension
====================
/* $Revision$ */
See notes in w32api.c

View File

@@ -1,3 +0,0 @@
TODO
====
.... LOTS ....

View File

@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE package SYSTEM "../pear/package.dtd">
<package>
<name>w32api</name>
<summary>Win32 and DLL API interface functions</summary>
<maintainers>
<maintainer>
<user>jmoore</user>
<name>James Moore</name>
<email>jmoore@php.net</email>
<role>lead</role>
</maintainer>
</maintainers>
<description>
This extension is a generic extension API to DLLs.
This was originally written to allow access to the Win32 API from PHP,
although you can also access other functions exported via other DLLs.
</description>
<license>PHP</license>
<release>
<state>beta</state>
<version>5.0.0rc1</version>
<date>2004-03-19</date>
<notes>
package.xml added to support intallation using pear installer
</notes>
<filelist>
<file role="doc" name="CREDITS"/>
<file role="doc" name="README"/>
<file role="doc" name="TODO"/>
<file role="src" name="w32api.dsp"/>
<file role="src" name="w32api.c"/>
<file role="src" name="w32api_function_definition_parser.y"/>
<file role="src" name="w32api_function_definition_scanner.l"/>
<file role="src" name="w32api_type_definition_parser.y"/>
<file role="src" name="w32api_type_definition_scanner.l"/>
<file role="src" name="php_w32api.h"/>
</filelist>
<deps>
<dep type="php" rel="ge" version="5" />
<!-- doesn't work yet <dep type="os" rel="has" name="windows"/> -->
</deps>
</release>
</package>
<!--
vim:et:ts=1:sw=1
-->

View File

@@ -1,345 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: James Moore <jmoore@php.net> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#if HAVE_W32API
#ifndef PHP_W32API_H
#define PHP_W32API_H
/* ================================================================================================
* Type Definitions
* ================================================================================================
*/
typedef struct _w32api_lib_handle w32api_lib_handle;
typedef struct _w32api_func_handle w32api_func_handle;
typedef struct _w32api_type_handle w32api_type_handle;
typedef struct _w32api_type_instance w32api_type_instance;
typedef struct _arguments arguments;
typedef struct _argument argument;
typedef union _w32api_parser_function_definition_union w32api_parser_function_definition_union;
typedef struct _w32api_func_handle_ptr w32api_func_handle_ptr;
typedef struct _w32api_type_handle_ptr w32api_type_handle_ptr;
typedef union _w32api_parser_type_definition_union w32api_parser_type_definition_union;
typedef struct _member member;
typedef struct _members members;
typedef union _w32api_result w32api_result;
typedef struct _w32api_dynamic_param w32api_dynamic_param;
struct _w32api_lib_handle
{
HINSTANCE handle; /* Handle for our library */
char *library_name; /* name of our library */
int ref_count; /* reference counter */
};
struct _w32api_func_handle_ptr /* Temporary structure */
{ /* To work around problems */
w32api_func_handle *hnd; /* at 3am.. Ill sort it out */
}; /* When I can think straight */
struct _w32api_type_handle_ptr /* Ditto.. should really combine */
{ /* These two into a union at least */
w32api_type_handle *hnd;
};
struct _w32api_type_handle
{
char *type_name; /* Name of our type */
long size; /* Size of type */
members *member_list; /* Pointer List of members */
long member_count; /* Number of members */
};
struct _w32api_type_instance
{
w32api_type_handle *type; /* pointer to w32api_type_handle */
zval **values; /* First element of an array of ptr's to zvals */
};
struct _w32api_func_handle
{
FARPROC handle; /* Handle for our function */
w32api_lib_handle *lib; /* Pointer to the library handle */
char *function_name; /* Name of our function (Alias is store if supplied) */
long return_type_id; /* ID of return type */
char *return_type_name; /* Name of return type (if W32API_COMPLEX) */
long flags; /* Flags for function */
arguments *argument_list; /* Pointer List of arguments */
};
struct _arguments
{
argument *arg; /* Current Argument */
arguments *next_arg; /* Next Arugment */
arguments *prev_arg; /* Previous Argument */
};
struct _argument
{
long type_id; /* ID of the return type */
char *type_name; /* Name of type (if W32API_COMPLEX) */
char *argument_name; /* Name of argument, currently not used */
long flags; /* Currently used for byref/byval */
};
struct _member
{
char *member_name;
long member_type_id;
char *member_type_name;
long flags;
long offset;
};
struct _members
{
member *member;
members *next_member;
members *prev_member;
};
union _w32api_result
{
int ival;
unsigned long lval;
DWORD dwval;
void *ptr;
float fval;
double dval;
__int64 i64val;
};
struct _w32api_dynamic_param
{
long flags;
int width;
union {
unsigned long argument;
void *argument_ptr;
};
};
union _w32api_parser_function_definition_union
{
char *s;
arguments *arg;
};
union _w32api_parser_type_definition_union
{
char *s;
members *type;
};
/* ================================================================================================
* Constants
* ================================================================================================
*/
/* Recognised Base types */
#define W32API_UNKNOWN -1
#define W32API_NULL 1
#define W32API_INT 2
#define W32API_LONG 3
#define W32API_DOUBLE 4
#define W32API_FLOAT 5
#define W32API_STRING 6
#define W32API_BYTE 7
#define W32API_BOOL 8
#define W32API_COMPLEX 9
/* Function Flags */
#define W32API_ARGPTR (1<<0)
#define W32API_BORLAND (1<<1)
#define W32API_CDECL (1<<2)
#define W32API_REAL4 (1<<3)
#define W32API_REAL8 (1<<4)
/* ================================================================================================
* Utility Macros
* ================================================================================================
*/
#define PROP_SET_ARGS zend_property_reference *property_reference, pval *value
#define PROP_GET_ARGS zend_property_reference *property_reference
#define W32API_PROP_SET_FUNCTION_N(class_name) w32api_set_property_handler_##class_name
#define W32API_PROP_GET_FUNCTION_N(class_name) w32api_get_property_handler_##class_name
#define W32API_CALL_FUNCTION_N(class_name) w32api_call_handler_##class_name
#define W32API_PROP_SET_FUNCTION(class_name) PHP_W32API_API int W32API_PROP_SET_FUNCTION_N(class_name)(PROP_SET_ARGS)
#define W32API_PROP_GET_FUNCTION(class_name) PHP_W32API_API zval W32API_PROP_GET_FUNCTION_N(class_name)(PROP_GET_ARGS)
#define W32API_CALL_FUNCITON(class_name) PHP_W32API_API void W32API_CALL_FUNCTION_N(class_name)(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference)
#define W32API_CLASS_FUNCTION(class_name, function_name) PHP_FUNCTION(##class_name##function_name)
#define W32API_CLASS_FN(class_name, function_name) PHP_FN(##class_name##function_name)
#define W32API_CLASS_FE(class_name, function_name, function_args) {#function_name, W32API_CLASS_FN(class_name, function_name), function_args},
/* ================================================================================================
* Module exports, Global Variables and General Definitions
* ================================================================================================
*/
extern zend_module_entry w32api_module_entry;
#define phpext_w32api_ptr &w32api_module_entry;
#define PHP_W32API_API __declspec(dllexport)
#ifdef ZTS
#include "TSRM.h"
#endif /* ZTS */
ZEND_BEGIN_MODULE_GLOBALS(w32api)
zend_class_entry *win32_ce; /* The class entry for our win32 class */
zend_class_entry *type_ce; /* The class entry for our type class */
HashTable *funcs; /* Functions we registered */
HashTable *libraries; /* Libraries we load using LoadLibrary */
HashTable *types; /* Types we have registed with us */
HashTable *callbacks; /* Callbacks we have registered with us */
long le_type_instance; /* Resource hanlde for runtime instances */
ZEND_END_MODULE_GLOBALS(w32api)
ZEND_DECLARE_MODULE_GLOBALS(w32api)
#ifdef ZTS
#define WG(v) TSRMG(w32api_globals_id, zend_w32api_globals *, v)
#else
#define WG(v) (w32api_globals.v)
#endif
/* ================================================================================================
* Startup, Shutdown and Info Functions
* ================================================================================================
*/
PHP_MINIT_FUNCTION(w32api);
PHP_MSHUTDOWN_FUNCTION(w32api);
PHP_RINIT_FUNCTION(w32api);
PHP_RSHUTDOWN_FUNCTION(w32api);
PHP_MINFO_FUNCTION(w32api);
static void php_w32api_init_globals(zend_w32api_globals *w32api_globals);
static void php_w32api_hash_lib_dtor(void *data);
static void php_w32api_hash_func_dtor(void *data);
static void php_w32api_hash_callback_dtor(void *data);
static void php_w32api_hash_type_dtor(void *data);
static void w32api_type_instance_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC);
/* ================================================================================================
* Win32 Class Functions
* ================================================================================================
*/
int win32_class_init(TSRMLS_D);
int win32_class_rshutdown(TSRMLS_D);
W32API_CLASS_FUNCTION(win32, registerfunction);
W32API_CLASS_FUNCTION(win32, unregisterfunction);
W32API_CLASS_FUNCTION(win32, registercallback);
W32API_CLASS_FUNCTION(win32, definetype);
W32API_CLASS_FUNCTION(win32, gettypesize);
W32API_CLASS_FUNCTION(win32, inittype);
W32API_CLASS_FUNCTION(win32, decref);
W32API_CLASS_FUNCTION(win32, invokefunction);
/* ================================================================================================
* Type Class Functions
* ================================================================================================
*/
int type_class_init(TSRMLS_DC);
W32API_CLASS_FUNCTION(type, clone);
W32API_PROP_SET_FUNCTION(type);
W32API_PROP_GET_FUNCTION(type);
/* ================================================================================================
* Utility Functions
* ================================================================================================
*/
static int php_w32api_load_function (char *definition, int definition_len, int flags TSRMLS_DC);
static void php_w32api_unload_function (w32api_func_handle **fh TSRMLS_DC);
static int php_w32api_load_library (char *library_name, w32api_lib_handle **lh TSRMLS_DC);
static void php_w32api_unload_library (w32api_lib_handle *lh, int flags TSRMLS_DC);
static int php_w32api_register_callback(char *function_definition, int function_definition_len TSRMLS_DC);
static void php_w32api_free_arguments(arguments *argument_list);
static void php_w32api_free_members(members *member_list);
static int php_w32api_get_type_id_from_name(char *type);
static unsigned char *php_w32api_do_arg_types(arguments **arguments);
void php_w32api_marshall_zval_to_c(argument *arg, w32api_dynamic_param *dp, zval *pzval TSRMLS_DC);
static void php_w32api_init_type(w32api_type_handle *th, zval *obj TSRMLS_DC);
static int php_w32api_do_prop_get(zval *object, zval *return_value, zend_llist_element **element TSRMLS_DC);
static int php_w32api_do_prop_set(zval *object, zval *value, zend_llist_element **element TSRMLS_DC);
static void *php_w32api_complex_marshall_zval_to_c(zval *pzval, int *width, void *data TSRMLS_DC);
/* ================================================================================================
* Parser & Scanner Functions
* ================================================================================================
*/
#define w32api_parser_load_alias_function w32api_parser_load_function_ex
#define w32api_parser_load_function(return_type, function_name, arguments, library_name) w32api_parser_load_function_ex (return_type, function_name, NULL, arguments, library_name)
#define w32api_parser_make_argument_byref(arg_type, arg_name) w32api_parser_make_argument(arg_type, arg_name, BYREF_FORCE)
#define w32api_parser_make_argument_byval(arg_type, arg_name) w32api_parser_make_argument(arg_type, arg_name, BYREF_NONE)
#define w32api_parser_type_make_byref_value(member_name, member_type) w32api_parser_type_make_value(member_name, member_type, BYREF_FORCE)
#define w32api_parser_type_make_byval_value(member_name, member_type) w32api_parser_type_make_value(member_name, member_type, BYREF_NONE)
w32api_func_handle *w32api_parser_load_function_ex(char *return_type, char *function_name, char *alias_name, arguments *argument_list, char *library_name);
arguments *w32api_parser_make_argument(char *arg_type, char *arg_name, int byref);
arguments *w32api_parser_join_arguments(arguments *lval, arguments *rval);
int w32api_function_definition_error(char *s);
w32api_type_handle *w32api_parser_register_type(char *type_name, members *member_list);
members *w32api_parser_type_make_value(char *member_name, char *type_name, long flags);
members *w32api_parser_type_join_values(members *lval, members *rval);
int w32api_type_definition_error(char *s);
struct yy_buffer_state *w32api_function_definition_scan_bytes(char *bytes, int len); /* Definied in w32api_function_definition_scanner.c */
int w32api_function_definition_parse(void *fh); /* Definied in w32api_function_definition_parser.c */
struct yy_buffer_state *w32api_type_definition_scan_bytes(char *bytes, int len); /* Definied in w32api_type_definition_scanner.c */
int w32api_type_definition_parse(void *th); /* Definied in w32api_type_definition_parser.c */
/* ================================================================================================
* Various Debugging Functions
* ================================================================================================
*/
#ifndef NDEBUG
W32API_CLASS_FUNCTION(win32, dump_library_hash);
W32API_CLASS_FUNCTION(win32, dump_function_hash);
W32API_CLASS_FUNCTION(win32, dump_callback_hash);
W32API_CLASS_FUNCTION(win32, dump_type_hash);
int php_w32api_dump_library_hash_cb(void *pData TSRMLS_DC);
int php_w32api_dump_function_hash_cb(void *pData TSRMLS_DC);
int php_w32api_dump_callback_hash_cb(void *pData TSRMLS_DC);
int php_w32api_dump_type_hash_cb(void *pData TSRMLS_DC);
void php_w32api_print_arguments(arguments *argument_list);
void php_w32api_print_members(members *member_list);
#endif /* ifndef NDEBUG */
#endif /* ifndef PHP_W32API_H */
#endif /* if HAVE_W32API */

File diff suppressed because it is too large Load Diff

View File

@@ -1,281 +0,0 @@
# Microsoft Developer Studio Project File - Name="w32api" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=w32api - Win32 Debug_TS
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "w32api.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "w32api.mak" CFG="w32api - Win32 Debug_TS"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "w32api - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "w32api - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "w32api - Win32 Debug_TS"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "w32api___Win32_Debug_TS"
# PROP BASE Intermediate_Dir "w32api___Win32_Debug_TS"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../../Debug_TS"
# PROP Intermediate_Dir "Debug_TS"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "W32API_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "W32API_EXPORTS" /D HAVE_W32API=1 /D "COMPILE_DL_W32API" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x809 /d "_DEBUG"
# ADD RSC /l 0x809 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"../../Debug_TS/php_w32api.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
!ELSEIF "$(CFG)" == "w32api - Win32 Release_TS"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "w32api___Win32_Release_TS"
# PROP BASE Intermediate_Dir "w32api___Win32_Release_TS"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../Release_TS"
# PROP Intermediate_Dir "Release_TS"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "W32API_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "W32API_EXPORTS" /D "HAVE_W32API" /D "COMPILE_DL_W32API" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=0 /YX /FD /c
# SUBTRACT CPP /WX /Fr
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x809 /d "NDEBUG"
# ADD RSC /l 0x809 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /debugtype:both /machine:I386 /out:"../../Release_TS/php_w32api.dll" /libpath:"..\..\Release_TS"
# SUBTRACT LINK32 /incremental:yes
!ENDIF
# Begin Target
# Name "w32api - Win32 Debug_TS"
# Name "w32api - Win32 Release_TS"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\w32api.c
# End Source File
# Begin Source File
SOURCE=.\w32api_function_definition_parser.c
# End Source File
# Begin Source File
SOURCE=.\w32api_function_definition_scanner.c
# End Source File
# Begin Source File
SOURCE=.\w32api_type_definition_parser.c
# End Source File
# Begin Source File
SOURCE=.\w32api_type_definition_scanner.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\php_w32api.h
# End Source File
# Begin Source File
SOURCE=.\w32api_function_definition_parser.h
# End Source File
# Begin Source File
SOURCE=.\w32api_type_definition_parser.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# Begin Group "Parsers"
# PROP Default_Filter ".y"
# Begin Source File
SOURCE=.\w32api_function_definition_parser.y
!IF "$(CFG)" == "w32api - Win32 Debug_TS"
# Begin Custom Build
InputDir=.
InputPath=.\w32api_function_definition_parser.y
BuildCmds= \
bison --output=w32api_function_definition_parser.c -v -d -p w32api_function_definition_ w32api_function_definition_parser.y
"$(InputDir)/w32api_function_definition_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)/w32api_function_definition_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "w32api - Win32 Release_TS"
# Begin Custom Build
InputDir=.
InputPath=.\w32api_function_definition_parser.y
BuildCmds= \
bison --output=w32api_function_definition_parser.c -v -d -p w32api_function_definition_ w32api_function_definition_parser.y
"$(InputDir)/w32api_function_definition_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)/w32api_function_definition_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\w32api_type_definition_parser.y
!IF "$(CFG)" == "w32api - Win32 Debug_TS"
# Begin Custom Build
InputDir=.
InputPath=.\w32api_type_definition_parser.y
BuildCmds= \
bison --output=w32api_type_definition_parser.c -v -d -p w32api_type_definition_ w32api_type_definition_parser.y
"$(InputDir)/w32api_type_definition_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)/w32api_type_definition_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "w32api - Win32 Release_TS"
# Begin Custom Build
InputDir=.
InputPath=.\w32api_type_definition_parser.y
BuildCmds= \
bison --output=w32api_type_definition_parser.c -v -d -p w32api_type_definition_ w32api_type_definition_parser.y
"$(InputDir)/w32api_type_definition_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)/w32api_type_definition_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ENDIF
# End Source File
# End Group
# Begin Group "Scanners"
# PROP Default_Filter ".l"
# Begin Source File
SOURCE=.\w32api_function_definition_scanner.l
!IF "$(CFG)" == "w32api - Win32 Debug_TS"
# Begin Custom Build
InputDir=.
InputPath=.\w32api_function_definition_scanner.l
"$(InputDir)\w32api_function_definition_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -B -i -Pw32api_function_definition -ow32api_function_definition_scanner.c w32api_function_definition_scanner.l
# End Custom Build
!ELSEIF "$(CFG)" == "w32api - Win32 Release_TS"
# Begin Custom Build
InputDir=.
InputPath=.\w32api_function_definition_scanner.l
"$(InputDir)\w32api_function_definition_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -B -i -Pw32api_function_definition -ow32api_function_definition_scanner.c w32api_function_definition_scanner.l
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\w32api_type_definition_scanner.l
!IF "$(CFG)" == "w32api - Win32 Debug_TS"
# Begin Custom Build
InputDir=.
InputPath=.\w32api_type_definition_scanner.l
"$(InputDir)/w32api_type_definition_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -B -i -Pw32api_type_definition -ow32api_type_definition_scanner.c w32api_type_definition_scanner.l
# End Custom Build
!ELSEIF "$(CFG)" == "w32api - Win32 Release_TS"
# Begin Custom Build
InputDir=.
InputPath=.\w32api_type_definition_scanner.l
"$(InputDir)/w32api_type_definition_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -B -i -Pw32api_type_definition -ow32api_type_definition_scanner.c w32api_type_definition_scanner.l
# End Custom Build
!ENDIF
# End Source File
# End Group
# End Target
# End Project

View File

@@ -1,67 +0,0 @@
%{
/*
+----------------------------------------------------------------------+
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: James Moore <jmoore@php.net> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include <stdio.h>
#include <stdlib.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <string.h>
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "ext/standard/php_string.h"
#include "php_w32api.h"
#define YYSTYPE w32api_parser_function_definition_union
#define YYPARSE_PARAM fh
int w32api_function_definition_lex(w32api_parser_function_definition_union *funcdef_lval);
%}
%pure_parser
%token tFROM
%token tBYREF
%token tALIAS
%token <s> tIDENTIFIER
%token <s> tFILENAME
%type <arg> argument argument_list
%start funcdef
%%
funcdef: tIDENTIFIER tIDENTIFIER tALIAS tIDENTIFIER'(' argument_list ')' tFROM tFILENAME {((w32api_func_handle_ptr *)fh)->hnd = w32api_parser_load_alias_function($1, $2, $4, $6, $9);}
| tIDENTIFIER tIDENTIFIER '(' argument_list ')' tFROM tFILENAME {((w32api_func_handle_ptr *)fh)->hnd = w32api_parser_load_function($1, $2, $4, $7);}
;
argument_list: argument ',' argument_list { $$ = w32api_parser_join_arguments($1, $3);}
| argument {$$ = $1;}
| {$$ = NULL;}
;
argument: tIDENTIFIER tIDENTIFIER { $$ = w32api_parser_make_argument_byval($1, $2); }
| tIDENTIFIER tBYREF tIDENTIFIER { $$ = w32api_parser_make_argument_byref($1, $3); }
;

View File

@@ -1,63 +0,0 @@
%{
/*
+----------------------------------------------------------------------+
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: James Moore <jmoore@php.net> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include <stdio.h>
#include <stdlib.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <string.h>
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "ext/standard/php_string.h"
#include "php_w32api.h"
#include "w32api_function_definition_parser.h"
#ifdef YYSTYPE
#undef YYSTYPE
#endif
#define YYSTYPE w32api_parser_function_definition_union
#define YY_DECL int w32api_function_definition_lex(w32api_parser_function_definition_union *funcdef_lval)
%}
ID [A-Za-z][A-Za-z0-9_]*
FILENAME {ID}\.{ID}
%option noyywrap
%%
"from" {return tFROM;}
"alias" {return tALIAS;}
"&" {return tBYREF;}
{FILENAME} {funcdef_lval->s = estrdup(yytext); return tFILENAME;}
{ID} {funcdef_lval->s = estrdup(yytext); return tIDENTIFIER;}
[ \r\t\n] /* Ignore Whitespace */
. {return *yytext;}
%%

View File

@@ -1,67 +0,0 @@
%{
/*
+----------------------------------------------------------------------+
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: James Moore <jmoore@php.net> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include <stdio.h>
#include <stdlib.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <string.h>
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "ext/standard/php_string.h"
#include "php_w32api.h"
#define YYSTYPE w32api_parser_type_definition_union
#define YYPARSE_PARAM th
int w32api_type_definition_lex(w32api_parser_type_definition_union *typedef_lval);
%}
%pure_parser
%token <s> tTYPEID
%token tBYREF
%type <type> value_list value
%%
start:
type_definition
;
type_definition:
tTYPEID '{' value_list '}' {((w32api_type_handle_ptr *)th)->hnd = w32api_parser_register_type($1, $3);}
;
value_list:
value ';' value_list {$$ = w32api_parser_type_join_values($1, $3);}
| value ';' {$$ = $1;}
;
value:
tTYPEID tTYPEID {$$ = w32api_parser_type_make_byval_value($1, $2);}
| tTYPEID tBYREF tTYPEID {$$ = w32api_parser_type_make_byref_value($1, $3);}
;

View File

@@ -1,56 +0,0 @@
%{
/*
+----------------------------------------------------------------------+
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: James Moore <jmoore@php.net> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include <stdio.h>
#include <stdlib.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <string.h>
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "ext/standard/php_string.h"
#include "php_w32api.h"
#include "w32api_type_definition_parser.h"
#ifdef YYSTYPE
#undef YYSTYPE
#endif
#define YYSTYPE w32api_parser_type_definition_union
#define YY_DECL int w32api_type_definition_lex(w32api_parser_type_definition_union *typedef_lval)
%}
TYPEID [A-Za-z][A-Za-z0-9_]*
%option noyywrap
%%
"&" {return tBYREF;}
{TYPEID} {typedef_lval->s = estrdup(yytext); return tTYPEID;}
[ \r\t\n] /* Ignore Whitespace */
. {return *yytext;}
%%