|
Next: About this document Up: No Title Previous: Maintenance Utilities
Compiling VIS and Creating a New Package
Compiling VISStandard Makefiles are provided with each package within VIS. To compile
For portability and uniformity, please use the suggested compiler gcc.
Adding Code to VISTo add code to the VIS system (that may or may not become part of the public system), use the tst package. This dummy package is known to the VIS system, yet is easily adapted to your purposes. If later your package is included in the public system, it can easily be adapted to become permanent. The VIS system knows about two functions in the tst package:
For example, to add a command _testRng to VIS, use the following function
/**Function******************************************************************** Synopsis [Implements the _test_rng command.] SideEffects [] ******************************************************************************/ static int CommandTestRng( Hrc_Manager_t ** hmgr, int argc, char ** argv) { int c; int verbose = 0; /* default value */ /* * Parse command line options. */ util_getopt_reset(); while ((c = util_getopt(argc, argv, "v")) != EOF) { switch(c) { case 'v': verbose = 1; break; default: goto usage; } } if (verbose) { (void) fprintf(vis_stdout, "The _test_rng command does nothing\n"); } /* * Normal exit */ return 0; usage: (void) fprintf(vis_stderr, "usage: _test_rng [-v]\n"); (void) fprintf(vis_stderr, " -v\t\tverbose\n"); /* * Error exit */ return 1; } and change Tst_Init and Tst_End (in tst.c) as follows
/**CFile*********************************************************************** FileName [tst.c] PackageName [tst] Synopsis [Test package initialization, ending, and the command _test.] Author [Originated from SIS.] Copyright [Copyright (c) 1994-1996 The Regents of the Univ. of California. All rights reserved. ******************************************************************************/ #include "tstInt.h" static char rcsid[] = "$Id: node7.html,v 1.1.1.1 2001/04/26 21:30:15 vis Exp $"; USE(rcsid); /*---------------------------------------------------------------------------*/ /* Definition of exported functions */ /*---------------------------------------------------------------------------*/ /**Function******************************************************************** Synopsis [Initializes the test package.] SideEffects [] SeeAlso [Tst_End] ******************************************************************************/ void Tst_Init() { /* * Add a command to the global command table. By using the leading * underscore, the command will be listed under "help -a" but not "help". */ Cmd_CommandAdd("_test_rng", CommandTestRng, /* doesn't changes_network */ 0); } /**Function******************************************************************** Synopsis [Ends the test package.] SideEffects [] SeeAlso [Tst_Init] ******************************************************************************/ void Tst_End() { /* * For example, free any global memory (if any) which the test package is * responsible for. */ }
Adding a New Package to VISTo add a new package to VIS,
VIS Engineering Manual |
Contact |
©2002-2018 U.C. Regents |