added epicsStrCaseCmp; add epicsShare decoration

This commit is contained in:
Marty Kraimer
2003-04-07 13:51:18 +00:00
parent cb4e242b40
commit 48e9500f1a
2 changed files with 29 additions and 2 deletions
+23 -1
View File
@@ -16,7 +16,11 @@
#include <limits.h>
#include <errno.h>
#include <ctype.h>
int dbTranslateEscape(char *to, const char *from)
#define epicsExportSharedSymbols
#include "epicsString.h"
epicsShareFunc int epicsShareAPI dbTranslateEscape(char *to, const char *from)
{
const char *pfrom = from;
char *pto = to;
@@ -81,3 +85,21 @@ int dbTranslateEscape(char *to, const char *from)
*pto = '\0'; /*NOTE that nto does not have to be incremented*/
return(nto);
}
epicsShareFunc int epicsShareAPI epicsStrCaseCmp(
const char *s1, const char *s2, int n)
{
size_t ind = 0;
int nexts1,nexts2;
while(1) {
if(ind++ >= n) break;
nexts1 = toupper(*s1++);
nexts2 = toupper(*s2++);
if(nexts1==0) return( (nexts2==0) ? 0 : 1 );
if(nexts2==0) return(-1);
if(nexts1<nexts2) return(-1);
if(nexts1>nexts2) return(1);
}
return(0);
}
+6 -1
View File
@@ -16,10 +16,15 @@
* returns the length of the resultant string (may contain nulls)
*/
#include <shareLib.h>
#ifdef __cplusplus
extern "C" {
#endif
int dbTranslateEscape(char *s,const char *ct);
epicsShareFunc int epicsShareAPI dbTranslateEscape(char *s,const char *ct);
epicsShareFunc int epicsShareAPI epicsStrCaseCmp(
const char *s1, const char *s2, int n);
#ifdef __cplusplus
}