[Spread-cvs] commit: r478 - in libspreadutil/trunk: . buildtools include src

jonathan at spread.org jonathan at spread.org
Sat Mar 3 16:19:41 EST 2012


Author: jonathan
Date: 2012-03-03 16:19:41 -0500 (Sat, 03 Mar 2012)
New Revision: 478

Added:
   libspreadutil/trunk/buildtools/gen_system_include.sh
   libspreadutil/trunk/include/Makefile.in
   libspreadutil/trunk/include/memory.h
   libspreadutil/trunk/include/spu_compatibility.h
   libspreadutil/trunk/include/system_defs.h
   libspreadutil/trunk/include/system_defs_autoconf.h
   libspreadutil/trunk/include/system_defs_windows.h
Removed:
   libspreadutil/trunk/src/memory.h
Modified:
   libspreadutil/trunk/Makefile.in
   libspreadutil/trunk/configure
   libspreadutil/trunk/configure.in
Log:
Add Makefile for include directory to rebuild new system.h header. Create safe, installable headers for the public library api to use to replace arch.h and config.h headers.

Modified: libspreadutil/trunk/Makefile.in
===================================================================
--- libspreadutil/trunk/Makefile.in	2012-03-03 21:18:02 UTC (rev 477)
+++ libspreadutil/trunk/Makefile.in	2012-03-03 21:19:41 UTC (rev 478)
@@ -1,5 +1,5 @@
-SUBDIRS=src
-INSTALLSUBDIRS=src docs
+SUBDIRS=src include
+INSTALLSUBDIRS=src include docs
 BINSUBDIRS=src
 
 all: $(SUBDIRS) 

Added: libspreadutil/trunk/buildtools/gen_system_include.sh
===================================================================
--- libspreadutil/trunk/buildtools/gen_system_include.sh	                        (rev 0)
+++ libspreadutil/trunk/buildtools/gen_system_include.sh	2012-03-03 21:19:41 UTC (rev 478)
@@ -0,0 +1,51 @@
+#! /bin/sh
+
+## Generate include/system.h from src/config.h 
+## Includes only those defines needed for the Spread Util Library API
+##
+##  This script takes the path to src/config.h as its only argument and
+##  generates a file suitable for being included as <spu/system.h>.  
+
+cat <<EOF
+/* Automatically generated by gen_system_include.sh from config.h; do not edit. */
+
+/* This system header contains those constants that change upon compilation and are
+ * required for the Spread Util Library API. These should not conflict with any
+ * other definitions in other software and should be safe to include in other software.
+ */
+
+#ifndef SYSTEM_H
+#define SYSTEM_H
+
+EOF
+
+awk -f - $1 <<'---END-OF-AWK-SCRIPT---'
+
+/^#define ARCH_PC_WIN95/      { print save $1 " SPU_" $2 " " $3 "\n" }
+/^#define HAVE_UINTXX_T/  { print save $1 " SPU_" $2 " " $3 "\n" }
+/^#define HAVE_U_INT/       { print save $1 " SPU_" $2 " " $3 "\n" }
+/^#define HAVE_U_INT64_T/  { print save $1 " SPU_" $2 " " $3 "\n" }
+/^#define HAVE_U_INTXX_T/  { print save $1 " SPU_" $2 " " $3 "\n" }
+/^#define HAVE_INT64_T/  { print save $1 " SPU_" $2 " " $3 "\n" }
+/^#define HAVE_INTXX_T/  { print save $1 " SPU_" $2 " " $3 "\n" }
+/^#define HAVE_INTTYPES_H/  { print save $1 " SPU_" $2 " " $3 "\n" }
+/^#define SIZEOF_CHAR/  { print save $1 " SPU_" $2 " " $3 "\n" }
+/^#define SIZEOF_INT/  { print save $1 " SPU_" $2 " " $3 "\n" }
+/^#define SIZEOF_LONG_INT/  { print save $1 " SPU_" $2 " " $3 "\n" }
+/^#define SIZEOF_LONG_LONG_INT/  { print save $1 " SPU_" $2 " " $3 "\n" }
+/^#define SIZEOF_SHORT_INT/  { print save $1 " SPU_" $2 " " $3 "\n" }
+/^#define HAVE_STDLIB_H/  { print save $1 " SPU_" $2 " " $3 "\n" }
+/^#define HAVE_SYS_BITYPES_H/  { print save $1 " SPU_" $2 " " $3 "\n" }
+/^#define HAVE_LIMITS_H/  { print save $1 " SPU_" $2 " " $3 "\n" }
+
+
+{ save = $0 "\n" }
+
+---END-OF-AWK-SCRIPT---
+
+cat <<EOF
+
+#include "system_defs.h"
+
+#endif /* SYSTEM_H */
+EOF


Property changes on: libspreadutil/trunk/buildtools/gen_system_include.sh
___________________________________________________________________
Added: svn:executable
   + *

Modified: libspreadutil/trunk/configure
===================================================================
--- libspreadutil/trunk/configure	2012-03-03 21:18:02 UTC (rev 477)
+++ libspreadutil/trunk/configure	2012-03-03 21:19:41 UTC (rev 478)
@@ -10210,7 +10210,7 @@
 
 
 
-ac_config_files="$ac_config_files Makefile src/Makefile docs/Makefile"
+ac_config_files="$ac_config_files Makefile src/Makefile docs/Makefile include/Makefile"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -10800,6 +10800,7 @@
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
     "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;;
+    "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
 
   *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
 $as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}

Modified: libspreadutil/trunk/configure.in
===================================================================
--- libspreadutil/trunk/configure.in	2012-03-03 21:18:02 UTC (rev 477)
+++ libspreadutil/trunk/configure.in	2012-03-03 21:19:41 UTC (rev 478)
@@ -763,7 +763,7 @@
 AC_SUBST(SHLDCONVERTSTATIC)
 AC_SUBST(SHLDCONVERTSTATICEND)
 
-AC_OUTPUT(Makefile src/Makefile docs/Makefile)
+AC_OUTPUT(Makefile src/Makefile docs/Makefile include/Makefile)
 
 # Print summary of options
 

Added: libspreadutil/trunk/include/Makefile.in
===================================================================
--- libspreadutil/trunk/include/Makefile.in	                        (rev 0)
+++ libspreadutil/trunk/include/Makefile.in	2012-03-03 21:19:41 UTC (rev 478)
@@ -0,0 +1,92 @@
+.SUFFIXES: .lo
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+sbindir=@sbindir@
+datarootdir=@datarootdir@
+libdir=@libdir@
+includedir=@includedir@
+mandir=@mandir@
+mansubdir=@mansubdir@
+sysconfdir=@sysconfdir@
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
+buildtoolsdir=$(top_srcdir)/buildtools
+host=@host@
+
+DESTDIR=
+VPATH=@srcdir@ $(top_srcdir)/src
+
+#Shared Library version -- Must be changed upon each release 
+#Rules: major  -- inc for incompatible change
+#     : minor  -- inc for backwards compatible change (add new api, but not break or remove old one)
+#     : bugfix -- inc for bugfix that is fully compatible
+
+LIBFULLVERSION=0.0.1
+LIBCOMPATVERSION=0.0
+LIBVERSION=0
+
+PATHS=-I. -I$(top_srcdir)/src
+
+CC=@CC@
+LD=@LD@
+
+# don't use debugging (asserts and dprintfs) (optional)
+NO_DEBUG=-DNDEBUG
+DEFINES=$(NO_DEBUG)
+
+CFLAGS=@CFLAGS@ $(DEFINES)
+CPPFLAGS=@CPPFLAGS@ $(PATHS) @DEFS@
+LDFLAGS=@LDFLAGS@ 
+LIBS=@LIBS@ 
+THLDFLAGS=@THLDFLAGS@
+THLIBS=@THLIBS@
+AR=@AR@
+SHCC=@SHCC@
+SHLD=@SHLD@
+SHCFLAGS=@SHCFLAGS@ $(DEFINES)
+SHCPPFLAGS=@SHCPPFLAGS@ $(PATHS) @DEFS@
+SHLDFLAGS=@SHLDFLAGS@
+SHLIBS=@SHLIBS@
+SHLDOPTION=@SHLDOPTION@
+SHLDNAME=@SHLDNAME@
+SHLDCONVERTSTATIC=@SHLDCONVERTSTATIC@
+SHLDCONVERTSTATICEND=@SHLDCONVERTSTATICEND@
+RANLIB=@RANLIB@
+INSTALL=@INSTALL@
+SOFTLINK=@LN_S@
+PERL=@PERL@
+ENT=@ENT@
+EXEEXT=@EXEEXT@
+
+TARGETS=headers
+
+HEADER_FILES=sp_events.h system_defs.h system_defs_autoconf.h system_defs_windows.h spu_compatibility.h
+
+all: $(TARGETS)
+
+headers:
+	$(buildtoolsdir)/gen_system_include.sh ../src/config.h > system.h
+
+install-headers: headers
+	$(buildtoolsdir)/mkinstalldirs $(DESTDIR)$(includedir)
+	for incfile in $(HEADER_FILES); \
+	do \
+	  $(INSTALL) -m 644 $(srcdir)/$$incfile $(DESTDIR)$(includedir)/$$incfile; \
+	done
+	$(INSTALL) -m 644 system.h $(DESTDIR)$(includedir)/system.h
+
+clean:
+	rm -f system.h
+
+distclean: clean
+	rm -f Makefile *~
+
+install: $(TARGETS) install-headers
+
+uninstall: 
+	-rm -f $(DESTDIR)$(includedir)/sp_events.h
+
+uninstallall:	uninstall
+	-rmdir $(DESTDIR)$(includedir)

Copied: libspreadutil/trunk/include/memory.h (from rev 469, libspreadutil/trunk/src/memory.h)
===================================================================
--- libspreadutil/trunk/include/memory.h	                        (rev 0)
+++ libspreadutil/trunk/include/memory.h	2012-03-03 21:19:41 UTC (rev 478)
@@ -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 <info at spreadconcepts.com>
+ *
+ *  All Rights Reserved.
+ *
+ * Major Contributor(s):
+ * ---------------
+ *    Ryan Caudy           rcaudy at gmail.com - contributions to process groups.
+ *    Claudiu Danilov      claudiu at acm.org - scalable wide area support.
+ *    Cristina Nita-Rotaru crisn at cs.purdue.edu - group communication security.
+ *    Theo Schlossnagle    jesus at omniti.com - Perl, autoconf, old skiplist.
+ *    Dan Schoenblum       dansch at cnds.jhu.edu - Java interface.
+ *
+ */
+
+
+#ifndef MEMORY_H
+#define MEMORY_H
+
+#include "arch.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 */
+

Added: libspreadutil/trunk/include/spu_compatibility.h
===================================================================
--- libspreadutil/trunk/include/spu_compatibility.h	                        (rev 0)
+++ libspreadutil/trunk/include/spu_compatibility.h	2012-03-03 21:19:41 UTC (rev 478)
@@ -0,0 +1,57 @@
+/*
+ * 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 <info at spreadconcepts.com>
+ *
+ *  All Rights Reserved.
+ *
+ * Major Contributor(s):
+ * ---------------
+ *    Ryan Caudy           rcaudy at gmail.com - contributions to process groups.
+ *    Claudiu Danilov      claudiu at acm.org - scalable wide area support.
+ *    Cristina Nita-Rotaru crisn at cs.purdue.edu - group communication security.
+ *    Theo Schlossnagle    jesus at omniti.com - Perl, autoconf, old skiplist.
+ *    Dan Schoenblum       dansch at cnds.jhu.edu - Java interface.
+ *
+ */
+
+
+/* spu_compatibility.h 
+ *  backwards compatible declarations of API functions
+ * Copyright 2012 Jonathan Stanton <jonathan at spread.org> 
+ *
+ */
+
+#ifndef SPU_COMPATIBILITY_H
+#define SPU_COMPATIBILITY_H
+
+
+/* If we need the old API for these sets of functions
+ * enable this and the old API names will work and map to the new functions
+ */
+#ifdef SPU_ENABLE_OLD_API
+
+#define Alarm   SPU_Alarm
+
+#endif
+
+#endif /* SPU_COMPATIBILITY_H */
+
+

Added: libspreadutil/trunk/include/system_defs.h
===================================================================
--- libspreadutil/trunk/include/system_defs.h	                        (rev 0)
+++ libspreadutil/trunk/include/system_defs.h	2012-03-03 21:19:41 UTC (rev 478)
@@ -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 /* ARCH_PC_WIN95 */
+
+
+#endif /* SYSTEM_DEFS_H */

Added: libspreadutil/trunk/include/system_defs_autoconf.h
===================================================================
--- libspreadutil/trunk/include/system_defs_autoconf.h	                        (rev 0)
+++ libspreadutil/trunk/include/system_defs_autoconf.h	2012-03-03 21:19:41 UTC (rev 478)
@@ -0,0 +1,125 @@
+#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>
+
+
+#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 */

Added: libspreadutil/trunk/include/system_defs_windows.h
===================================================================
--- libspreadutil/trunk/include/system_defs_windows.h	                        (rev 0)
+++ libspreadutil/trunk/include/system_defs_windows.h	2012-03-03 21:19:41 UTC (rev 478)
@@ -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/src/memory.h
===================================================================
--- libspreadutil/trunk/src/memory.h	2012-03-03 21:18:02 UTC (rev 477)
+++ libspreadutil/trunk/src/memory.h	2012-03-03 21:19:41 UTC (rev 478)
@@ -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 <info at spreadconcepts.com>
- *
- *  All Rights Reserved.
- *
- * Major Contributor(s):
- * ---------------
- *    Ryan Caudy           rcaudy at gmail.com - contributions to process groups.
- *    Claudiu Danilov      claudiu at acm.org - scalable wide area support.
- *    Cristina Nita-Rotaru crisn at cs.purdue.edu - group communication security.
- *    Theo Schlossnagle    jesus at omniti.com - Perl, autoconf, old skiplist.
- *    Dan Schoenblum       dansch at cnds.jhu.edu - Java interface.
- *
- */
-
-
-#ifndef MEMORY_H
-#define MEMORY_H
-
-#include "arch.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 */
-




More information about the Spread-cvs mailing list