Click here to Skip to main content
15,892,839 members
Articles / Programming Languages / XML

UTF-8 encoded XML file/stream processing

Rate me:
Please Sign up or sign in to vote.
3.58/5 (9 votes)
5 Jan 20072 min read 84.6K   6K   31  
Process an UTF-8 encoded XML file or stream; read group & attribute values; write & delete grps, attribs, values & comments.
#ifndef __JPR_GetNxtLne
#define	__JPR_GetNxtLne 1
//=====================================================================================	//
//				J P R _ G e t N x t L n e . h				//
//-------------------------------------------------------------------------------------	//
//=====================================================================================	//
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

//=============================================================================	//
// Definitions									//
//=============================================================================	//
#define	Nc		'\003'				// Unlikely char in a text file
#define	bB		  500				// Big read/write buffer sizes
#define	sB		   99				// Standard character string buffer size


#ifdef JPRDLL_API			    // This is "not using the DLL"
#else
 #ifdef JPRDLL_EXPORTS
  #define JPRDLL_API __declspec(dllexport)  // This is "building the DLL"
 #else
  #define JPRDLL_API __declspec(dllimport)  // This is "using the DLL"
 #endif
#endif
//=============================================================================	//
// Prototypes									//
//=============================================================================	//
extern JPRDLL_API FILE*	JPR_fopen	(char*,char*);
extern JPRDLL_API long	JPR_GetNxtLne	(char*,size_t*,size_t,FILE*);
extern JPRDLL_API long  JPR_fclose	(FILE*);

#endif	//__JPR_GetNxtLne


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United Kingdom United Kingdom
BSc (St.Andrews(1963-67))
MSCE
Systems Programmer 39+yrs
Married to first wife 35yrs & counting, four grown-up children
Religious opinions similar to MelG's
It is not the gnosis, but the praxis must be the fruit. (Aristotle)

Comments and Discussions