commit: r483 - in libspreadutil/trunk: include src
[email protected] Mon, 05 Mar 2012 14:36:45 -0500
| Newsgroups | gmane.network.spread.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: jonathan Date: 2012-03-05 14:36:45 -0500 (Mon, 05 Mar 2012) New Revision: 483 Added: libspreadutil/trunk/include/spu_alarm.h libspreadutil/trunk/include/spu_alarm_types.h libspreadutil/trunk/include/spu_data_link.h libspreadutil/trunk/include/spu_events.h libspreadutil/trunk/include/spu_memory.h libspreadutil/trunk/include/spu_objects.h libspreadutil/trunk/include/spu_objects_local.h libspreadutil/trunk/include/spu_system_defs.h libspreadutil/trunk/include/spu_system_defs_autoconf.h libspreadutil/trunk/include/spu_system_defs_windows.h Removed: libspreadutil/trunk/include/alarm.h libspreadutil/trunk/include/alarm_types.h libspreadutil/trunk/include/data_link.h libspreadutil/trunk/include/memory.h libspreadutil/trunk/include/objects.h libspreadutil/trunk/include/objects_local.h libspreadutil/trunk/include/sp_events.h libspreadutil/trunk/include/system_defs.h libspreadutil/trunk/include/system_defs_autoconf.h libspreadutil/trunk/include/system_defs_windows.h Modified: libspreadutil/trunk/src/alarm.c libspreadutil/trunk/src/data_link.c libspreadutil/trunk/src/events.c libspreadutil/trunk/src/memory.c Log: Rename all header files to have spu_ prefix. Update source files. Deleted: libspreadutil/trunk/include/alarm.h =================================================================== --- libspreadutil/trunk/include/alarm.h 2012-03-05 19:32:04 UTC (rev 482) +++ libspreadutil/trunk/include/alarm.h 2012-03-05 19:36:45 UTC (rev 483) @@ -1,117 +0,0 @@ -/* - * The Spread Toolkit. - * - * The contents of this file are subject to the Spread Open-Source - * License, Version 1.0 (the ``License''); you may not use - * this file except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.spread.org/license/ - * - * or in the file ``license.txt'' found in this distribution. - * - * Software distributed under the License is distributed on an AS IS basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Creators of Spread are: - * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz. - * - * Copyright (C) 1993-2009 Spread Concepts LLC <[email protected]> - * - * All Rights Reserved. - * - * Major Contributor(s): - * --------------- - * Ryan Caudy [email protected] - contributions to process groups. - * Claudiu Danilov [email protected] - scalable wide area support. - * Cristina Nita-Rotaru [email protected] - group communication security. - * Theo Schlossnagle [email protected] - Perl, autoconf, old skiplist. - * Dan Schoenblum [email protected] - Java interface. - * - */ - - -#ifndef INC_ALARM -#define INC_ALARM - -#include <stdio.h> -#include "system.h" - -/* Type for Alarm realtime handler functions */ -typedef int (alarm_realtime_handler)( int16, int32, char *, size_t, char *, size_t); - - -/* This includes the custom types for each project */ -#include "alarm_types.h" - -/* These are always defined for any project using Alarm */ -#define ALL 0xffffffff -#define NONE 0x00000000 - -/* Priority levels */ -#define SPLOG_DEBUG 0x0001 /* Program information that is only useful for debugging. - Will normally be turned off in operation. */ -#define SPLOG_INFO 0x0002 /* Program reports information that may be useful for - performance tuning, analysis, or operational checks. */ -#define SPLOG_WARNING 0x0003 /* Program encountered a situation that is not erroneous, - but is uncommon and may indicate an error. */ -#define SPLOG_ERROR 0x0004 /* Program encountered an error that can be recovered from. */ -#define SPLOG_CRITICAL 0x0005 /* Program will not exit, but has only temporarily recovered - and without help may soon fail. */ -#define SPLOG_FATAL 0x0006 /* Program will exit() or abort(). */ - -#define SPLOG_PRINT 0x0007 /* Program should always print this information */ - -#define SPLOG_PRIORITY_FIELDS 0x000f - -/* Feature Flags for Priority field */ -#define SPLOG_NODATE 0x0010 /* Program should omit the datestamp at the beginning of the message. */ -#define SPLOG_REALTIME 0x0020 /* This message should be disseminated through the realtime handler if possible. - This is used for alerts you want sent now and not just logged (they are also logged). */ -#define SPLOG_PRIORITY_FLAGS 0x00f0 - -#ifdef HAVE_GOOD_VARGS -void Alarmp( int16 priority, int32 type, char *message, ...); -void Alarm( int32 type, char *message, ...); - -#else -void Alarm(); -#endif - -void Alarm_set_output(char *filename); - -void Alarm_enable_timestamp(const char *format); -void Alarm_enable_timestamp_high_res(const char *format); -void Alarm_disable_timestamp(void); - -void Alarm_set_types(int32 mask); -void Alarm_clear_types(int32 mask); -int32 Alarm_get_types(void); - -void Alarm_set_priority(int16 priority); -int16 Alarm_get_priority(void); - -void Alarm_set_realtime_print_handler( alarm_realtime_handler *output_message_function ); - -void Alarm_set_interactive(void); -int Alarm_get_interactive(void); - -#define IPF "%d.%d.%d.%d" - -#define IP1(address) ( (int) ( ( (address) >> 24 ) & 0xFF ) ) -#define IP2(address) ( (int) ( ( (address) >> 16 ) & 0xFF ) ) -#define IP3(address) ( (int) ( ( (address) >> 8 ) & 0xFF ) ) -#define IP4(address) ( (int) ( ( (address) >> 0 ) & 0xFF ) ) - -#define IP(address) IP1(address), IP2(address), IP3(address), IP4(address) - -#define IP1_NET(address) ( (int) ( (unsigned char*) &(address) )[0] ) -#define IP2_NET(address) ( (int) ( (unsigned char*) &(address) )[1] ) -#define IP3_NET(address) ( (int) ( (unsigned char*) &(address) )[2] ) -#define IP4_NET(address) ( (int) ( (unsigned char*) &(address) )[3] ) - -#define IP_NET(address) IP1_NET(address), IP2_NET(address), IP3_NET(address), IP4_NET(address) - -#endif /* INC_ALARM */ Deleted: libspreadutil/trunk/include/alarm_types.h =================================================================== --- libspreadutil/trunk/include/alarm_types.h 2012-03-05 19:32:04 UTC (rev 482) +++ libspreadutil/trunk/include/alarm_types.h 2012-03-05 19:36:45 UTC (rev 483) @@ -1,82 +0,0 @@ -/* - * The Spread Toolkit. - * - * The contents of this file are subject to the Spread Open-Source - * License, Version 1.0 (the ``License''); you may not use - * this file except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.spread.org/license/ - * - * or in the file ``license.txt'' found in this distribution. - * - * Software distributed under the License is distributed on an AS IS basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Creators of Spread are: - * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz. - * - * Copyright (C) 1993-2006 Spread Concepts LLC <[email protected]> - * - * All Rights Reserved. - * - * Major Contributor(s): - * --------------- - * Ryan Caudy [email protected] - contributions to process groups. - * Cristina Nita-Rotaru [email protected] - group communication security. - * Theo Schlossnagle [email protected] - Perl, autoconf, old skiplist. - * Dan Schoenblum [email protected] - Java interface. - * - * - * This file is also licensed by Spread Concepts LLC under the Spines - * Open-Source License, version 1.0. You may obtain a copy of the - * Spines Open-Source License, version 1.0 at: - * - * http://www.spines.org/LICENSE.txt - * - * or in the file ``LICENSE.txt'' found in this distribution. - * - */ - - -#ifndef INC_ALARM_TYPES -#define INC_ALARM_TYPES - -/* List of type values that are valid for this project. - * This list can be customized for each user of Alarm library. - * The defines must be consistent amoung all code that will be compiled together, - * but can be different for different executables - */ -#define DEBUG 0x00000001 -#define EXIT 0x00000002 -#define PRINT 0x00000004 -/* new type to replace general prints */ -#define SYSTEM 0x00000004 - -#define DATA_LINK 0x00000010 -#define NETWORK 0x00000020 -#define PROTOCOL 0x00000040 -#define SESSION 0x00000080 -//#define CONF 0x00000100 Clash with an OpenSSL definition -#define MEMB 0x00000200 -#define FLOW_CONTROL 0x00000400 -#define STATUS 0x00000800 -#define EVENTS 0x00001000 -#define GROUPS 0x00002000 - -#define HOP 0x00004000 -#define OBJ_HANDLER 0x00008000 -#define MEMORY 0x00010000 -#define ROUTE 0x00020000 -#define QOS 0x00040000 -#define RING 0x00080000 -#define TCP_HOP 0x00100000 - -#define SKIPLIST 0x00200000 -#define ACM 0x00400000 - -#define SECURITY 0x00800000 - -#endif /* INC_ALARM_TYPES */ Deleted: libspreadutil/trunk/include/data_link.h =================================================================== --- libspreadutil/trunk/include/data_link.h 2012-03-05 19:32:04 UTC (rev 482) +++ libspreadutil/trunk/include/data_link.h 2012-03-05 19:36:45 UTC (rev 483) @@ -1,58 +0,0 @@ -/* - * The Spread Toolkit. - * - * The contents of this file are subject to the Spread Open-Source - * License, Version 1.0 (the ``License''); you may not use - * this file except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.spread.org/license/ - * - * or in the file ``license.txt'' found in this distribution. - * - * Software distributed under the License is distributed on an AS IS basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Creators of Spread are: - * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz. - * - * Copyright (C) 1993-2009 Spread Concepts LLC <[email protected]> - * - * All Rights Reserved. - * - * Major Contributor(s): - * --------------- - * Ryan Caudy [email protected] - contributions to process groups. - * Claudiu Danilov [email protected] - scalable wide area support. - * Cristina Nita-Rotaru [email protected] - group communication security. - * Theo Schlossnagle [email protected] - Perl, autoconf, old skiplist. - * Dan Schoenblum [email protected] - Java interface. - * - */ - - -#ifndef INC_DATA_LINK -#define INC_DATA_LINK - -#include "system.h" -#include "scatter.h" - -#define MAX_PACKET_SIZE 1472 /*1472 = 1536-64 (of udp)*/ - -#define SEND_CHANNEL 0x00000001 -#define RECV_CHANNEL 0x00000002 -#define NO_LOOP 0x00000004 -#define REUSE_ADDR 0x00000008 - -#define IS_MCAST_ADDR(addr) ( ( (addr) & 0xF0000000 ) == 0xE0000000 ) -#define IS_MCAST_ADDR_NET(addr) ( ( (unsigned char*) &(addr) )[0] == 0xE0 ) - -channel DL_init_channel( int32 channel_type, int16 port, int32 mcast_address, int32 interface_address ); -void DL_close_channel(channel chan); -int DL_send( channel chan, int32 address, int16 port, sys_scatter *scat ); -int DL_recv( channel chan, sys_scatter *scat ); -int DL_recvfrom( channel chan, sys_scatter *scat, int *src_address, unsigned short *src_port ); - -#endif /* INC_DATA_LINK */ Deleted: libspreadutil/trunk/include/memory.h =================================================================== --- libspreadutil/trunk/include/memory.h 2012-03-05 19:32:04 UTC (rev 482) +++ libspreadutil/trunk/include/memory.h 2012-03-05 19:36:45 UTC (rev 483) @@ -1,175 +0,0 @@ -/* - * The Spread Toolkit. - * - * The contents of this file are subject to the Spread Open-Source - * License, Version 1.0 (the ``License''); you may not use - * this file except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.spread.org/license/ - * - * or in the file ``license.txt'' found in this distribution. - * - * Software distributed under the License is distributed on an AS IS basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Creators of Spread are: - * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz. - * - * Copyright (C) 1993-2009 Spread Concepts LLC <[email protected]> - * - * All Rights Reserved. - * - * Major Contributor(s): - * --------------- - * Ryan Caudy [email protected] - contributions to process groups. - * Claudiu Danilov [email protected] - scalable wide area support. - * Cristina Nita-Rotaru [email protected] - group communication security. - * Theo Schlossnagle [email protected] - Perl, autoconf, old skiplist. - * Dan Schoenblum [email protected] - Java interface. - * - */ - - -#ifndef MEMORY_H -#define MEMORY_H - -#include "system.h" - -/******************************************************************************* - * Special Object type used for - * NON-OBJECT Oriented allocates (traditional Malloc/free with arbitrary sizes) - * 0 is never a valid object type for any real object (they start at 1) - *******************************************************************************/ -#define BLOCK_OBJECT 0 - - -/************************************ - * Function Declarations - ************************************/ - -/* Input: valid object type, size of object, threshold/watermark value for this object, - * number of initial objects to create - * Output: error code - * Effects: registers type, sets watermark for type,creates initial memory buffers and updates global vars - * Should ONLY be called once per execution of the program, but must be called before any other - * memory management function is used on that object - */ -int Mem_init_object(int32u obj_type, int32u size, unsigned int threshold, unsigned int initial); - -/* This calls Mem_init_object and if any error results it EXIT's with a printed error */ -void Mem_init_object_abort( int32u obj_type, int32u size, unsigned int threshold, unsigned int initial ); - -/* This initializes the status reporting of the memory module and should be called from - * status.c after the Group, Recod, and RefRecord objects are mem_init'ed. - * After this is called each object created by Mem_init_object() will automatically - * be added to the status reporting. - * This function is needed to avoid a double-dependency loop where memory needs status working when - * it starts, but status requires memory working for it to work. - */ -void Mem_init_status(); -/* Input: a valid type of object - * Output: a pointer to memory which will hold an object - * Effects: will only allocate an object from system if none exist in pool - */ -void * new(int32u obj_type); - - -/* Input: a valid pointer to an object or block created by new or mem_alloc - * Output: none - * Effects: destroys the object and frees memory associated with it if necessary - */ -void dispose(void *object); - - -/************************************************************************ - * These functions are for reference count objects only. - * Basically they provide the same functionality as 'new' and 'dispose' - * only that they provide reference count functionality. - * Reference count functions can not be applied on non ref. count objects. - * and viceversa - ************************************************************************/ - -/* Input: a valid type of object - * Output: a pointer to memory which will hold an object - * Effects: will only allocate an object from system if none exist in pool - * The allocated object will have reference counter initiated with 1 - */ -void * new_ref_cnt(int32 obj_type); - - -/* Input: a size of memory block desired - * Output: a pointer to memory which will hold the block - * Effects: - */ -void * Mem_alloc_ref_cnt(unsigned int length); - -/* Input: a valid pointer to a reference count object - * Output: the resulting reference count - * Effects: Increments the reference count of an object - */ -int inc_ref_cnt(void *object); - - -/* Input: a valid pointer to a reference count object - * Output: the resulting reference count - * Effects: Decrements the reference count of an object. - * If the resulting reference count is 0, then the object is disposed - */ -int dec_ref_cnt(void *object); - - -/* Input: a valid pointer to a reference count object - * Output: the reference count of the object - * Effects: Returns the reference count of an object. - */ -int get_ref_cnt(void *object); - - -/*************************************************************************** - * These two functions are ONLY needed for dynamically sized allocations - * like traditional malloc/free --NOT for object based allocations - ***************************************************************************/ - -/* Input: a size of memory block desired - * Output: a pointer to memory which will hold the block - * Effects: - */ -void * Mem_alloc( unsigned int length); - - -/* Input: a valid pointer to an object created with memalloc_object - * Output: a pointer to an object which is an identical copy of the object input - * Effects: same as memalloc_object - */ -void * Mem_copy(const void *object); - -/************************ - * Query Functions - ************************/ - -int Mem_valid_objtype(int32u objtype); - -/* Input: A valid pointer to an object/block created with new or mem_alloc - * Output: the obj_type of this block of memory - */ -int32u Mem_Obj_Type(const void *object); - -extern LOC_INLINE unsigned int Mem_total_bytes(void); -extern LOC_INLINE unsigned int Mem_total_max_bytes(void); -extern LOC_INLINE unsigned int Mem_total_inuse(void); -extern LOC_INLINE unsigned int Mem_total_max_inuse(void); -extern LOC_INLINE unsigned int Mem_total_obj(void); -extern LOC_INLINE unsigned int Mem_total_max_obj(void); -extern LOC_INLINE unsigned int Mem_bytes(int32u objtype); -extern LOC_INLINE unsigned int Mem_max_bytes(int32u objtype); -extern LOC_INLINE unsigned int Mem_obj_in_pool(int32u objtype); -extern LOC_INLINE unsigned int Mem_obj_in_app(int32u objtype); -extern LOC_INLINE unsigned int Mem_max_in_app(int32u objtype); -extern LOC_INLINE unsigned int Mem_obj_total(int32u objtype); -extern LOC_INLINE unsigned int Mem_max_obj(int32u objtype); - -#endif /* MEMORY_H */ - Deleted: libspreadutil/trunk/include/objects.h =================================================================== --- libspreadutil/trunk/include/objects.h 2012-03-05 19:32:04 UTC (rev 482) +++ libspreadutil/trunk/include/objects.h 2012-03-05 19:36:45 UTC (rev 483) @@ -1,73 +0,0 @@ -/* - * The Spread Toolkit. - * - * The contents of this file are subject to the Spread Open-Source - * License, Version 1.0 (the ``License''); you may not use - * this file except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.spread.org/license/ - * - * or in the file ``license.txt'' found in this distribution. - * - * Software distributed under the License is distributed on an AS IS basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Creators of Spread are: - * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz. - * - * Copyright (C) 1993-2009 Spread Concepts LLC <[email protected]> - * - * All Rights Reserved. - * - * Major Contributor(s): - * --------------- - * Ryan Caudy [email protected] - contributions to process groups. - * Claudiu Danilov [email protected] - scalable wide area support. - * Cristina Nita-Rotaru [email protected] - group communication security. - * Theo Schlossnagle [email protected] - Perl, autoconf, old skiplist. - * Dan Schoenblum [email protected] - Java interface. - * - */ - - -/* objects.h - * main declarations of objects - * Copyright 1997-2012 Jonathan Stanton <[email protected]> - * - */ - -#ifndef OBJECTS_H -#define OBJECTS_H - -#define MAX_OBJECTS 200 -#define MAX_OBJ_USED 56 - -/* Object types - * - * Object types must start with 1 and go up. 0 is reserved - * The implementation of the spread-util library uses the following object ids - * so applications must start with higher numbers. - */ - -#define TIME_EVENT 1 - -#define FIRST_APPLICATION_OBJECT_TYPE 2 - -#include "objects_local.h" - -/* Special objects */ - -/* This represents an object of undertermined or - * variable type. Can only be used when appropriate. - * i.e. when internal structure of object is not accessed. - * This is mainly used with queues - */ -#define UNKNOWN_OBJ (MAX_OBJ_USED -1) - - -#endif /* OBJECTS_H */ - - Deleted: libspreadutil/trunk/include/objects_local.h =================================================================== --- libspreadutil/trunk/include/objects_local.h 2012-03-05 19:32:04 UTC (rev 482) +++ libspreadutil/trunk/include/objects_local.h 2012-03-05 19:36:45 UTC (rev 483) @@ -1,60 +0,0 @@ -/* - * The Spread Toolkit. - * - * The contents of this file are subject to the Spread Open-Source - * License, Version 1.0 (the ``License''); you may not use - * this file except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.spread.org/license/ - * - * or in the file ``license.txt'' found in this distribution. - * - * Software distributed under the License is distributed on an AS IS basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Creators of Spread are: - * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz. - * - * Copyright (C) 1993-2009 Spread Concepts LLC <[email protected]> - * - * All Rights Reserved. - * - * Major Contributor(s): - * --------------- - * Ryan Caudy [email protected] - contributions to process groups. - * Claudiu Danilov [email protected] - scalable wide area support. - * Cristina Nita-Rotaru [email protected] - group communication security. - * Theo Schlossnagle [email protected] - Perl, autoconf, old skiplist. - * Dan Schoenblum [email protected] - Java interface. - * - */ - - -/* objects.h - * main declarations of objects - * Copyright 1997-2012 Jonathan Stanton <[email protected]> - * - */ - -#ifndef OBJECTS_LOCAL_H -#define OBJECTS_LOCAL_H - -/* Object types - * - * Object types must start with FIRST_APPLICATION_OBJECT_TYPE and go up. - */ - -/* Sample declartion of object number - * first_val = (FIRST_APPLICATION_OBJECT_TYPE + 1) -#define MY_FIRST_OBJ = first_val -*/ - - -/* Highest valid object number is defined in objects.h as UNKNOWN_OBJ */ - -#endif /* OBJECTS_LOCAL_H */ - - Deleted: libspreadutil/trunk/include/sp_events.h =================================================================== --- libspreadutil/trunk/include/sp_events.h 2012-03-05 19:32:04 UTC (rev 482) +++ libspreadutil/trunk/include/sp_events.h 2012-03-05 19:36:45 UTC (rev 483) @@ -1,100 +0,0 @@ -/* - * The Spread Toolkit. - * - * The contents of this file are subject to the Spread Open-Source - * License, Version 1.0 (the ``License''); you may not use - * this file except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.spread.org/license/ - * - * or in the file ``license.txt'' found in this distribution. - * - * Software distributed under the License is distributed on an AS IS basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Creators of Spread are: - * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz. - * - * Copyright (C) 1993-2009 Spread Concepts LLC <[email protected]> - * - * All Rights Reserved. - * - * Major Contributor(s): - * --------------- - * Ryan Caudy [email protected] - contributions to process groups. - * Claudiu Danilov [email protected] - scalable wide area support. - * Cristina Nita-Rotaru [email protected] - group communication security. - * Theo Schlossnagle [email protected] - Perl, autoconf, old skiplist. - * Dan Schoenblum [email protected] - Java interface. - * - */ - - - -#ifndef INC_SP_EVENTS -#define INC_SP_EVENTS - -/* Raise this number AND RECOMPILE events.c to handle more active FD's. - * This number limits the number of connections that - * can be handled. - */ -#define MAX_FD_EVENTS 2000 - -#define NUM_PRIORITY 3 - -#define LOW_PRIORITY 0 -#define MEDIUM_PRIORITY 1 -#define HIGH_PRIORITY 2 - -#define NUM_FDTYPES 3 - -#define READ_FD 0 -#define WRITE_FD 1 -#define EXCEPT_FD 2 - - -typedef struct dummy_time { - long sec; - long usec; -} sp_time; - -#ifndef NULL -#define NULL (void *)0 -#endif - -/* Event routines */ - -int E_init(void); -sp_time E_get_time(void); -sp_time E_sub_time( sp_time t, sp_time delta_t ); -sp_time E_add_time( sp_time t, sp_time delta_t ); -/* if t1 > t2 then returns 1; - if t1 < t2 then returns -1; - if t1 == t2 then returns 0; */ -int E_compare_time( sp_time t1, sp_time t2 ); -int E_queue( void (* func)( int code, void *data ), int code, void *data, - sp_time delta_time ); -int E_in_queue( void (* func)( int code, void *data ), int code, - void *data ); -/* Note: This does not dispose/free the data pointed at by the void - *data pointer */ -int E_dequeue( void (* func)( int code, void *data ), int code, - void *data ); -void E_delay( sp_time t ); - -int E_attach_fd( int fd, int fd_type, - void (* func)( int fd, int code, void *data), int code, - void *data, int priority ); -int E_detach_fd( int fd, int fd_type ); -int E_set_active_threshold( int priority ); -int E_activate_fd( int fd, int fd_type ); -int E_deactivate_fd( int fd, int fd_type ); -int E_num_active( int priority ); - -void E_handle_events(void); -void E_exit_events(void); - -#endif /* INC_SP_EVENTS */ Copied: libspreadutil/trunk/include/spu_alarm.h (from rev 482, libspreadutil/trunk/include/alarm.h) =================================================================== --- libspreadutil/trunk/include/spu_alarm.h (rev 0) +++ libspreadutil/trunk/include/spu_alarm.h 2012-03-05 19:36:45 UTC (rev 483) @@ -0,0 +1,117 @@ +/* + * The Spread Toolkit. + * + * The contents of this file are subject to the Spread Open-Source + * License, Version 1.0 (the ``License''); you may not use + * this file except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.spread.org/license/ + * + * or in the file ``license.txt'' found in this distribution. + * + * Software distributed under the License is distributed on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Creators of Spread are: + * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz. + * + * Copyright (C) 1993-2009 Spread Concepts LLC <[email protected]> + * + * All Rights Reserved. + * + * Major Contributor(s): + * --------------- + * Ryan Caudy [email protected] - contributions to process groups. + * Claudiu Danilov [email protected] - scalable wide area support. + * Cristina Nita-Rotaru [email protected] - group communication security. + * Theo Schlossnagle [email protected] - Perl, autoconf, old skiplist. + * Dan Schoenblum [email protected] - Java interface. + * + */ + + +#ifndef INC_ALARM +#define INC_ALARM + +#include <stdio.h> +#include "system.h" + +/* Type for Alarm realtime handler functions */ +typedef int (alarm_realtime_handler)( int16, int32, char *, size_t, char *, size_t); + + +/* This includes the custom types for each project */ +#include "alarm_types.h" + +/* These are always defined for any project using Alarm */ +#define ALL 0xffffffff +#define NONE 0x00000000 + +/* Priority levels */ +#define SPLOG_DEBUG 0x0001 /* Program information that is only useful for debugging. + Will normally be turned off in operation. */ +#define SPLOG_INFO 0x0002 /* Program reports information that may be useful for + performance tuning, analysis, or operational checks. */ +#define SPLOG_WARNING 0x0003 /* Program encountered a situation that is not erroneous, + but is uncommon and may indicate an error. */ +#define SPLOG_ERROR 0x0004 /* Program encountered an error that can be recovered from. */ +#define SPLOG_CRITICAL 0x0005 /* Program will not exit, but has only temporarily recovered + and without help may soon fail. */ +#define SPLOG_FATAL 0x0006 /* Program will exit() or abort(). */ + +#define SPLOG_PRINT 0x0007 /* Program should always print this information */ + +#define SPLOG_PRIORITY_FIELDS 0x000f + +/* Feature Flags for Priority field */ +#define SPLOG_NODATE 0x0010 /* Program should omit the datestamp at the beginning of the message. */ +#define SPLOG_REALTIME 0x0020 /* This message should be disseminated through the realtime handler if possible. + This is used for alerts you want sent now and not just logged (they are also logged). */ +#define SPLOG_PRIORITY_FLAGS 0x00f0 + +#ifdef HAVE_GOOD_VARGS +void Alarmp( int16 priority, int32 type, char *message, ...); +void Alarm( int32 type, char *message, ...); + +#else +void Alarm(); +#endif + +void Alarm_set_output(char *filename); + +void Alarm_enable_timestamp(const char *format); +void Alarm_enable_timestamp_high_res(const char *format); +void Alarm_disable_timestamp(void); + +void Alarm_set_types(int32 mask); +void Alarm_clear_types(int32 mask); +int32 Alarm_get_types(void); + +void Alarm_set_priority(int16 priority); +int16 Alarm_get_priority(void); + +void Alarm_set_realtime_print_handler( alarm_realtime_handler *output_message_function ); + +void Alarm_set_interactive(void); +int Alarm_get_interactive(void); + +#define IPF "%d.%d.%d.%d" + +#define IP1(address) ( (int) ( ( (address) >> 24 ) & 0xFF ) ) +#define IP2(address) ( (int) ( ( (address) >> 16 ) & 0xFF ) ) +#define IP3(address) ( (int) ( ( (address) >> 8 ) & 0xFF ) ) +#define IP4(address) ( (int) ( ( (address) >> 0 ) & 0xFF ) ) + +#define IP(address) IP1(address), IP2(address), IP3(address), IP4(address) + +#define IP1_NET(address) ( (int) ( (unsigned char*) &(address) )[0] ) +#define IP2_NET(address) ( (int) ( (unsigned char*) &(address) )[1] ) +#define IP3_NET(address) ( (int) ( (unsigned char*) &(address) )[2] ) +#define IP4_NET(address) ( (int) ( (unsigned char*) &(address) )[3] ) + +#define IP_NET(address) IP1_NET(address), IP2_NET(address), IP3_NET(address), IP4_NET(address) + +#endif /* INC_ALARM */ Copied: libspreadutil/trunk/include/spu_alarm_types.h (from rev 482, libspreadutil/trunk/include/alarm_types.h) =================================================================== --- libspreadutil/trunk/include/spu_alarm_types.h (rev 0) +++ libspreadutil/trunk/include/spu_alarm_types.h 2012-03-05 19:36:45 UTC (rev 483) @@ -0,0 +1,82 @@ +/* + * The Spread Toolkit. + * + * The contents of this file are subject to the Spread Open-Source + * License, Version 1.0 (the ``License''); you may not use + * this file except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.spread.org/license/ + * + * or in the file ``license.txt'' found in this distribution. + * + * Software distributed under the License is distributed on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Creators of Spread are: + * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz. + * + * Copyright (C) 1993-2006 Spread Concepts LLC <[email protected]> + * + * All Rights Reserved. + * + * Major Contributor(s): + * --------------- + * Ryan Caudy [email protected] - contributions to process groups. + * Cristina Nita-Rotaru [email protected] - group communication security. + * Theo Schlossnagle [email protected] - Perl, autoconf, old skiplist. + * Dan Schoenblum [email protected] - Java interface. + * + * + * This file is also licensed by Spread Concepts LLC under the Spines + * Open-Source License, version 1.0. You may obtain a copy of the + * Spines Open-Source License, version 1.0 at: + * + * http://www.spines.org/LICENSE.txt + * + * or in the file ``LICENSE.txt'' found in this distribution. + * + */ + + +#ifndef INC_ALARM_TYPES +#define INC_ALARM_TYPES + +/* List of type values that are valid for this project. + * This list can be customized for each user of Alarm library. + * The defines must be consistent amoung all code that will be compiled together, + * but can be different for different executables + */ +#define DEBUG 0x00000001 +#define EXIT 0x00000002 +#define PRINT 0x00000004 +/* new type to replace general prints */ +#define SYSTEM 0x00000004 + +#define DATA_LINK 0x00000010 +#define NETWORK 0x00000020 +#define PROTOCOL 0x00000040 +#define SESSION 0x00000080 +//#define CONF 0x00000100 Clash with an OpenSSL definition +#define MEMB 0x00000200 +#define FLOW_CONTROL 0x00000400 +#define STATUS 0x00000800 +#define EVENTS 0x00001000 +#define GROUPS 0x00002000 + +#define HOP 0x00004000 +#define OBJ_HANDLER 0x00008000 +#define MEMORY 0x00010000 +#define ROUTE 0x00020000 +#define QOS 0x00040000 +#define RING 0x00080000 +#define TCP_HOP 0x00100000 + +#define SKIPLIST 0x00200000 +#define ACM 0x00400000 + +#define SECURITY 0x00800000 + +#endif /* INC_ALARM_TYPES */ Copied: libspreadutil/trunk/include/spu_data_link.h (from rev 480, libspreadutil/trunk/include/data_link.h) =================================================================== --- libspreadutil/trunk/include/spu_data_link.h (rev 0) +++ libspreadutil/trunk/include/spu_data_link.h 2012-03-05 19:36:45 UTC (rev 483) @@ -0,0 +1,58 @@ +/* + * The Spread Toolkit. + * + * The contents of this file are subject to the Spread Open-Source + * License, Version 1.0 (the ``License''); you may not use + * this file except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.spread.org/license/ + * + * or in the file ``license.txt'' found in this distribution. + * + * Software distributed under the License is distributed on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Creators of Spread are: + * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz. + * + * Copyright (C) 1993-2009 Spread Concepts LLC <[email protected]> + * + * All Rights Reserved. + * + * Major Contributor(s): + * --------------- + * Ryan Caudy [email protected] - contributions to process groups. + * Claudiu Danilov [email protected] - scalable wide area support. + * Cristina Nita-Rotaru [email protected] - group communication security. + * Theo Schlossnagle [email protected] - Perl, autoconf, old skiplist. + * Dan Schoenblum [email protected] - Java interface. + * + */ + + +#ifndef INC_DATA_LINK +#define INC_DATA_LINK + +#include "system.h" +#include "scatter.h" + +#define MAX_PACKET_SIZE 1472 /*1472 = 1536-64 (of udp)*/ + +#define SEND_CHANNEL 0x00000001 +#define RECV_CHANNEL 0x00000002 +#define NO_LOOP 0x00000004 +#define REUSE_ADDR 0x00000008 + +#define IS_MCAST_ADDR(addr) ( ( (addr) & 0xF0000000 ) == 0xE0000000 ) +#define IS_MCAST_ADDR_NET(addr) ( ( (unsigned char*) &(addr) )[0] == 0xE0 ) + +channel DL_init_channel( int32 channel_type, int16 port, int32 mcast_address, int32 interface_address ); +void DL_close_channel(channel chan); +int DL_send( channel chan, int32 address, int16 port, sys_scatter *scat ); +int DL_recv( channel chan, sys_scatter *scat ); +int DL_recvfrom( channel chan, sys_scatter *scat, int *src_address, unsigned short *src_port ); + +#endif /* INC_DATA_LINK */ Copied: libspreadutil/trunk/include/spu_events.h (from rev 474, libspreadutil/trunk/include/sp_events.h) =================================================================== --- libspreadutil/trunk/include/spu_events.h (rev 0) +++ libspreadutil/trunk/include/spu_events.h 2012-03-05 19:36:45 UTC (rev 483) @@ -0,0 +1,100 @@ +/* + * The Spread Toolkit. + * + * The contents of this file are subject to the Spread Open-Source + * License, Version 1.0 (the ``License''); you may not use + * this file except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.spread.org/license/ + * + * or in the file ``license.txt'' found in this distribution. + * + * Software distributed under the License is distributed on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Creators of Spread are: + * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz. + * + * Copyright (C) 1993-2009 Spread Concepts LLC <[email protected]> + * + * All Rights Reserved. + * + * Major Contributor(s): + * --------------- + * Ryan Caudy [email protected] - contributions to process groups. + * Claudiu Danilov [email protected] - scalable wide area support. + * Cristina Nita-Rotaru [email protected] - group communication security. + * Theo Schlossnagle [email protected] - Perl, autoconf, old skiplist. + * Dan Schoenblum [email protected] - Java interface. + * + */ + + + +#ifndef INC_SP_EVENTS +#define INC_SP_EVENTS + +/* Raise this number AND RECOMPILE events.c to handle more active FD's. + * This number limits the number of connections that + * can be handled. + */ +#define MAX_FD_EVENTS 2000 + +#define NUM_PRIORITY 3 + +#define LOW_PRIORITY 0 +#define MEDIUM_PRIORITY 1 +#define HIGH_PRIORITY 2 + +#define NUM_FDTYPES 3 + +#define READ_FD 0 +#define WRITE_FD 1 +#define EXCEPT_FD 2 + + +typedef struct dummy_time { + long sec; + long usec; +} sp_time; + +#ifndef NULL +#define NULL (void *)0 +#endif + +/* Event routines */ + +int E_init(void); +sp_time E_get_time(void); +sp_time E_sub_time( sp_time t, sp_time delta_t ); +sp_time E_add_time( sp_time t, sp_time delta_t ); +/* if t1 > t2 then returns 1; + if t1 < t2 then returns -1; + if t1 == t2 then returns 0; */ +int E_compare_time( sp_time t1, sp_time t2 ); +int E_queue( void (* func)( int code, void *data ), int code, void *data, + sp_time delta_time ); +int E_in_queue( void (* func)( int code, void *data ), int code, + void *data ); +/* Note: This does not dispose/free the data pointed at by the void + *data pointer */ +int E_dequeue( void (* func)( int code, void *data ), int code, + void *data ); +void E_delay( sp_time t ); + +int E_attach_fd( int fd, int fd_type, + void (* func)( int fd, int code, void *data), int code, + void *data, int priority ); +int E_detach_fd( int fd, int fd_type ); +int E_set_active_threshold( int priority ); +int E_activate_fd( int fd, int fd_type ); +int E_deactivate_fd( int fd, int fd_type ); +int E_num_active( int priority ); + +void E_handle_events(void); +void E_exit_events(void); + +#endif /* INC_SP_EVENTS */ Copied: libspreadutil/trunk/include/spu_memory.h (from rev 482, libspreadutil/trunk/include/memory.h) =================================================================== --- libspreadutil/trunk/include/spu_memory.h (rev 0) +++ libspreadutil/trunk/include/spu_memory.h 2012-03-05 19:36:45 UTC (rev 483) @@ -0,0 +1,175 @@ +/* + * The Spread Toolkit. + * + * The contents of this file are subject to the Spread Open-Source + * License, Version 1.0 (the ``License''); you may not use + * this file except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.spread.org/license/ + * + * or in the file ``license.txt'' found in this distribution. + * + * Software distributed under the License is distributed on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Creators of Spread are: + * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz. + * + * Copyright (C) 1993-2009 Spread Concepts LLC <[email protected]> + * + * All Rights Reserved. + * + * Major Contributor(s): + * --------------- + * Ryan Caudy [email protected] - contributions to process groups. + * Claudiu Danilov [email protected] - scalable wide area support. + * Cristina Nita-Rotaru [email protected] - group communication security. + * Theo Schlossnagle [email protected] - Perl, autoconf, old skiplist. + * Dan Schoenblum [email protected] - Java interface. + * + */ + + +#ifndef MEMORY_H +#define MEMORY_H + +#include "system.h" + +/******************************************************************************* + * Special Object type used for + * NON-OBJECT Oriented allocates (traditional Malloc/free with arbitrary sizes) + * 0 is never a valid object type for any real object (they start at 1) + *******************************************************************************/ +#define BLOCK_OBJECT 0 + + +/************************************ + * Function Declarations + ************************************/ + +/* Input: valid object type, size of object, threshold/watermark value for this object, + * number of initial objects to create + * Output: error code + * Effects: registers type, sets watermark for type,creates initial memory buffers and updates global vars + * Should ONLY be called once per execution of the program, but must be called before any other + * memory management function is used on that object + */ +int Mem_init_object(int32u obj_type, int32u size, unsigned int threshold, unsigned int initial); + +/* This calls Mem_init_object and if any error results it EXIT's with a printed error */ +void Mem_init_object_abort( int32u obj_type, int32u size, unsigned int threshold, unsigned int initial ); + +/* This initializes the status reporting of the memory module and should be called from + * status.c after the Group, Recod, and RefRecord objects are mem_init'ed. + * After this is called each object created by Mem_init_object() will automatically + * be added to the status reporting. + * This function is needed to avoid a double-dependency loop where memory needs status working when + * it starts, but status requires memory working for it to work. + */ +void Mem_init_status(); +/* Input: a valid type of object + * Output: a pointer to memory which will hold an object + * Effects: will only allocate an object from system if none exist in pool + */ +void * new(int32u obj_type); + + +/* Input: a valid pointer to an object or block created by new or mem_alloc + * Output: none + * Effects: destroys the object and frees memory associated with it if necessary + */ +void dispose(void *object); + + +/************************************************************************ + * These functions are for reference count objects only. + * Basically they provide the same functionality as 'new' and 'dispose' + * only that they provide reference count functionality. + * Reference count functions can not be applied on non ref. count objects. + * and viceversa + ************************************************************************/ + +/* Input: a valid type of object + * Output: a pointer to memory which will hold an object + * Effects: will only allocate an object from system if none exist in pool + * The allocated object will have reference counter initiated with 1 + */ +void * new_ref_cnt(int32 obj_type); + + +/* Input: a size of memory block desired + * Output: a pointer to memory which will hold the block + * Effects: + */ +void * Mem_alloc_ref_cnt(unsigned int length); + +/* Input: a valid pointer to a reference count object + * Output: the resulting reference count + * Effects: Increments the reference count of an object + */ +int inc_ref_cnt(void *object); + + +/* Input: a valid pointer to a reference count object + * Output: the resulting reference count + * Effects: Decrements the reference count of an object. + * If the resulting reference count is 0, then the object is disposed + */ +int dec_ref_cnt(void *object); + + +/* Input: a valid pointer to a reference count object + * Output: the reference count of the object + * Effects: Returns the reference count of an object. + */ +int get_ref_cnt(void *object); + + +/*************************************************************************** + * These two functions are ONLY needed for dynamically sized allocations + * like traditional malloc/free --NOT for object based allocations + ***************************************************************************/ + +/* Input: a size of memory block desired + * Output: a pointer to memory which will hold the block + * Effects: + */ +void * Mem_alloc( unsigned int length); + + +/* Input: a valid pointer to an object created with memalloc_object + * Output: a pointer to an object which is an identical copy of the object input + * Effects: same as memalloc_object + */ +void * Mem_copy(const void *object); + +/************************ + * Query Functions + ************************/ + +int Mem_valid_objtype(int32u objtype); + +/* Input: A valid pointer to an object/block created with new or mem_alloc + * Output: the obj_type of this block of memory + */ +int32u Mem_Obj_Type(const void *object); + +extern LOC_INLINE unsigned int Mem_total_bytes(void); +extern LOC_INLINE unsigned int Mem_total_max_bytes(void); +extern LOC_INLINE unsigned int Mem_total_inuse(void); +extern LOC_INLINE unsigned int Mem_total_max_inuse(void); +extern LOC_INLINE unsigned int Mem_total_obj(void); +extern LOC_INLINE unsigned int Mem_total_max_obj(void); +extern LOC_INLINE unsigned int Mem_bytes(int32u objtype); +extern LOC_INLINE unsigned int Mem_max_bytes(int32u objtype); +extern LOC_INLINE unsigned int Mem_obj_in_pool(int32u objtype); +extern LOC_INLINE unsigned int Mem_obj_in_app(int32u objtype); +extern LOC_INLINE unsigned int Mem_max_in_app(int32u objtype); +extern LOC_INLINE unsigned int Mem_obj_total(int32u objtype); +extern LOC_INLINE unsigned int Mem_max_obj(int32u objtype); + +#endif /* MEMORY_H */ + Copied: libspreadutil/trunk/include/spu_objects.h (from rev 481, libspreadutil/trunk/include/objects.h) =================================================================== --- libspreadutil/trunk/include/spu_objects.h (rev 0) +++ libspreadutil/trunk/include/spu_objects.h 2012-03-05 19:36:45 UTC (rev 483) @@ -0,0 +1,73 @@ +/* + * The Spread Toolkit. + * + * The contents of this file are subject to the Spread Open-Source + * License, Version 1.0 (the ``License''); you may not use + * this file except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.spread.org/license/ + * + * or in the file ``license.txt'' found in this distribution. + * + * Software distributed under the License is distributed on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Creators of Spread are: + * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz. + * + * Copyright (C) 1993-2009 Spread Concepts LLC <[email protected]> + * + * All Rights Reserved. + * + * Major Contributor(s): + * --------------- + * Ryan Caudy [email protected] - contributions to process groups. + * Claudiu Danilov [email protected] - scalable wide area support. + * Cristina Nita-Rotaru [email protected] - group communication security. + * Theo Schlossnagle [email protected] - Perl, autoconf, old skiplist. + * Dan Schoenblum [email protected] - Java interface. + * + */ + + +/* objects.h + * main declarations of objects + * Copyright 1997-2012 Jonathan Stanton <[email protected]> + * + */ + +#ifndef OBJECTS_H +#define OBJECTS_H + +#define MAX_OBJECTS 200 +#define MAX_OBJ_USED 56 + +/* Object types + * + * Object types must start with 1 and go up. 0 is reserved + * The implementation of the spread-util library uses the following object ids + * so applications must start with higher numbers. + */ + +#define TIME_EVENT 1 + +#define FIRST_APPLICATION_OBJECT_TYPE 2 + +#include "objects_local.h" + +/* Special objects */ + +/* This represents an object of undertermined or + * variable type. Can only be used when appropriate. + * i.e. when internal structure of object is not accessed. + * This is mainly used with queues + */ +#define UNKNOWN_OBJ (MAX_OBJ_USED -1) + + +#endif /* OBJECTS_H */ + + Copied: libspreadutil/trunk/include/spu_objects_local.h (from rev 482, libspreadutil/trunk/include/objects_local.h) =================================================================== --- libspreadutil/trunk/include/spu_objects_local.h (rev 0) +++ libspreadutil/trunk/include/spu_objects_local.h 2012-03-05 19:36:45 UTC (rev 483) @@ -0,0 +1,60 @@ +/* + * The Spread Toolkit. + * + * The contents of this file are subject to the Spread Open-Source + * License, Version 1.0 (the ``License''); you may not use + * this file except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.spread.org/license/ + * + * or in the file ``license.txt'' found in this distribution. + * + * Software distributed under the License is distributed on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Creators of Spread are: + * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz. + * + * Copyright (C) 1993-2009 Spread Concepts LLC <[email protected]> + * + * All Rights Reserved. + * + * Major Contributor(s): + * --------------- + * Ryan Caudy [email protected] - contributions to process groups. + * Claudiu Danilov [email protected] - scalable wide area support. + * Cristina Nita-Rotaru [email protected] - group communication security. + * Theo Schlossnagle [email protected] - Perl, autoconf, old skiplist. + * Dan Schoenblum [email protected] - Java interface. + * + */ + + +/* objects.h + * main declarations of objects + * Copyright 1997-2012 Jonathan Stanton <[email protected]> + * + */ + +#ifndef OBJECTS_LOCAL_H +#define OBJECTS_LOCAL_H + +/* Object types + * + * Object types must start with FIRST_APPLICATION_OBJECT_TYPE and go up. + */ + +/* Sample declartion of object number + * first_val = (FIRST_APPLICATION_OBJECT_TYPE + 1) +#define MY_FIRST_OBJ = first_val +*/ + + +/* Highest valid object number is defined in objects.h as UNKNOWN_OBJ */ + +#endif /* OBJECTS_LOCAL_H */ + + Copied: libspreadutil/trunk/include/spu_system_defs.h (from rev 480, libspreadutil/trunk/include/system_defs.h) =================================================================== --- libspreadutil/trunk/include/spu_system_defs.h (rev 0) +++ libspreadutil/trunk/include/spu_system_defs.h 2012-03-05 19:36:45 UTC (rev 483) @@ -0,0 +1,17 @@ + +#ifndef SYSTEM_DEFS_H +#define SYSTEM_DEFS_H + + +#ifndef SPU_ARCH_PC_WIN95 +/* For non Windows systems, use standard headers and types */ +#include "system_defs_autoconf.h" + +#else +/* For Windows systems, use specified types and definitions */ +#include "system_defs_windows.h" + +#endif /* SPU_ARCH_PC_WIN95 */ + + +#endif /* SYSTEM_DEFS_H */ Copied: libspreadutil/trunk/include/spu_system_defs_autoconf.h (from rev 480, libspreadutil/trunk/include/system_defs_autoconf.h) =================================================================== --- libspreadutil/trunk/include/spu_system_defs_autoconf.h (rev 0) +++ libspreadutil/trunk/include/spu_system_defs_autoconf.h 2012-03-05 19:36:45 UTC (rev 483) @@ -0,0 +1,128 @@ +#ifndef SYSTEM_DEFS_AUTOCONF_H +#define SYSTEM_DEFS_AUTOCONF_H + +#ifndef SYSTEM_DEFS_H +#error "system_defs_autoconf.h should never be directly included. Include system_defs.h." +#endif + +#define LOC_INLINE __inline__ + +#ifdef SPU_HAVE_STDLIB_H +#include <stdlib.h> +#endif + +#include <sys/types.h> +#include <sys/socket.h> +#include <sys/param.h> + +#ifdef SPU_HAVE_SYS_BITYPES_H +# include <sys/bitypes.h> +#endif + +#ifdef SPU_HAVE_LIMITS_H +# include <limits.h> +#endif + +#ifndef SPU_HAVE_U_INT +typedef unsigned int u_int; +#endif + +#ifndef SPU_HAVE_INTXX_T +# if (SPU_SIZEOF_CHAR == 1) +typedef char int8_t; +# else +# error "8 bit int type not found." +# endif +# if (SPU_SIZEOF_SHORT_INT == 2) +typedef short int int16_t; +# else +# error "16 bit int type not found." +# endif +# if (SPU_SIZEOF_INT == 4) +typedef int int32_t; +# else +# error "32 bit int type not found." +# endif +#endif + +/* If sys/types.h does not supply u_intXX_t, supply them ourselves */ +#ifndef SPU_HAVE_U_INTXX_T +# ifdef SPU_HAVE_UINTXX_T +typedef uint8_t u_int8_t; +typedef uint16_t u_int16_t; +typedef uint32_t u_int32_t; +# define SPU_HAVE_U_INTXX_T 1 +# else +# if (SPU_SIZEOF_CHAR == 1) +typedef unsigned char u_int8_t; +# else +# error "8 bit int type not found." +# endif +# if (SPU_SIZEOF_SHORT_INT == 2) +typedef unsigned short int u_int16_t; +# else +# error "16 bit int type not found." +# endif +# if (SPU_SIZEOF_INT == 4) +typedef unsigned int u_int32_t; +# else +# error "32 bit int type not found." +# endif +# endif +#endif + +/* 64-bit types */ +#ifndef SPU_HAVE_INT64_T +# if (SPU_SIZEOF_LONG_INT == 8) +typedef long int int64_t; +# define SPU_HAVE_INT64_T 1 +# else +# if (SPU_SIZEOF_LONG_LONG_INT == 8) +typedef long long int int64_t; +# define SPU_HAVE_INT64_T 1 +# define SPU_HAVE_LONG_LONG_INT +# endif +# endif +#endif +#ifndef SPU_HAVE_U_INT64_T +# if (SPU_SIZEOF_LONG_INT == 8) +typedef unsigned long int u_int64_t; +# define SPU_HAVE_U_INT64_T 1 +# else +# if (SPU_SIZEOF_LONG_LONG_INT == 8) +typedef unsigned long long int u_int64_t; +# define SPU_HAVE_U_INT64_T 1 +# endif +# endif +#endif + + +#ifndef byte +#define byte u_int8_t +#endif + +#ifndef int16 +#define int16 int16_t +#endif + +#ifndef int16u +#define int16u u_int16_t +#endif + +#ifndef int32 +#define int32 int32_t +#endif + +#ifndef int32u +#define int32u u_int32_t +#endif + +#ifdef UIO_MAXIOV +#define SPU_ARCH_SCATTER_SIZE UIO_MAXIOV +#else +#define SPU_ARCH_SCATTER_SIZE 1024 +#endif + + + +#endif /* SYSTEM_DEFS_AUTOCONF_H */ Copied: libspreadutil/trunk/include/spu_system_defs_windows.h (from rev 478, libspreadutil/trunk/include/system_defs_windows.h) =================================================================== --- libspreadutil/trunk/include/spu_system_defs_windows.h (rev 0) +++ libspreadutil/trunk/include/spu_system_defs_windows.h 2012-03-05 19:36:45 UTC (rev 483) @@ -0,0 +1,44 @@ +#ifndef SYSTEM_DEFS_WINDOWS_H +#define SYSTEM_DEFS_WINDOWS_H + +#ifndef SYSTEM_DEFS_H +#error "system_defs_windows.h should never be directly included. Include system_defs.h." +#endif + +#define LOC_INLINE __inline__ + +#ifndef int16 +#define int16 short +#endif + +#ifndef int16u +#define int16u unsigned short +#endif + +#ifndef int32 +#define int32 int +#endif + +#ifndef int32u +#define int32u unsigned int +#endif + +#ifndef UINT32_MAX +#define UINT32_MAX UINT_MAX +#endif +#ifndef INT32_MAX +#define INT32_MAX INT_MAX +#endif + +#ifndef int64_t +#define int64_t __int64 +#endif + +#ifdef MSG_MAXIOVLEN +#define SPU_ARCH_SCATTER_SIZE MSG_MAXIOVLEN +#else +#define SPU_ARCH_SCATTER_SIZE 64 +#endif + + +#endif /* SYSTEM_DEFS_WINDOWS_H */ Deleted: libspreadutil/trunk/include/system_defs.h =================================================================== --- libspreadutil/trunk/include/system_defs.h 2012-03-05 19:32:04 UTC (rev 482) +++ libspreadutil/trunk/include/system_defs.h 2012-03-05 19:36:45 UTC (rev 483) @@ -1,17 +0,0 @@ - -#ifndef SYSTEM_DEFS_H -#define SYSTEM_DEFS_H - - -#ifndef SPU_ARCH_PC_WIN95 -/* For non Windows systems, use standard headers and types */ -#include "system_defs_autoconf.h" - -#else -/* For Windows systems, use specified types and definitions */ -#include "system_defs_windows.h" - -#endif /* SPU_ARCH_PC_WIN95 */ - - -#endif /* SYSTEM_DEFS_H */ Deleted: libspreadutil/trunk/include/system_defs_autoconf.h =================================================================== --- libspreadutil/trunk/include/system_defs_autoconf.h 2012-03-05 19:32:04 UTC (rev 482) +++ libspreadutil/trunk/include/system_defs_autoconf.h 2012-03-05 19:36:45 UTC (rev 483) @@ -1,128 +0,0 @@ -#ifndef SYSTEM_DEFS_AUTOCONF_H -#define SYSTEM_DEFS_AUTOCONF_H - -#ifndef SYSTEM_DEFS_H -#error "system_defs_autoconf.h should never be directly included. Include system_defs.h." -#endif - -#define LOC_INLINE __inline__ - -#ifdef SPU_HAVE_STDLIB_H -#include <stdlib.h> -#endif - -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/param.h> - -#ifdef SPU_HAVE_SYS_BITYPES_H -# include <sys/bitypes.h> -#endif - -#ifdef SPU_HAVE_LIMITS_H -# include <limits.h> -#endif - -#ifndef SPU_HAVE_U_INT -typedef unsigned int u_int; -#endif - -#ifndef SPU_HAVE_INTXX_T -# if (SPU_SIZEOF_CHAR == 1) -typedef char int8_t; -# else -# error "8 bit int type not found." -# endif -# if (SPU_SIZEOF_SHORT_INT == 2) -typedef short int int16_t; -# else -# error "16 bit int type not found." -# endif -# if (SPU_SIZEOF_INT == 4) -typedef int int32_t; -# else -# error "32 bit int type not found." -# endif -#endif - -/* If sys/types.h does not supply u_intXX_t, supply them ourselves */ -#ifndef SPU_HAVE_U_INTXX_T -# ifdef SPU_HAVE_UINTXX_T -typedef uint8_t u_int8_t; -typedef uint16_t u_int16_t; -typedef uint32_t u_int32_t; -# define SPU_HAVE_U_INTXX_T 1 -# else -# if (SPU_SIZEOF_CHAR == 1) -typedef unsigned char u_int8_t; -# else -# error "8 bit int type not found." -# endif -# if (SPU_SIZEOF_SHORT_INT == 2) -typedef unsigned short int u_int16_t; -# else -# error "16 bit int type not found." -# endif -# if (SPU_SIZEOF_INT == 4) -typedef unsigned int u_int32_t; -# else -# error "32 bit int type not found." -# endif -# endif -#endif - -/* 64-bit types */ -#ifndef SPU_HAVE_INT64_T -# if (SPU_SIZEOF_LONG_INT == 8) -typedef long int int64_t; -# define SPU_HAVE_INT64_T 1 -# else -# if (SPU_SIZEOF_LONG_LONG_INT == 8) -typedef long long int int64_t; -# define SPU_HAVE_INT64_T 1 -# define SPU_HAVE_LONG_LONG_INT -# endif -# endif -#endif -#ifndef SPU_HAVE_U_INT64_T -# if (SPU_SIZEOF_LONG_INT == 8) -typedef unsigned long int u_int64_t; -# define SPU_HAVE_U_INT64_T 1 -# else -# if (SPU_SIZEOF_LONG_LONG_INT == 8) -typedef unsigned long long int u_int64_t; -# define SPU_HAVE_U_INT64_T 1 -# endif -# endif -#endif - - -#ifndef byte -#define byte u_int8_t -#endif - -#ifndef int16 -#define int16 int16_t -#endif - -#ifndef int16u -#define int16u u_int16_t -#endif - -#ifndef int32 -#define int32 int32_t -#endif - -#ifndef int32u -#define int32u u_int32_t -#endif - -#ifdef UIO_MAXIOV -#define SPU_ARCH_SCATTER_SIZE UIO_MAXIOV -#else -#define SPU_ARCH_SCATTER_SIZE 1024 -#endif - - - -#endif /* SYSTEM_DEFS_AUTOCONF_H */ Deleted: libspreadutil/trunk/include/system_defs_windows.h =================================================================== --- libspreadutil/trunk/include/system_defs_windows.h 2012-03-05 19:32:04 UTC (rev 482) +++ libspreadutil/trunk/include/system_defs_windows.h 2012-03-05 19:36:45 UTC (rev 483) @@ -1,44 +0,0 @@ -#ifndef SYSTEM_DEFS_WINDOWS_H -#define SYSTEM_DEFS_WINDOWS_H - -#ifndef SYSTEM_DEFS_H -#error "system_defs_windows.h should never be directly included. Include system_defs.h." -#endif - -#define LOC_INLINE __inline__ - -#ifndef int16 -#define int16 short -#endif - -#ifndef int16u -#define int16u unsigned short -#endif - -#ifndef int32 -#define int32 int -#endif - -#ifndef int32u -#define int32u unsigned int -#endif - -#ifndef UINT32_MAX -#define UINT32_MAX UINT_MAX -#endif -#ifndef INT32_MAX -#define INT32_MAX INT_MAX -#endif - -#ifndef int64_t -#define int64_t __int64 -#endif - -#ifdef MSG_MAXIOVLEN -#define SPU_ARCH_SCATTER_SIZE MSG_MAXIOVLEN -#else -#define SPU_ARCH_SCATTER_SIZE 64 -#endif - - -#endif /* SYSTEM_DEFS_WINDOWS_H */ Modified: libspreadutil/trunk/src/alarm.c =================================================================== --- libspreadutil/trunk/src/alarm.c 2012-03-05 19:32:04 UTC (rev 482) +++ libspreadutil/trunk/src/alarm.c 2012-03-05 19:36:45 UTC (rev 483) @@ -52,8 +52,8 @@ # include <stdarg.h> #endif -#include "alarm.h" -#include "sp_events.h" +#include "spu_alarm.h" +#include "spu_events.h" #define MAX_ALARM_MESSAGE_BUF 256 Modified: libspreadutil/trunk/src/data_link.c =================================================================== --- libspreadutil/trunk/src/data_link.c 2012-03-05 19:32:04 UTC (rev 482) +++ libspreadutil/trunk/src/data_link.c 2012-03-05 19:36:45 UTC (rev 483) @@ -56,9 +56,9 @@ #include <string.h> #include <assert.h> -#include "data_link.h" -#include "alarm.h" -#include "sp_events.h" /* for sp_time */ +#include "spu_data_link.h" +#include "spu_alarm.h" +#include "spu_events.h" /* for sp_time */ channel DL_init_channel( int32 channel_type, int16 port, int32 mcast_address, int32 interface_address ) Modified: libspreadutil/trunk/src/events.c =================================================================== --- libspreadutil/trunk/src/events.c 2012-03-05 19:32:04 UTC (rev 482) +++ libspreadutil/trunk/src/events.c 2012-03-05 19:36:45 UTC (rev 483) @@ -63,10 +63,10 @@ #endif /* ARCH_PC_WIN95 */ #include <string.h> -#include "sp_events.h" -#include "objects.h" /* For memory */ -#include "memory.h" /* for memory */ -#include "alarm.h" +#include "spu_events.h" +#include "spu_objects.h" /* For memory */ +#include "spu_memory.h" /* for memory */ +#include "spu_alarm.h" typedef struct dummy_t_event { sp_time t; Modified: libspreadutil/trunk/src/memory.c =================================================================== --- libspreadutil/trunk/src/memory.c 2012-03-05 19:32:04 UTC (rev 482) +++ libspreadutil/trunk/src/memory.c 2012-03-05 19:36:45 UTC (rev 483) @@ -43,9 +43,9 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "memory.h" -#include "alarm.h" -#include "objects.h" +#include "spu_memory.h" +#include "spu_alarm.h" +#include "spu_objects.h" #define NO_REF_CNT -1 #define MAX_MEM_OBJECTS 200