home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume36
/
formes
/
part01
/
assoc.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-04-01
|
1KB
|
53 lines
/*
* Copyright (C) 1992-1993 Jeffrey Chilton
*
* Permission is granted to anyone to make or distribute copies of
* this program, in any medium, provided that the copyright notice
* and permission notice are preserved, and that the distributor
* grants the recipient permission for further redistribution as
* permitted by this notice.
*
* Author's E-mail address: 172-9221@mcimail.com
*
*/
/* static char *whatstring = "@(#)assoc.h 2.2 JWC"; */
#ifndef ASSOC_H
#define ASSOC_H
/*
* Association - a pair of general-purpose pointers
*/
typedef struct Association Association;
struct Association
{
void *key;
void *value;
};
#if __STDC__
extern Association *Association_new();
extern Association *Association_newWithKey(void *key);
extern Association *Association_newWithPair(void *key, void *value);
extern void Association_destroy(Association *self);
#else
extern Association *Association_new();
extern Association *Association_newWithKey();
extern Association *Association_newWithPair();
extern void Association_destroy();
#endif
#define Association_getKey(s) ((s)->key)
#define Association_getValue(s) ((s)->value)
#define Association_setValue(s, v) (s)->value = v
#endif