~ubuntu-branches/ubuntu/lucid/nspluginwrapper/lucid

« back to all changes in this revision

Viewing changes to src/sysdeps.h

  • Committer: Bazaar Package Importer
  • Author(s): Rob Andrews
  • Date: 2007-05-10 12:17:09 UTC
  • Revision ID: james.westby@ubuntu.com-20070510121709-xb8fx1cmr6kae2ba
Tags: upstream-0.9.91.4
ImportĀ upstreamĀ versionĀ 0.9.91.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  sysdeps.h - System dependent definitions
 
3
 *
 
4
 *  nspluginwrapper (C) 2005-2007 Gwenole Beauchesne
 
5
 *
 
6
 *  This program is free software; you can redistribute it and/or modify
 
7
 *  it under the terms of the GNU General Public License as published by
 
8
 *  the Free Software Foundation; either version 2 of the License, or
 
9
 *  (at your option) any later version.
 
10
 *
 
11
 *  This program is distributed in the hope that it will be useful,
 
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 *  GNU General Public License for more details.
 
15
 *
 
16
 *  You should have received a copy of the GNU General Public License
 
17
 *  along with this program; if not, write to the Free Software
 
18
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
19
 */
 
20
 
 
21
#ifndef SYSDEPS_H
 
22
#define SYSDEPS_H
 
23
 
 
24
#if !defined(__STDC__) || (__STDC_VERSION__ < 199901L)
 
25
#error "Your compiler is not ISO. Get a real one."
 
26
#endif
 
27
 
 
28
#include "config.h"
 
29
 
 
30
/* XXX detect popen() et al. at configure time */
 
31
#define _XOPEN_SOURCE 600
 
32
 
 
33
#include <stdio.h>
 
34
#include <stdlib.h>
 
35
#include <stdint.h>
 
36
#include <string.h>
 
37
#include <time.h>
 
38
#include <limits.h>
 
39
 
 
40
// NSPluginWrapper paths and identification strings
 
41
#define NPW_CONNECTION_PATH "/org/wrapper/NSPlugins"
 
42
#define NPW_VIEWER_BASE "npviewer"
 
43
#define NPW_VIEWER NPW_VIEWER_BASE
 
44
#define NPW_WRAPPER_BASE "npwrapper"
 
45
#define NPW_WRAPPER NPW_WRAPPER_BASE ".so"
 
46
#define NPW_OLD_DEFAULT_PLUGIN_PATH NPW_LIBDIR "/" HOST_ARCH "/" NPW_WRAPPER
 
47
#define NPW_DEFAULT_PLUGIN_PATH NPW_LIBDIR "/" HOST_ARCH "/" HOST_OS "/" NPW_WRAPPER
 
48
#define NPW_PLUGIN_IDENT "NPW:" NPW_VERSION
 
49
#define NPW_PLUGIN_IDENT_SIZE 32
 
50
typedef struct __attribute__((packed)) {
 
51
  char ident[NPW_PLUGIN_IDENT_SIZE];
 
52
  char path[PATH_MAX];
 
53
  time_t mtime;
 
54
  char target_arch[65];
 
55
  char target_os[65];
 
56
} NPW_PluginInfo;
 
57
 
 
58
#if defined(BUILD_XPCOM)
 
59
#define NPW_COMPONENT_NAME "XPCOM  "
 
60
#elif defined(BUILD_WRAPPER)
 
61
#define NPW_COMPONENT_NAME "Wrapper"
 
62
#elif defined(BUILD_VIEWER)
 
63
#define NPW_COMPONENT_NAME "Viewer "
 
64
#endif
 
65
 
 
66
// Boolean types
 
67
#ifndef __cplusplus
 
68
#ifdef HAVE_STDBOOL_H
 
69
#include <stdbool.h>
 
70
#else
 
71
#ifndef __bool_true_false_are_defined
 
72
#define __bool_true_false_are_defined 1
 
73
#define bool _Bool
 
74
#ifndef true
 
75
#define true 1
 
76
#endif
 
77
#ifndef false
 
78
#define false 0
 
79
#endif
 
80
#endif
 
81
#endif
 
82
#endif
 
83
 
 
84
#endif /* SYSDEPS_H */