/* 
   +----------------------------------------------------------------------+
   | PHP Version 4                                                        |
   +----------------------------------------------------------------------+
   | Copyright (c) 1997-2002 The PHP Group                                |
   +----------------------------------------------------------------------+
   | This source file is subject to version 2.02 of the PHP license,      |
   | that is bundled with this package in the file LICENSE, and is        |
   | available at through the world-wide-web at                           |
   | http://www.php.net/license/2_02.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.               |
   +----------------------------------------------------------------------+
   | Author: Sara Golemon <pollita@php.net>                               |
   +----------------------------------------------------------------------+
*/

#ifndef PHP_CVSCLIENT_H
#define PHP_CVSCLIENT_H

#if WITH_CVSCLIENT

extern zend_module_entry cvsclient_module_entry;
#define phpext_cvsclient_ptr &cvsclient_module_entry

PHP_MINIT_FUNCTION(cvsclient);
PHP_MSHUTDOWN_FUNCTION(cvsclient);
PHP_MINFO_FUNCTION(cvsclient);

PHP_FUNCTION(cvsclient_connect);
PHP_FUNCTION(cvsclient_login);
PHP_FUNCTION(cvsclient_retrieve);

#define PHP_CVSCLIENT_REQ_ARGUMENT      0x00000001
#define PHP_CVSCLIENT_REQ_ARGUMENTX     0x00000002
#define PHP_CVSCLIENT_REQ_DIRECTORY     0x00000004
#define PHP_CVSCLIENT_REQ_ROOT          0x00000008
#define PHP_CVSCLIENT_REQ_REPOSITORY    0x00000010
#define PHP_CVSCLIENT_REQ_UPDATE        0x00000020
#define PHP_CVSCLIENT_REQ_CI            0x00000040
#define PHP_CVSCLIENT_REQ_CO            0x00000080
#define PHP_CVSCLIENT_REQ_DIFF          0x00000100
#define PHP_CVSCLIENT_REQ_LOG           0x00000200
#define PHP_CVSCLIENT_REQ_ADD           0x00000400
#define PHP_CVSCLIENT_REQ_REMOVE        0x00000800
#define PHP_CVSCLIENT_REQ_HISTORY       0x00001000

#define PHP_CVSCLIENT_DEFAULT_PORT      2401
#define PHP_CVSCLIENT_REV_DIVIDER       "M ----------------------------"
#define PHP_CVSCLIENT_REV_DIVIDER2      "M ============================================================================="

/* search modes for parsing log output */
#define CVSCLIENT_DIVIDER 0
#define CVSCLIENT_REVISION 1
#define CVSCLIENT_SIGNATURE 2
#define CVSCLIENT_BODY 3

#define CVSCLIENT_HAVE_REVISION     0x00000001

static int le_cvsclient;
#define CVSCLIENT_RES_NAME "CVS pserver Client"

typedef struct _php_cvsclient_resource {
    php_stream *server;
    char *cvsroot;
    int requests;
} php_cvsclient_resource;

typedef struct _php_cvsclient_requests {
    long request;
    char *label;
} php_cvsclient_requests;

static php_cvsclient_requests cvsclient_requests[] = {
    { PHP_CVSCLIENT_REQ_ARGUMENT,       "argument"      },
    { PHP_CVSCLIENT_REQ_ARGUMENTX,      "argumentx"     },
    { PHP_CVSCLIENT_REQ_DIRECTORY,      "directory"     },
    { PHP_CVSCLIENT_REQ_ROOT,           "root"          },
    { PHP_CVSCLIENT_REQ_REPOSITORY,     "repository"    },
    { PHP_CVSCLIENT_REQ_UPDATE,         "update"        },
    { PHP_CVSCLIENT_REQ_CI,             "ci"            },
    { PHP_CVSCLIENT_REQ_CO,             "co"            },
    { PHP_CVSCLIENT_REQ_DIFF,           "diff"          },
    { PHP_CVSCLIENT_REQ_LOG,            "log"           },
    { PHP_CVSCLIENT_REQ_ADD,            "add"           },
    { PHP_CVSCLIENT_REQ_REMOVE,         "remove"        },
    { PHP_CVSCLIENT_REQ_HISTORY,        "history"       },
    { 0,                                NULL            }
};

static char cvs_encode[96] =
    {  32, 120,  53,  35,  36, 109,  72, 108,
       70,  64,  76,  67, 116,  74,  68,  87,
      111,  52,  75, 119,  49,  34,  82,  81,
       95,  65, 112,  86, 118, 110, 122, 105,
       64,  57,  83,  43,  46, 102,  40,  89,
       38, 103,  45,  50,  42, 123,  91,  35,
      125,  55,  54,  66, 124, 126,  59,  47,
       92,  71, 115,  91,  92,  93,  94,  56,
       96, 121, 117, 104, 101, 100,  69,  73,
       99,  63,  94,  93,  39,  37,  61,  48,
       58, 113,  32,  90,  44,  98,  60,  51,
       33,  97,  62, 123, 124, 125, 126, 127 };

#else

#define phpext_cvsclient_ptr NULL

#endif /* WITH_CVSCLIENT */

#endif /* PHP_CVSCLIENT_H */


syntax highlighted by Code2HTML, v. 0.9.1