core/parser/os/win32_string_compat.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // Copy of AvxSynth's windowsPorts.cpp; it was missing the licensing | ||
| 2 | // header there, too. | ||
| 3 | |||
| 4 | #include "win32_string_compat.h" | ||
| 5 | #include <stdio.h> | ||
| 6 | #include <stdlib.h> | ||
| 7 | #include <ctype.h> | ||
| 8 | #include <string.h> | ||
| 9 | #include <dirent.h> | ||
| 10 | |||
| 11 | ✗ | char *_strrev(char *str) | |
| 12 | { | ||
| 13 | ✗ | unsigned long nLength = strlen(str); | |
| 14 | ✗ | for(unsigned long i = 0; i < nLength/2; i++) | |
| 15 | { | ||
| 16 | ✗ | char chTemp = str[i]; | |
| 17 | ✗ | str[i] = str[nLength - i - 1]; | |
| 18 | ✗ | str[nLength - i - 1] = chTemp; | |
| 19 | } | ||
| 20 | ✗ | return str; | |
| 21 | } | ||
| 22 | |||
| 23 | ✗ | char *_strupr(char *str) | |
| 24 | { | ||
| 25 | ✗ | if (str) | |
| 26 | { | ||
| 27 | ✗ | unsigned long nLength = strlen(str); | |
| 28 | ✗ | for(unsigned long i = 0; i < nLength; i++) | |
| 29 | { | ||
| 30 | ✗ | str[i] = toupper(str[i]); | |
| 31 | } | ||
| 32 | } | ||
| 33 | |||
| 34 | ✗ | return str; | |
| 35 | } | ||
| 36 | |||
| 37 | ✗ | char *_strlwr(char *str) | |
| 38 | { | ||
| 39 | ✗ | if (str) | |
| 40 | { | ||
| 41 | ✗ | unsigned long nLength = strlen(str); | |
| 42 | ✗ | for(unsigned long i = 0; i < nLength; i++) | |
| 43 | { | ||
| 44 | ✗ | str[i] = tolower(str[i]); | |
| 45 | } | ||
| 46 | } | ||
| 47 | |||
| 48 | ✗ | return str; | |
| 49 | } | ||
| 50 |