mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
Move get_bool() to src/common/
...in preparation for sharing it more widely
This commit is contained in:
parent
471e3837b7
commit
bdf6e13881
4 changed files with 36 additions and 15 deletions
19
src/common/get-bool.c
Normal file
19
src/common/get-bool.c
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include "common/get-bool.h"
|
||||
|
||||
bool
|
||||
get_bool(const char *s)
|
||||
{
|
||||
if (!s) {
|
||||
return false;
|
||||
}
|
||||
if (!strcasecmp(s, "yes")) {
|
||||
return true;
|
||||
}
|
||||
if (!strcasecmp(s, "true")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ labwc_sources += files(
|
|||
'dir.c',
|
||||
'fd_util.c',
|
||||
'font.c',
|
||||
'get-bool.c',
|
||||
'grab-file.c',
|
||||
'graphic-helpers.c',
|
||||
'mem.c',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue