/* * Copyright (c) 1995, 1996 Gunther Schadow. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef SUPPORT_H_ #define SUPPORT_H_ #include #pragma interface #include #include #ifdef __cplusplus #include extern "C" { #endif void *memchrs(const void *blk, const char *chrs, size_t len); char *strsepc(char **str, char delim); char *strlow(char *); char *strup(char *); size_t txlen(const char *); char *txdup(const char *); char *clws(char *); char *trws(char *); /* M10 check digit according to the HL7 v2.2 standard */ int cdM10(unsigned long x); /* HP-CareVue Versions of MOD10 (n=10) and MOD11 (n=11) check * digit algorithm */ int cdmod(const char*, int n); /* * These have escape character rules which are irrelevant for HL7 */ char *strsepe(char **str, const char *delim, char esc); char *strsepce(char **str, char delim, char esc); void *memchrse(const void *blk, const char *chrs, size_t len, char esc); #ifdef __cplusplus } /* FUNCTION: match * * Seek the stream `is' for any character in the string `dset'. * If one is found stop *after* the delimiter character and test if we * have just found the first character of `dset'. * * RETURN: TRUE if we stopped at the first character of `dset' * FALSE otherwise */ bool match(istream &is, const char *dset); /* FUNCTION: seek * * Seek the stream is for any character in the null termiated string * dset. Stop reading *at* the found delimiter character. * * RETURN: SUCCESS if a delimiter was found * FAIL if the stream ended before a delimiter was found * * DO NOT USE SKIP IF YOU REALLY MEAN MATCH! * i.e. don't use such sequences like: * { * skip(is,dset); * is.get(); * } */ result skip (istream &is, const char *dset); #endif /* __cplusplus */ #endif /* ! SUPPORT_H_ */