\doxysection{src/core/msgfile.c File Reference}
\label{msgfile_8c}\index{src/core/msgfile.c@{src/core/msgfile.c}}


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


{\ttfamily \#include \char`\"{}config.\+h\char`\"{}}\newline
{\ttfamily \#include $<$osmocom/core/msgfile.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/talloc.\+h$>$}\newline
{\ttfamily \#include $<$sys/stat.\+h$>$}\newline
{\ttfamily \#include $<$fcntl.\+h$>$}\newline
{\ttfamily \#include $<$unistd.\+h$>$}\newline
{\ttfamily \#include $<$string.\+h$>$}\newline
{\ttfamily \#include $<$stdio.\+h$>$}\newline
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ \+\_\+\+WITH\+\_\+\+GETLINE}
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static struct \textbf{ osmo\+\_\+config\+\_\+entry} $\ast$ \textbf{ alloc\+\_\+entry} (struct \textbf{ osmo\+\_\+config\+\_\+list} $\ast$entries, const char $\ast$mcc, const char $\ast$mnc, const char $\ast$option, const char $\ast$text)
\item 
static struct \textbf{ osmo\+\_\+config\+\_\+list} $\ast$ \textbf{ alloc\+\_\+entries} (void $\ast$ctx)
\item 
static void \textbf{ handle\+\_\+line} (struct \textbf{ osmo\+\_\+config\+\_\+list} $\ast$entries, char $\ast$line)
\item 
struct \textbf{ osmo\+\_\+config\+\_\+list} $\ast$ \textbf{ osmo\+\_\+config\+\_\+list\+\_\+parse} (void $\ast$ctx, const char $\ast$filename)
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Parse a simple file with messages, e.\+g used for USSD messages. 



\doxysubsection{Macro Definition Documentation}
\mbox{\label{msgfile_8c_af0f7b0f33fcbbfbf92bf1cf729b2f23c}} 
\index{msgfile.c@{msgfile.c}!\_WITH\_GETLINE@{\_WITH\_GETLINE}}
\index{\_WITH\_GETLINE@{\_WITH\_GETLINE}!msgfile.c@{msgfile.c}}
\doxysubsubsection{\_WITH\_GETLINE}
{\footnotesize\ttfamily \#define \+\_\+\+WITH\+\_\+\+GETLINE}



\doxysubsection{Function Documentation}
\mbox{\label{msgfile_8c_a8c50eedf1ddacea2debd0c8f92b40860}} 
\index{msgfile.c@{msgfile.c}!alloc\_entries@{alloc\_entries}}
\index{alloc\_entries@{alloc\_entries}!msgfile.c@{msgfile.c}}
\doxysubsubsection{alloc\_entries()}
{\footnotesize\ttfamily static struct \textbf{ osmo\+\_\+config\+\_\+list} $\ast$ alloc\+\_\+entries (\begin{DoxyParamCaption}\item[{void $\ast$}]{ctx }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+config\+\_\+list\+::entry}, and \textbf{ INIT\+\_\+\+LLIST\+\_\+\+HEAD}.



Referenced by \textbf{ osmo\+\_\+config\+\_\+list\+\_\+parse()}.

\mbox{\label{msgfile_8c_a48ad4d6a44a7c97f67379b1472745535}} 
\index{msgfile.c@{msgfile.c}!alloc\_entry@{alloc\_entry}}
\index{alloc\_entry@{alloc\_entry}!msgfile.c@{msgfile.c}}
\doxysubsubsection{alloc\_entry()}
{\footnotesize\ttfamily static struct \textbf{ osmo\+\_\+config\+\_\+entry} $\ast$ alloc\+\_\+entry (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+config\+\_\+list} $\ast$}]{entries,  }\item[{const char $\ast$}]{mcc,  }\item[{const char $\ast$}]{mnc,  }\item[{const char $\ast$}]{option,  }\item[{const char $\ast$}]{text }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+config\+\_\+list\+::entry}, \textbf{ osmo\+\_\+config\+\_\+entry\+::list}, \textbf{ llist\+\_\+add\+\_\+tail()}, \textbf{ osmo\+\_\+config\+\_\+entry\+::mcc}, \textbf{ osmo\+\_\+config\+\_\+entry\+::mnc}, \textbf{ osmo\+\_\+config\+\_\+entry\+::option}, and \textbf{ osmo\+\_\+config\+\_\+entry\+::text}.



Referenced by \textbf{ handle\+\_\+line()}.

\mbox{\label{msgfile_8c_a00d6e2267c4785f1a12b9ee94941d6a9}} 
\index{msgfile.c@{msgfile.c}!handle\_line@{handle\_line}}
\index{handle\_line@{handle\_line}!msgfile.c@{msgfile.c}}
\doxysubsubsection{handle\_line()}
{\footnotesize\ttfamily static void handle\+\_\+line (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+config\+\_\+list} $\ast$}]{entries,  }\item[{char $\ast$}]{line }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ alloc\+\_\+entry()}, and \textbf{ len()}.



Referenced by \textbf{ osmo\+\_\+config\+\_\+list\+\_\+parse()}.

\mbox{\label{msgfile_8c_a40305f9090e1954fcf45028a49457105}} 
\index{msgfile.c@{msgfile.c}!osmo\_config\_list\_parse@{osmo\_config\_list\_parse}}
\index{osmo\_config\_list\_parse@{osmo\_config\_list\_parse}!msgfile.c@{msgfile.c}}
\doxysubsubsection{osmo\_config\_list\_parse()}
{\footnotesize\ttfamily struct \textbf{ osmo\+\_\+config\+\_\+list} $\ast$ osmo\+\_\+config\+\_\+list\+\_\+parse (\begin{DoxyParamCaption}\item[{void $\ast$}]{ctx,  }\item[{const char $\ast$}]{filename }\end{DoxyParamCaption})}



References \textbf{ alloc\+\_\+entries()}, \textbf{ file()}, \textbf{ handle\+\_\+line()}, and \textbf{ n}.

