Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4b1302b

Browse files
committed
Generalized version of dictionaries, with compatibility hacks.
1 parent aff9470 commit 4b1302b

3 files changed

Lines changed: 1453 additions & 0 deletions

File tree

Include/mappingobject.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/***********************************************************
2+
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
3+
Amsterdam, The Netherlands.
4+
5+
All Rights Reserved
6+
7+
Permission to use, copy, modify, and distribute this software and its
8+
documentation for any purpose and without fee is hereby granted,
9+
provided that the above copyright notice appear in all copies and that
10+
both that copyright notice and this permission notice appear in
11+
supporting documentation, and that the names of Stichting Mathematisch
12+
Centrum or CWI not be used in advertising or publicity pertaining to
13+
distribution of the software without specific, written prior permission.
14+
15+
STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
16+
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
17+
FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
18+
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
21+
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22+
23+
******************************************************************/
24+
25+
/*
26+
Mapping object type -- mapping from object to object.
27+
These functions set errno for errors. Functions mappingremove() and
28+
mappinginsert() return nonzero for errors, getmappingsize() returns -1,
29+
the others NULL. A successful call to mappinginsert() calls INCREF()
30+
for the inserted item.
31+
*/
32+
33+
extern typeobject Mappingtype;
34+
35+
#define is_mappingobject(op) ((op)->ob_type == &Mappingtype)
36+
37+
extern object *newmappingobject PROTO((void));
38+
extern object *mappinglookup PROTO((object *dp, object *key));
39+
extern int mappinginsert PROTO((object *dp, object *key, object *item));
40+
extern int mappingremove PROTO((object *dp, object *key));
41+
extern int getmappingsize PROTO((object *dp));
42+
extern object *getmappingkey PROTO((object *dp, int i));
43+
extern object *getmappingkeys PROTO((object *dp));

0 commit comments

Comments
 (0)