diff options
author | dos-reis <gdr@axiomatics.org> | 2010-11-28 15:08:36 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2010-11-28 15:08:36 +0000 |
commit | bbb5a69f0f2348adbbb8db960e5e45306b865683 (patch) | |
tree | 23f3039b350d61a402f3af97e8cc3ec06f08797e /src/include | |
parent | ab86c48186a05391f1c1fbc3f90759cc0caff45b (diff) | |
download | open-axiom-bbb5a69f0f2348adbbb8db960e5e45306b865683.tar.gz |
* lib/Makefile.in: Build libopen-axiom-core and libspad with a C++
compiler and linker.
* lib/bsdsignal.c: Fix C calling convention annotation.
* lib/cfuns-c.c: Likewise.
* lib/edin.c: Likewise.
* lib/sockio-c.c: Likewise.
* include/bsdsignal.h: Remove 'extern "C"'-block annotation.
* include/cfuns.h: Likewise.
* include/cursor.h: Likewise.
* include/edin.h: Likewise.
* include/fnct_key.h: Likewise.
* include/halloc.h: Likewise.
* include/hash.h: Likewise.
* include/openpty.h: Likewise.
* include/pixmap.h: Likewise.
* include/prt.h: Likewise.
* include/sockio.h: Likewise.
* include/spadcolors.h: Likewise.
* include/util.H1: Likewise.
* include/view.h: Likewise.
* include/wct.h: Likewise.
* include/open-axiom.h (OPENAXIOM_C_CALL): New macro.
(OPENAXIOM_C_EXPORT): Likewise.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/bsdsignal.h | 13 | ||||
-rw-r--r-- | src/include/cfuns.h | 64 | ||||
-rw-r--r-- | src/include/cursor.h | 8 | ||||
-rw-r--r-- | src/include/edin.h | 8 | ||||
-rw-r--r-- | src/include/fnct_key.h | 9 | ||||
-rw-r--r-- | src/include/halloc.h | 8 | ||||
-rw-r--r-- | src/include/hash.h | 18 | ||||
-rw-r--r-- | src/include/open-axiom.h | 37 | ||||
-rw-r--r-- | src/include/openpty.h | 8 | ||||
-rw-r--r-- | src/include/pixmap.h | 8 | ||||
-rw-r--r-- | src/include/prt.h | 8 | ||||
-rw-r--r-- | src/include/sockio.h | 175 | ||||
-rw-r--r-- | src/include/spadcolors.h | 13 | ||||
-rw-r--r-- | src/include/util.H1 | 8 | ||||
-rw-r--r-- | src/include/view.h | 2 | ||||
-rw-r--r-- | src/include/wct.h | 9 |
16 files changed, 140 insertions, 256 deletions
diff --git a/src/include/bsdsignal.h b/src/include/bsdsignal.h index ecbebebe..4c2a1992 100644 --- a/src/include/bsdsignal.h +++ b/src/include/bsdsignal.h @@ -1,7 +1,7 @@ /* Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd. All rights reserved. - Copyright (C) 2007-2008, Gabriel Dos Reis. + Copyright (C) 2007-2010, Gabriel Dos Reis. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -40,11 +40,6 @@ #include "open-axiom.h" -#ifdef __cplusplus -extern "C" { -#endif - - #ifdef SIGCHLD # define OPENAXIOM_SIGCHLD SIGCHLD #elif defined (SIGCLD) @@ -56,10 +51,6 @@ extern "C" { typedef void (* SignalHandlerFunc)(int); -OPENAXIOM_EXPORT SignalHandlerFunc bsdSignal(int, SignalHandlerFunc, int); - -#ifdef __cplusplus -} -#endif +OPENAXIOM_C_EXPORT SignalHandlerFunc bsdSignal(int, SignalHandlerFunc, int); #endif /* OPENAXIOM_BSDSIGNAL_included */ diff --git a/src/include/cfuns.h b/src/include/cfuns.h index 10f439d2..28e89d85 100644 --- a/src/include/cfuns.h +++ b/src/include/cfuns.h @@ -38,43 +38,35 @@ #include "open-axiom.h" -#ifdef __cplusplus -extern "C" { -#endif +OPENAXIOM_C_EXPORT int addtopath(char*); +OPENAXIOM_C_EXPORT int directoryp(char*); +OPENAXIOM_C_EXPORT int make_path_from_file(char*, char*); +OPENAXIOM_C_EXPORT int writeablep(char*); +OPENAXIOM_C_EXPORT int readablep(char*); +OPENAXIOM_C_EXPORT long findString(char*, char*); +OPENAXIOM_C_EXPORT int copyEnvValue(char*, char*); +OPENAXIOM_C_EXPORT int oa_chdir(const char*); +OPENAXIOM_C_EXPORT int oa_unlink(const char*); +OPENAXIOM_C_EXPORT int oa_rename(const char*, const char*); +OPENAXIOM_C_EXPORT int oa_mkdir(const char*); +OPENAXIOM_C_EXPORT int oa_system(const char*); +OPENAXIOM_C_EXPORT char* oa_getenv(const char*); +OPENAXIOM_C_EXPORT int oa_setenv(const char*, const char*); +OPENAXIOM_C_EXPORT int oa_getpid(void); +OPENAXIOM_C_EXPORT char* oa_getcwd(void); +OPENAXIOM_C_EXPORT int oa_access_file_for_read(const char*); +OPENAXIOM_C_EXPORT char* oa_dirname(const char*); +OPENAXIOM_C_EXPORT const char* oa_get_tmpdir(void); +OPENAXIOM_C_EXPORT int oa_copy_file(const char*, const char*); -OPENAXIOM_EXPORT int addtopath(char*); -OPENAXIOM_EXPORT int directoryp(char*); -OPENAXIOM_EXPORT int make_path_from_file(char*, char*); -OPENAXIOM_EXPORT int writeablep(char*); -OPENAXIOM_EXPORT int readablep(char*); -OPENAXIOM_EXPORT long findString(char*, char*); -OPENAXIOM_EXPORT int copyEnvValue(char*, char*); -OPENAXIOM_EXPORT int oa_chdir(const char*); -OPENAXIOM_EXPORT int oa_unlink(const char*); -OPENAXIOM_EXPORT int oa_rename(const char*, const char*); -OPENAXIOM_EXPORT int oa_mkdir(const char*); -OPENAXIOM_EXPORT int oa_system(const char*); -OPENAXIOM_EXPORT char* oa_getenv(const char*); -OPENAXIOM_EXPORT int oa_setenv(const char*, const char*); -OPENAXIOM_EXPORT int oa_getpid(void); -OPENAXIOM_EXPORT char* oa_getcwd(void); -OPENAXIOM_EXPORT int oa_access_file_for_read(const char*); -OPENAXIOM_EXPORT char* oa_dirname(const char*); -OPENAXIOM_EXPORT const char* oa_get_tmpdir(void); -OPENAXIOM_EXPORT int oa_copy_file(const char*, const char*); +OPENAXIOM_C_EXPORT double plus_infinity(void); +OPENAXIOM_C_EXPORT double minus_infinity(void); +OPENAXIOM_C_EXPORT double quiet_double_NaN(void); +OPENAXIOM_C_EXPORT openaxiom_byteorder oa_get_host_byteorder(void); -OPENAXIOM_EXPORT double plus_infinity(void); -OPENAXIOM_EXPORT double minus_infinity(void); -OPENAXIOM_EXPORT double quiet_double_NaN(void); -OPENAXIOM_EXPORT openaxiom_byteorder oa_get_host_byteorder(void); - -OPENAXIOM_EXPORT const char* oa_concatenate_string(const char*, const char*); -OPENAXIOM_EXPORT const char* oa_strcat(const char*, const char*); -OPENAXIOM_EXPORT char* oa_substr(const char*, const size_t, const size_t); -OPENAXIOM_EXPORT char** oa_split(const char*, const char*, int*); - -#ifdef __cplusplus -} -#endif +OPENAXIOM_C_EXPORT const char* oa_concatenate_string(const char*, const char*); +OPENAXIOM_C_EXPORT const char* oa_strcat(const char*, const char*); +OPENAXIOM_C_EXPORT char* oa_substr(const char*, const size_t, const size_t); +OPENAXIOM_C_EXPORT char** oa_split(const char*, const char*, int*); #endif /* OPENAXIOM_CFUNS_included */ diff --git a/src/include/cursor.h b/src/include/cursor.h index 7073786b..ac44357c 100644 --- a/src/include/cursor.h +++ b/src/include/cursor.h @@ -36,14 +36,6 @@ #ifndef OPENAXIOM_cursor_INCLUDED #define OPENAXIOM_cursor_INCLUDED -#ifdef __cplusplus -extern "C" { -#endif - extern int Cursor_shape(int ); -#ifdef __cplusplus -} -#endif - #endif /* OPENAXIOM_cursor_INCLUDED */ diff --git a/src/include/edin.h b/src/include/edin.h index 73c02b2b..65f77aeb 100644 --- a/src/include/edin.h +++ b/src/include/edin.h @@ -36,10 +36,6 @@ #ifndef OPENAXIOM_edin_INCLUDED #define OPENAXIOM_edin_INCLUDED -#ifdef __cplusplus -extern "C" { -#endif - extern void init_reader(void); extern void init_flag(int * , int ); extern void do_reading(void); @@ -58,8 +54,4 @@ extern void flagncpy(int * , int * , int ); extern void send_function_to_child(void); extern void send_buff_to_child(int ); -#ifdef __cplusplus -} -#endif - #endif /* OPENAXIOM_edin_INCLUDED */ diff --git a/src/include/fnct_key.h b/src/include/fnct_key.h index e0223961..812b62b6 100644 --- a/src/include/fnct_key.h +++ b/src/include/fnct_key.h @@ -36,11 +36,6 @@ #ifndef OPENAXIOM_fnct_key_INCLUDED #define OPENAXIOM_fnct_key_INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif - extern void set_editor_key(void); extern void define_function_keys(void); extern int get_key(int , char * ); @@ -48,8 +43,4 @@ extern int get_str(int , char * ); extern void null_fnct(int ); extern void handle_function_key(int , int ); -#ifdef __cplusplus -} -#endif - #endif /* OPENAXIOM_fnct_key_INCLUDED */ diff --git a/src/include/halloc.h b/src/include/halloc.h index 6df64c31..facead25 100644 --- a/src/include/halloc.h +++ b/src/include/halloc.h @@ -36,14 +36,6 @@ #ifndef OPENAXIOM_HALLOC #define OPENAXIOM_HALLOC -#ifdef __cplusplus -extern "C" { -#endif - extern char * halloc(int, const char*); -#ifdef __cplusplus -} -#endif - #endif /* OPENAXIOM_HALLOC */ diff --git a/src/include/hash.h b/src/include/hash.h index aadcec03..8f97754d 100644 --- a/src/include/hash.h +++ b/src/include/hash.h @@ -1,6 +1,8 @@ /* Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. All rights reserved. + Copyright (C) 2007-2010, Gabriel Dos Reis. + All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -34,27 +36,23 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef OPENAXIOM_HASH_INCLUDED #define OPENAXIOM_HASH_INCLUDED -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct HashEntry { +struct HashEntry { const char *key; /* pointer to key data */ char *data; /* Pointer to entry */ struct HashEntry *next; /* Link to next entry */ -} HashEntry; +}; typedef int (*EqualFunction)(const void*, const void*); typedef int (*HashcodeFunction)(const void*,int); typedef void (*MappableFunction) (const void*); typedef void (*FreeFunction) (void *); -typedef struct HashTable { +struct HashTable { HashEntry **table; /* the actual table */ int size; /* size of table */ int num_entries; /* number of elements in a hash table */ EqualFunction equal; /* equality predicate for keys */ HashcodeFunction hash_code; /* create hash code for a key */ -} HashTable; +}; extern char* alloc_string(const char*); extern HashEntry* hash_copy_entry(HashEntry*); @@ -69,8 +67,4 @@ extern char* hash_replace(HashTable*, char*, const char*); extern int string_equal(const char*, const char*); extern int string_hash(const char*, int size); -#ifdef __cplusplus -} -#endif - #endif /* OPENAXIOM_HASH_INCLUDED */ diff --git a/src/include/open-axiom.h b/src/include/open-axiom.h index fd0e7326..30cb3fd3 100644 --- a/src/include/open-axiom.h +++ b/src/include/open-axiom.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2007-2009, Gabriel Dos Reis. + Copyright (C) 2007-2010, Gabriel Dos Reis. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -36,6 +36,13 @@ #include "openaxiom-c-macros.h" +/* Annotation to request C calling convention */ +#ifdef __cplusplus +# define OPENAXIOM_C_CALL extern "C" +#else +# define OPENAXIOM_C_CALL +#endif + /* Cope with MS-platform oddities. */ #ifdef __WIN32__ # ifdef DLL_EXPORT @@ -51,6 +58,8 @@ # define OPENAXIOM_EXPORT /* nothing */ #endif /* OPENAXIOM_EXPORT */ +#define OPENAXIOM_C_EXPORT OPENAXIOM_C_CALL OPENAXIOM_EXPORT + #if defined(HAVE_STDINT_H) # include <stdint.h> #elif defined (HAVE_INTTYPES_H) @@ -68,10 +77,6 @@ typedef void* openaxiom_handle; #include <unistd.h> -#ifdef __cplusplus -extern "C" { -#endif - /* Do we have graphics support? */ #ifdef X_DISPLAY_MISSING # define OPENAXIOM_HAVE_GRAPHICS 0 @@ -80,22 +85,22 @@ extern "C" { #endif /* Byte order enumeration. */ -typedef enum openaxiom_byteorder { +enum openaxiom_byteorder { oa_unknown_endian, oa_little_endian, oa_big_endian -} openaxiom_byteorder; +}; /* Datatype for packaging information necessary tolaunch a process. */ -typedef struct openaxiom_process { +struct openaxiom_process { int argc; char** argv; int id; -} openaxiom_process; +}; -typedef enum openaxiom_spawn_flags { +enum openaxiom_spawn_flags { openaxiom_spawn_search_path = 0x01, openaxiom_spawn_replace = 0x02, -} openaxiom_spawn_flags; +}; /* Return the address of the data buffer `BUF'. */ @@ -130,12 +135,8 @@ openaxiom_sleep(int n) } -OPENAXIOM_EXPORT void oa_allocate_process_argv(openaxiom_process*, int); -OPENAXIOM_EXPORT int oa_spawn(openaxiom_process*, openaxiom_spawn_flags); -OPENAXIOM_EXPORT const char* oa_concatenate_string(const char*, const char*); - -#ifdef __cplusplus -} -#endif +OPENAXIOM_C_EXPORT void oa_allocate_process_argv(openaxiom_process*, int); +OPENAXIOM_C_EXPORT int oa_spawn(openaxiom_process*, openaxiom_spawn_flags); +OPENAXIOM_C_EXPORT const char* oa_concatenate_string(const char*, const char*); #endif /* OPENAXIOM_included */ diff --git a/src/include/openpty.h b/src/include/openpty.h index 24df8a0d..c76bb3d8 100644 --- a/src/include/openpty.h +++ b/src/include/openpty.h @@ -36,14 +36,6 @@ #ifndef OPENAXIOM_openpty_INCLUDED #define OPENAXIOM_openpty_INCLUDED -#ifdef __cplusplus -extern "C" { -#endif - extern int ptyopen(int*, int*, char*); -#ifdef __cplusplus -} -#endif - #endif /* OPENAXIOM_openpty_INCLUDED */ diff --git a/src/include/pixmap.h b/src/include/pixmap.h index 86f34437..a181b979 100644 --- a/src/include/pixmap.h +++ b/src/include/pixmap.h @@ -36,18 +36,10 @@ #ifndef OPENAXIOM_PIXMAP_included #define OPENAXIOM_PIXMAP_included -#ifdef __cplusplus -extern "C" { -#endif - extern int file_exists(char * ); extern FILE * zzopen(char * , char * ); extern void write_pixmap_file(Display * , int , char * , Window , int , int , int , int ); extern int read_pixmap_file(Display * , int , char * , XImage * * , int * , int * ); - -#ifdef __cplusplus -} -#endif #endif diff --git a/src/include/prt.h b/src/include/prt.h index 5df67134..a6d60e7f 100644 --- a/src/include/prt.h +++ b/src/include/prt.h @@ -36,10 +36,6 @@ #ifndef OPENAXIOM_ptr_INCLUDED #define OPENAXIOM_ptr_INCLUDED -#ifdef __cplusplus -extern "C" { -#endif - extern void myputchar(char ); extern void clear_buff(void); extern void move_end(void); @@ -60,8 +56,4 @@ extern void move_ahead(void); extern void move_back(void); extern void back_over_current_char(void); -#ifdef __cplusplus -} -#endif - #endif /* OPENAXIOM_ptr_INCLUDED */ diff --git a/src/include/sockio.h b/src/include/sockio.h index 07d9097a..03893967 100644 --- a/src/include/sockio.h +++ b/src/include/sockio.h @@ -1,7 +1,7 @@ /* Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd. All rights reserved. - Copyright (C) 2007-2008, Gabriel Dos Reis + Copyright (C) 2007-2010, Gabriel Dos Reis All rights reserved. Redistribution and use in source and binary forms, with or without @@ -53,11 +53,6 @@ #include "openaxiom-c-macros.h" #include "open-axiom.h" -#ifdef __cplusplus -extern "C" { -#endif - - /* On Windows, a socket identifier is not a file descriptor. It is represented by an integer type, but that integer type is not just plain int as in the Unix world. It is an unsigned integer. @@ -73,7 +68,7 @@ typedef int openaxiom_filedesc; #endif typedef int openaxiom_port; -typedef struct openaxiom_sio { +struct openaxiom_sio { openaxiom_socket socket; /* descriptor of this socket I/O endpoint. */ int type; /* socket type (AF_UNIX or AF_INET) */ int purpose; /* can be SessionManager, GraphicsServer, etc. */ @@ -86,103 +81,102 @@ typedef struct openaxiom_sio { } addr; char *host_name; /* name of foreign host if type == AF_INET */ size_t nbytes_pending; /* pending bytes for read. */ -} openaxiom_sio; +}; -OPENAXIOM_EXPORT openaxiom_filedesc +OPENAXIOM_C_EXPORT openaxiom_filedesc oa_open_local_client_stream_socket(const char*); -OPENAXIOM_EXPORT int oa_inet_pton(const char*, int, openaxiom_byte*); -OPENAXIOM_EXPORT int oa_get_host_address(const char*, int, openaxiom_byte*); -OPENAXIOM_EXPORT int oa_open_local_server_stream_socket(const char*); -OPENAXIOM_EXPORT openaxiom_socket +OPENAXIOM_C_EXPORT int oa_inet_pton(const char*, int, openaxiom_byte*); +OPENAXIOM_C_EXPORT int oa_get_host_address(const char*, int, openaxiom_byte*); +OPENAXIOM_C_EXPORT int oa_open_local_server_stream_socket(const char*); +OPENAXIOM_C_EXPORT openaxiom_socket oa_connect_ip_port_stream(const openaxiom_byte*, int, openaxiom_port); -OPENAXIOM_EXPORT int oa_socket_write(openaxiom_socket, +OPENAXIOM_C_EXPORT int oa_socket_write(openaxiom_socket, const openaxiom_byte*, int); -OPENAXIOM_EXPORT int oa_socket_write_byte(openaxiom_socket, openaxiom_byte); +OPENAXIOM_C_EXPORT int oa_socket_write_byte(openaxiom_socket, openaxiom_byte); -OPENAXIOM_EXPORT int oa_socket_read(openaxiom_socket, +OPENAXIOM_C_EXPORT int oa_socket_read(openaxiom_socket, openaxiom_byte*, int); -OPENAXIOM_EXPORT int oa_socket_read_byte(openaxiom_socket); +OPENAXIOM_C_EXPORT int oa_socket_read_byte(openaxiom_socket); -OPENAXIOM_EXPORT void oa_close_socket(openaxiom_socket); +OPENAXIOM_C_EXPORT void oa_close_socket(openaxiom_socket); -OPENAXIOM_EXPORT int +OPENAXIOM_C_EXPORT int oa_filedesc_write(openaxiom_filedesc, const openaxiom_byte*, int); -OPENAXIOM_EXPORT int +OPENAXIOM_C_EXPORT int oa_filedesc_read(openaxiom_filedesc, openaxiom_byte*, int); -OPENAXIOM_EXPORT int oa_filedesc_close(openaxiom_filedesc); +OPENAXIOM_C_EXPORT int oa_filedesc_close(openaxiom_filedesc); -OPENAXIOM_EXPORT int sread(openaxiom_sio*, openaxiom_byte*, int, const char*); -OPENAXIOM_EXPORT int swrite(openaxiom_sio*, const openaxiom_byte*, int, +OPENAXIOM_C_EXPORT int sread(openaxiom_sio*, openaxiom_byte*, int, const char*); +OPENAXIOM_C_EXPORT int swrite(openaxiom_sio*, const openaxiom_byte*, int, const char*); -OPENAXIOM_EXPORT int wait_for_client_read(openaxiom_sio*, openaxiom_byte*, +OPENAXIOM_C_EXPORT int wait_for_client_read(openaxiom_sio*, openaxiom_byte*, int, const char*); -OPENAXIOM_EXPORT int wait_for_client_write(openaxiom_sio*, +OPENAXIOM_C_EXPORT int wait_for_client_write(openaxiom_sio*, const openaxiom_byte*, int, const char*); -OPENAXIOM_EXPORT int make_server_name(char*, const char*); -OPENAXIOM_EXPORT int make_server_number(void); -OPENAXIOM_EXPORT openaxiom_sio* connect_to_local_server(char*, int, int); -OPENAXIOM_EXPORT int open_server(const char*); -OPENAXIOM_EXPORT int accept_connection(openaxiom_sio*); -OPENAXIOM_EXPORT int sselect(int, fd_set*, fd_set*, fd_set*, void*); -OPENAXIOM_EXPORT void close_socket(openaxiom_socket, const char*); - -OPENAXIOM_EXPORT int get_int(openaxiom_sio*); -OPENAXIOM_EXPORT double get_float(openaxiom_sio*); -OPENAXIOM_EXPORT double sock_get_float(int); -OPENAXIOM_EXPORT int get_sfloats(openaxiom_sio*, float*, int); -OPENAXIOM_EXPORT char* get_string(openaxiom_sio*); -OPENAXIOM_EXPORT void sigpipe_handler(int); -OPENAXIOM_EXPORT int fill_buf(openaxiom_sio*, openaxiom_byte*, int, +OPENAXIOM_C_EXPORT int make_server_name(char*, const char*); +OPENAXIOM_C_EXPORT int make_server_number(void); +OPENAXIOM_C_EXPORT openaxiom_sio* connect_to_local_server(char*, int, int); +OPENAXIOM_C_EXPORT int open_server(const char*); +OPENAXIOM_C_EXPORT int accept_connection(openaxiom_sio*); +OPENAXIOM_C_EXPORT int sselect(int, fd_set*, fd_set*, fd_set*, void*); +OPENAXIOM_C_EXPORT void close_socket(openaxiom_socket, const char*); + +OPENAXIOM_C_EXPORT int get_int(openaxiom_sio*); +OPENAXIOM_C_EXPORT double get_float(openaxiom_sio*); +OPENAXIOM_C_EXPORT double sock_get_float(int); +OPENAXIOM_C_EXPORT int get_sfloats(openaxiom_sio*, float*, int); +OPENAXIOM_C_EXPORT char* get_string(openaxiom_sio*); +OPENAXIOM_C_EXPORT void sigpipe_handler(int); +OPENAXIOM_C_EXPORT int fill_buf(openaxiom_sio*, openaxiom_byte*, int, const char*); -OPENAXIOM_EXPORT int sock_get_int(int); -OPENAXIOM_EXPORT int get_ints(openaxiom_sio*, int*, int); -OPENAXIOM_EXPORT int sock_get_ints(int, int*, int); -OPENAXIOM_EXPORT int send_int(openaxiom_sio*, int); -OPENAXIOM_EXPORT int sock_send_int(int, int); -OPENAXIOM_EXPORT int send_ints(openaxiom_sio*, const int*, int); -OPENAXIOM_EXPORT int sock_send_ints(int, const int*, int); -OPENAXIOM_EXPORT int send_string(openaxiom_sio*, const char*); -OPENAXIOM_EXPORT int send_string_len(openaxiom_sio*, const char*, int); -OPENAXIOM_EXPORT int sock_send_string(int, const char*); -OPENAXIOM_EXPORT int sock_send_string_len(int, const char*, int); -OPENAXIOM_EXPORT int send_strings(openaxiom_sio*, const char**, int); -OPENAXIOM_EXPORT int sock_send_strings(int, const char**, int); -OPENAXIOM_EXPORT char* sock_get_string(int); -OPENAXIOM_EXPORT char* get_string_buf(openaxiom_sio*, char*, int); -OPENAXIOM_EXPORT char* sock_get_string_buf(int, char*, int); -OPENAXIOM_EXPORT int get_strings(openaxiom_sio*, char**, int); -OPENAXIOM_EXPORT int sock_get_strings(int, char**, int); -OPENAXIOM_EXPORT int send_float(openaxiom_sio*, double); -OPENAXIOM_EXPORT int sock_send_float(int, double); -OPENAXIOM_EXPORT int send_sfloats(openaxiom_sio*, const float*, int); -OPENAXIOM_EXPORT int sock_send_sfloats(int, const float*, int); -OPENAXIOM_EXPORT int send_floats(openaxiom_sio*, const double*, int); -OPENAXIOM_EXPORT int sock_send_floats(int, const double*, int); -OPENAXIOM_EXPORT int sock_get_sfloats(int, float*, int); -OPENAXIOM_EXPORT int get_floats(openaxiom_sio*, double*, int); -OPENAXIOM_EXPORT int sock_get_floats(int, double*, int); -OPENAXIOM_EXPORT int wait_for_client_kill(openaxiom_sio*, int); -OPENAXIOM_EXPORT int sock_get_remote_fd(int); -OPENAXIOM_EXPORT int send_signal(openaxiom_sio*, int); -OPENAXIOM_EXPORT int sock_send_signal(int, int); -OPENAXIOM_EXPORT int send_wakeup(openaxiom_sio*); -OPENAXIOM_EXPORT int sock_send_wakeup(int); -OPENAXIOM_EXPORT void remote_stdio(openaxiom_sio*); -OPENAXIOM_EXPORT void init_purpose_table(void); -OPENAXIOM_EXPORT void get_socket_type(openaxiom_sio*); -OPENAXIOM_EXPORT int sock_accept_connection(int); -OPENAXIOM_EXPORT void redirect_stdio(openaxiom_sio*); -OPENAXIOM_EXPORT void init_socks(void); -OPENAXIOM_EXPORT int server_switch(void); -OPENAXIOM_EXPORT void flush_stdout(void); -OPENAXIOM_EXPORT void print_line(const char*); - +OPENAXIOM_C_EXPORT int sock_get_int(int); +OPENAXIOM_C_EXPORT int get_ints(openaxiom_sio*, int*, int); +OPENAXIOM_C_EXPORT int sock_get_ints(int, int*, int); +OPENAXIOM_C_EXPORT int send_int(openaxiom_sio*, int); +OPENAXIOM_C_EXPORT int sock_send_int(int, int); +OPENAXIOM_C_EXPORT int send_ints(openaxiom_sio*, const int*, int); +OPENAXIOM_C_EXPORT int sock_send_ints(int, const int*, int); +OPENAXIOM_C_EXPORT int send_string(openaxiom_sio*, const char*); +OPENAXIOM_C_EXPORT int send_string_len(openaxiom_sio*, const char*, int); +OPENAXIOM_C_EXPORT int sock_send_string(int, const char*); +OPENAXIOM_C_EXPORT int sock_send_string_len(int, const char*, int); +OPENAXIOM_C_EXPORT int send_strings(openaxiom_sio*, const char**, int); +OPENAXIOM_C_EXPORT int sock_send_strings(int, const char**, int); +OPENAXIOM_C_EXPORT char* sock_get_string(int); +OPENAXIOM_C_EXPORT char* get_string_buf(openaxiom_sio*, char*, int); +OPENAXIOM_C_EXPORT char* sock_get_string_buf(int, char*, int); +OPENAXIOM_C_EXPORT int get_strings(openaxiom_sio*, char**, int); +OPENAXIOM_C_EXPORT int sock_get_strings(int, char**, int); +OPENAXIOM_C_EXPORT int send_float(openaxiom_sio*, double); +OPENAXIOM_C_EXPORT int sock_send_float(int, double); +OPENAXIOM_C_EXPORT int send_sfloats(openaxiom_sio*, const float*, int); +OPENAXIOM_C_EXPORT int sock_send_sfloats(int, const float*, int); +OPENAXIOM_C_EXPORT int send_floats(openaxiom_sio*, const double*, int); +OPENAXIOM_C_EXPORT int sock_send_floats(int, const double*, int); +OPENAXIOM_C_EXPORT int sock_get_sfloats(int, float*, int); +OPENAXIOM_C_EXPORT int get_floats(openaxiom_sio*, double*, int); +OPENAXIOM_C_EXPORT int sock_get_floats(int, double*, int); +OPENAXIOM_C_EXPORT int wait_for_client_kill(openaxiom_sio*, int); +OPENAXIOM_C_EXPORT int sock_get_remote_fd(int); +OPENAXIOM_C_EXPORT int send_signal(openaxiom_sio*, int); +OPENAXIOM_C_EXPORT int sock_send_signal(int, int); +OPENAXIOM_C_EXPORT int send_wakeup(openaxiom_sio*); +OPENAXIOM_C_EXPORT int sock_send_wakeup(int); +OPENAXIOM_C_EXPORT void remote_stdio(openaxiom_sio*); +OPENAXIOM_C_EXPORT void init_purpose_table(void); +OPENAXIOM_C_EXPORT void get_socket_type(openaxiom_sio*); +OPENAXIOM_C_EXPORT int sock_accept_connection(int); +OPENAXIOM_C_EXPORT void redirect_stdio(openaxiom_sio*); +OPENAXIOM_C_EXPORT void init_socks(void); +OPENAXIOM_C_EXPORT int server_switch(void); +OPENAXIOM_C_EXPORT void flush_stdout(void); +OPENAXIOM_C_EXPORT void print_line(const char*); #define MaxClients 150 @@ -219,15 +213,10 @@ OPENAXIOM_EXPORT void print_line(const char*); /* table of dedicated socket types */ -OPENAXIOM_EXPORT extern openaxiom_sio *purpose_table[]; -OPENAXIOM_EXPORT extern openaxiom_sio server[]; -OPENAXIOM_EXPORT extern openaxiom_sio clients[]; -OPENAXIOM_EXPORT extern fd_set socket_mask; -OPENAXIOM_EXPORT extern fd_set server_mask; - - -#ifdef __cplusplus -} -#endif +OPENAXIOM_C_EXPORT openaxiom_sio *purpose_table[]; +OPENAXIOM_C_EXPORT openaxiom_sio server[]; +OPENAXIOM_C_EXPORT openaxiom_sio clients[]; +OPENAXIOM_C_EXPORT fd_set socket_mask; +OPENAXIOM_C_EXPORT fd_set server_mask; #endif /* OPENAXIOM_SOCKIO_included */ diff --git a/src/include/spadcolors.h b/src/include/spadcolors.h index c244cc6f..63621599 100644 --- a/src/include/spadcolors.h +++ b/src/include/spadcolors.h @@ -1,6 +1,8 @@ /* Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. All rights reserved. + Copyright (C) 2007-2010, Gabriel Dos Reis + All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -37,10 +39,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <X11/Xlib.h> #include "rgb.h" -#ifdef __cplusplus -extern "C" { -#endif - #define numOfColors 240 #define totalHuesConst 27 #define totalShadesConst 5 @@ -80,11 +78,4 @@ extern int scrn; #define maxColors DisplayCells(dsply,scrn)-1 - - -#ifdef __cplusplus -} -#endif - - #endif /* OPENAXIOM_SPADCOLORS_included */ diff --git a/src/include/util.H1 b/src/include/util.H1 index c60bd374..bed0da32 100644 --- a/src/include/util.H1 +++ b/src/include/util.H1 @@ -1,14 +1,6 @@ -#ifdef __cplusplus -extern "C" { -#endif - extern int checker(int , int , char * ); extern char * getmemWithLine(int , char * , int ); extern char * saymemWithLine(char * , int , int , int ); extern void myfree(void * , int ); extern XPoint getWindowPositionXY(Display * , Window ); extern XPoint getWindowSizeXY(Display * , Window ); - -#ifdef __cplusplus -} -#endif diff --git a/src/include/view.h b/src/include/view.h index 196a6019..3a02a187 100644 --- a/src/include/view.h +++ b/src/include/view.h @@ -1,7 +1,7 @@ /* Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd. All rights reserved. - Copyright (C) 2007-2008, Gabriel Dos Reis. + Copyright (C) 2007-2010, Gabriel Dos Reis. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/include/wct.h b/src/include/wct.h index b61cd233..bc7a3604 100644 --- a/src/include/wct.h +++ b/src/include/wct.h @@ -36,10 +36,6 @@ #ifndef OPENAXIOM_wct_INCLUDED #define OPENAXIOM_wct_INCLUDED -#ifdef __cplusplus -extern "C" { -#endif - extern time_t ftime(char * ); extern void fatal(char * , char * ); extern off_t fsize(char * ); @@ -66,9 +62,4 @@ extern void skim_wct(void); extern void rescan_wct(void); extern void find_wct(void); - -#ifdef __cplusplus -} -#endif - #endif /* OPENAXIOM_wct_INCLUDED */ |