factory.h 1022 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 <tchar.h>
  14. #include <stdio.h>
  15. #include "sd/defs.h"
  16. __SD_BEGIN_DECLS
  17. struct __sd_factory;
  18. typedef struct __sd_factory sd_factory_t;
  19. struct __sd_factory_ops
  20. {
  21. void* (*fac_new) (const TCHAR*);
  22. void (*fac_delete) (void*);
  23. void (*fac_print) (void*, FILE*);
  24. };
  25. typedef struct __sd_factory_ops sd_factory_ops_t;
  26. extern sd_factory_t* sd_factory_new(const TCHAR* a_name, 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 TCHAR* 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,int a_nitems);
  32. __SD_END_DECLS
  33. #endif