factory.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* $Id$
  2. *
  3. * factory.h
  4. *
  5. * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved.
  6. * See the COPYING file for the terms of usage and distribution.
  7. */
  8. #ifndef __sd_factory_h
  9. #define __sd_factory_h
  10. /**
  11. * @file factory.h
  12. */
  13. #include <stdio.h>
  14. #include <sd/defs.h>
  15. __SD_BEGIN_DECLS
  16. struct __sd_factory;
  17. typedef struct __sd_factory sd_factory_t;
  18. struct __sd_factory_ops
  19. {
  20. void* (*fac_new) (const char*);
  21. void (*fac_delete) (void*);
  22. void (*fac_print) (void*, FILE*);
  23. };
  24. typedef struct __sd_factory_ops sd_factory_ops_t;
  25. extern sd_factory_t* sd_factory_new(const char* a_name,
  26. const sd_factory_ops_t* a_ops);
  27. extern void sd_factory_delete(sd_factory_t* a_this);
  28. extern void* sd_factory_get(sd_factory_t* a_this, const char* a_name);
  29. extern void sd_factory_destroy(sd_factory_t* a_this, void* a_pr);
  30. extern void sd_factory_print(const sd_factory_t* a_this, FILE* a_stream);
  31. extern int sd_factory_list(const sd_factory_t* a_this, void** a_items,
  32. int a_nitems);
  33. __SD_END_DECLS
  34. #endif