ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
bar.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "misc/util/abc_global.h"
#include "base/main/main.h"
#include "bar.h"
Include dependency graph for bar.c:

Go to the source code of this file.

Classes

struct  Bar_Progress_t_
 DECLARATIONS ///. More...
 

Functions

Bar_Progress_tBar_ProgressStart (FILE *pFile, int nItemsTotal)
 FUNCTION DEFINITIONS ///.
 
void Bar_ProgressUpdate_int (Bar_Progress_t *p, int nItemsCur, char *pString)
 
void Bar_ProgressStop (Bar_Progress_t *p)
 

Function Documentation

◆ Bar_ProgressStart()

Bar_Progress_t * Bar_ProgressStart ( FILE * pFile,
int nItemsTotal )

FUNCTION DEFINITIONS ///.

MACRO 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 66 of file bar.c.

67{
69 Abc_Frame_t * pFrame;
70 pFrame = Abc_FrameReadGlobalFrame();
71 if ( pFrame == NULL )
72 return NULL;
73 if ( !Abc_FrameShowProgress(pFrame) ) return NULL;
75 memset( p, 0, sizeof(Bar_Progress_t) );
76 p->pFile = pFile;
77 p->nItemsTotal = nItemsTotal;
78 p->posTotal = 78;
79 p->posCur = 1;
80 p->nItemsNext = (int)((7.0+p->posCur)*p->nItemsTotal/p->posTotal);
81 Bar_ProgressShow( p, NULL );
82 return p;
83}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
Definition abcapis.h:38
struct Bar_Progress_t_ Bar_Progress_t
BASIC TYPES ///.
Definition bar.h:48
ABC_DLL int Abc_FrameShowProgress(Abc_Frame_t *p)
Definition mainFrame.c:310
ABC_DLL Abc_Frame_t * Abc_FrameReadGlobalFrame()
Definition mainFrame.c:666
Cube * p
Definition exorList.c:222
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Bar_ProgressStop()

void Bar_ProgressStop ( Bar_Progress_t * p)

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

Synopsis [Stops the progress bar.]

Description []

SideEffects []

SeeAlso []

Definition at line 126 of file bar.c.

127{
128 if ( p == NULL ) return;
129 Bar_ProgressClean( p );
130 ABC_FREE( p );
131}
#define ABC_FREE(obj)
Definition abc_global.h:267
Here is the caller graph for this function:

◆ Bar_ProgressUpdate_int()

void Bar_ProgressUpdate_int ( Bar_Progress_t * p,
int nItemsCur,
char * pString )

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

Synopsis [Updates the progress bar.]

Description []

SideEffects []

SeeAlso []

Definition at line 96 of file bar.c.

97{
98 if ( p == NULL ) return;
99 if ( nItemsCur < p->nItemsNext )
100 return;
101 if ( nItemsCur >= p->nItemsTotal )
102 {
103 p->posCur = 78;
104 p->nItemsNext = 0x7FFFFFFF;
105 }
106 else
107 {
108 p->posCur += 7;
109 p->nItemsNext = (int)((7.0+p->posCur)*p->nItemsTotal/p->posTotal);
110 }
111 Bar_ProgressShow( p, pString );
112}