/*
 *
 * u s e r i n i t . c			-- The place where user put his/her
 *					   initialization
 *
 * Copyright (C) 1993,1994,1995 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
 * 
 *
 * Permission to use, copy, and/or distribute this software and its
 * documentation for any purpose and without fee is hereby granted, provided
 * that both the above copyright notice and this permission notice appear in
 * all copies and derived works.  Fees for distribution or use of this
 * software or derived works may only be charged with express written
 * permission of the copyright holder.  
 * This software is provided ``as is'' without express or implied warranty.
 *
 * This software is a derivative work of other copyrighted softwares; the
 * copyright notices of these softwares are placed in the file COPYRIGHTS
 *
 *
 *           Author: Erick Gallesio [eg@kaolin.unice.fr]
 *    Creation date: 23-Jan-1994 19:09
 * Last file update: 19-Jul-1996 berryj@dimacs.rutgers.edu
 */

#include <stk.h>

#include <LINK/stkWrapper/LINK_STk.h>
#include <LINK/wrappers/basicSTkInit.h>
#include <LINK/wrappers/graphSTkInit.h>
#include <LINK/wrappers/algorithmSTkInit.h>
#include <LINK/wrappers/generatorSTkInit.h>
#include <LINK/wrappers/layoutSTkInit.h>
#include <LINK/wrappers/userobjSTkInit.h>

#include <iostream.h>

void STk_user_init(void)
{
	Link_initRand();

	cout << "defining Link methods......" << endl;
	STk_init_CXXwrapper();
	STk_basic_init();
	STk_graph_init();
	STk_algorithm_init();
	STk_generator_init();
	STk_layout_init();
	STk_userobj_init();
	cout << "loading Link interface......" << endl;
        STk_eval_C_string("(let ((ss (getenv \"STK_LOAD_PATH\")))
                            (cond ((equal? ss \"\") 

	(display \"error: STK_LOAD_PATH must contain $NEWLINKBASE/stklos\n\"))
					))", NIL);

	STk_eval_C_string("(require \"main-window\")", NIL);
	STk_eval_C_string("(define gv (make <graph-view> :graph (graph)))",NIL);
        //*****************************************************************
	//** User additions below
	//*****************************************************************
	extern void STk_evenOddRanks_Init();
	STk_evenOddRanks_Init();
	//*****************************************************************
}

void STk_user_cleanup(void)
{
	STk_basic_cleanup();
	STk_graph_cleanup();
	STk_algorithm_cleanup();
	STk_generator_cleanup();
	STk_layout_cleanup();
	STk_userobj_cleanup();
	//*****************************************************************
	//** User additions below
	//*****************************************************************

	//*****************************************************************
}
