Move opts/ into util/opts/

This commit is contained in:
Kamil Trzcinski
2022-09-02 22:00:01 +02:00
parent 9a592fb00e
commit f5726fc9b2
34 changed files with 48 additions and 48 deletions

26
util/opts/control.c Normal file
View File

@ -0,0 +1,26 @@
#include "control.h"
#include <ctype.h>
#include <stdbool.h>
#include <stdio.h>
int device_option_normalize_name(const char *in, char *outp)
{
// The output is always shorter, so `outp=in`
// colour_correction_matrix => colourcorrectionmatrix
// Colour Correction Matrix => colourcorrectionmatrix
// ColourCorrectionMatrix => colourcorrectionmatrix
char *out = outp;
while (*in) {
if (isalnum(*in)) {
*out++ = tolower(*in++);
} else {
in++;
}
}
*out++ = 0;
return out - outp;
}