src/aig/ioa/ioaUtil.c File Reference

#include "ioa.h"
Include dependency graph for ioaUtil.c:

Go to the source code of this file.

Functions

int Ioa_FileSize (char *pFileName)
char * Ioa_FileNameGeneric (char *FileName)
char * Ioa_TimeStamp ()

Function Documentation

char* Ioa_FileNameGeneric ( char *  FileName  ) 

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 70 of file ioaUtil.c.

00071 {
00072     char * pDot;
00073     char * pUnd;
00074     char * pRes;
00075     
00076     // find the generic name of the file
00077     pRes = Aig_UtilStrsav( FileName );
00078     // find the pointer to the "." symbol in the file name
00079 //  pUnd = strstr( FileName, "_" );
00080     pUnd = NULL;
00081     pDot = strstr( FileName, "." );
00082     if ( pUnd )
00083         pRes[pUnd - FileName] = 0;
00084     else if ( pDot )
00085         pRes[pDot - FileName] = 0;
00086     return pRes;
00087 }

int Ioa_FileSize ( char *  pFileName  ) 

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

FileName [ioaUtil.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Command processing package.]

Synopsis [Procedures to read binary AIGER format developed by Armin Biere, Johannes Kepler University (http://fmv.jku.at/)]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - December 16, 2006.]

Revision [

Id
ioaUtil.c,v 1.00 2006/12/16 00:00:00 alanmi Exp

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

Synopsis [Returns the file size.]

Description [The file should be closed.]

SideEffects []

SeeAlso []

Definition at line 43 of file ioaUtil.c.

00044 {
00045     FILE * pFile;
00046     int nFileSize;
00047     pFile = fopen( pFileName, "r" );
00048     if ( pFile == NULL )
00049     {
00050         printf( "Ioa_FileSize(): The file is unavailable (absent or open).\n" );
00051         return 0;
00052     }
00053     fseek( pFile, 0, SEEK_END );  
00054     nFileSize = ftell( pFile ); 
00055     fclose( pFile );
00056     return nFileSize;
00057 }

char* Ioa_TimeStamp (  ) 

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

Synopsis [Returns the time stamp.]

Description [The file should be closed.]

SideEffects []

SeeAlso []

Definition at line 100 of file ioaUtil.c.

00101 {
00102     static char Buffer[100];
00103         char * TimeStamp;
00104         time_t ltime;
00105     // get the current time
00106         time( &ltime );
00107         TimeStamp = asctime( localtime( &ltime ) );
00108         TimeStamp[ strlen(TimeStamp) - 1 ] = 0;
00109     strcpy( Buffer, TimeStamp );
00110     return Buffer;
00111 }


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