Skip to content

Commit 49dfb4d

Browse files
committed
ROMIO: add strtolower function
a lot more straightforward to just lowercase the string than to try to check all the different case possibilities of strings. Useful in hint processing too, but not used there yet.
1 parent 4e5aa37 commit 49dfb4d

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/mpi/romio/adio/common/strfns.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,18 @@ char *ADIOI_Strdup(const char *str)
102102
}
103103
return save_p;
104104
}
105+
106+
/*
107+
* Convert string to lowercase
108+
* Converts inplace, returns pointer to str
109+
*/
110+
char *ADIOI_Strlower(char *str)
111+
{
112+
if (!str)
113+
return str;
114+
while (*str) {
115+
*str = tolower(*str);
116+
str++;
117+
}
118+
return str;
119+
}

src/mpi/romio/adio/include/adioi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,7 @@ int ADIOI_Set_lock64(FDTYPE fd_sys, int cmd, int type, ADIO_Offset offset, int w
849849

850850
int ADIOI_Strncpy(char *outstr, const char *instr, size_t maxlen);
851851
char *ADIOI_Strdup(const char *);
852+
char *ADIOI_Strlower(char *str);
852853

853854
/* the current MPI standard is not const-correct, and modern compilers warn
854855
* about the following sort of code:

0 commit comments

Comments
 (0)