X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cfbe03c9c3ffecd6363dcc63e6fc27b8c6ed70aa..73ef393701bd6c2c689a05d5637cc701e2f5cc2f:/src/xpm/hashtab.c?ds=sidebyside diff --git a/src/xpm/hashtab.c b/src/xpm/hashtab.c index 6efa9708b8..521a918901 100644 --- a/src/xpm/hashtab.c +++ b/src/xpm/hashtab.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1989-94 GROUPE BULL + * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -24,7 +24,7 @@ */ /*****************************************************************************\ -* hashtable.c: * +* hashtab.c: * * * * XPM library * * * @@ -33,15 +33,21 @@ * * \*****************************************************************************/ -#include "xpm34p.h" +#include "XpmI.h" LFUNC(AtomMake, xpmHashAtom, (char *name, void *data)); LFUNC(HashTableGrows, int, (xpmHashTable * table)); +#ifdef __OS2__ +/* Visual Age cannot deal with old, non-ansi, code */ static xpmHashAtom -AtomMake(char *name, void *data) /* makes an atom */ -/* char *name; */ /* WARNING: is just pointed to */ -/* void *data; */ +AtomMake(char* name, void* data) /* makes an atom */ +#else +static xpmHashAtom +AtomMake(name, data) /* makes an atom */ + char *name; /* WARNING: is just pointed to */ + void *data; +#endif { xpmHashAtom object = (xpmHashAtom) XpmMalloc(sizeof(struct _xpmHashAtom)); @@ -103,8 +109,15 @@ AtomMake(char *name, void *data) /* makes an atom */ * */ +#ifdef __OS2__ +/* Visual Age cannot deal with old, non-ansi, code */ +xpmHashAtom* xpmHashSlot(xpmHashTable* table, char* s) +#else xpmHashAtom * -xpmHashSlot(xpmHashTable *table, char *s) +xpmHashSlot(table, s) + xpmHashTable *table; + char *s; +#endif { xpmHashAtom *atomTable = table->atomTable; unsigned int hash; @@ -128,8 +141,14 @@ xpmHashSlot(xpmHashTable *table, char *s) return p; } +#ifdef __OS2__ +/* Visual Age cannot deal with old, non-ansi, code */ +static int HashTableGrows(xpmHashTable* table) +#else static int -HashTableGrows(xpmHashTable *table) +HashTableGrows(table) + xpmHashTable *table; +#endif { xpmHashAtom *atomTable = table->atomTable; int size = table->size; @@ -162,8 +181,16 @@ HashTableGrows(xpmHashTable *table) * an xpmHashAtom is created if name doesn't exist, with the given data. */ +#ifdef __OS2__ +/* Visual Age cannot deal with old, non-ansi, code */ +int xpmHashIntern(xpmHashTable* table, char* tag, void* data) +#else int -xpmHashIntern(xpmHashTable *table, char *tag, void *data) +xpmHashIntern(table, tag, data) + xpmHashTable *table; + char *tag; + void *data; +#endif { xpmHashAtom *slot; @@ -188,8 +215,14 @@ xpmHashIntern(xpmHashTable *table, char *tag, void *data) * must be called before allocating any atom */ +#ifdef __OS2__ +/* Visual Age cannot deal with old, non-ansi, code */ +int xpmHashTableInit(xpmHashTable* table) +#else int -xpmHashTableInit(xpmHashTable *table) +xpmHashTableInit(table) + xpmHashTable *table; +#endif { xpmHashAtom *p; xpmHashAtom *atomTable; @@ -210,12 +243,21 @@ xpmHashTableInit(xpmHashTable *table) * frees a hashtable and all the stored atoms */ +#ifdef __OS2__ +/* Visual Age cannot deal with old, non-ansi, code */ +void +xpmHashTableFree(xpmHashTable* table) +#else void -xpmHashTableFree(xpmHashTable *table) +xpmHashTableFree(table) + xpmHashTable *table; +#endif { xpmHashAtom *p; xpmHashAtom *atomTable = table->atomTable; + if (!atomTable) + return; for (p = atomTable + table->size; p > atomTable;) if (*--p) XpmFree(*p);