ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
extraUtilProgress.c File Reference
#include <stdio.h>
#include "extra.h"
#include "base/main/main.h"
Include dependency graph for extraUtilProgress.c:

Go to the source code of this file.

Classes

struct  ProgressBarStruct
 DECLARATIONS ///. More...
 

Functions

ProgressBarExtra_ProgressBarStart (FILE *pFile, int nItemsTotal)
 FUNCTION DEFINITIONS ///.
 
void Extra_ProgressBarUpdate_int (ProgressBar *p, int nItemsCur, char *pString)
 
void Extra_ProgressBarStop (ProgressBar *p)
 

Function Documentation

◆ Extra_ProgressBarStart()

ProgressBar * Extra_ProgressBarStart ( FILE * pFile,
int nItemsTotal )

FUNCTION DEFINITIONS ///.

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

Synopsis [Starts the progress bar.]

Description [The first parameter is the output stream (pFile), where the progress is printed. The current printing position should be the first one on the given line. The second parameters is the total number of items that correspond to 100% position of the progress bar.]

SideEffects []

SeeAlso []

Definition at line 62 of file extraUtilProgress.c.

63{
64 ProgressBar * p;
66 p = ABC_ALLOC( ProgressBar, 1 );
67 memset( p, 0, sizeof(ProgressBar) );
68 p->pFile = pFile;
69 p->nItemsTotal = nItemsTotal;
70 p->posTotal = 78;
71 p->posCur = 1;
72 p->nItemsNext = (int)((7.0+p->posCur)*p->nItemsTotal/p->posTotal);
73 Extra_ProgressBarShow( p, NULL );
74 return p;
75}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
ABC_DLL Abc_Frame_t * Abc_FrameGetGlobalFrame()
Definition mainFrame.c:643
ABC_DLL int Abc_FrameShowProgress(Abc_Frame_t *p)
Definition mainFrame.c:310
ABC_NAMESPACE_IMPL_START typedef char ProgressBar
Definition bbrNtbdd.c:27
Cube * p
Definition exorList.c:222
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Extra_ProgressBarStop()

void Extra_ProgressBarStop ( ProgressBar * p)

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

Synopsis [Stops the progress bar.]

Description []

SideEffects []

SeeAlso []

Definition at line 118 of file extraUtilProgress.c.

119{
120 if ( p == NULL ) return;
121 Extra_ProgressBarClean( p );
122 ABC_FREE( p );
123}
#define ABC_FREE(obj)
Definition abc_global.h:267
Here is the caller graph for this function:

◆ Extra_ProgressBarUpdate_int()

void Extra_ProgressBarUpdate_int ( ProgressBar * p,
int nItemsCur,
char * pString )

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

Synopsis [Updates the progress bar.]

Description []

SideEffects []

SeeAlso []

Definition at line 88 of file extraUtilProgress.c.

89{
90 if ( p == NULL ) return;
91 if ( nItemsCur < p->nItemsNext )
92 return;
93 if ( nItemsCur >= p->nItemsTotal )
94 {
95 p->posCur = 78;
96 p->nItemsNext = 0x7FFFFFFF;
97 }
98 else
99 {
100 p->posCur += 7;
101 p->nItemsNext = (int)((7.0+p->posCur)*p->nItemsTotal/p->posTotal);
102 }
103 Extra_ProgressBarShow( p, pString );
104}