1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-20 00:15:31 +00:00
elinks/src/bfu/leds.h
Witold Filipczyk 1f57e72212 [mozjs24] Allow build elinks with g++
SpiderMonkey was updated to mozjs24. If you want to build elinks
with ecmascript support, you must compile using g++ with -fpermissive .
There is a lot of warnings.
There are some memleaks in ecmascript code, especially related to JSAutoCompartment.
I don't know yet, where and how to free it.

Debian does not support mozjs24, so I'm going to gradually update SpiderMonkey version.
2020-10-05 20:14:55 +02:00

63 lines
1.3 KiB
C

#ifndef EL__BFU_LEDS_H
#define EL__BFU_LEDS_H
#ifdef CONFIG_LEDS
#include "main/module.h"
#include "util/color.h"
#ifdef __cplusplus
extern "C" {
#endif
struct session;
struct terminal;
/* TODO: Variable count! */
#define LEDS_COUNT 6
/* We use struct in order to at least somehow 'authorize' client to use certain
* LED, preventing possible mess i.e. with conflicting patches or Lua scripts.
*/
/* See header of bfu/leds.c for LEDs assignment. If you are planning to use
* some LED in your script/patch, please tell us on the list so that we can
* register the LED for you. Always check latest sources for actual LED
* assignment scheme in order to prevent conflicts. */
struct led {
/* Private data. */
/* 32 bits */
unsigned int used__:1;
unsigned int value_changed__:1;
unsigned int value__:8;
};
/* Per-session led panel structure. */
struct led_panel {
struct led leds[LEDS_COUNT];
};
extern struct module leds_module;
void init_led_panel(struct led_panel *leds);
void draw_leds(struct session *ses);
void menu_leds_info(struct terminal *term, void *xxx, void *xxxx);
struct led *register_led(struct session *ses, int number);
void unregister_led(struct led *);
void set_led_value(struct led *led, unsigned char value);
unsigned char get_led_value(struct led *led);
void unset_led_value(struct led *led);
#endif
#ifdef __cplusplus
}
#endif
#endif