kvamemolibxml.h

Go to the documentation of this file.
1 /*
2  * Copyright 2005-2017 by KVASER AB, SWEDEN
3  * WWW: http://www.kvaser.com
4  *
5  * This software is furnished under a license and may be used and copied
6  * only in accordance with the terms of such license.
7  *
8  */
9 
10 #ifndef KVAMEMOLIBXML_H
11 #define KVAMEMOLIBXML_H
12 
39 #include <windows.h>
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
54 #define XML_ERROR_MESSAGE_LENGTH 2048
55 
67 typedef enum {
81 } KvaXmlStatus;
94 typedef enum {
112 
133 KvaXmlStatus WINAPI kvaXmlInitialize (void);
134 
152 KvaXmlStatus WINAPI kvaXmlGetLastError (char *buf, unsigned int len, KvaXmlStatus *err);
153 
175 KvaXmlStatus WINAPI kvaXmlToBuffer (const char *xmlbuf, unsigned int xmllen, char *outbuf, unsigned int *outlen, long *version);
176 
192 KvaXmlStatus WINAPI kvaXmlToFile (const char *infile, const char *outfile);
193 
209 KvaXmlStatus WINAPI kvaFileToXml(const char * parfile, const char * xmlfile);
210 
223 KvaXmlStatus WINAPI kvaXmlDebugOutput (int on);
224 
246 KvaXmlStatus WINAPI kvaBufferToXml (const char *inbuf, unsigned int inlen, char *xmlbuf, unsigned int *xmllen, long *version, const char * scriptpath);
247 
262 KvaXmlStatus WINAPI kvaXmlValidate (const char *xmlbuf, unsigned int xmllen);
263 
278 KvaXmlStatus WINAPI kvaXmlGetValidationStatusCount (int *countErr, int *countWarn);
279 
296 KvaXmlStatus WINAPI kvaXmlGetValidationError (KvaXmlValidationStatus *status, char *buf, unsigned int len);
297 
314 KvaXmlStatus WINAPI kvaXmlGetValidationWarning (KvaXmlValidationStatus *status, char *buf, unsigned int len);
315 
331 KvaXmlStatus WINAPI kvaXmlGetErrorText (KvaXmlStatus status, char *buf, unsigned int len);
332 
349 KvaXmlStatus WINAPI kvaXmlGetValidationText (KvaXmlValidationStatus status, char *buf, unsigned int len);
350 
363 unsigned short WINAPI kvaXmlGetVersion (void);
364 
365 
366 // Functions and definitions provided by kv_parser, used for going back and
367 // forth between infix and postfix notation.
368 
375 typedef struct tag_token {
376  int type; // T_xxx
377  char *name; // Name for identifiers
378  struct tag_token *left; // Left part of expr if this is an op
379  struct tag_token *right; // Right dito
380  int start_pos; // Token's start pos
381  int end_pos; // Token's end pos
382  struct tag_token *next; // For later memory deallocation
383  int errCode; // ERR_xxx if this is a T_ERROR
384 } Token;
385 
391 typedef struct {
393 } KvParseHandle;
394 
405 KvParseHandle* WINAPI kvaToolsParseCreate(void);
406 
414 void WINAPI kvaToolsParseDestroy(KvParseHandle *h);
415 
426 void WINAPI kvaToolsExprGetErrorString(int errCode, char *s, size_t bufsiz);
427 
440 int WINAPI kvaToolsParseExpr(KvParseHandle *h, char* expr, Token **t);
441 
452 int WINAPI kvaToolsFreeExpr(KvParseHandle *h, Token *t);
453 
465 int WINAPI kvaToolsDumpExpr(KvParseHandle *h, Token *t);
466 
479 int WINAPI kvaToolsExprHasErrors(KvParseHandle *h, Token *t);
480 
494 int WINAPI kvaToolsExprGetError(KvParseHandle *h, Token *t, int *errCode, int *pos);
495 
527 #ifdef __cplusplus
528 }
529 #endif
530 
531 #endif //KVAMEMOLIBXML_H