ext-uv/uv.c

83 lines
4.7 KiB
C
Raw Normal View History

2012-05-22 19:43:11 +02:00
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
2012-05-28 05:10:49 +02:00
| Copyright (c) 1997-2012 The PHP Group |
2012-05-22 19:43:11 +02:00
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 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_01.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. |
+----------------------------------------------------------------------+
2012-05-28 05:10:49 +02:00
| Authors: Shuhei Tanuma <chobieeee@php.net> |
2012-05-22 19:43:11 +02:00
+----------------------------------------------------------------------+
*/
#include "php_uv.h"
2012-06-22 16:01:32 +02:00
#include <fcntl.h>
2012-05-22 19:43:11 +02:00
void php_uv_init(TSRMLS_D);
zend_class_entry *uv_class_entry;
2012-05-29 05:03:05 +02:00
/* TODO: will be add soon */
2012-05-22 19:43:11 +02:00
static zend_function_entry php_uv_methods[] = {
{NULL, NULL, NULL}
};
static int php_uv_class_init(TSRMLS_D)
2012-05-22 19:43:11 +02:00
{
zend_class_entry ce;
INIT_CLASS_ENTRY(ce, "UV", php_uv_methods);
uv_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
//uv_class_entry->create_object = php_uv_new;
2012-06-23 07:18:38 +02:00
zend_declare_class_constant_long(uv_class_entry, "CHANGE", sizeof("CHANGE")-1, UV_CHANGE TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "RENAME", sizeof("RENAME")-1, UV_RENAME TSRMLS_CC);
2012-07-09 05:24:35 +02:00
zend_declare_class_constant_long(uv_class_entry, "READABLE",sizeof("READABLE")-1, UV_READABLE TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "WRITABLE",sizeof("WRITABLE")-1, UV_WRITABLE TSRMLS_CC);
2012-06-23 07:18:38 +02:00
2012-06-22 16:01:32 +02:00
zend_declare_class_constant_long(uv_class_entry, "O_RDONLY", sizeof("O_RDONLY")-1, O_RDONLY TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "O_WRONLY", sizeof("O_WRONLY")-1, O_WRONLY TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "O_RDWR", sizeof("O_RDWR")-1, O_RDWR TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "O_CREAT", sizeof("O_CREAT")-1, O_CREAT TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "O_EXCL", sizeof("O_EXCL")-1, O_EXCL TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "O_TRUNC", sizeof("O_TRUNC")-1, O_TRUNC TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "O_APPEND", sizeof("O_APPEND")-1, O_APPEND TSRMLS_CC);
2012-06-25 16:59:49 +02:00
2012-06-25 17:10:40 +02:00
#ifndef PHP_WIN32
2012-06-22 17:53:58 +02:00
zend_declare_class_constant_long(uv_class_entry, "O_NOCTTY", sizeof("O_NOCTTY")-1, O_NOCTTY TSRMLS_CC);
2012-06-22 16:01:32 +02:00
zend_declare_class_constant_long(uv_class_entry, "S_IRWXU", sizeof("S_IRWXU")-1, S_IRWXU TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "S_IRUSR", sizeof("S_IRUSR")-1, S_IRUSR TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "S_IRWXG", sizeof("S_IRWXG")-1, S_IRWXG TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "S_IRGRP", sizeof("S_IRGRP")-1, S_IRWXG TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "S_IWGRP", sizeof("S_IWGRP")-1, S_IWGRP TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "S_IXGRP", sizeof("S_IXGRP")-1, S_IXGRP TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "S_IRWXO", sizeof("S_IRWXO")-1, S_IRWXO TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "S_IROTH", sizeof("S_IROTH")-1, S_IROTH TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "S_IWOTH", sizeof("S_IWOTH")-1, S_IWOTH TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "S_IXOTH", sizeof("S_IXOTH")-1, S_IXOTH TSRMLS_CC);
2012-06-25 16:59:49 +02:00
#endif
2012-06-22 16:01:32 +02:00
2012-06-23 20:34:06 +02:00
zend_declare_class_constant_long(uv_class_entry, "AF_INET", sizeof("AF_INET")-1, AF_INET TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "AF_INET6", sizeof("AF_INET6")-1, AF_INET6 TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "AF_UNSPEC", sizeof("AF_UNSPEC")-1, AF_UNSPEC TSRMLS_CC);
2012-06-24 15:33:47 +02:00
zend_declare_class_constant_long(uv_class_entry, "LEAVE_GROUP", sizeof("LEAVE_GROUP")-1, UV_LEAVE_GROUP TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "JOIN_GROUP", sizeof("JOIN_GROUP")-1, UV_JOIN_GROUP TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "HTTP_BOTH", sizeof("HTTP_BOTH"), HTTP_BOTH TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "HTTP_REQUEST", sizeof("HTTP_REQUEST"), HTTP_REQUEST TSRMLS_CC);
zend_declare_class_constant_long(uv_class_entry, "HTTP_RESPONSE", sizeof("HTTP_RESPONSE"), HTTP_RESPONSE TSRMLS_CC);
return 0;
2012-05-22 19:43:11 +02:00
}
void php_uv_init(TSRMLS_D)
{
php_uv_class_init(TSRMLS_C);
}