src/base/cmd/cmdAlias.c File Reference

#include "cmdInt.h"
Include dependency graph for cmdAlias.c:

Go to the source code of this file.

Functions

void CmdCommandAliasAdd (Abc_Frame_t *pAbc, char *sName, int argc, char **argv)
void CmdCommandAliasPrint (Abc_Frame_t *pAbc, Abc_Alias *pAlias)
char * CmdCommandAliasLookup (Abc_Frame_t *pAbc, char *sCommand)
void CmdCommandAliasFree (Abc_Alias *pAlias)

Function Documentation

void CmdCommandAliasAdd ( Abc_Frame_t pAbc,
char *  sName,
int  argc,
char **  argv 
)

CFile****************************************************************

FileName [cmdAlias.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Command processing package.]

Synopsis [Procedures dealing with aliases in the command package.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id
cmdAlias.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

] DECLARATIONS /// FUNCTION DEFINITIONS ///Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 42 of file cmdAlias.c.

00043 {
00044     Abc_Alias * pAlias;
00045     int fStatus, i;
00046 
00047     pAlias = ALLOC(Abc_Alias, 1);
00048     pAlias->sName = Extra_UtilStrsav(sName);
00049     pAlias->argc = argc;
00050     pAlias->argv = ALLOC(char *, pAlias->argc);
00051     for(i = 0; i < argc; i++) 
00052         pAlias->argv[i] = Extra_UtilStrsav(argv[i]);
00053     fStatus = st_insert( pAbc->tAliases, pAlias->sName, (char *) pAlias );
00054     assert(!fStatus);  
00055 }

void CmdCommandAliasFree ( Abc_Alias pAlias  ) 

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 109 of file cmdAlias.c.

00110 {
00111     CmdFreeArgv( pAlias->argc, pAlias->argv );
00112     FREE(pAlias->sName);    
00113     FREE(pAlias);
00114 }

char* CmdCommandAliasLookup ( Abc_Frame_t pAbc,
char *  sCommand 
)

Function********************************************************************

Synopsis [required]

Description [optional]

SideEffects [required]

SeeAlso [optional]

Definition at line 88 of file cmdAlias.c.

00089 {
00090   Abc_Alias * pAlias;
00091   char * value;
00092   if (!st_lookup( pAbc->tAliases, sCommand, &value)) 
00093     return sCommand;
00094   pAlias = (Abc_Alias *) value;
00095   return pAlias->argv[0];
00096 }

void CmdCommandAliasPrint ( Abc_Frame_t pAbc,
Abc_Alias pAlias 
)

Function********************************************************************

Synopsis [required]

Description [optional]

SideEffects [required]

SeeAlso [optional]

Definition at line 68 of file cmdAlias.c.

00069 {
00070     int i;
00071     fprintf(pAbc->Out, "%-15s", pAlias->sName);
00072     for(i = 0; i < pAlias->argc; i++) 
00073         fprintf( pAbc->Out, " %s", pAlias->argv[i] );
00074     fprintf( pAbc->Out, "\n" );
00075 }


Generated on Tue Jan 5 12:18:43 2010 for abc70930 by  doxygen 1.6.1