X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCset.h;h=c3bd289c079de8c46da51dccbfc238f8c4acd23b;hb=a286d842914f6fe8e4498d840ac873c64e3d8733;hp=f60664e771026eb6cab92048ff862fcda5c5d975;hpb=f93eb1eafde8985b8634d476b01641de63124b9e;p=fw%2Fsdcc diff --git a/src/SDCCset.h b/src/SDCCset.h index f60664e7..c3bd289c 100644 --- a/src/SDCCset.h +++ b/src/SDCCset.h @@ -26,58 +26,60 @@ #define SDCCSET_H #include -#if defined(_MSC_VER) -# include "sdcc_vc.h" +#if defined(_MSC_VER) || defined(__BORLANDC__) +#include "sdcc_vc.h" #else -# include "sdccconf.h" -#endif // _MSC_VER - -#include "SDCCalloc.h" +#include "sdccconf.h" +#endif // _MSC_VER #ifndef THROWS #define THROWS -#define THROW_NONE 0 -#define THROW_SRC 1 +#define THROW_NONE 0 +#define THROW_SRC 1 #define THROW_DEST 2 #define THROW_BOTH 3 #endif /* linear linked list generic */ typedef struct set -{ - void *item ; - struct set *curr ; - struct set *next ; -} set ; + { + void *item; + struct set *curr; + struct set *next; + } +set; #define DEFSETFUNC(fname) int fname ( void *item, va_list ap) -#define V_ARG(type,var) type var = va_arg(ap,type) +#define V_ARG(type,var) type var = va_arg(ap,type) /* set related functions */ -void *addSet ( set ** , void * ); -void *addSetHead ( set ** , void * ); -void *getSet ( set ** ); -void deleteSetItem ( set ** , void * ); -void deleteItemIf ( set ** , int (*cond) (void *, va_list), ... ); -int isinSet ( set * , void * ); -int isinSetWith ( set *, void *, int (*cfunc)()); -int applyToSet ( set *list ,int (*somefunc)(void *,va_list), ...); -int applyToSetFTrue ( set *list ,int (*somefunc)(void *,va_list), ...); -set *unionSets ( set *, set *, int); -set *unionSetsWith ( set *, set *, int (*cFunc)(),int); -set *intersectSets ( set *, set *, int); -void *addSetIfnotP ( set **, void *); -set *setFromSet ( set * ); -int isSetsEqual ( set *, set *); -set *subtractFromSet ( set *, set *,int); -int elementsInSet (set *); -set *intersectSetsWith (set *, set *,int (*cFunc)(),int ); -int isSetsEqualWith ( set *, set *, int (*cFunc)()); -void *peekSet ( set *); -void *setFirstItem ( set *); -void *setNextItem ( set *); -void setToNull (void ** ); - +set *newSet (void); +void *addSet (set **, void *); +void *addSetHead (set **, void *); +void *getSet (set **); +void deleteSetItem (set **, void *); +void deleteItemIf (set **, int (*cond) (void *, va_list),...); +int isinSet (set *, void *); +typedef int (* insetwithFunc) (void *, void *); +int isinSetWith (set *, void *, insetwithFunc cfunc); +int applyToSet (set * list, int (*somefunc) (void *, va_list),...); +int applyToSetFTrue (set * list, int (*somefunc) (void *, va_list),...); +set *unionSets (set *, set *, int); +set *unionSetsWith (set *, set *, int (*cFunc) (), int); +set *intersectSets (set *, set *, int); +void *addSetIfnotP (set **, void *); +set *setFromSet (set *); +int isSetsEqual (set *, set *); +set *subtractFromSet (set *, set *, int); +int elementsInSet (set *); +set *intersectSetsWith (set *, set *, int (*cFunc) (void *, void *), int); +int isSetsEqualWith (set *, set *, int (*cFunc) (void *, void *)); +void *peekSet (set *); +void *setFirstItem (set *); +void *setNextItem (set *); +void setToNull (void **); +set *reverseSet (set *); +void deleteSet(set **s); #endif