Avis Client Library: avis/defs.h Source File

- Main Page
- Data Structures
- Files

# avis/defs.h

Go to the documentation of this file.

    00001 /*
    00002  *  Avis Elvin client library for C.
    00003  *
    00004  *  Copyright (C) 2008 Matthew Phillips <avis@mattp.name>
    00005  *
    00006  *  This program is free software; you can redistribute it and/or
    00007  *  modify it under the terms of version 3 of the GNU Lesser General
    00008  *  Public License as published by the Free Software Foundation.
    00009  *
    00010  *  This program is distributed in the hope that it will be useful,
    00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    00013  *  General Public License for more details.
    00014  *
    00015  *  You should have received a copy of the GNU General Public License
    00016  *  along with this program. If not, see <http://www.gnu.org/licenses/>.
    00017  */
    00021 #ifndef AVIS_DEFS_H_
    00022 #define AVIS_DEFS_H_
    00023
    00025 #define DEFAULT_ELVIN_PORT 2917
    00026
    00028 #define DEFAULT_CLIENT_PROTOCOL_MAJOR 4
    00029
    00031 #define DEFAULT_CLIENT_PROTOCOL_MINOR 0
    00032
    00034 #define AVIS_IO_TIMEOUT 10000
    00035
    00037 #define AVIS_LIVENESS_IDLE_INTERVAL 60
    00038
    00039 #define _KB_  1024
    00040 #define _MB_  _KB_ * _KB_
    00041
    00045 #define MAX_PACKET_LENGTH    (2 * _MB_)
    00046
    00051 #define MAX_STRING_LENGTH    (1 * _MB_)
    00052
    00057 #define MAX_OPAQUE_LENGTH    (1 * _MB_)
    00058
    00063 #define MAX_ARRAY_LENGTH     (4 * _KB_)
    00064
    00068 #define MAX_ATTRIBUTE_COUNT  (4 * _KB_)
    00069
    00075 #define MAX_KEY_SCHEME_COUNT 16
    00076
    00082 #define MAX_KEY_COUNT  (1 * _KB_)
    00083
    00084 /*
    00085  * Allow building .DLL on Windows. Functions that should be public are
    00086  * tagged with AVIS_PUBLIC, data with AVIS_PUBLIC_DATA.
    00087  */
    00088 #ifdef _WIN32
    00089 #  if !defined (AVIS_LIBRARY_STATIC)
    00090 #    if defined (AVIS_BUILDING_LIB)
    00091 #      define AVIS_PUBLIC       __declspec(dllexport)
    00092 #      define AVIS_PUBLIC_DATA  extern __declspec(dllexport)
    00093 #    else
    00094 #      define AVIS_PUBLIC       __declspec(dllimport)
    00095 #      define AVIS_PUBLIC_DATA  extern __declspec(dllimport)
    00096 #    endif
    00097 #  else
    00098     /* Static links must use extern */
    00099 #    define AVIS_PUBLIC        extern
    00100 #    define AVIS_PUBLIC_DATA   extern
    00101 #  endif
    00102 #else
    00103 #  define AVIS_PUBLIC
    00104 #  define AVIS_PUBLIC_DATA   extern
    00105 #endif
    00106
    00107 #endif /* AVIS_DEFS_H_ */