rev 375 - in trunk/modules: . dbm
SVN User <[email protected]> Sat, 17 Apr 2004 16:31:52 -0400
| Newsgroups | gmane.comp.lang.prothon.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: mark
Date: 2004-04-17 16:31:48 -0400 (Sat, 17 Apr 2004)
New Revision: 375
Added:
trunk/modules/dbm/
trunk/modules/dbm/DBM.c
trunk/modules/dbm/dbm.vcproj
Log:
REALLY added dbm this time
Added: trunk/modules/dbm/DBM.c
===================================================================
--- trunk/modules/dbm/DBM.c 2004-04-17 19:17:18 UTC (rev 374)
+++ trunk/modules/dbm/DBM.c 2004-04-17 20:31:48 UTC (rev 375)
@@ -0,0 +1,157 @@
+/* ====================================================================
+ * The Prothon License Agreement, Version 1.1
+ *
+ * Copyright (c) 2004 Hahn Creative Applications, http://hahnca.com.
+ * All rights reserved.
+ *
+ * 1. This LICENSE AGREEMENT is between Hahn Creative Applications ("HCA"),
+ * and the Individual or Organization ("Licensee") accessing and otherwise
+ * using Prothon software in source or binary form and its associated
+ * documentation.
+ *
+ * 2. Subject to the terms and conditions of this License Agreement, HCA
+ * hereby grants Licensee a nonexclusive, royalty-free, world-wide license
+ * to reproduce, analyze, test, perform and/or display publicly, prepare
+ * derivative works, distribute, and otherwise use Prothon alone or in any
+ * derivative version, provided, however, that HCA's License Agreement and
+ * HCA's notice of copyright, i.e., "Copyright (c) 2004 Hahn Creative
+ * Applications; All Rights Reserved" are retained in Prothon alone or
+ * in any derivative version prepared by Licensee.
+ *
+ * 3. In the event Licensee prepares a derivative work that is based on or
+ * incorporates Prothon or any part thereof, and wants to make the
+ * derivative work available to others as provided herein, then Licensee
+ * hereby agrees to include in any such work a brief summary of the
+ * changes made to Prothon.
+ *
+ * 4. HCA is making Prothon available to Licensee on an "AS IS" basis.
+ * HCA MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY
+ * OF EXAMPLE, BUT NOT LIMITATION, HCA MAKES NO AND DISCLAIMS ANY
+ * REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY
+ * PARTICULAR PURPOSE OR THAT THE USE OF PROTHON WILL NOT INFRINGE ANY
+ * THIRD PARTY RIGHTS.
+ *
+ * 5. HCA SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PROTHON
+ * FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A
+ * RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PROTHON, OR ANY
+ * DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+ *
+ * 6. This License Agreement will automatically terminate upon a material
+ * breach of its terms and conditions.
+ *
+ * 7. Nothing in this License Agreement shall be deemed to create any
+ * relationship of agency, partnership, or joint venture between HCA and
+ * Licensee. This License Agreement does not grant permission to use HCA
+ * trademarks or trade name in a trademark sense to endorse or promote
+ * products or services of Licensee, or any third party.
+ *
+ * 8. By copying, installing or otherwise using Prothon, Licensee agrees
+ * to be bound by the terms and conditions of this License Agreement.
+ * ====================================================================
+ */
+
+// DBM.c
+
+#include <prothon/prothon_dll.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <apr_strings.h>
+#include <apr_dbm.h>
+
+MODULE_DECLARE(DBM);
+MODULE_DECLARE(DB);
+
+
+/*
+DB if present *apr_status_t apr_dbm_open_ex (apr_dbm_t **dbm, const char *type, const char *name, apr_int32_t mode, apr_fileperms_t perm, apr_pool_t *cntxt)
+apr_status_t apr_dbm_open (apr_dbm_t **dbm, const char *name, apr_int32_t mode, apr_fileperms_t perm, apr_pool_t *cntxt)
+void apr_dbm_close (apr_dbm_t *dbm)
+apr_status_t apr_dbm_fetch (apr_dbm_t *dbm, apr_datum_t key, apr_datum_t *pvalue)
+apr_status_t apr_dbm_store (apr_dbm_t *dbm, apr_datum_t key, apr_datum_t value)
+apr_status_t apr_dbm_delete (apr_dbm_t *dbm, apr_datum_t key)
+int apr_dbm_exists (apr_dbm_t *dbm, apr_datum_t key)
+apr_status_t apr_dbm_firstkey (apr_dbm_t *dbm, apr_datum_t *pkey)
+apr_status_t apr_dbm_nextkey (apr_dbm_t *dbm, apr_datum_t *pkey)
+void apr_dbm_freedatum (apr_dbm_t *dbm, apr_datum_t data)
+char * apr_dbm_geterror (apr_dbm_t *dbm, int *errcode, char *errbuf, apr_size_t errbufsize)
+apr_status_t apr_dbm_get_usednames_ex (apr_pool_t *pool, const char *type, const char *pathname, const char **used1, const char **used2)
+void apr_dbm_get_usednames (apr_pool_t *pool, const char *pathname, const char **used1, const char **used2)
+
+*/
+
+
+MODULE_CONSTANT_DECLARE(DBM, READONLY);
+
+MODULE_START(DBM)
+{
+ DBM_OBJ = NEW_OBJ(NULL);
+ set_obj_doc(DBM_OBJ, "DBM module");
+ set_obj_id(DBM_OBJ, *, DBM);
+ MODULE_ADD_TO_BASE(DBM);
+ DBM_OBJ->unclonable = TRUE;
+
+ DB_OBJ = NEW_OBJ(NULL);
+ set_obj_doc(DB_OBJ, "DBM DB object prototype");
+ set_obj_id(DB_OBJ, DBM, DB);
+ MODULE_ADD_TO_OBJ(DB, DBM_OBJ, "DB");
+ DBM_OBJ->unclonable = TRUE;
+
+ MODULE_CONSTANT_INT(DBM, READONLY, APR_DBM_READONLY);
+}
+
+DEF(DB, __init__, FPARM4( filename, NULL,
+ mode, DBM_READONLY,
+ dbtype, new_string_obj(ist, "SDBM"),
+ access, NEW_INT(-1) ) ) {
+// apr_status_t aprerr;
+ char *filename, *dbtype;
+ int mode, access;
+
+ STRING_PARAM(1, filename);
+ INT_32_PARAM(2, mode);
+ STRING_PARAM(3, dbtype);
+ INT_32_PARAM(4, access);
+/*
+apr_status_t apr_dbm_open_ex ( apr_dbm_t ** dbm,
+ const char * type,
+ const char * name,
+ apr_int32_t mode,
+ apr_fileperms_t perm,
+ apr_pool_t * cntxt
+ )
+
+ Open a dbm file by file name and type of DBM
+
+Parameters:
+dbm The newly opened database
+type The type of the DBM (not all may be available at run time)
+ GDBM for GDBM files
+ SDBM for SDBM files
+ DB for berkeley DB files
+ NDBM for NDBM files
+ default for the default DBM type
+
+
+name The dbm file name to open
+mode The flag value
+ APR_DBM_READONLY open for read-only access
+ APR_DBM_READWRITE open for read-write access
+ APR_DBM_RWCREATE open for r/w, create if needed
+ APR_DBM_RWTRUNC open for r/w, truncate if already there
+
+
+perm Permissions to apply to if created
+cntxt The pool to use when creating the dbm
+ */
+ return self;
+}
+
+MAIN_MODULE_INIT(File) {
+
+ MODULE_ADD_SYM(DB, __init__);
+
+}
+
+
+
Added: trunk/modules/dbm/dbm.vcproj
===================================================================
--- trunk/modules/dbm/dbm.vcproj 2004-04-17 19:17:18 UTC (rev 374)
+++ trunk/modules/dbm/dbm.vcproj 2004-04-17 20:31:48 UTC (rev 375)
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="dbm"
+ ProjectGUID="{9178A30F-B02E-4D57-9786-D417A42CD026}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="2"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="c:\prothon\include;c:\prothon\apr\apr\include;c:\prothon\apr\apr-util\include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DBM_EXPORTS;APR_DECLARE_STATIC;APU_DECLARE_STATIC"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ WarnAsError="TRUE"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="apr.lib wsock32.lib"
+ OutputFile="$(OutDir)/dbm.dll"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="C:\prothon\apr\apr\LibR"
+ IgnoreDefaultLibraryNames="LIBCMTD.lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/dbm.pdb"
+ SubSystem="2"
+ ImportLibrary="$(OutDir)/dbm.lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="2"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="c:\prothon\include;c:\prothon\apr\apr\include;c:\prothon\apr\apr-util\include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DBM_EXPORTS"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="apr.lib wsock32.lib"
+ OutputFile="$(OutDir)/dbm.dll"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="C:\prothon\apr\apr\LibR"
+ IgnoreDefaultLibraryNames="LIBCMTD.lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(OutDir)/dbm.lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath=".\DBM.c">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>