00001 /* DazukoXP Interface. Interace with Dazuko for file access control. 00002 Written by John Ogness <jogness@antivir.de> 00003 00004 Copyright (c) 2002, 2003, 2004, 2005 H+BEDV Datentechnik GmbH 00005 All rights reserved. 00006 00007 Redistribution and use in source and binary forms, with or without 00008 modification, are permitted provided that the following conditions 00009 are met: 00010 00011 1. Redistributions of source code must retain the above copyright notice, 00012 this list of conditions and the following disclaimer. 00013 00014 2. Redistributions in binary form must reproduce the above copyright notice, 00015 this list of conditions and the following disclaimer in the documentation 00016 and/or other materials provided with the distribution. 00017 00018 3. Neither the name of Dazuko nor the names of its contributors may be used 00019 to endorse or promote products derived from this software without specific 00020 prior written permission. 00021 00022 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00023 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00024 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00025 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00026 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00027 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00028 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00029 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00030 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00031 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00032 POSSIBILITY OF SUCH DAMAGE. 00033 */ 00034 00035 #ifndef DAZUKOIO_XP_H 00036 #define DAZUKOIO_XP_H 00037 00038 #include <stdio.h> 00039 #include "dazukoio_platform.h" 00040 #include "dazuko_transport.h" 00041 00042 /* this should be big enough for the biggest number string + 4 */ 00043 #define ITOA_SIZE 64 00044 00045 struct dazuko_id 00046 { 00047 int id; 00048 int write_mode; 00049 struct xp_dazukoio_id *extra_data; /* this must be defined in platform implementation */ 00050 }; 00051 00052 /* connection to Dazuko */ 00053 int xp_connection_open(struct dazuko_id *id); 00054 int xp_connection_close(struct dazuko_id *id); 00055 00056 /* verify id validity */ 00057 int xp_verify_id(struct dazuko_id *id); 00058 00059 /* process requests */ 00060 int xp_process_request(struct dazuko_id *id, const char *buffer, size_t buffer_size); 00061 00062 /* functions available to extensions */ 00063 int dazuko_get_value(const char *key, const char *string, char *buffer, size_t buffer_size); 00064 00065 #endif