Files
recycled-ni-neutrino/src/create_rcsim_h.sh
vanhofen 228594f31f introduce src/driver/rcinput_fake.h
Origin commit data
------------------
Branch: ni/coolstream
Commit: 1e520b1032
Author: vanhofen <vanhofen@gmx.de>
Date: 2022-09-27 (Tue, 27 Sep 2022)

Origin message was:
------------------
- introduce src/driver/rcinput_fake.h

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
2022-09-27 23:58:23 +02:00

44 lines
873 B
Bash

#!/bin/sh
#
# create a rcsim.h file from the rcinput header
# (C) 2011 Stefan Seyfried
# License: GPL v2
#
# usage: sh ./create_rcsim_h.sh > rcsim.h
cat << EOF
// rcsim.h - automatically created from driver/rcinput.h and driver/rcinput_fake.h
EOF
cat driver/rcinput_fake.h
cat << EOF
enum {
EOF
sed -n '/^[[:space:]]*RC_0/,/^[[:space:]]*RC_analog_off/s/^[[:space:]]*/ /p' driver/rcinput.h
cat << EOF
};
enum { // not defined in input.h but used like that, at least in 2.4.22
KEY_RELEASED = 0,
KEY_PRESSED,
KEY_AUTOREPEAT
};
struct key{
const char *name;
const unsigned long code;
};
static const struct key keyname[] = {
EOF
sed -n '/^[[:space:]]*RC_0/,/^[[:space:]]*RC_analog_off/ s/^.*=[[:space:]]*\(KEY_.*\),.*/ { "\1", \1 },/p' driver/rcinput.h
cat << EOF
/* to stay backward compatible */
{ "KEY_SETUP", KEY_MENU },
{ "KEY_HOME", KEY_EXIT },
};
EOF