Permalink
Browse files

Update prototypes and README.

  • Loading branch information...
1 parent 3cdc3a9 commit 521c7b9ae4b66cb3b0ac605cdb41529dfc7bfedb Andrei Zmievski committed Mar 18, 2009
Showing with 13 additions and 74 deletions.
  1. +5 −69 README
  2. +8 −5 php_bloomy.c
View
74 README
@@ -1,70 +1,6 @@
-This is a standalone PHP extension created using CodeGen_PECL 1.1.2
-
-HACKING
-=======
-
-There are two ways to modify an extension created using CodeGen_PECL:
-
-1) you can modify the generated code as with any other PHP extension
-
-2) you can add custom code to the CodeGen_PECL XML source and re-run pecl-gen
-
-The 2nd approach may look a bit complicated but you have be aware that any
-manual changes to the generated code will be lost if you ever change the
-XML specs and re-run PECL-Gen. All changes done before have to be applied
-to the newly generated code again.
-Adding code snippets to the XML source itself on the other hand may be a
-bit more complicated but this way your custom code will always be in the
-generated code no matter how often you rerun CodeGen_PECL.
-
-
-BUILDING ON UNIX etc.
-=====================
-
-To compile your new extension, you will have to execute the following steps:
-
-1. $ ./phpize
-2. $ ./configure [--enable--bloomy]
-3. $ make
-4. $ make test
-5. $ [sudo] make install
-
-
-
-BUILDING ON WINDOWS
-===================
-
-The extension provides the VisualStudio V6 project file
-
- bloomy.dsp
-To compile the extension you open this file using VisualStudio,
-select the apropriate configuration for your installation
-(either "Release_TS" or "Debug_TS") and create "php_bloomy.dll"
-
-After successfull compilation you have to copy the newly
-created "bloomy.dll" to the PHP
-extension directory (default: C:\PHP\extensions).
-
-
-TESTING
-=======
-
-You can now load the extension using a php.ini directive
-
- extension="bloomy.[so|dll]"
-
-or load it at runtime using the dl() function
-
- dl("bloomy.[so|dll]");
-
-The extension should now be available, you can test this
-using the extension_loaded() function:
-
- if (extension_loaded("bloomy"))
- echo "bloomy loaded :)";
- else
- echo "something is wrong :(";
-
-The extension will also add its own block to the output
-of phpinfo();
+Description
+-----------
+This extension implements a Bloom filter, which is a space-efficient
+probabilistic data structure that is used to test whether an element is a
+member of a set.
View
13 php_bloomy.c
@@ -56,14 +56,14 @@ static const double DEFAULT_ERROR_RATE = 0.01;
Forward declarations
****************************************/
-static void php_bloom_destroy(php_bloom_t *obj TSRMLS_DC);
/****************************************
Method implementations
****************************************/
-/* {{{ BloomFilter::__construct */
+/* {{{ BloomFilter::__construct(int capacity [, double error_rate [, int random_seed ] ])
+ Creates a new filter with the specified capacity */
static PHP_METHOD(BloomFilter, __construct)
{
zval *object = getThis();
@@ -105,7 +105,8 @@ static PHP_METHOD(BloomFilter, __construct)
}
/* }}} */
-/* {{{ BloomFilter::add */
+/* {{{ BloomFilter::add(string item)
+ Adds an item to the filter */
static PHP_METHOD(BloomFilter, add)
{
char *data = NULL;
@@ -129,7 +130,8 @@ static PHP_METHOD(BloomFilter, add)
}
/* }}} */
-/* {{{ BloomFilter::has */
+/* {{{ BloomFilter::has(string item)
+ Checks if the filter has the specified item */
static PHP_METHOD(BloomFilter, has)
{
char *data = NULL;
@@ -153,7 +155,8 @@ static PHP_METHOD(BloomFilter, has)
}
/* }}} */
-/* {{{ BloomFilter::getInfo */
+/* {{{ BloomFilter::getInfo()
+ Returns array with filter information */
static PHP_METHOD(BloomFilter, getInfo)
{
BLOOM_METHOD_INIT_VARS;

0 comments on commit 521c7b9

Please sign in to comment.