constrain.c

Go to the documentation of this file.
00001 /*
00002  * $Id: constrain.c,v 1.2 2004/06/22 20:23:26 joaoluiz Exp $
00003  * (C) COPYRIGHT 2004, Joao Luiz Elias Campos.
00004  * All Rights Reserved
00005  * Duplication of this program or any part thereof without the express
00006  * written consent of the author is prohibited
00007  *
00008  *   Modified:    25-Jan-2006    Alexandre A. Del Savio
00009  *     Modificada a função ConstrainInit onde foi adicionado a
00010  *     função de inicialização ConstSurfaceInit. 
00011  *
00012  *   Modified  28-03-06  Juan Pablo Ibañez
00013  *     Modificada a funcão ConstrainInit, onde foi tirada a liberacao de
00014  *     memória de ConstList, que passa a ser feito no final da análise
00015  *     (funcão DRSolver no arquivo alg.c).
00016  *
00017  *   Modified:    21-Jun-2006    Alexandre A. Del Savio
00018  *     Added the ContNumConstrainRead variable to control the read of
00019  *     constrain globally.
00020  *     Modified the ConstrainInit function when add the initialization of
00021  *     ContNumConstrainRead.
00022  */
00023 
00030 /*
00031  * Global variables and symbols:
00032  */
00033 #include <stdlib.h>
00034 #include "constrain.h"
00035 
00036 sConstClass ConstClass[NumConstTypes];
00037 sConstrain **ConstList = NULL;
00038 int ContNumConstrainRead = 0;
00039 int NumConstrains = 0;
00040 
00041 /*
00042  * Local functions:
00043  */
00044 void ConstCurveInit  ( void );
00045 void ConstShotInit   ( void );
00046 void ConstSurfaceInit( void );
00047 
00048 /*
00049  * Public functions:
00050  */
00051 
00055 void ConstrainInit( void )
00056 {
00057   int i;
00058 
00059   ContNumConstrainRead = 0;
00060 
00061   ConstClass[CURVE].init   = ConstCurveInit;
00062   ConstClass[SHOT].init    = ConstShotInit;
00063   ConstClass[SURFACE].init = ConstSurfaceInit;
00064 
00065   for(i = 0; i < NumConstTypes; i++)
00066     ConstInit(i);
00067 
00068   ConstList = (sConstrain **)calloc(NumConstrains, sizeof(sConstrain *));
00069 
00070 } /* End of ConstrainInit */
00071 
00075 void ConstrainFree( void )
00076 {
00077   int i;
00078 
00079   for(i = 0; i < NumConstrains; i++) 
00080     ConstFree(ConstList[i]);
00081 
00082   free(ConstList);
00083   ConstList = NULL;
00084 
00085 } /* End of ConstrainFree */
00086 
00090 void ConstrainBuild( void )
00091 {
00092   int i;
00093 
00094   for(i = 0; i < NumConstrains; i++) 
00095     ConstBuild(ConstList[i]);
00096 
00097 } /* End of ConstrainBuild */
00098 
00099 /*
00100  * End of File.
00101  */
00102 

Generated on Tue Oct 23 11:23:29 2007 for Relax by  doxygen 1.5.3