sig2str.c
Source changes string letter casingCalls a character-class helper
SHA-256e298fd1bcb9fe9a3589b2e0d2a499e3beeb27b69b866e8a2332be68ee7ba89b1
MaleculeO(Er)H(Db₂)
Evidence
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause
3 *
4 * Copyright (c) 2025 Ricardo Branco <rbranco@suse.de>.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must repr …
17:6… PLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
29:3… Translate between signal names and numbers
30 */
31#include "namespace.h"
32#include <ctype.h>
33#include <limits.h>
34#include <signal.h>
35#include <stdio.h>
36#include <stdlib.h>
37#include <string.h>
38#include <ssp/ssp.h>
39#include "un-namespace.h"
40
41static const char rtmin_str[] = "RTMIN";
42static const char rtmax_str[] = "RTMAX";
43
44int
⋯6 lines
80:10… casecmp(str, rtmax_str, sizeof(rtmax_str) - 1) == 0) {
81 sig = (toupper(str[4]) == 'X') ? SIGRTMAX : SIGRTMIN;
82 n = 0;
83 if (str[rtend] == '+' || str[rtend] == '-') {
84 n = strtonum(str + rtend, IN …
⋯4 lines
95 }
96
97 if (isdigit((unsigned char)str[0])) {
98 n = strtonum(str, 1, SIGRTMAX, &errstr);
99 if (errstr == NULL) {
100 *pnum = (int)n;
101 return (0);
102 …