* [Guía completa para novatos](es/newbs.md) * [Empezando](es/newbs_getting_started.md) * [Construyendo tu primer firmare](es/newbs_building_firmware.md) * [Flasheando el firmware](es/newbs_flashing.md) * [Testeando y depurando ](es/newbs_testing_debugging.md) * [Mejores práticas](es/newbs_best_practices.md) * [Recursos de aprendizaje](es/newbs_learn_more_resources.md) * [QMK Basics](es/README.md) * [Introducción a QMK](es/getting_started_introduction.md) * [QMK CLI](es/cli.md) * [Configuración de QMK CLI](es/cli_configuration.md) * [Contribuyendo a QMK](es/contributing.md) * [Cómo usar Github](es/getting_started_github.md) * [Obtener ayuda](es/getting_started_getting_help.md) * [Cambios incompatibles](es/breaking_changes.md) * [30 Ago 2019](es/ChangeLog/20190830.md) * [Preguntas frecuentes](es/faq.md) * [General](es/faq_general.md) * [Construir/Compilar QMK](es/faq_build.md) * [Depurando/Encontrando problemas en QMK](es/faq_debug.md) * [Keymap](es/faq_keymap.md) * [Instalación de drivers con Zadig](es/driver_installation_zadig.md) * Guías detalladas * [Instalar herramientas construcción](es/getting_started_build_tools.md) * [Guía Vagrant](es/getting_started_vagrant.md) * [Instrucciones de Construcción/Compilado](es/getting_started_make_guide.md) * [Flasheando Firmware](es/flashing.md) * [Personalizando funcionalidad](es/custom_quantum_functions.md) * [Visión general del Keymap](es/keymap.md) * [Hardware](es/hardware.md) * [Procesadores AVR](es/hardware_avr.md) * [Drivers](es/hardware_drivers.md) * Referencia * [Pautas de teclados](es/hardware_keyboard_guidelines.md) * [Opciones de configuración](es/config_options.md) * [Keycodes](es/keycodes.md) * [Convenciones de código - C](es/coding_conventions_c.md) * [Convenciones de código - Python](es/coding_conventions_python.md) * [Mejores prácticas de documentación](es/documentation_best_practices.md) * [Plantillas de documentación](es/documentation_templates.md) * [Glosario](es/reference_glossary.md) * [Tests unitarios](es/unit_testing.md) * [Funciones útiles](es/ref_functions.md) * [Sporte configurador](es/reference_configurator_support.md) * [Formato info.json](es/reference_info_json.md) * [Desarrollo Python CLI](es/cli_development.md) * [Características](es/features.md) * [Keycodes Básicos](es/keycodes_basic.md) * [Teclas US ANSI Shifted](es/keycodes_us_ansi_shifted.md) * [Keycodes Quantum](es/quantum_keycodes.md) * [Keycodes Avanzados](es/feature_advanced_keycodes.md) * [Audio](es/feature_audio.md) * [Auto Shift](es/feature_auto_shift.md) * [Retroiluminación](es/feature_backlight.md) * [Bluetooth](es/feature_bluetooth.md) * [Bootmagic](es/feature_bootmagic.md) * [Combos](es/feature_combo.md) * [Comando](es/feature_command.md) * [API Debounce](es/feature_debounce_type.md) * [Switch DIP](es/feature_dip_switch.md) * [Macros Dinámicas](es/feature_dynamic_macros.md) * [Encoders](es/feature_encoders.md) * [Grave Escape](es/feature_grave_esc.md) * [Feedback Háptico](es/feature_haptic_feedback.md) * [Controlador LCD HD44780](es/feature_hd44780.md) * [Key Lock](es/feature_key_lock.md) * [Layouts](es/feature_layouts.md) * [Tecla Leader](es/feature_leader_key.md) * [Matriz LED](es/feature_led_matrix.md) * [Macros](es/feature_macros.md) * [Teclas del ratón](es/feature_mouse_keys.md) * [Driver OLED](es/feature_oled_driver.md) * [Teclas One Shot](es/feature_advanced_keycodes.md#one-shot-keys) * [Dispositivo de apuntado](es/feature_pointing_device.md) * [Ratón PS/2](es/feature_ps2_mouse.md) * [Iluminación RGB](es/feature_rgblight.md) * [Matriz RGB](es/feature_rgb_matrix.md) * [Cadete espacial](es/feature_space_cadet.md) * [Teclado dividido](es/feature_split_keyboard.md) * [Stenografía](es/feature_stenography.md) * [Swap Hands](es/feature_swap_hands.md) * [Tap Dance](es/feature_tap_dance.md) * [Terminal](es/feature_terminal.md) * [Impresora Térmica](es/feature_thermal_printer.md) * [Unicode](es/feature_unicode.md) * [Userspace](es/feature_userspace.md) * [Velocikey](es/feature_velocikey.md) * Para Makers y Modders * [Guía de cableado a mano](es/hand_wire.md) * [Guía de flasheado de ISP](es/isp_flashing_guide.md) * [Guía de depuración de ARM](es/arm_debugging.md) * [Driver I2C](es/i2c_driver.md) * [Controles GPIO](es/internals_gpio_control.md) * [Conversión Proton C](es/proton_c_conversion.md) * Para entender en profundidad * [Cómo funcionan los teclados](es/how_keyboards_work.md) * [Entendiendo QMK](es/understanding_qmk.md) * Otros temas * [Usando Eclipse con QMK](es/other_eclipse.md) * [Usando VSCode con QMK](es/other_vscode.md) * [Soporte](es/support.md) * [Cómo añadir traducciones](es/translating.md) * QMK Internals (En progreso) * [Defines](es/internals_defines.md) * [Input Callback Reg](es/internals_input_callback_reg.md) * [Dispositivo Midi](es/internals_midi_device.md) * [Proceso de configuración de un dispositivo Midi](es/internals_midi_device_setup_process.md) * [Utilidad Midi](es/internals_midi_util.md) * [Funciones Send](es/internals_send_functions.md) * [Herramientas Sysex](es/internals_sysex_tools.md) olor: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; } td.linenos pre.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; } .highlight .hll { background-color: #ffffcc } .highlight { background: #ffffff; } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * Copyright (C) 2010      Citrix Ltd.
 * Author Ian Jackson <ian.jackson@eu.citrix.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation; version 2.1 only. with the special
 * exception on linking described in file LICENSE.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 */

#ifndef LIBXLUTIL_H
#define LIBXLUTIL_H

#include <stdio.h>

#include "libxl.h"

/* Unless otherwise stated, all functions return an errno value. */
typedef struct XLU_Config XLU_Config;
typedef struct XLU_ConfigList XLU_ConfigList;

XLU_Config *xlu_cfg_init(FILE *report, const char *report_filename);
  /* 0 means we got ENOMEM. */
  /* report_filename is copied; report is saved and must remain valid
   *  until the Config is destroyed. */

int xlu_cfg_readfile(XLU_Config*, const char *real_filename);
int xlu_cfg_readdata(XLU_Config*, const char *data, int length);
  /* If these fail, then it is undefined behaviour to call xlu_cfg_get_...
   * functions.  You have to just xlu_cfg_destroy. */
 
void xlu_cfg_destroy(XLU_Config*);


/* All of the following print warnings to "report" if there is a problem.
 * Return values are:
 *   0        OK
 *   ESRCH    not defined
 *   EINVAL   value found but wrong format for request (prints warning)
 *   ERANGE   value out of range (from strtol)
 */

int xlu_cfg_get_string(const XLU_Config*, const char *n, const char **value_r);
int xlu_cfg_get_long(const XLU_Config*, const char *n, long *value_r);

int xlu_cfg_get_list(const XLU_Config*, const char *n,
                     XLU_ConfigList **list_r /* may be 0 */,
                     int *entries_r /* may be 0 */);
  /* there is no need to free *list_r; lifetime is that of the XLU_Config */
const char *xlu_cfg_get_listitem(const XLU_ConfigList*, int entry);
  /* xlu_cfg_get_listitem cannot fail, except that if entry is
   * out of range it returns 0 (not setting errno) */

#endif /* LIBXLUTIL_H */