home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 June / CHIP_CD_2004-06.iso / software / miranda_hit / files / mirinstsetup.exe / Miranda Installer 0.0.1.2 / XMLParse.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-04-20  |  1.9 KB  |  43 lines

  1. /*
  2.     Miranda Installer - Installs nightlies and Miranda addons.
  3.     Copyright (C) 2002-2003 Goblineye Entertainment
  4.  
  5.     Authors: Saar (Tornado) and Kai (kai_b)
  6.  
  7.     This program is free software; you can redistribute it and/or modify
  8.     it under the terms of the GNU General Public License as published by
  9.     the Free Software Foundation; either version 2 of the License, or
  10.     (at your option) any later version.
  11.  
  12.     This program is distributed in the hope that it will be useful,
  13.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.     GNU General Public License for more details.
  16.  
  17.     You should have received a copy of the GNU General Public License
  18.     along with this program; if not, write to the Free Software
  19.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  20. */
  21.  
  22. #pragma once
  23.  
  24. /*
  25.     A basic XML Parser, adapted from Wassup
  26.     The parser was revised at some point to be able to handle comments and empty tags
  27. */
  28.  
  29. #include "MirandaInstaller.h"
  30. #pragma hdrstop
  31.  
  32. // notification sent by the parser
  33. #define XMLPARSER_NOTIFY_STARTELEMENT 0 // also "tells" when a an empty tag is found
  34. #define XMLPARSER_NOTIFY_ENDELEMENT 1
  35. #define XMLPARSER_NOTIFY_ARGUMENTS 2 // the arguments of the last element we talked about
  36. #define XMLPARSER_NOTIFY_DATA 3 // data (raw data, no elements)
  37.  
  38. // byte - notification. char* - the data (depends on the notifcation). unsigned long - length of data that should be touched. LPARAM - defined user data
  39. typedef void (*XMLParse_Handler)(byte,char*,unsigned long,LPARAM);
  40.  
  41. // this is the handler. receives all sorts of notifications from us.
  42. bool XMLParser_FeedDocument(XMLParse_Handler NotifyFunc,char *lpszDoc,LPARAM lParam); // feed the parser with the document. the document should be whole!! we don't handle semi-documents and such :)
  43. // the document is always null-terminated!!!