Displaying 18 results from an estimated 18 matches for "strtoupper".
2016 Jul 08
6
[PATCH v3 0/7] lib: string: add functions to case-convert strings
...d in)
Consequently, I am proposing these new functions:
void strlcpytoupper(char *dst, const char *src, size_t len);
void strlcpytolower(char *dst, const char *src, size_t len);
void strcpytoupper(char *dst, const char *src);
void strcpytolower(char *dst, const char *src);
void strtoupper(char *s);
void strtolower(char *s);
Several drivers are being modified to make use of the functions above.
Another driver that also makes use of this functionality will be
submitted upstream shortly, which prompted this whole exercise.
The changes made here have been compile-tested, but not t...
2016 Jul 09
2
[PATCH v3 1/7] lib: string: add functions to case-convert strings
...gt;
> The new functions are
> void strlcpytoupper(char *dst, const char *src, size_t len);
> void strlcpytolower(char *dst, const char *src, size_t len);
> void strcpytoupper(char *dst, const char *src);
> void strcpytolower(char *dst, const char *src);
> void strtoupper(char *s);
> void strtolower(char *s);
>
> The "str[l]cpyto*" versions of the function take a destination string
> and a source string as arguments. The "strlcpyto*" versions additionally
> take a length argument like strlcpy() itself. Lastly, the strto*
>...
2016 Jul 13
1
[PATCH v3 0/7] lib: string: add functions to case-convert strings
...void strlcpytoupper(char *dst, const char *src, size_t len);
> >> void strlcpytolower(char *dst, const char *src, size_t len);
> >> void strcpytoupper(char *dst, const char *src);
> >> void strcpytolower(char *dst, const char *src);
> >> void strtoupper(char *s);
> >> void strtolower(char *s);
> >
> >
> > You may want to read the article here:
> >
> > https://lwn.net/Articles/659214/
>
> I'll read that. Thanks.
It doesn't look like there is going to be the danger of "mass changes&quo...
2016 Jul 05
7
[PATCH v2 0/7] lib: string: add functions to case-convert strings
...Consequently, I am proposing these new functions:
char *strncpytoupper(char *dst, const char *src, size_t len);
char *strncpytolower(char *dst, const char *src, size_t len);
char *strcpytoupper(char *dst, const char *src);
char *strcpytolower(char *dst, const char *src);
char *strtoupper(char *s);
char *strtolower(char *s);
They all return a pointer to the terminating '\0' in the destination
string (for strtoupper() and strtolower() that is "s").
Several drivers are being modified to make use of the functions above.
Another driver that also makes use of this...
2016 Aug 10
3
[PATCH v5 0/7] lib: string: add functions to case-convert strings
...sed in)
Consequently, I am proposing these new functions:
int strlcpytoupper(char *dst, const char *src, size_t len);
int strlcpytolower(char *dst, const char *src, size_t len);
void strcpytoupper(char *dst, const char *src);
void strcpytolower(char *dst, const char *src);
void strtoupper(char *s);
void strtolower(char *s);
Several drivers are being modified to make use of the functions above.
Another driver that also makes use of this functionality will be
submitted upstream shortly, which prompted this whole exercise.
The changes made here have been compile-tested, but not t...
2016 Jul 22
3
[PATCH v4 0/7] lib: string: add functions to case-convert strings
...sed in)
Consequently, I am proposing these new functions:
int strlcpytoupper(char *dst, const char *src, size_t len);
int strlcpytolower(char *dst, const char *src, size_t len);
void strcpytoupper(char *dst, const char *src);
void strcpytolower(char *dst, const char *src);
void strtoupper(char *s);
void strtolower(char *s);
Several drivers are being modified to make use of the functions above.
Another driver that also makes use of this functionality will be
submitted upstream shortly, which prompted this whole exercise.
The changes made here have been compile-tested, but not t...
2016 Jul 10
1
[PATCH v3 0/7] lib: string: add functions to case-convert strings
...osing these new functions:
> void strlcpytoupper(char *dst, const char *src, size_t len);
> void strlcpytolower(char *dst, const char *src, size_t len);
> void strcpytoupper(char *dst, const char *src);
> void strcpytolower(char *dst, const char *src);
> void strtoupper(char *s);
> void strtolower(char *s);
You may want to read the article here:
https://lwn.net/Articles/659214/
and follow up some of the discussion threads on LKML about the best
semantics to advertise for the strlcpy/strscpy variants. It might be
helpful to return some kind of overflow/...
2016 Jul 08
0
[PATCH v3 1/7] lib: string: add functions to case-convert strings
...t reducing this code duplication.
The new functions are
void strlcpytoupper(char *dst, const char *src, size_t len);
void strlcpytolower(char *dst, const char *src, size_t len);
void strcpytoupper(char *dst, const char *src);
void strcpytolower(char *dst, const char *src);
void strtoupper(char *s);
void strtolower(char *s);
The "str[l]cpyto*" versions of the function take a destination string
and a source string as arguments. The "strlcpyto*" versions additionally
take a length argument like strlcpy() itself. Lastly, the strto*
functions take a single string...
2016 Jul 09
0
[PATCH v3 1/7] lib: string: add functions to case-convert strings
...nctions are
>> void strlcpytoupper(char *dst, const char *src, size_t len);
>> void strlcpytolower(char *dst, const char *src, size_t len);
>> void strcpytoupper(char *dst, const char *src);
>> void strcpytolower(char *dst, const char *src);
>> void strtoupper(char *s);
>> void strtolower(char *s);
>>
>> The "str[l]cpyto*" versions of the function take a destination string
>> and a source string as arguments. The "strlcpyto*" versions additionally
>> take a length argument like strlcpy() itself. Lastl...
2016 Jul 05
0
[PATCH v2 1/7] lib: string: add functions to case-convert strings
...ucing this code duplication.
The new functions are
char *strncpytoupper(char *dst, const char *src, size_t len);
char *strncpytolower(char *dst, const char *src, size_t len);
char *strcpytoupper(char *dst, const char *src);
char *strcpytolower(char *dst, const char *src);
char *strtoupper(char *s);
char *strtolower(char *s);
The "str[n]cpyto*" versions of the function take a destination string
and a source string as arguments. The "strncpyto*" versions
additionally take a length argument like strncpy() itself. Lastly, the
strto* functions take a single strin...
2016 Jul 05
3
[PATCH v2 0/7] lib: string: add functions to case-convert strings
...tions:
>> char *strncpytoupper(char *dst, const char *src, size_t len);
>> char *strncpytolower(char *dst, const char *src, size_t len);
>> char *strcpytoupper(char *dst, const char *src);
>> char *strcpytolower(char *dst, const char *src);
>> char *strtoupper(char *s);
>> char *strtolower(char *s);
>
> I think there isn't much value in anything other
> than strto<upper|lower>.
>
> Using str[n]cpy followed by strto<upper|lower> is
> pretty obvious and rarely used anyway.
First time around, folks were proposing...
2016 Jul 13
0
[PATCH v3 1/7] lib: string: add functions to case-convert strings
...rlcpytoupper(char *dst, const char *src, size_t len);
>>>> void strlcpytolower(char *dst, const char *src, size_t len);
>>>> void strcpytoupper(char *dst, const char *src);
>>>> void strcpytolower(char *dst, const char *src);
>>>> void strtoupper(char *s);
>>>> void strtolower(char *s);
>>>>
>>>> The "str[l]cpyto*" versions of the function take a destination string
>>>> and a source string as arguments. The "strlcpyto*" versions additionally
>>>> take a leng...
2016 Jul 01
1
[PATCH 1/6] lib: string: add function strtolower()
...trcpy and memcpy by definition return dst, that's
mostly useless. If you want it to return anything, please make it
something that might be used - for example, having stpcpy semantics
(returning a pointer to dst's terminating \0) means a caller might avoid
a strlen call.
- Maybe do strtoupper while you're at it. Quick grepping didn't find any
use for the copy-while-lowercasing, but copy-while-uppercasing can at
least be used in drivers/acpi/acpica/nsrepair2.c,
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c,
drivers/power/power_supply_sysfs.c along with a bunch of inpla...
2016 Jul 11
2
[PATCH v3 1/7] lib: string: add functions to case-convert strings
...> void strlcpytoupper(char *dst, const char *src, size_t len);
>>> void strlcpytolower(char *dst, const char *src, size_t len);
>>> void strcpytoupper(char *dst, const char *src);
>>> void strcpytolower(char *dst, const char *src);
>>> void strtoupper(char *s);
>>> void strtolower(char *s);
>>>
>>> The "str[l]cpyto*" versions of the function take a destination string
>>> and a source string as arguments. The "strlcpyto*" versions additionally
>>> take a length argument like str...
2016 Jul 05
0
[PATCH v2 0/7] lib: string: add functions to case-convert strings
...osing these new functions:
> char *strncpytoupper(char *dst, const char *src, size_t len);
> char *strncpytolower(char *dst, const char *src, size_t len);
> char *strcpytoupper(char *dst, const char *src);
> char *strcpytolower(char *dst, const char *src);
> char *strtoupper(char *s);
> char *strtolower(char *s);
I think there isn't much value in anything other
than strto<upper|lower>.
Using str[n]cpy followed by strto<upper|lower> is
pretty obvious and rarely used anyway.
2016 Jul 10
0
[PATCH v3 0/7] lib: string: add functions to case-convert strings
...tions:
>> void strlcpytoupper(char *dst, const char *src, size_t len);
>> void strlcpytolower(char *dst, const char *src, size_t len);
>> void strcpytoupper(char *dst, const char *src);
>> void strcpytolower(char *dst, const char *src);
>> void strtoupper(char *s);
>> void strtolower(char *s);
>
>
> You may want to read the article here:
>
> https://lwn.net/Articles/659214/
I'll read that. Thanks.
> and follow up some of the discussion threads on LKML about the best
> semantics to advertise for the strlcpy/strsc...
2016 Jul 05
0
[PATCH v2 0/7] lib: string: add functions to case-convert strings
...*strncpytoupper(char *dst, const char *src, size_t len);
> > > char *strncpytolower(char *dst, const char *src, size_t len);
> > > char *strcpytoupper(char *dst, const char *src);
> > > char *strcpytolower(char *dst, const char *src);
> > > char *strtoupper(char *s);
> > > char *strtolower(char *s);
> > I think there isn't much value in anything other
> > than strto.
> >
> > Using str[n]cpy followed by strto is
> > pretty obvious and rarely used anyway.
> First time around, folks were proposing the &q...
2016 Jun 30
6
[PATCH 0/6] lib: string: add function strtolower()
This series introduces a new generic function strtolower(), which
converts strings to lowercase in-place, overwriting the original
string. This kind of functionality is needed in several places in the
kernel. Right now, everybody seems to be implementing their own copy of
this function. So, we replace several custom "strtolower"
implementations with this new library function.
Another