Blame
Date:
Fri Jul 1 19:42:55 2022 UTC
Message:
switch to kristaps@' oconfigure

It's a bit ugly to depend _only_ on the OpenBSD make infrastructure;
it's better when things are portable! Making mymenu-portable would be
more effort than what it's worth it, so just make the main version
portable (again). kristaps@' oconfigure (used also by mandoc-portable
and mymenu) is a lightweight configure system that's really nice to use.

see GitHub issue #1
01
2022-07-01
op
/*
02
2022-07-01
op
* Copyright (c) 2015 Ingo Schwarze <schwarze@openbsd.org>
03
2022-07-01
op
*
04
2022-07-01
op
* Permission to use, copy, modify, and distribute this software for any
05
2022-07-01
op
* purpose with or without fee is hereby granted, provided that the above
06
2022-07-01
op
* copyright notice and this permission notice appear in all copies.
07
2022-07-01
op
*
08
2022-07-01
op
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
09
2022-07-01
op
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
2022-07-01
op
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
2022-07-01
op
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
2022-07-01
op
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
2022-07-01
op
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
2022-07-01
op
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
2022-07-01
op
*/
16
2022-07-01
op
#ifdef __NetBSD__
17
2022-07-01
op
# define _OPENBSD_SOURCE
18
2022-07-01
op
#endif
19
2022-07-01
op
#include <stdlib.h>
20
2022-07-01
op
21
2022-07-01
op
int
22
2022-07-01
op
main(void)
23
2022-07-01
op
{
24
2022-07-01
op
const char *errstr;
25
2022-07-01
op
26
2022-07-01
op
if (strtonum("1", 0, 2, &errstr) != 1)
27
2022-07-01
op
return 1;
28
2022-07-01
op
if (errstr != NULL)
29
2022-07-01
op
return 2;
30
2022-07-01
op
if (strtonum("1x", 0, 2, &errstr) != 0)
31
2022-07-01
op
return 3;
32
2022-07-01
op
if (errstr == NULL)
33
2022-07-01
op
return 4;
34
2022-07-01
op
if (strtonum("2", 0, 1, &errstr) != 0)
35
2022-07-01
op
return 5;
36
2022-07-01
op
if (errstr == NULL)
37
2022-07-01
op
return 6;
38
2022-07-01
op
if (strtonum("0", 1, 2, &errstr) != 0)
39
2022-07-01
op
return 7;
40
2022-07-01
op
if (errstr == NULL)
41
2022-07-01
op
return 8;
42
2022-07-01
op
return 0;
43
2022-07-01
op
}
Omar Polo