FreeWRL / FreeX3D 4.3.0
pluginUtils.h
1/*
2
3
4FreeWRL plugin utilities header file.
5
6*/
7
8/****************************************************************************
9 This file is part of the FreeWRL/FreeX3D Distribution.
10
11 Copyright 2009 CRC Canada. (http://www.crc.gc.ca)
12
13 FreeWRL/FreeX3D is free software: you can redistribute it and/or modify
14 it under the terms of the GNU Lesser Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 FreeWRL/FreeX3D is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with FreeWRL/FreeX3D. If not, see <http://www.gnu.org/licenses/>.
25****************************************************************************/
26
27
28#ifndef __FREEWRL_PLUGIN_UTILS_H__
29#define __FREEWRL_PLUGIN_UTILS_H__
30
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36
37#define SMALLSTRINGSIZE 64
38#define STRINGSIZE 128
39#define LARGESTRINGSIZE 256
40
41#define PLUGIN_PORT 2009
42#define PLUGIN_TIMEOUT_SEC 10
43#define PLUGIN_TIMEOUT_NSEC 0
44
45#define PLUGIN_RETRY 2
46#define SLEEP_TIME 5
47
48#ifndef WIN32
49#define NO_ERROR 0
50#define SOCKET_ERROR -1000
51#endif
52#define SIGNAL_ERROR -1001
53
54#define UNUSED(v) ((void) v)
55
56
57typedef struct _urlRequest {
58 char url[FILENAME_MAX]; /* limit url length (defined in stdio.h) */
59 void *instance; /* NPP instance for plugin */
60 unsigned int notifyCode; /* NPN_GetURLNotify, NPP_URLNotify */
62
63
64const char* XEventToString(int type);
65const char* XErrorToString(int error);
66
67void URLencod (char *dest, const char *src, int maxlen);
68
69/* used by fw/fwWindow.c */
70void sendXwinToPlugin(void);
71
72#ifdef __cplusplus
73}
74#endif
75
76
77#endif /* __FREEWRL_PLUGIN_UTILS_H__ */