libosmocore 1.9.0.196-9975
Osmocom core library
msgfile.c File Reference

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

#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_entryalloc_entry (struct osmo_config_list *entries, const char *mcc, const char *mnc, const char *option, const char *text)
 
static struct osmo_config_listalloc_entries (void *ctx)
 
static void handle_line (struct osmo_config_list *entries, char *line)
 
struct osmo_config_listosmo_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

◆ 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

◆ 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.