domnode.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* $Id$
  2. *
  3. * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved.
  4. * See the COPYING file for the terms of usage and distribution.
  5. */
  6. #ifndef __sd_domnode_h
  7. #define __sd_domnode_h
  8. /**
  9. * @file domnode.h @ingroup sd
  10. *
  11. * @brief Generic DOM object.
  12. */
  13. #include <tchar.h>
  14. #include <stdio.h>
  15. #include "sd/list.h"
  16. __SD_BEGIN_DECLS
  17. typedef struct {
  18. const TCHAR* name;
  19. const TCHAR* value;
  20. sd_list_t* children;
  21. sd_list_t* attrs;
  22. } sd_domnode_t;
  23. extern sd_domnode_t* sd_domnode_new(const TCHAR* a_name,const TCHAR* a_value);
  24. extern void sd_domnode_delete(sd_domnode_t* ptrThis);
  25. extern int sd_domnode_read(sd_domnode_t* ptrThis,const TCHAR* a_buffer, size_t asize);
  26. extern int sd_domnode_write(sd_domnode_t* ptrThis, TCHAR** a_buffer,size_t* asize);
  27. extern int sd_domnode_fread(sd_domnode_t* ptrThis, FILE* a_stream);
  28. extern int sd_domnode_fwrite(const sd_domnode_t* ptrThis,FILE* a_stream);
  29. extern int sd_domnode_load(sd_domnode_t* ptrThis,const TCHAR* a_filename);
  30. extern int sd_domnode_store(const sd_domnode_t* ptrThis, const TCHAR* a_filename);
  31. extern sd_domnode_t* sd_domnode_search(const sd_domnode_t* ptrThis,const TCHAR* a_name);
  32. extern sd_domnode_t* sd_domnode_attrs_put(sd_domnode_t* ptrThis,sd_domnode_t* a_attr);
  33. extern sd_domnode_t* sd_domnode_attrs_get(const sd_domnode_t* ptrThis,const TCHAR* a_name);
  34. extern sd_domnode_t* sd_domnode_attrs_remove(sd_domnode_t* ptrThis,const TCHAR* a_name);
  35. /** Creates a new node. */
  36. extern sd_domnode_t* __sd_domnode_new(const TCHAR* name, const TCHAR* a_value,int is_elem);
  37. __SD_END_DECLS
  38. #endif