libosmocore 1.13.1.1-afb4 Osmocom core library

Macros | Functions
msgfile.c File Reference

Parse a simple file with messages, e.g used for USSD messages. More...

`#include "config.h"`
`#include <osmocom/core/msgfile.h>`
`#include <osmocom/core/talloc.h>`
`#include <sys/stat.h>`
`#include <fcntl.h>`
`#include <unistd.h>`
`#include <string.h>`
`#include <stdio.h>`

## Macros
#define | _WITH_GETLINE

## Functions
static struct osmo_config_entry * | alloc_entry (struct osmo_config_list *entries, const char *mcc, const char *mnc, const char *option, const char *text)
static struct osmo_config_list * | alloc_entries (void *ctx)
static void | handle_line (struct osmo_config_list *entries, char *line)
struct osmo_config_list * | osmo_config_list_parse (void *ctx, const char *filename)

## Detailed Description

Parse a simple file with messages, e.g used for USSD messages.

## Macro Definition Documentation

## ◆ _WITH_GETLINE

#define _WITH_GETLINE

## Function Documentation

## ◆ alloc_entries()

static struct osmo_config_list * alloc_entries | ( | void * | ctx | ) |
| static

References osmo_config_list::entry, and INIT_LLIST_HEAD.

Referenced by osmo_config_list_parse().

## ◆ alloc_entry()

static struct osmo_config_entry * alloc_entry | ( | struct osmo_config_list * | entries,
|  | const char * | mcc,
|  | const char * | mnc,
|  | const char * | option,
|  | const char * | text
| ) |  |
| static

References osmo_config_list::entry, osmo_config_entry::list, llist_add_tail(), osmo_config_entry::mcc, osmo_config_entry::mnc, osmo_config_entry::option, and osmo_config_entry::text.

Referenced by handle_line().

## ◆ handle_line()

static void handle_line | ( | struct osmo_config_list * | entries,
|  | char * | line
| ) |  |
| static

References alloc_entry(), and len().

Referenced by osmo_config_list_parse().

## ◆ osmo_config_list_parse()

struct osmo_config_list * osmo_config_list_parse | ( | void * | ctx,
|  | const char * | filename
| ) |  |

References alloc_entries(), file(), handle_line(), and n.