mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-20 12:16:40 +00:00
New file.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1241 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
57f600e121
commit
2e90c4e163
24 changed files with 11364 additions and 0 deletions
85
Source/objects/numbers.h
Normal file
85
Source/objects/numbers.h
Normal file
|
@ -0,0 +1,85 @@
|
|||
/* Structure counters and functions for getting at them.
|
||||
* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
*
|
||||
* Author: Albin L. Jones <Albin.L.Jones@Dartmouth.EDU>
|
||||
* Created: Sun Dec 3 00:28:01 EST 1995
|
||||
* Updated: Mon Mar 18 14:36:49 EST 1996
|
||||
* Serial: 96.03.18.03
|
||||
*
|
||||
* This file is part of the GNU Objective C Class Library.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#ifndef __numbers_h_OBJECTS_INCLUDE
|
||||
#define __numbers_h_OBJECTS_INCLUDE 1
|
||||
|
||||
/**** Included Headers *******************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
/**** Type, Constant, and Macro Definitions **********************************/
|
||||
|
||||
/** Magic numbers... **/
|
||||
|
||||
/* Magic numbers for the different types of structures... */
|
||||
#define OBJECTS_MAGIC_ARRAY 0x1b658008 /* Thu Mar 2 02:28:50 EST 1994 */
|
||||
#define OBJECTS_MAGIC_DATA 0x1b651971 /* Fri Nov 24 21:46:14 EST 1995 */
|
||||
#define OBJECTS_MAGIC_HASH 0x1b653ee5 /* ??? ??? ?? ??:??:?? ??? 1993 */
|
||||
#define OBJECTS_MAGIC_HEAP 0x1b65beef /* Tue Sep 5 17:21:34 EDT 1995 */
|
||||
#define OBJECTS_MAGIC_LIST 0x1b65600d /* Tue Sep 5 17:23:50 EDT 1995 */
|
||||
#define OBJECTS_MAGIC_MAP 0x1b65abba /* ??? ??? ?? ??:??:?? ??? 1993 */
|
||||
|
||||
/* WARNING: Don't use these. They are not guaranteed to remain in future
|
||||
* editions of this file. They are here only as a cheap fix for an
|
||||
* annoying little problem. */
|
||||
/* FIXME: Get rid of these. See `x-basics.[ch].in'
|
||||
* and `x-callbacks.[ch].in'. */
|
||||
#define _OBJECTS_MAGIC_array OBJECTS_MAGIC_ARRAY
|
||||
#define _OBJECTS_MAGIC_data OBJECTS_MAGIC_DATA
|
||||
#define _OBJECTS_MAGIC_hash OBJECTS_MAGIC_HASH
|
||||
#define _OBJECTS_MAGIC_heap OBJECTS_MAGIC_HEAP
|
||||
#define _OBJECTS_MAGIC_list OBJECTS_MAGIC_LIST
|
||||
#define _OBJECTS_MAGIC_map OBJECTS_MAGIC_MAP
|
||||
|
||||
/* Internal counters for the three functions below. They are placed here
|
||||
* purely for your viewing pleasure. WARNING: Do not mess with these
|
||||
* unless you know what you're doing. */
|
||||
extern size_t ___objects_number_allocated;
|
||||
extern size_t ___objects_number_deallocated;
|
||||
extern size_t ___objects_number_serialized;
|
||||
|
||||
/**** Function Prototypes ****************************************************/
|
||||
|
||||
/* Returns the number of hash tables, map tables, lists,
|
||||
* and sparse arrays allocated thus far. */
|
||||
size_t
|
||||
_objects_number_allocated(void);
|
||||
|
||||
/* Returns the number of hash tables, map tables, lists,
|
||||
* and sparse arrays deallocated thus far. */
|
||||
size_t
|
||||
_objects_number_deallocated(void);
|
||||
|
||||
/* Returns (but does not increment) the number of hash tables,
|
||||
* map tables, lists, and sparse arrays given serial numbers thus far. */
|
||||
size_t
|
||||
_objects_number_serialized(void);
|
||||
|
||||
/* Returns the least power of two strictly greater than BOUND. */
|
||||
size_t
|
||||
_objects_next_power_of_two(size_t bound);
|
||||
|
||||
#endif /* __numbers_h_OBJECTS_INCLUDE */
|
||||
|
126
Source/objects/x-bas.h.in
Normal file
126
Source/objects/x-bas.h.in
Normal file
|
@ -0,0 +1,126 @@
|
|||
/* Basic functions for @XX@ structures.
|
||||
* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
*
|
||||
* Author: Albin L. Jones <Albin.L.Jones@Dartmouth.EDU>
|
||||
* Created: Mon Dec 11 01:24:48 EST 1995
|
||||
* Updated: Mon Mar 11 00:54:50 EST 1996
|
||||
* Serial: 96.03.11.03
|
||||
*
|
||||
* This file is part of the GNU Objective C Class Library.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#ifndef __@XX@_bas_h_OBJECTS_INCLUDE
|
||||
#define __@XX@_bas_h_OBJECTS_INCLUDE 1
|
||||
|
||||
/**** Included Headers *******************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <Foundation/NSZone.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <objects/numbers.h>
|
||||
|
||||
/**** Type, Constant, and Macro Definitions **********************************/
|
||||
|
||||
#define __@XX@__ 1
|
||||
|
||||
/**** Function Implementations ***********************************************/
|
||||
|
||||
/** Magic numbers... **/
|
||||
|
||||
/* Returns XX's magic number. */
|
||||
int
|
||||
objects_@XX@_magic_number(objects_@XX@_t *xx);
|
||||
|
||||
/** Zones... **/
|
||||
|
||||
/* Returns the allocs used to create and maintain XX. */
|
||||
NSZone *
|
||||
objects_@XX@_zone(objects_@XX@_t *xx);
|
||||
|
||||
/** Names... **/
|
||||
|
||||
/* Returns the name that was given to XX. */
|
||||
NSString *
|
||||
objects_@XX@_name(objects_@XX@_t *xx);
|
||||
|
||||
/* Gives XX a name. */
|
||||
void
|
||||
objects_@XX@_set_name(objects_@XX@_t *xx, NSString *name);
|
||||
|
||||
/* Takes away XX's name. */
|
||||
void
|
||||
objects_@XX@_unset_name(objects_@XX@_t *xx);
|
||||
|
||||
/** Serial numbers... **/
|
||||
|
||||
/* Returns the (process-wide) unique number given to the Libfn
|
||||
* structure XX. See <objects/numbers.h> for more info. */
|
||||
size_t
|
||||
objects_@XX@_serial_number(objects_@XX@_t *xx);
|
||||
|
||||
/* Gives XX a new (process-wide) unique number. Numbers are not
|
||||
* reused. See <objects/numbers.h> for more info. */
|
||||
size_t
|
||||
_objects_@XX@_set_serial_number(objects_@XX@_t *xx);
|
||||
|
||||
/** Extras... **/
|
||||
|
||||
/* Sets the callbacks associated with XX's ``extra''. NOTE: This must
|
||||
* be done before calling `objects_@XX@_set_extra()', as these callbacks
|
||||
* are used in that routine. */
|
||||
objects_callbacks_t
|
||||
objects_@XX@_set_extra_callbacks(objects_@XX@_t *xx,
|
||||
objects_callbacks_t callbacks);
|
||||
|
||||
/* Returns the callbacks associated with XX's ``extra''. */
|
||||
objects_callbacks_t
|
||||
objects_@XX@_extra_callbacks(objects_@XX@_t *xx);
|
||||
|
||||
/* Returns XX's ``extra'', a little extra space that each
|
||||
* structure carries around with it. Its use is
|
||||
* implementation-dependent. */
|
||||
const void *
|
||||
objects_@XX@_extra(objects_@XX@_t *xx);
|
||||
|
||||
/* Sets XX's ``extra'', a little extra space that each structure
|
||||
* carries around with it. Its use is implementation-dependent. */
|
||||
const void *
|
||||
objects_@XX@_set_extra(objects_@XX@_t *xx, const void *extra);
|
||||
|
||||
/* Resets XX's ``extra''. */
|
||||
void
|
||||
objects_@XX@_unset_extra(objects_@XX@_t *xx);
|
||||
|
||||
/** Low-level Creation and Destruction **/
|
||||
|
||||
/* Handles the universal, low-level allocation of structures. */
|
||||
objects_@XX@_t *
|
||||
_objects_@XX@_alloc_with_zone(NSZone *zone);
|
||||
|
||||
/* Handles the universal, low-level deallocation of structures. */
|
||||
void
|
||||
_objects_@XX@_dealloc(objects_@XX@_t *xx);
|
||||
|
||||
/* Handles the low-level copying of structures. */
|
||||
objects_@XX@_t *
|
||||
_objects_@XX@_copy_with_zone(objects_@XX@_t *xx, NSZone *zone);
|
||||
|
||||
/* Returns a low-level description of XX. */
|
||||
NSString *
|
||||
_objects_@XX@_description(objects_@XX@_t *xx);
|
||||
|
||||
#endif /* __@XX@_bas_h_OBJECTS_INCLUDE */
|
||||
|
69
Source/objects/x-cbs.h.in
Normal file
69
Source/objects/x-cbs.h.in
Normal file
|
@ -0,0 +1,69 @@
|
|||
/* Getting callbacks from @YY@ structures.
|
||||
* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
*
|
||||
* Author: Albin L. Jones <Albin.L.Jones@Dartmouth.EDU>
|
||||
* Created: Mon Dec 11 03:41:00 EST 1995
|
||||
* Updated: Mon Mar 11 00:54:20 EST 1996
|
||||
* Serial: 96.03.11.02
|
||||
*
|
||||
* This file is part of the GNU Objective C Class Library.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#ifndef __@YY@_cbs_h_OBJECTS_INCLUDE
|
||||
#define __@YY@_cbs_h_OBJECTS_INCLUDE 1
|
||||
|
||||
/**** Included Headers *******************************************************/
|
||||
|
||||
#include <objects/callbacks.h>
|
||||
#include <objects/@YY@.h>
|
||||
|
||||
/**** Type, Constant, and Macro Definitions **********************************/
|
||||
|
||||
#define __@YY@__ 1
|
||||
|
||||
/**** Function Implementations ***********************************************/
|
||||
|
||||
#ifdef __map__
|
||||
|
||||
/** Callbacks **/
|
||||
|
||||
/* Returns the callbacks associated with YY's keys. */
|
||||
objects_callbacks_t objects_@YY@_key_callbacks (objects_@YY@_t *yy);
|
||||
|
||||
/* Returns the ``bogus'' marker associated with YY's keys. */
|
||||
const void *objects_@YY@_not_a_key_marker (objects_@YY@_t *yy);
|
||||
|
||||
/* Returns the callbacks associated with YY's values. */
|
||||
objects_callbacks_t
|
||||
objects_@YY@_value_callbacks (objects_@YY@_t *yy);
|
||||
|
||||
/* Returns the ``bogus'' marker associated with YY's values. */
|
||||
const void *objects_@YY@_not_a_value_marker (objects_@YY@_t *yy);
|
||||
|
||||
#else /* !__map__ */
|
||||
|
||||
/** Callbacks **/
|
||||
|
||||
/* Returns the callbacks associated with YY's elements. */
|
||||
objects_callbacks_t objects_@YY@_element_callbacks (objects_@YY@_t *yy);
|
||||
|
||||
/* Returns the ``bogus'' marker associated with YY's elements. */
|
||||
const void *objects_@YY@_not_an_element_marker (objects_@YY@_t *yy);
|
||||
|
||||
#endif /* __map__ */
|
||||
|
||||
#endif /* __@YY@_cbs_h_OBJECTS_INCLUDE */
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue