root/php/jlog.c

Revision adf2ee8486352700056029fde45a13fc81b71218, 16.6 kB (checked in by Wez Furlong <wez.furlong@messagesystems.com>, 6 years ago)

Sync with the ecelerity jlog sources

  • Property mode set to 100644
Line 
1 /*
2  * Copyright (c) 2005-2008, Message Systems, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met:
8  *
9  *    * Redistributions of source code must retain the above copyright
10  *      notice, this list of conditions and the following disclaimer.
11  *    * Redistributions in binary form must reproduce the above
12  *      copyright notice, this list of conditions and the following
13  *      disclaimer in the documentation and/or other materials provided
14  *      with the distribution.
15  *    * Neither the name Message Systems, Inc. nor the names
16  *      of its contributors may be used to endorse or promote products
17  *      derived from this software without specific prior written
18  *      permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32
33 #include "php.h"
34 #include "php_ini.h"
35 #include "php_jlog.h"
36
37 #if HAVE_JLOG
38
39 typedef struct {
40   zend_object zo;
41   jlog_ctx *ctx;
42   char *path;
43   jlog_id start;
44   jlog_id last;
45   jlog_id end;
46   int auto_checkpoint;
47 } jlog_obj;
48
49 static zend_class_entry * Jlog_ce_ptr = NULL;
50 static zend_class_entry * Jlog_Writer_ce_ptr = NULL;
51 static zend_class_entry * Jlog_Reader_ce_ptr = NULL;
52 static zend_object_handlers jlog_object_handlers;
53
54
55 static void FREE_JLOG_OBJ(jlog_obj *intern)
56 {
57   if(intern) {
58     if(intern->ctx) {
59       jlog_ctx_close(intern->ctx);
60       intern->ctx = NULL;
61     }
62     if(intern->path) {
63       free(intern->path);
64     }
65   }
66 }
67
68 static void jlog_obj_dtor(void *object TSRMLS_DC)
69 {
70   zend_object *zo = (zend_object *) object;
71   jlog_obj *intern = (jlog_obj *) zo;
72   FREE_JLOG_OBJ(intern);
73   zend_object_std_dtor(&intern->zo TSRMLS_CC);
74   efree(intern);
75 }
76
77 zend_object_value jlog_objects_new(zend_class_entry *class_type TSRMLS_DC)
78 {
79   zend_object_value retval;
80   jlog_obj *intern;
81
82   intern = emalloc(sizeof(*intern));
83   memset(intern, 0, sizeof(*intern));
84  
85   zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
86   retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, jlog_obj_dtor, NULL TSRMLS_CC);
87   retval.handlers = &jlog_object_handlers;
88   return retval;
89 }
90
91 /* {{{ Class definitions */
92
93 /* {{{ Class Jlog */
94
95
96 /* {{{ Methods */
97
98
99 /* {{{ proto object Jlog __construct(string path [, array options])
100  */
101 PHP_METHOD(Jlog, __construct)
102 {
103   zend_class_entry * _this_ce;
104   zval * _this_zval;
105   const char * path = NULL;
106   int path_len = 0;
107   int options = 0;
108   int size = 0;
109   jlog_obj *jo;
110
111   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &path, &path_len, &options, &size) == FAILURE) {
112     return;
113   }
114
115   _this_zval = getThis();
116   _this_ce = Z_OBJCE_P(_this_zval);
117   jo = (jlog_obj *) zend_object_store_get_object(_this_zval TSRMLS_CC);
118
119   jo->ctx = jlog_new(path);
120   jo->path = strdup(path);
121   if(options & O_CREAT) {
122     if(size) {
123       jlog_ctx_alter_journal_size(jo->ctx, size);
124     }
125     if(jlog_ctx_init(jo->ctx) != 0) {
126       if(jlog_ctx_err(jo->ctx) == JLOG_ERR_CREATE_EXISTS) {
127         if(options & O_EXCL) {
128           FREE_JLOG_OBJ(jo);
129           efree(jo);
130           php_error(E_WARNING, "file already exists: %s", path);
131         }
132       } else {
133         int err = jlog_ctx_err(jo->ctx);
134         const char *err_string = jlog_ctx_err_string(jo->ctx);
135         FREE_JLOG_OBJ(jo);
136         efree(jo);
137         php_error(E_WARNING, "error initializing jlog: %d %s", err, err_string);
138         RETURN_FALSE;
139       }
140     }
141     jlog_ctx_close(jo->ctx);
142     jo->ctx = jlog_new(path);
143     if(!jo->ctx) {
144       FREE_JLOG_OBJ(jo);
145       efree(jo);
146       php_error(E_WARNING, "jlog_new(%s) failed after successful init", path);
147       RETURN_FALSE;
148     }
149   }
150 }
151 /* }}} __construct */
152
153
154
155 /* {{{ proto bool add_subscriber(string subscriber [, int whence])
156    */
157 PHP_METHOD(Jlog, add_subscriber)
158 {
159         zend_class_entry * _this_ce;
160         zval * _this_zval = NULL;
161         const char * subscriber = NULL;
162         int subscriber_len = 0;
163         long whence = 0;
164     jlog_obj *jo;
165
166         if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &_this_zval, Jlog_ce_ptr, &subscriber, &subscriber_len, &whence) == FAILURE) {
167                 return;
168         }
169
170         _this_ce = Z_OBJCE_P(_this_zval);
171         jo = (jlog_obj *) zend_object_store_get_object(_this_zval TSRMLS_CC);
172   if(!jo || !jo->ctx || jlog_ctx_add_subscriber(jo->ctx, subscriber, whence) != 0)
173   {
174     RETURN_FALSE;
175   }
176         RETURN_TRUE;
177 }
178 /* }}} add_subscriber */
179
180
181
182 /* {{{ proto bool remove_subscriber(string subscriber)
183    */
184 PHP_METHOD(Jlog, remove_subscriber)
185 {
186         zend_class_entry * _this_ce;
187         zval * _this_zval = NULL;
188         const char * subscriber = NULL;
189         int subscriber_len = 0;
190     jlog_obj *jo;
191
192         if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &_this_zval, Jlog_ce_ptr, &subscriber, &subscriber_len) == FAILURE) {
193                 return;
194         }
195
196         _this_ce = Z_OBJCE_P(_this_zval);
197         jo = (jlog_obj *) zend_object_store_get_object(_this_zval TSRMLS_CC);
198   if(!jo || !jo->ctx || jlog_ctx_remove_subscriber(jo->ctx, subscriber) != 0)
199   {
200     RETURN_FALSE;
201   }
202         RETURN_TRUE;
203 }
204 /* }}} remove_subscriber */
205
206
207
208 /* {{{ proto array list_subscribers()
209    */
210 PHP_METHOD(Jlog, list_subscribers)
211 {
212         zend_class_entry * _this_ce;
213         zval * _this_zval = NULL;
214   jlog_obj *jo;
215   char **list;
216   int i;
217
218         if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &_this_zval, Jlog_ce_ptr) == FAILURE) {
219                 return;
220         }
221
222         _this_ce = Z_OBJCE_P(_this_zval);
223         jo = (jlog_obj *) zend_object_store_get_object(_this_zval TSRMLS_CC);
224   if(!jo || !jo->ctx) {
225     RETURN_NULL();
226   }
227         array_init(return_value);
228   jlog_ctx_list_subscribers(jo->ctx, &list);
229   for(i=0; list[i]; i++) {
230     add_index_string(return_value, i, list[i], 1);
231   }
232   jlog_ctx_list_subscribers_dispose(jo->ctx, list);
233 }
234 /* }}} list_subscribers */
235
236
237
238 /* {{{ proto int raw_size()
239    */
240 PHP_METHOD(Jlog, raw_size)
241 {
242   long size;
243         zend_class_entry * _this_ce;
244         zval * _this_zval = NULL;
245     jlog_obj *jo;
246
247         if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &_this_zval, Jlog_ce_ptr) == FAILURE) {
248                 return;
249         }
250
251         _this_ce = Z_OBJCE_P(_this_zval);
252         jo = (jlog_obj *) zend_object_store_get_object(_this_zval TSRMLS_CC);
253   if(!jo || !jo->ctx) {
254     php_error(E_WARNING, "no valid context");
255           RETURN_LONG(0);
256   }
257   size = jlog_raw_size(jo->ctx);
258   RETURN_LONG(size);
259 }
260 /* }}} raw_size */
261
262
263
264 /* {{{ proto void close()
265    */
266 PHP_METHOD(Jlog, close)
267 {
268         zend_class_entry * _this_ce;
269         zval * _this_zval = NULL;
270     jlog_obj *jo;
271
272         if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &_this_zval, Jlog_ce_ptr) == FAILURE) {
273                 return;
274         }
275
276         _this_ce = Z_OBJCE_P(_this_zval);
277         jo = (jlog_obj *) zend_object_store_get_object(_this_zval TSRMLS_CC);
278   if(!jo || !jo->ctx) { return; }
279   jlog_ctx_close(jo->ctx);
280   jo->ctx = NULL;
281 }
282 /* }}} close */
283
284
285 static zend_function_entry Jlog_methods[] = {
286         PHP_ME(Jlog, __construct, Jlog____construct_args, /**/ZEND_ACC_PUBLIC)
287         PHP_ME(Jlog, add_subscriber, Jlog__add_subscriber_args, /**/ZEND_ACC_PUBLIC)
288         PHP_ME(Jlog, remove_subscriber, Jlog__remove_subscriber_args, /**/ZEND_ACC_PUBLIC)
289         PHP_ME(Jlog, list_subscribers, NULL, /**/ZEND_ACC_PUBLIC)
290         PHP_ME(Jlog, raw_size, NULL, /**/ZEND_ACC_PUBLIC)
291         PHP_ME(Jlog, close, NULL, /**/ZEND_ACC_PUBLIC)
292         { NULL, NULL, NULL }
293 };
294
295 /* }}} Methods */
296
297 static void class_init_Jlog(TSRMLS_D)
298 {
299         zend_class_entry ce;
300
301         INIT_CLASS_ENTRY(ce, "Jlog", Jlog_methods);
302   ce.create_object = jlog_objects_new;
303         Jlog_ce_ptr = zend_register_internal_class(&ce TSRMLS_CC);
304         Jlog_ce_ptr->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
305 }
306
307 /* }}} Class Jlog */
308
309 /* {{{ Class Jlog_Writer */
310
311
312 /* {{{ Methods */
313
314
315 /* {{{ proto object Jlog_Writer open()
316    */
317 PHP_METHOD(Jlog_Writer, open)
318 {
319         zend_class_entry * _this_ce;
320         zval * _this_zval = NULL;
321     jlog_obj *jo;
322
323         if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &_this_zval, Jlog_Writer_ce_ptr) == FAILURE) {
324                 return;
325         }
326
327         _this_ce = Z_OBJCE_P(_this_zval);
328         jo = (jlog_obj *) zend_object_store_get_object(_this_zval TSRMLS_CC);
329   if(!jo || !jo->ctx) {
330     RETURN_NULL();
331   }
332   if(jlog_ctx_open_writer(jo->ctx) != 0) {
333     php_error(E_WARNING, "jlog_ctx_open_writer failed");
334     RETURN_NULL();
335   }
336   ZVAL_ADDREF(_this_zval);
337   return_value = _this_zval;
338 }
339 /* }}} open */
340
341
342
343 /* {{{ proto bool write(string buffer)
344    */
345 PHP_METHOD(Jlog_Writer, write)
346 {
347         zend_class_entry * _this_ce;
348         zval * _this_zval = NULL;
349         const char * buffer = NULL;
350         int buffer_len = 0;
351     jlog_obj *jo;
352
353         if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &_this_zval, Jlog_Writer_ce_ptr, &buffer, &buffer_len) == FAILURE) {
354                 return;
355         }
356
357         _this_ce = Z_OBJCE_P(_this_zval);
358         jo = (jlog_obj *) zend_object_store_get_object(_this_zval TSRMLS_CC);
359   if(!jo || !jo->ctx) {
360           RETURN_FALSE;
361   }
362   if(jlog_ctx_write(jo->ctx, buffer, buffer_len) < 0) {
363     RETURN_FALSE;
364   }
365   RETURN_TRUE;
366 }
367 /* }}} write */
368
369
370 static zend_function_entry Jlog_Writer_methods[] = {
371         PHP_ME(Jlog_Writer, open, NULL, /**/ZEND_ACC_PUBLIC)
372         PHP_ME(Jlog_Writer, write, Jlog_Writer__write_args, /**/ZEND_ACC_PUBLIC)
373         { NULL, NULL, NULL }
374 };
375
376 /* }}} Methods */
377
378 static void class_init_Jlog_Writer(TSRMLS_D)
379 {
380         zend_class_entry ce;
381
382         INIT_CLASS_ENTRY(ce, "Jlog_Writer", Jlog_Writer_methods);
383   ce.create_object = jlog_objects_new;
384         Jlog_Reader_ce_ptr = zend_register_internal_class_ex(&ce, Jlog_ce_ptr, NULL TSRMLS_CC);
385 }
386
387 /* }}} Class Jlog_Writer */
388
389 /* {{{ Class Jlog_Reader */
390
391 /* {{{ Methods */
392
393
394 /* {{{ proto object Jlog_Reader open(string subscriber)
395    */
396 PHP_METHOD(Jlog_Reader, open)
397 {
398         zend_class_entry * _this_ce;
399         zval * _this_zval = NULL;
400         const char * subscriber = NULL;
401         int subscriber_len = 0;
402     jlog_obj *jo;
403
404         if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &_this_zval, Jlog_Reader_ce_ptr, &subscriber, &subscriber_len) == FAILURE) {
405                 return;
406         }
407
408         _this_ce = Z_OBJCE_P(_this_zval);
409         jo = (jlog_obj *) zend_object_store_get_object(_this_zval TSRMLS_CC);
410   if(!jo || !jo->ctx) {
411     RETURN_NULL();
412   }
413   if(jlog_ctx_open_reader(jo->ctx, subscriber) != 0) {
414     RETURN_NULL();
415   }
416   ZVAL_ADDREF(_this_zval);
417   return_value = _this_zval;
418 }
419 /* }}} open */
420
421
422
423 /* {{{ proto string read()
424  */
425 PHP_METHOD(Jlog_Reader, read)
426 {
427   zend_class_entry * _this_ce;
428   zval * _this_zval = NULL;
429   jlog_obj *jo;
430   const jlog_id epoch = { 0, 0 };
431   jlog_id cur;
432   jlog_message message;
433   int cnt;
434
435   if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &_this_zval, Jlog_Reader_ce_ptr) == FAILURE) {
436     return;
437   }
438
439   _this_ce = Z_OBJCE_P(_this_zval);
440   jo = (jlog_obj *) zend_object_store_get_object(_this_zval TSRMLS_CC);
441   if(!jo || !jo->ctx) {
442     RETURN_FALSE;
443   }
444   /* if start is unset, we need to read the interval (again) */
445   if(!memcmp(&jo->start, &epoch, sizeof(jlog_id)))
446   {
447     cnt = jlog_ctx_read_interval(jo->ctx, &jo->start, &jo->end);
448     if(cnt == -1) {
449       php_error(E_WARNING, "jlog_ctx_read_interval failed");
450     }
451     if(cnt == 0) {
452       jo->start = epoch;
453       jo->end = epoch;
454       RETURN_FALSE;
455     }
456   }
457   /* if last is unset, start at the beginning */
458   if(!memcmp(&jo->last, &epoch, sizeof(jlog_id))) {
459     cur = jo->start;
460   } else {
461     /* if we've already read the end, return; otherwise advance */
462     if (!memcmp(&jo->last, &jo->end, sizeof(jlog_id))) {
463       jo->start = epoch;
464       jo->end = epoch;
465       RETURN_FALSE;
466     } else {
467       cur = jo->last;
468       JLOG_ID_ADVANCE(&cur);
469     }
470   }
471
472   if(jlog_ctx_read_message(jo->ctx, &cur, &message) != 0) {
473     php_error(E_WARNING, "read failed");
474     RETURN_FALSE;
475   }
476   if(jo->auto_checkpoint) {
477     if(jlog_ctx_read_checkpoint(jo->ctx, &cur) != 0) {
478       php_error(E_WARNING, "checkpoint failed");
479       RETURN_FALSE;
480     }
481     /* we have to re-read the interval after a checkpoint */
482     jo->last = epoch;
483     jo->start = epoch;
484     jo->end = epoch;
485   } else {
486     /* update last */
487     jo->last = cur;
488     /* if we've reaached the end, clear interval so we'll re-read it */
489     if(!memcmp(&jo->last, &jo->end, sizeof(jlog_id))) {
490       jo->start = epoch;
491       jo->end = epoch;
492     }
493   }
494   RETURN_STRINGL(message.mess, message.mess_len, 1);
495 end:
496   ;
497 }
498
499 /* }}} read */
500
501
502
503 /* {{{ proto object Jlog_Reader checkpoint()
504    */
505 PHP_METHOD(Jlog_Reader, checkpoint)
506 {
507   jlog_id epoch = { 0, 0 };
508         zend_class_entry * _this_ce;
509         zval * _this_zval = NULL;
510     jlog_obj *jo;
511
512         if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &_this_zval, Jlog_Reader_ce_ptr) == FAILURE) {
513                 return;
514         }
515
516         _this_ce = Z_OBJCE_P(_this_zval);
517         jo = (jlog_obj *) zend_object_store_get_object(_this_zval TSRMLS_CC);
518   if(!jo || !jo->ctx) { RETURN_NULL(); }
519   if(memcmp(&jo->last, &epoch, sizeof(jlog_id)))
520   {
521     jlog_ctx_read_checkpoint(jo->ctx, &jo->last);
522     /* we have to re-read the interval after a checkpoint */
523     jo->last = epoch;
524     jo->start = epoch;
525     jo->end = epoch;
526   }
527   ZVAL_ADDREF(_this_zval);
528   return_value = _this_zval;
529 }
530 /* }}} checkpoint */
531
532
533
534 /* {{{ proto bool auto_checkpoint([bool state])
535    */
536 PHP_METHOD(Jlog_Reader, auto_checkpoint)
537 {
538         zend_class_entry * _this_ce;
539         zval * _this_zval = NULL;
540         zend_bool state = 0;
541     jlog_obj *jo;
542
543         if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|b", &_this_zval, Jlog_Reader_ce_ptr, &state) == FAILURE) {
544                 return;
545         }
546
547   fprintf(stderr, "num_args = %d\n", ZEND_NUM_ARGS());
548         _this_ce = Z_OBJCE_P(_this_zval);
549         jo = (jlog_obj *) zend_object_store_get_object(_this_zval TSRMLS_CC);
550   if(!jo || !jo->ctx) { RETURN_NULL(); }
551   if(ZEND_NUM_ARGS() == 1) {
552     jo->auto_checkpoint = state;
553   }
554   RETURN_LONG(jo->auto_checkpoint);
555 }
556 /* }}} auto_checkpoint */
557
558
559 static zend_function_entry Jlog_Reader_methods[] = {
560         PHP_ME(Jlog_Reader, open, Jlog_Reader__open_args, /**/ZEND_ACC_PUBLIC)
561         PHP_ME(Jlog_Reader, read, NULL, /**/ZEND_ACC_PUBLIC)
562         PHP_ME(Jlog_Reader, checkpoint, NULL, /**/ZEND_ACC_PUBLIC)
563         PHP_ME(Jlog_Reader, auto_checkpoint, Jlog_Reader__auto_checkpoint_args, /**/ZEND_ACC_PUBLIC)
564         { NULL, NULL, NULL }
565 };
566
567 /* }}} Methods */
568
569 static void class_init_Jlog_Reader(TSRMLS_D)
570 {
571         zend_class_entry ce;
572
573         INIT_CLASS_ENTRY(ce, "Jlog_Reader", Jlog_Reader_methods);
574   ce.create_object = jlog_objects_new;
575         Jlog_Reader_ce_ptr = zend_register_internal_class_ex(&ce, Jlog_ce_ptr, NULL TSRMLS_CC);
576 }
577
578 /* }}} Class Jlog_Reader */
579
580 /* }}} Class definitions*/
581
582 /* {{{ jlog_functions[] */
583 function_entry jlog_functions[] = {
584         { NULL, NULL, NULL }
585 };
586 /* }}} */
587
588
589 /* {{{ jlog_module_entry
590  */
591 zend_module_entry jlog_module_entry = {
592         STANDARD_MODULE_HEADER,
593         "jlog",
594         jlog_functions,
595         PHP_MINIT(jlog),     /* Replace with NULL if there is nothing to do at php startup   */
596         PHP_MSHUTDOWN(jlog), /* Replace with NULL if there is nothing to do at php shutdown  */
597         PHP_RINIT(jlog),     /* Replace with NULL if there is nothing to do at request start */
598         PHP_RSHUTDOWN(jlog), /* Replace with NULL if there is nothing to do at request end   */
599         PHP_MINFO(jlog),
600         "0.0.1",
601         STANDARD_MODULE_PROPERTIES
602 };
603 /* }}} */
604
605 #ifdef COMPILE_DL_JLOG
606 ZEND_GET_MODULE(jlog)
607 #endif
608
609
610 /* {{{ PHP_MINIT_FUNCTION */
611 PHP_MINIT_FUNCTION(jlog)
612 {
613     zend_object_handlers *std_hnd = zend_get_std_object_handlers();
614
615     memcpy(&jlog_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
616     jlog_object_handlers.clone_obj = NULL;
617
618         class_init_Jlog(TSRMLS_C);
619         class_init_Jlog_Writer(TSRMLS_C);
620         class_init_Jlog_Reader(TSRMLS_C);
621    
622    
623         /* add your stuff here */
624
625         return SUCCESS;
626 }
627 /* }}} */
628
629
630 /* {{{ PHP_MSHUTDOWN_FUNCTION */
631 PHP_MSHUTDOWN_FUNCTION(jlog)
632 {
633
634         /* add your stuff here */
635
636         return SUCCESS;
637 }
638 /* }}} */
639
640
641 /* {{{ PHP_RINIT_FUNCTION */
642 PHP_RINIT_FUNCTION(jlog)
643 {
644         /* add your stuff here */
645
646         return SUCCESS;
647 }
648 /* }}} */
649
650
651 /* {{{ PHP_RSHUTDOWN_FUNCTION */
652 PHP_RSHUTDOWN_FUNCTION(jlog)
653 {
654         /* add your stuff here */
655
656         return SUCCESS;
657 }
658 /* }}} */
659
660
661 /* {{{ PHP_MINFO_FUNCTION */
662 PHP_MINFO_FUNCTION(jlog)
663 {
664         php_info_print_box_start(0);
665         php_printf("<p>A sample PHP extension</p>\n");
666         php_printf("<p>Version 0.0.1devel (2007-07-02)</p>\n");
667         php_info_print_box_end();
668         /* add your stuff here */
669
670 }
671 /* }}} */
672
673 #endif /* HAVE_JLOG */
674
675
676 /*
677  * Local variables:
678  * tab-width: 4
679  * c-basic-offset: 4
680  * End:
681  * vim600: et sw=2 ts=2 sts=2 ai bs=2 fdm=marker
682  */
Note: See TracBrowser for help on using the browser.