Carlos,
   Cuando creas un archivo .h debes hacer los siguiente:
si el archivo se llamase lista.h:

#ifndef lista.h
#define lista.h

/* sub includes */
/*Tu archivo .h normal*/

#endif

   Tendras que hacer un ifndef distinto para cada archivo. De esa
forma se rompe la dependencia ciclica.

Saludos



On Tue, Mar 18, 2008 at 4:36 PM, Carlos Pantelides
<[EMAIL PROTECTED]> wrote:
> Hola:
>
>  Estoy teniendo una dificultad con declaraciones. En la
>  seccion marcada como "antes", esta todo ok. "Luego",
>  cuando agrego t_api en la firma de *inner_read, se me
>  produce una dependencia cíclica que no se como
>  resolver.
>
>  Quizas el problema sea con la declaración del puntero
>  a  funcion, por eso agregué el "creo" al subject
>
>  Agradeceré orientación al respecto.
>
>  Carlos Pantelides
>
>  ####################### antes #######################
>
>
>  [main.h]
>  #include "cache.h"
>  typedef struct {
>   Cache * cache;
>  } t_api;
>
>  -----------------------------------------------------
>  [cache.h]
>
>  typedef struct {
>   void  (*inner_read)() ;
>  } Cache;
>
>  ####################### luego #######################
>  [main.h]
>  typedef struct {
>    ...
>  } t_rec;
>
>  #include "cache.h"
>
>  typedef struct {
>   Cache * cache;
>  } t_api;
>
>  -----------------------------------------------------
>  [cache.h]
>  typedef struct {
>   int   cache_size;
>   void  (*inner_read)(t_api *, t_rec *) ;
>  } Cache;
>
>  ##################### mas luego #####################
>  [main.h]
>  typedef struct {
>    ...
>  } t_rec;
>
>  struct t_api;
>
>  #include "cache.h"
>
>  struct t_api{
>   FILE * imp_file;
>   Cache * cache;
>  };
>
>
>
>
>
>       
> ____________________________________________________________________________________
>  Looking for last minute shopping deals?
>  Find them fast with Yahoo! Search.  
> http://tools.search.yahoo.com/newsearch/category.php?category=shopping
>  _______________________________________________
>  Lista de correo Programacion.
>  [email protected]
>  http://listas.fi.uba.ar/mailman/listinfo/programacion
>

_______________________________________________
Lista de correo Programacion.
[email protected]
http://listas.fi.uba.ar/mailman/listinfo/programacion

Responder a