This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:latest as build | |
RUN apk add build-base | |
WORKDIR /tmp | |
COPY . ./ | |
RUN make | |
FROM alpine:latest | |
COPY --from=build /tmp/output /usr/local/bin/output | |
CMD ["output"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <linux/input.h> | |
#include <sys/ioctl.h> | |
struct leds { | |
const char *name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <linux/input.h> | |
#include <sys/ioctl.h> | |
struct leds { | |
const char *name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Jsmn does not decode json strings, so it's up to you to do that. | |
Incidentally the json string is always going to be longer, | |
or the same size as the decoded string because of the way escape sequences work. | |
This means you can decode the json string in place in the original input buffer. | |
So. After you have parsed the input string into jsm tokens you can call | |
const char *foo = jsmn_string(buffer, token); | |
on any token. If the return is not NULL, it is a valid utf8 string. |