2 * Copyright (c) 1998,1999,2000
3 * Traakan, Inc., Los Altos, CA
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice unmodified, this list of conditions, and the following
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * This establishes the environment and options
35 * for the Glib "platform". That is, it reflects all of the ndmjoblib
36 * abstractions into the corresponding glib abstractions. This, combined
37 * with the O/S generic ndmos.h, are the foundation
40 * This file is #include'd by ndmos.h when
41 * selected by #ifdef's of NDMOS_ID.
43 * Refer to ndmos.h for explanations of the
44 * macros thar are or can be #define'd here.
51 #error rpc/rpc.h is required to compile ndmp-src
55 /* On Solaris platforms create platform specific environment for NDMP
56 if not we might see issues with rpc code, specifically with 64 bit
64 #include <sys/types.h>
66 #include <sys/socket.h>
67 #include <sys/fcntl.h>
69 #include <netinet/in.h>
70 #include <arpa/inet.h>
77 /* On some solaris distributions INADDR_NONE is not defined
78 hence define here.. "in_addr_t" is defined in netinet/in.h
82 #define INADDR_NONE ((in_addr_t)-1)
88 /* this may need to be autodetected, or NDMOS_MACRO_SET_SOCKADDR may need to be
89 * rewritten in terms of Amanda's sockaddr-util.h. According to ndmpjoblib,
90 * only FreeBDS has sin_len. */
91 #undef NDMOS_OPTION_HAVE_SIN_LEN
93 #define NDMOS_OPTION_TAPE_SIMULATOR
94 #define NDMOS_OPTION_ROBOT_SIMULATOR
96 #define NDMOS_OPTION_USE_SELECT_FOR_CHAN_POLL
98 #define NDMOS_API_BCOPY(S,D,N) g_memmove((void*)(D), (void*)(S), (N))
99 /* default: NDMOS_API_BZERO */
100 #define NDMOS_API_MALLOC(N) g_malloc((N))
101 #define NDMOS_API_FREE(P) g_free((void*)(P))
102 #define NDMOS_API_STRTOLL(P,PP,BASE) strtoll((P),(PP),(BASE))
103 #define NDMOS_API_STRDUP(S) g_strdup((S))
104 /* default: NDMOS_API_STREND (default: implemented in ndml_util.c) */
106 /* default: NDMOS_CONST_ALIGN */
107 /* default: NDMOS_CONST_EWOULDBLOCK */
108 /* default: NDMOS_CONST_TAPE_REC_MAX */
109 /* default: NDMOS_CONST_TAPE_REC_MIN */
110 /* default: NDMOS_CONST_PATH_MAX */
111 #define NDMOS_CONST_NDMOS_REVISION "Glib-2.2+"
113 #define NDMOS_MACRO_NEW(T) g_new(T, 1)
114 #define NDMOS_MACRO_NEWN(T,N) g_new(T, (N))
115 /* default: NDMOS_MACRO_ZEROFILL */
116 #define NDMOS_MACRO_SRAND() g_random_set_seed(time(0))
117 #define NDMOS_MACRO_RAND() g_random_int()
118 /* default: NDMOS_MACRO_OK_TAPE_REC_LEN */
124 #define assert g_assert