Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/yalecad/deck.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ extern VOIDPTR Ydeck_dequeue( P1(YDECK *deck) ) ;
Returns data (interger or pointer) stored on card.
*/

extern VOID Ydeck_dump ( P2( YDECK *deckPtr, VOID (*userPrint)() ) );
extern VOID Ydeck_dump ( P2( YDECK *deckPtr, VOID (*userPrint)(void *) ) );
/*
Arguments:
YDECK *deckPt ;
Expand All @@ -178,7 +178,7 @@ extern VOID Ydeck_dump ( P2( YDECK *deckPtr, VOID (*userPrint)() ) );
For each data item in the deck, call the user print function.
*/

extern VOID Ydeck_empty( P2( YDECK *deck, VOID (*userDelete)() ) ) ;
extern VOID Ydeck_empty( P2( YDECK *deck, VOID (*userDelete)(void *) ) ) ;
/*
Arguments:
YDECK *deck ;
Expand All @@ -189,7 +189,7 @@ extern VOID Ydeck_empty( P2( YDECK *deck, VOID (*userDelete)() ) ) ;
Should be used if deck is to be used again.
*/

extern VOID Ydeck_free( P2( YDECK *deck, VOID (*userDelete)() ) ) ;
extern VOID Ydeck_free( P2( YDECK *deck, VOID (*userDelete)(void *) ) ) ;
/*
Arguments:
YDECK *deck ;
Expand Down
8 changes: 4 additions & 4 deletions include/yalecad/dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ typedef struct {
typedef struct {
INT type ;
char *string ;
BOOL bool ;
BOOL boolx ;
} TWDRETURNBOX, *TWDRETURNPTR ;

typedef void (*dialog_callback_t)(TWDRETURNPTR, INT);
/* build a dialog box and get info */
extern TWDRETURNPTR TWdialog( P3(TWDIALOGPTR fieldp, char *name,
INT (*user_function)() ) ) ;
extern TWDRETURNPTR TWdialog( P3(TWDIALOGPTR fieldp, char *name, dialog_callback_t user_function) ) ;
/*
Arguments:
TWDIALOGPTR fieldp ;
char *name ;
INT (*user_function)() ;
dialog_callback_t user_function ;
Function:
Creates a dialog box for user to enter data. Return a pointer
to an array of type TWDRETURNPTR of the same size as input argument.
Expand Down
12 changes: 6 additions & 6 deletions include/yalecad/dset.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ REVISIONS: Sun Dec 8 23:30:16 EST 1991 - removed indirection

typedef struct ydsetrec {
YTREEPTR dtree ; /* rbtree holding sets */
INT (*compare_func)() ; /* how to compare functions in rbtree */
VOID (*user_delete)() ; /* how to delete functions in rbtree */
INT (*compare_func)(void *, void*) ; /* how to compare functions in rbtree */
VOID (*user_delete)(void *) ; /* how to delete functions in rbtree */
YTREEPTR superset_tree ; /* tree to store the superset */
YTREEPTR subset_tree ; /* tree to store the subsets */
YTREEPTR parent_tree ; /* tree to store the parents */
Expand All @@ -29,7 +29,7 @@ typedef struct ydsetrec {
NOTE that the users comparison function will be similar to
comparison function used in the rbtree package.
---------------------------------------*/
extern YDSETPTR Ydset_init( P1(INT (*compare_func)() ) ) ;
extern YDSETPTR Ydset_init( P1(INT (*compare_func)(void *, void*) ) ) ;
/*
Function:
Initialize the union/find routines. Returns back a set.
Expand All @@ -44,7 +44,7 @@ extern YDSETPTR Ydset_init( P1(INT (*compare_func)() ) ) ;
Free all elements in the set but leaves the set intact
This may be used recursively.
---------------------------------------*/
extern VOID Ydset_empty( P2(YDSETPTR set,VOID (*userDelete)() ) );
extern VOID Ydset_empty( P2(YDSETPTR set,VOID (*userDelete)(void *) ) );
/*
free all elements of a superset. Function userDelete is applied to user data.
*/
Expand Down Expand Up @@ -103,7 +103,7 @@ VOIDPTR Ydset_find_set( P2( YDSETPTR dset, VOIDPTR data ));
Free all elements in the set and the set.
This can be used recursively.
---------------------------------------*/
extern VOID Ydset_free( P2(YDSETPTR set,VOID (*userDelete)() ) );
extern VOID Ydset_free( P2(YDSETPTR set,VOID (*userDelete)(void *) ) );
/*
free the entire superset. Function userDelete is applied to user data.
*/
Expand Down Expand Up @@ -148,7 +148,7 @@ extern INT Ydset_verify( P1(YDSETPTR set));
/*------------------------
Ydset_dump
------------------------*/
extern void Ydset_dump(P2( YDSETPTR set, VOID (*printFunc)() ) );
extern void Ydset_dump(P2( YDSETPTR set, VOID (*printFunc)(void *) ) );

#endif /* YDSET_H */

22 changes: 11 additions & 11 deletions include/yalecad/graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ typedef struct graph_edge *YEDGEPTR;
Thus, the user edge weight function is optional and only
should be used if the user need dynamic edge weights.
-------------------------------------------------------------*/
extern YGRAPHPTR Ygraph_init(P4(INT(*compare_node)(),
INT(*compare_edge)(),
INT(*user_edge_weight)(),
extern YGRAPHPTR Ygraph_init(P4(INT(*compare_node)(void *, void*),
INT(*compare_edge)(void *, void*),
INT(*user_edge_weight)(void *),
INT flags));
/*
Arguments:
Expand Down Expand Up @@ -99,7 +99,7 @@ extern YNODEPTR Ygraph_nodeInsert( P2(YGRAPHPTR graph,
/*--------------------------------------------------
Ygraph_edgeDelete: free edges from data structure
--------------------------------------------------*/
extern VOID Ygraph_edgeDelete(P3(YGRAPHPTR graph,YEDGEPTR edge,VOID (*userEdgeFree)()));
extern VOID Ygraph_edgeDelete(P3(YGRAPHPTR graph,YEDGEPTR edge,VOID (*userEdgeFree)(void *)));

/*-------------------------------------------------
Ygraph_edgeInsert: insert an edge into the graph
Expand Down Expand Up @@ -140,7 +140,7 @@ then NULL returned.
/*---------------------------------------------
empty all nodes and edge from the graph
---------------------------------------------*/
VOID Ygraph_empty(P3(YGRAPHPTR graph,VOID (*nodeDelete)(),VOID (*edgeDelete)()));
VOID Ygraph_empty(P3(YGRAPHPTR graph,VOID (*nodeDelete)(void *),VOID (*edgeDelete)(void *)));

/*-------------------------------------------------
Ygraph_nodeCount
Expand Down Expand Up @@ -247,7 +247,7 @@ extern VOIDPTR Ygraph_nodeData( P1( YNODEPTR node));
/*--------------------------------------------------
free and empty the graph
--------------------------------------------------*/
extern VOID Ygraph_free(P3(YGRAPHPTR graph,VOID (*nodeDelete)(),VOID (*edgeDelete)()));
extern VOID Ygraph_free(P3(YGRAPHPTR graph,VOID (*nodeDelete)(void *),VOID (*edgeDelete)(void *)));

/*-------------------------------------------------
Ygraph_edgeEnumerate
Expand Down Expand Up @@ -353,7 +353,7 @@ VOID Ygraph_edgeIntervalPop(P1(YGRAPHPTR graph));
free_node: free node from data structure
--------------------------------------------------*/
extern VOID Ygraph_nodeDelete(P4(YGRAPHPTR graph,YNODEPTR node,
VOID (*nodeFree)(),VOID (*edgeFree)()));
VOID (*nodeFree)(void *),VOID (*edgeFree)(void *)));

/*-------------------------------------------------
Ygraph_nodeVeriy: exercise node data structure
Expand Down Expand Up @@ -518,23 +518,23 @@ extern int Ygraph_verify(P1(YGRAPHPTR graph));
/*------------------------------------------------------------
Ygraph_dump: print graph stats and call user print functions
------------------------------------------------------------*/
extern VOID Ygraph_dump(P3(YGRAPHPTR graph,VOID (*printNode)(),VOID (*printEdge)()));
extern VOID Ygraph_dump(P3(YGRAPHPTR graph,VOID (*printNode)(void *),VOID (*printEdge)(void *)));

/*---------------------------------------------------------
Sets up the users draw functions for Ygraph_draw.
---------------------------------------------------------*/
extern VOID Ygraph_drawFunctions(P3( YGRAPHPTR graph, VOID (*userNodeDraw)(), VOID (*userEdgeDraw)()));
extern VOID Ygraph_drawFunctions(P3( YGRAPHPTR graph, VOID (*userNodeDraw)(void *, INT), VOID (*userEdgeDraw)(void *, INT)));

/*---------------------------------------------------------
Get the current edge weight function
---------------------------------------------------------*/
extern INT (*Ygraph_getEdgeWeightFunction(P1(YGRAPHPTR graph)))();
extern INT (*Ygraph_getEdgeWeightFunction(P1(YGRAPHPTR graph)))(void *);

/*---------------------------------------------------------
Set the current edge weight function
---------------------------------------------------------*/
extern VOID Ygraph_setEdgeWeightFunction(P2(YGRAPHPTR graph,
INT (*userEdgeWeight)()));
INT (*userEdgeWeight)(void *)));

/*---------------------------------------------------------
Call the users drawing functions for all required nodes
Expand Down
2 changes: 1 addition & 1 deletion include/yalecad/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ extern char *Yhash_add( P4( YHASHPTR hashtable, char *key,
*/


extern void Yhash_table_delete( P2(YHASHPTR hashtable,INT (*userdelete)() ) ) ;
extern void Yhash_table_delete( P2(YHASHPTR hashtable,INT (*userdelete)(void *) ) ) ;
/*
Function:
Frees the memory associated with a hash table. The user
Expand Down
4 changes: 2 additions & 2 deletions include/yalecad/heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*****************************************************************************/

typedef struct heap {
INT (*heap_cmp)();
INT (*heap_cmp)(void *, void *);
struct heap_el *top;
} YHEAP, *YHEAPPTR;

Expand All @@ -57,7 +57,7 @@ typedef struct heap {
************************************************************************/

extern YHEAPPTR Yheap_init();
extern YHEAPPTR Yheap_init_with_parms(P1(INT (*fn)()));
extern YHEAPPTR Yheap_init_with_parms(P1(INT (*fn)(void *, void *)));
extern VOID Yheap_empty(P1(YHEAPPTR));
extern VOID Yheap_free(P1(YHEAPPTR));
extern VOID Yheap_insert(P2(YHEAPPTR, VOIDPTR));
Expand Down
8 changes: 4 additions & 4 deletions include/yalecad/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static char Ylist_h_SID[] = "@(#) list.h Yale Version 1.7 12/9/91" ;
*****************************************************************************/

typedef struct ylist {
INT (*comp)();
INT (*comp)(void *, void*);
INT size;
struct ylist_el *first, *last;
struct ylist *next;
Expand Down Expand Up @@ -226,16 +226,16 @@ typedef struct ylist_el {
* *
************************************************************************/
extern YLIST Ylist_create();
extern YLIST Ylist_create_with_parms(P1(INT (*comp)()));
extern YLIST Ylist_create_with_parms(P1(INT (*comp)(void *, void*)));
extern VOID Ylist_enqueue(P2(YLIST list, VOIDPTR data));
extern VOID Ylist_push(P2(YLIST list, VOIDPTR data));
extern VOID Ylist_insert_after(P3(YLIST list, YLIST_EL item, VOIDPTR data));
extern VOID Ylist_insert_before(P3(YLIST list, YLIST_EL item, VOIDPTR data));
extern VOID Ylist_insert_in_order(P2(YLIST list, VOIDPTR data));
extern VOIDPTR Ylist_dequeue(P1(YLIST));
extern VOIDPTR Ylist_pop(P1(YLIST));
extern VOID Ylist_delete(P3(YLIST, YLIST_EL, INT (*user_delete)() ));
extern BOOL Ylist_find_and_delete(P3(YLIST list,VOIDPTR data,INT (*user_delete)()));
extern VOID Ylist_delete(P3(YLIST, YLIST_EL, INT (*user_delete)(void *) ));
extern BOOL Ylist_find_and_delete(P3(YLIST list,VOIDPTR data,INT (*user_delete)(void *)));
extern YLIST Ylist_sort(P1(YLIST list));
extern VOID Ylist_append(P2(YLIST l1, YLIST l2));
extern VOID Ylist_clear(P1(YLIST list));
Expand Down
2 changes: 1 addition & 1 deletion include/yalecad/quicksort.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ DATE: Tue Mar 3 16:01:25 EST 1992
#define YQUICKSORT_H


extern VOID Yquicksort( P4(VOIDPTR base, INT n, INT size, INT (*compare)() ) ) ;
extern VOID Yquicksort( P4(VOIDPTR base, INT n, INT size, INT (*compare)(char *, char *) ) ) ;

#endif /* YQUICKSORT_H */
22 changes: 11 additions & 11 deletions include/yalecad/rbtree.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ typedef struct tree *YTREEPTR ;
#define SEARCH_CLOSEST 3

/* ******************* BINARY TREE INCLUDE FILES ****************** */
extern YTREEPTR Yrbtree_init( P1(INT (*compare_func)() ) ) ;
extern YTREEPTR Yrbtree_init( P1(INT (*compare_func)(void*, void*) ) ) ;
/*
Arguments:
INT compare_func() ;
Expand Down Expand Up @@ -195,7 +195,7 @@ extern VOID Yrbtree_intervalPop( P1(YTREEPTR tree) ) ;
*/

extern VOID Yrbtree_interval_free( P4(YTREEPTR tree, VOIDPTR low_key,
VOIDPTR high_key, VOID (*userDelete)()) );
VOIDPTR high_key, VOID (*userDelete)(void *)) );
/*
Arguments:
YTREEPTR tree ;
Expand All @@ -208,7 +208,7 @@ extern VOID Yrbtree_interval_free( P4(YTREEPTR tree, VOIDPTR low_key,
See below for an example.
*/

extern BOOL Yrbtree_delete( P3(YTREEPTR tree, VOIDPTR key, VOID (*userDelete)() ) ) ;
extern BOOL Yrbtree_delete( P3(YTREEPTR tree, VOIDPTR key, VOID (*userDelete)(void *) ) ) ;
/*
Arguments:
YTREEPTR tree ;
Expand Down Expand Up @@ -237,7 +237,7 @@ extern BOOL Yrbtree_delete( P3(YTREEPTR tree, VOIDPTR key, VOID (*userDelete)()
Returns 1 if successful, 0 otherwise.
*/

extern BOOL Yrbtree_deleteCurrentInterval(P2(YTREEPTR tree,VOID (*userDelete)()));
extern BOOL Yrbtree_deleteCurrentInterval(P2(YTREEPTR tree,VOID (*userDelete)(void *)));
/*
Function:
While in an interval loop, deletes the current element. This allows
Expand All @@ -246,7 +246,7 @@ extern BOOL Yrbtree_deleteCurrentInterval(P2(YTREEPTR tree,VOID (*userDelete)())
how it is used.
*/

extern BOOL Yrbtree_deleteCurrentEnumerate(P2(YTREEPTR tree,VOID (*userDel)()));
extern BOOL Yrbtree_deleteCurrentEnumerate(P2(YTREEPTR tree,VOID (*userDel)(void *)));
/*
Function:
Like Yrbtree_deleteCurrentInterval, this routine is call from inside an
Expand All @@ -256,7 +256,7 @@ extern BOOL Yrbtree_deleteCurrentEnumerate(P2(YTREEPTR tree,VOID (*userDel)()));
function. See the rbtree test program to see how it is used.
*/

extern VOID Yrbtree_empty( P2(YTREEPTR tree, VOID (*userDelete)() ) ) ;
extern VOID Yrbtree_empty( P2(YTREEPTR tree, VOID (*userDelete)(void *) ) ) ;
/*
Arguments:
YTREEPTR tree;
Expand All @@ -266,7 +266,7 @@ extern VOID Yrbtree_empty( P2(YTREEPTR tree, VOID (*userDelete)() ) ) ;
unallocated using userDelete function
*/

extern VOID Yrbtree_free( P2(YTREEPTR tree, VOID (*userDelete)() ) ) ;
extern VOID Yrbtree_free( P2(YTREEPTR tree, VOID (*userDelete)(void *) ) ) ;
/*
Arguments:
YTREEPTR tree;
Expand All @@ -282,7 +282,7 @@ extern INT Yrbtree_size( P1(YTREEPTR tree) ) ;
Find the total elements in the tree.
*/

extern INT(*Yrbtree_get_compare( P1(YTREEPTR tree) ))() ;
extern INT(*Yrbtree_get_compare( P1(YTREEPTR tree) ))(void *, void*) ;
/*
Function:
Returns a pointer to the tree's comparison function.
Expand Down Expand Up @@ -346,21 +346,21 @@ extern VOIDPTR Yrbtree_revlist( P2(YTREEPTR tree, BOOL startFlag) ) ;
Enumerate the tree in reverse order.
*/

extern VOID Yrbtree_dump( P2(YTREEPTR tree, VOID (*print_key)() )) ;
extern VOID Yrbtree_dump( P2(YTREEPTR tree, VOID (*print_key)(char *) )) ;
/*
Function:
Dump the contents of a tree. Print keys takes one argument,
a key.
*/

extern VOID Yrbtree_resort( P2(YTREEPTR tree, INT (*compare_func)() )) ;
extern VOID Yrbtree_resort( P2(YTREEPTR tree, INT (*compare_func)(void*, void*) )) ;
/*
Function:
Takes a tree and resorts the tree with a new comparison function.
All search markers are reset to NIL.
*/

extern YTREEPTR Yrbtree_copy( P2(YTREEPTR tree,INT (*compare_func)() ) );
extern YTREEPTR Yrbtree_copy( P2(YTREEPTR tree,INT (*compare_func)(void*, void*) ) );
/*
Function:
Make a copy of a tree sorted with the given comparison function.
Expand Down
4 changes: 2 additions & 2 deletions include/yalecad/tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ DATE: Mar 30, 1990
#ifndef RBTREE_H
typedef struct tree {
char *root ; /* the root of the tree */
INT (*compare_func)() ; /* how to compare two keys */
INT (*compare_func)(void*, void*) ; /* how to compare two keys */
INT offset ; /* how to get the key */
} YTREEBOX, *YTREEPTR ;
#endif
Expand All @@ -28,7 +28,7 @@ typedef struct tree {
}

/* ******************* BINARY TREE INCLUDE FILES ****************** */
extern YTREEPTR Ytree_init( P2(INT compare_func(), INT offset ) ) ;
extern YTREEPTR Ytree_init( P2(INT compare_func(void*, void*), INT offset ) ) ;
/*
Arguments:
INT compare_func() ;
Expand Down
10 changes: 5 additions & 5 deletions src/Ylib/assign.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ static INT *h4S = (INT *) NULL ;
static INT *h5S = (INT *) NULL ;
static INT *h6S = (INT *) NULL ;

static void initassign();
static void shortestpath();
static void augmentation();
static void initassign(INT[], INT[], INT, INT);
static void shortestpath(INT[], INT[], INT[], INT[], INT[], INT[], INT, INT *, INT *, INT, INT);
static void augmentation(INT[], INT, INT);
static void transformation( INT ys[], INT yt[], INT dplus[], INT dminus[], INT d, int m, int n );
static INT *allocatevector() ;
static INT **allocatematrix() ;
static INT *allocatevector(INT) ;
static INT **allocatematrix(INT, INT) ;

INT *Yassign( cost_matrix, m, n )
INT **cost_matrix ;
Expand Down
6 changes: 3 additions & 3 deletions src/Ylib/deck.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ INT Ydeck_notEmpty( deckPtr )
/* remove all cards from the deck */
/*--------------------------------*/
VOID Ydeck_empty(deckPtr,userDelete)
VOID (*userDelete)();
VOID (*userDelete)(void *);
YDECK *deckPtr;
{
VOIDPTR deckData;
Expand All @@ -232,7 +232,7 @@ VOID Ydeck_empty(deckPtr,userDelete)
/*-----------------------------------------*/
VOID Ydeck_free(deckPtr,userDelete)
YDECK *deckPtr;
VOID (*userDelete)();
VOID (*userDelete)(void *);
{
Ydeck_empty(deckPtr,userDelete);
YFREE(deckPtr);
Expand All @@ -243,7 +243,7 @@ VOID Ydeck_free(deckPtr,userDelete)
/*-------------------------------------------------*/
VOID Ydeck_dump( deckPtr, userPrint )
YDECK *deckPtr ;
VOID (*userPrint)();
VOID (*userPrint)(void *);
{

fprintf( stderr,"%d cards\n",deckPtr->size);
Expand Down
Loading