--- /dev/null
+typedef enum {
+ CINFO_UNKNOWN_SEP_LIN
+} color_enc_sep_lin_t;
+struct device_color_info_s {
+ int max_components;
+ int text_bits;
+ int graphics_bits;
+ color_enc_sep_lin_t separable_and_linear;
+ char comp_shift[64];
+ char comp_bits[64];
+ int black_component;
+};
+struct device_procs_s {
+ int (*open_device) ();
+ void (*get_initial_matrix) ();
+ int (*sync_output) ();
+ int (*output_page) ();
+ int (*close_device) ();
+ long long (*map_rgb_color) ();
+ int (*map_color_rgb) ();
+ void *(*ret_devn_params) ();
+};
+typedef struct inferno_device_s {
+ int retained;
+ int is_open;
+ struct device_color_info_s color_info;
+ struct device_procs_s orig_procs;
+ int ldepth;
+ int cmapcall;
+} inferno_device;
+long long inferno_rgb2cmap(void *dev)
+{
+ inferno_device *bdev;
+ bdev = (inferno_device *) dev;
+ int mask;
+ int red;
+ if (red == mask)
+ bdev->ldepth = 3;
+ bdev->cmapcall = 1;
+ return mask;
+}