Loading...
Searching...
No Matches
config_file.c File Reference

Implements config_file.h. More...

`#include <dirent.h>`
`#include <errno.h>`
`#include <glob.h>`
`#include <limits.h>`
`#include <unistd.h>`
`#include <stdio.h>`
`#include <stdint.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <libgen.h>`
`#include <sys/socket.h>`
`#include <sys/un.h>`
`#include <sys/stat.h>`
`#include <sys/types.h>`
`#include <fcntl.h>`
`#include <ctype.h>`
`#include "media/lirc.h"`
`#include "lirc/lirc_log.h"`
`#include "lirc/lirc_options.h"`
`#include "lirc/ir_remote.h"`
`#include "lirc/config_file.h"`
`#include "lirc/transmit.h"`
`#include "lirc/config_flags.h"`

Go to the source code of this file.

## Macros

#define | LINE_LEN 4096
#define | MAX_INCLUDES 10

## Typedefs

typedef void *(* | array_guest_func) (void *item, void *arg)
| foreach_void_array argument.

## Enumerations

enum | directive { ID_none , ID_remote , ID_codes , ID_raw_codes , ID_raw_name }

## Functions

void ** | init_void_array (struct void_array *ar, size_t chunk_size, size_t item_size)
int | add_void_array (struct void_array *ar, void *dataptr)
| Add *dataptr to end of ar, re-allocating as necessary.
void * | get_void_array (struct void_array *ar)
| Return the array dataptr, an array[nr_items] of item_size elements.
void * | s_malloc (size_t size)
char * | s_strdup (char *string)
ir_code | s_strtocode (const char *val)
uint32_t | s_strtou32 (char *val)
int | s_strtoi (char *val)
unsigned int | s_strtoui (char *val)
lirc_t | s_strtolirc_t (char *val)
int | checkMode (int is_mode, int c_mode, char *error)
int | addSignal (struct void_array *signals, char *val)
struct ir_ncode * | defineCode (char *key, char *val, struct ir_ncode *code)
struct ir_code_node * | defineNode (struct ir_ncode *code, const char *val)
int | parseFlags (char *val)
int | defineRemote (char *key, char *val, char *val2, struct ir_remote *rem)
struct ir_remote * | read_config (FILE *f, const char *name)
| Parse a lircd.conf config file.
void | free_config (struct ir_remote *remotes)
| Free() an ir_remote instance obtained using read_config().

## Variables

const char * | whitespace = " \t"
const struct flaglist | all_flags []
| All flags i config file: Their name and mask.

## Detailed Description

Implements config_file.h.

Author
  Pablo d'Angelo

Definition in file config_file.c.

## Macro Definition Documentation

## LINE_LEN

#define LINE_LEN 4096

Definition at line 70 of file config_file.c.

## MAX_INCLUDES

#define MAX_INCLUDES 10

Definition at line 71 of file config_file.c.

## Typedef Documentation

## array_guest_func

typedef void *(* array_guest_func) (void *item, void *arg)

foreach_void_array argument.

Definition at line 67 of file config_file.c.

## Enumeration Type Documentation

## directive

enum directive

Definition at line 50 of file config_file.c.

## Function Documentation

## add_void_array()

int add_void_array | ( | struct void_array * | ar,
|  | void * | dataptr )

Add *dataptr to end of ar, re-allocating as necessary.

Definition at line 119 of file config_file.c.

## addSignal()

int addSignal | ( | struct void_array * | signals,
|  | char * | val )

Definition at line 346 of file config_file.c.

## checkMode()

int checkMode | ( | int | is_mode,
|  | int | c_mode,
|  | char * | error )

Definition at line 335 of file config_file.c.

## defineCode()

struct ir_ncode * defineCode | ( | char * | key,
|  | char * | val,
|  | struct ir_ncode * | code )

Definition at line 359 of file config_file.c.

## defineNode()

struct ir_code_node * defineNode | ( | struct ir_ncode * | code,
|  | const char * | val )

Definition at line 368 of file config_file.c.

## defineRemote()

int defineRemote | ( | char * | key,
|  | char * | val,
|  | char * | val2,
|  | struct ir_remote * | rem )

Definition at line 437 of file config_file.c.

## get_void_array()

void * get_void_array | ( | struct void_array * | ar | ) |

Return the array dataptr, an array[nr_items] of item_size elements.

Definition at line 144 of file config_file.c.

## init_void_array()

void ** init_void_array | ( | struct void_array * | ar,
|  | size_t | chunk_size,
|  | size_t | item_size )

Definition at line 81 of file config_file.c.

## parseFlags()

int parseFlags | ( | char * | val | ) |

Definition at line 391 of file config_file.c.

## s_malloc()

void * s_malloc | ( | size_t | size | ) |

Definition at line 222 of file config_file.c.

## s_strdup()

char * s_strdup | ( | char * | string | ) |

Definition at line 236 of file config_file.c.

## s_strtocode()

ir_code s_strtocode | ( | const char * | val | ) |

Definition at line 249 of file config_file.c.

## s_strtoi()

int s_strtoi | ( | char * | val | ) |

Definition at line 280 of file config_file.c.

## s_strtolirc_t()

lirc_t s_strtolirc_t | ( | char * | val | ) |

Definition at line 314 of file config_file.c.

## s_strtou32()

uint32_t s_strtou32 | ( | char * | val | ) |

Definition at line 265 of file config_file.c.

## s_strtoui()

unsigned int s_strtoui | ( | char * | val | ) |

Definition at line 297 of file config_file.c.

## Variable Documentation

## all_flags

const struct flaglist all_flags[]

Initial value:
= {
{ "RAW_CODES", RAW_CODES },
{ "RC5", RC5 },
{ "SHIFT_ENC", SHIFT_ENC },
{ "RC6", RC6 },
{ "RCMM", RCMM },
{ "SPACE_ENC", SPACE_ENC },
{ "SPACE_FIRST", SPACE_FIRST },
{ "GRUNDIG", GRUNDIG },
{ "BO", BO },
{ "SERIAL", SERIAL },
{ "XMP", XMP },
{ "REVERSE", REVERSE },
{ "NO_HEAD_REP", NO_HEAD_REP },
{ "NO_FOOT_REP", NO_FOOT_REP },
{ "CONST_LENGTH", CONST_LENGTH },
{ "REPEAT_HEADER", REPEAT_HEADER },
{ NULL, 0 },
}
SHIFT_ENC
#define SHIFT_ENC
IR data is shift encoded (name obsolete).
Definition ir_remote_types.h:102
RAW_CODES
#define RAW_CODES
for internal use only
Definition ir_remote_types.h:100
XMP
#define XMP
XMP protocol.
Definition ir_remote_types.h:114
RC6
#define RC6
IR data follows RC6 protocol.
Definition ir_remote_types.h:107
REPEAT_HEADER
#define REPEAT_HEADER
header is also sent before repeat code
Definition ir_remote_types.h:121
GRUNDIG
#define GRUNDIG
encoding found on Grundig remote
Definition ir_remote_types.h:111
BO
#define BO
encoding found on Bang & Olufsen remote
Definition ir_remote_types.h:112
SPACE_FIRST
#define SPACE_FIRST
bits are encoded as space+pulse
Definition ir_remote_types.h:110
SPACE_ENC
#define SPACE_ENC
IR data is space encoded.
Definition ir_remote_types.h:109
RC5
#define RC5
IR data follows RC5 protocol.
Definition ir_remote_types.h:101
NO_FOOT_REP
#define NO_FOOT_REP
no foot for key repeats
Definition ir_remote_types.h:119
SERIAL
#define SERIAL
serial protocol
Definition ir_remote_types.h:113
NO_HEAD_REP
#define NO_HEAD_REP
no header for key repeats
Definition ir_remote_types.h:118
CONST_LENGTH
#define CONST_LENGTH
signal length+gap is always constant
Definition ir_remote_types.h:120
RCMM
#define RCMM
IR data follows RC-MM protocol.
Definition ir_remote_types.h:108

All flags i config file: Their name and mask.

Definition at line 95 of file config_file.c.

## whitespace

const char* whitespace = " \t"

Definition at line 73 of file config_file.c.