Skip to content

Commit 78749ee

Browse files
committed
This commit was generated by cvs2svn to compensate for changes in r2,
which included commits to RCS files with non-trunk default branches. SVN Rev: 3
1 parent cd942a0 commit 78749ee

12 files changed

Lines changed: 1080 additions & 0 deletions

File tree

.cvsignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.deps
2+
Makefile
3+
*.lo
4+
*.la
5+
.libs
6+
libs.mk
7+
ac*.m4
8+
build
9+
config.h
10+
config.h.in
11+
config.nice
12+
config.sub
13+
configure
14+
configure.in
15+
core
16+
dynlib.m4
17+
install-sh
18+
ltmain.sh
19+
include
20+
Makefile.global
21+
missing
22+
mkinstalldirs
23+
modules
24+
scan_makefile_in.awk
25+

CREDITS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
xdebug
2+
Derick Rethans

EXPERIMENTAL

Whitespace-only changes.

config.m4

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
dnl $Id: config.m4,v 1.1.1.1 2002-04-24 14:26:19 derick Exp $
2+
dnl config.m4 for extension xdebug
3+
4+
PHP_ARG_ENABLE(xdebug, whether to enable eXtended debugging support,
5+
[ --enable-xdebug Enable xdebug support])
6+
7+
if test "$PHP_XDEBUG" != "no"; then
8+
PHP_NEW_EXTENSION(xdebug, xdebug.c srm_llist.c, $ext_shared)
9+
AC_DEFINE(HAVE_XDEBUG,1,[ ])
10+
fi

php_xdebug.h

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/*
2+
+----------------------------------------------------------------------+
3+
| PHP Version 4 |
4+
+----------------------------------------------------------------------+
5+
| Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
6+
+----------------------------------------------------------------------+
7+
| This source file is subject to version 2.02 of the PHP license, |
8+
| that is bundled with this package in the file LICENSE, and is |
9+
| available at through the world-wide-web at |
10+
| http://www.php.net/license/2_02.txt. |
11+
| If you did not receive a copy of the PHP license and are unable to |
12+
| obtain it through the world-wide-web, please send a note to |
13+
| license@php.net so we can mail you a copy immediately. |
14+
+----------------------------------------------------------------------+
15+
| Authors: Derick Rethans <derick@vl-srm.net> |
16+
+----------------------------------------------------------------------+
17+
*/
18+
19+
#ifndef PHP_XDEBUG_H
20+
#define PHP_XDEBUG_H
21+
22+
#include "php.h"
23+
#include "srm_llist.h"
24+
25+
extern zend_module_entry xdebug_module_entry;
26+
#define phpext_xdebug_ptr &xdebug_module_entry
27+
28+
#ifdef PHP_WIN32
29+
#define PHP_XDEBUG_API __declspec(dllexport)
30+
#else
31+
#define PHP_XDEBUG_API
32+
#endif
33+
34+
#ifdef ZTS
35+
#include "TSRM.h"
36+
#endif
37+
38+
PHP_MINIT_FUNCTION(xdebug);
39+
PHP_MSHUTDOWN_FUNCTION(xdebug);
40+
PHP_RINIT_FUNCTION(xdebug);
41+
PHP_RSHUTDOWN_FUNCTION(xdebug);
42+
PHP_MINFO_FUNCTION(xdebug);
43+
44+
45+
PHP_FUNCTION(xdebug_get_function_stack);
46+
47+
typedef struct function_stack_entry {
48+
char *function_name;
49+
char *filename;
50+
int lineno;
51+
int varc;
52+
char *vars[20];
53+
} function_stack_entry;
54+
55+
56+
ZEND_BEGIN_MODULE_GLOBALS(xdebug)
57+
int level;
58+
srm_llist *stack;
59+
int max_nesting_level;
60+
ZEND_END_MODULE_GLOBALS(xdebug)
61+
62+
63+
#ifdef ZTS
64+
#define XG(v) TSRMG(xdebug_globals_id, zend_xdebug_globals *, v)
65+
#else
66+
#define XG(v) (xdebug_globals.v)
67+
#endif
68+
69+
#endif
70+
71+
72+
/*
73+
* Local variables:
74+
* tab-width: 4
75+
* c-basic-offset: 4
76+
* indent-tabs-mode: t
77+
* End:
78+
*/

srm_llist.c

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
/* $Id: srm_llist.c,v 1.1.1.1 2002-04-24 14:26:19 derick Exp $ */
2+
3+
/* The contents of this file are subject to the Vulcan Logic Public
4+
* License Version 1.1 (the "License"); you may not use this file
5+
* except in compliance with the License. You may obtain a copy of
6+
* the License at http://www.vl-srm.net/vlpl/
7+
*
8+
* Software distributed under the License is distributed on an "AS
9+
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10+
* implied. See the License for the specific language governing
11+
* rights and limitations under the License.
12+
*
13+
* The Original Code is vl-srm.net code.
14+
*
15+
* The Initial Developer of the Original Code is the Vulcan Logic
16+
* Group. Portions created by Vulcan Logic Group are Copyright (C)
17+
* 2000, 2001, 2002 Vulcan Logic Group. All Rights Reserved.
18+
*
19+
* Author(s): Sterling Hughes <sterling@php.net>
20+
*/
21+
22+
#include <stdlib.h>
23+
#include <string.h>
24+
25+
#include "srm_llist.h"
26+
27+
srm_llist *srm_llist_alloc(srm_llist_dtor dtor)
28+
{
29+
srm_llist *l;
30+
31+
l = malloc(sizeof(srm_llist));
32+
l->size = 0;
33+
l->dtor = dtor;
34+
l->head = NULL;
35+
l->tail = NULL;
36+
37+
return l;
38+
}
39+
40+
int srm_llist_insert_next(srm_llist *l, srm_llist_element *e, const void *p)
41+
{
42+
srm_llist_element *ne;
43+
44+
if (!e) {
45+
e = SRM_LLIST_TAIL(l);
46+
}
47+
48+
ne = (srm_llist_element *) malloc(sizeof(srm_llist_element));
49+
ne->ptr = (void *) p;
50+
if (l->size == 0) {
51+
l->head = ne;
52+
l->head->prev = NULL;
53+
l->head->next = NULL;
54+
l->tail = ne;
55+
} else {
56+
ne->next = e->next;
57+
ne->prev = e;
58+
if (e->next) {
59+
e->next->prev = ne;
60+
} else {
61+
l->tail = ne;
62+
}
63+
e->next = ne;
64+
}
65+
66+
++l->size;
67+
68+
return 1;
69+
}
70+
71+
int srm_llist_insert_prev(srm_llist *l, srm_llist_element *e, const void *p)
72+
{
73+
srm_llist_element *ne;
74+
75+
if (!e) {
76+
e = SRM_LLIST_HEAD(l);
77+
}
78+
79+
ne = (srm_llist_element *) malloc(sizeof(srm_llist_element));
80+
ne->ptr = (void *) p;
81+
if (l->size == 0) {
82+
l->head = ne;
83+
l->head->prev = NULL;
84+
l->head->next = NULL;
85+
l->tail = ne;
86+
} else {
87+
ne->next = e;
88+
ne->prev = e->prev;
89+
if (e->prev)
90+
e->prev->next = ne;
91+
else
92+
l->head = ne;
93+
e->prev = ne;
94+
}
95+
96+
++l->size;
97+
98+
return 0;
99+
}
100+
101+
int srm_llist_remove(srm_llist *l, srm_llist_element *e, void *user)
102+
{
103+
if (e == NULL || l->size == 0)
104+
return 0;
105+
106+
if (e == l->head) {
107+
l->head = e->next;
108+
109+
if (l->head == NULL)
110+
l->tail = NULL;
111+
else
112+
e->next->prev = NULL;
113+
} else {
114+
e->prev->next = e->next;
115+
if (!e->next)
116+
l->tail = e->prev;
117+
else
118+
e->next->prev = e->prev;
119+
}
120+
121+
l->dtor(user, e->ptr);
122+
free(e);
123+
--l->size;
124+
125+
return 0;
126+
}
127+
128+
int srm_llist_remove_next(srm_llist *l, srm_llist_element *e, void *user)
129+
{
130+
return srm_llist_remove(l, e->next, user);
131+
}
132+
133+
int srm_llist_remove_prev(srm_llist *l, srm_llist_element *e, void *user)
134+
{
135+
return srm_llist_remove(l, e->prev, user);
136+
}
137+
138+
srm_llist_element *srm_llist_jump(srm_llist *l, int where, int pos)
139+
{
140+
srm_llist_element *e=NULL;
141+
int i;
142+
143+
if (where == LIST_HEAD) {
144+
e = SRM_LLIST_HEAD(l);
145+
for (i = 0; i < pos; ++i) {
146+
e = SRM_LLIST_NEXT(e);
147+
}
148+
}
149+
else if (where == LIST_TAIL) {
150+
e = SRM_LLIST_TAIL(l);
151+
for (i = 0; i < pos; ++i) {
152+
e = SRM_LLIST_PREV(e);
153+
}
154+
}
155+
156+
return e;
157+
}
158+
159+
size_t srm_llist_count(srm_llist *l)
160+
{
161+
return l->size;
162+
}
163+
164+
void srm_llist_destroy(srm_llist *l, void *user)
165+
{
166+
while (srm_llist_count(l) > 0) {
167+
srm_llist_remove(l, SRM_LLIST_TAIL(l), user);
168+
}
169+
170+
free (l);
171+
l = NULL;
172+
}
173+
174+
/*
175+
* Local Variables:
176+
* c-basic-offset: 4
177+
* tab-width: 4
178+
* End:
179+
* vim600: fdm=marker
180+
* vim: noet sw=4 ts=4
181+
*/

srm_llist.h

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/* $Id: srm_llist.h,v 1.1.1.1 2002-04-24 14:26:19 derick Exp $ */
2+
3+
/* The contents of this file are subject to the Vulcan Logic Public
4+
* License Version 1.1 (the "License"); you may not use this file
5+
* except in compliance with the License. You may obtain a copy of
6+
* the License at http://www.vl-srm.net/vlpl/
7+
*
8+
* Software distributed under the License is distributed on an "AS
9+
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10+
* implied. See the License for the specific language governing
11+
* rights and limitations under the License.
12+
*
13+
* The Original Code is vl-srm.net code.
14+
*
15+
* The Initial Developer of the Original Code is the Vulcan Logic
16+
* Group. Portions created by Vulcan Logic Group are Copyright (C)
17+
* 2000, 2001, 2002 Vulcan Logic Group. All Rights Reserved.
18+
*
19+
* Contributor(s): Sterling Hughes <sterling@php.net>
20+
* Daniel R. Kalowsky <dank@deadmime.org>
21+
*/
22+
23+
#ifndef __SRM_LLIST_H__
24+
#define __SRM_LLIST_H__
25+
26+
#include <stddef.h>
27+
28+
typedef void (*srm_llist_dtor)(void *, void *);
29+
30+
typedef struct _srm_llist_element {
31+
void *ptr;
32+
33+
struct _srm_llist_element *prev;
34+
struct _srm_llist_element *next;
35+
} srm_llist_element;
36+
37+
typedef struct _srm_llist {
38+
srm_llist_element *head;
39+
srm_llist_element *tail;
40+
41+
srm_llist_dtor dtor;
42+
43+
size_t size;
44+
} srm_llist;
45+
46+
srm_llist *srm_llist_alloc(srm_llist_dtor dtor);
47+
int srm_llist_insert_next(srm_llist *l, srm_llist_element *e, const void *p);
48+
int srm_llist_insert_prev(srm_llist *l, srm_llist_element *e, const void *p);
49+
int srm_llist_remove(srm_llist *l, srm_llist_element *e, void *user);
50+
int srm_llist_remove_next(srm_llist *l, srm_llist_element *e, void *user);
51+
srm_llist_element *srm_llist_jump(srm_llist *l, int where, int pos);
52+
size_t srm_llist_count(srm_llist *l);
53+
void srm_llist_destroy(srm_llist *l, void *user);
54+
55+
#if !defined(LIST_HEAD)
56+
#define LIST_HEAD 0
57+
#endif
58+
59+
#if !defined(LIST_TAIL)
60+
#define LIST_TAIL 1
61+
#endif
62+
63+
#define SRM_LLIST_HEAD(__l) ((__l)->head)
64+
#define SRM_LLIST_TAIL(__l) ((__l)->tail)
65+
#define SRM_LLIST_NEXT(__e) ((__e)->next)
66+
#define SRM_LLIST_PREV(__e) ((__e)->prev)
67+
#define SRM_LLIST_VALP(__e) ((__e)->ptr)
68+
#define SRM_LLIST_IS_TAIL(__e) ((__e)->next ? 0 : 1)
69+
#define SRM_LLIST_IS_HEAD(__e) ((__e)->prev ? 0 : 1)
70+
71+
#endif /* __SRM_LLIST_H__ */

tests/.test1.php.swp

12 KB
Binary file not shown.

tests/001.phpt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--TEST--
2+
Check for vle presence
3+
--SKIPIF--
4+
<?php if (!extension_loaded("vle")) print "skip"; ?>
5+
--POST--
6+
--GET--
7+
--FILE--
8+
<?php
9+
echo "vle extension is available";
10+
/*
11+
you can add regression tests for your extension here
12+
13+
the output of your test code has to be equal to the
14+
text in the --EXPECT-- section below for the tests
15+
to pass, differences between the output and the
16+
expected text are interpreted as failure
17+
18+
see php4/tests/README for further information on
19+
writing regression tests
20+
*/
21+
?>
22+
--EXPECT--
23+
vle extension is available

0 commit comments

Comments
 (0)