loudmouth/lm-parser.h
author Frank Zschockelt <lm@freakysoft.de>
Sat, 11 May 2019 22:25:49 +0200
changeset 738 264fece7ff0d
parent 690 7ccf2113ec5f
permissions -rw-r--r--
Fix getaddrinfo() handling in blocking resolver If getaddrinfo() fails, the first call setting the result will already free the resolver. Trying to access it afterwards will lead to a warning to the console from glib. getaddrinfo() shouldn't return NULL for the result list if it returns successful.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
516
4dd3aa6b83e5 Change the tab width to 4 steps in the emacs headers
Mikael Hallendal <micke@imendio.com>
parents: 515
diff changeset
     1
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
     2
/*
99
81e9d035de02 2004-10-05 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 84
diff changeset
     3
 * Copyright (C) 2003 Imendio AB
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
     4
 *
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
     6
 * modify it under the terms of the GNU Lesser General Public License as
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
     7
 * published by the Free Software Foundation; either version 2 of the
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
     8
 * License, or (at your option) any later version.
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
     9
 *
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    10
 * This program is distributed in the hope that it will be useful,
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    13
 * Lesser General Public License for more details.
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    14
 *
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    15
 * You should have received a copy of the GNU Lesser General Public
690
7ccf2113ec5f Update the postal address of the FSF
Frank Zschockelt <lm@freakysoft.de>
parents: 518
diff changeset
    16
 * License along with this program; if not, see <https://www.gnu.org/licenses>
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    17
 */
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    18
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    19
#ifndef __LM_PARSER_H__
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    20
#define __LM_PARSER_H__
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    21
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    22
#include <glib.h>
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    23
#include "lm-message.h"
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    24
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    25
typedef struct LmParser LmParser;
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    26
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    27
typedef void (* LmParserMessageFunction) (LmParser     *parser,
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    28
                                          LmMessage    *message,
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    29
                                          gpointer      user_data);
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    30
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    31
LmParser *   lm_parser_new       (LmParserMessageFunction  function,
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    32
                                  gpointer                 user_data,
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    33
                                  GDestroyNotify           notify);
399
b5ebdc9d8152 Added a boolean return value from LmParser::parse to be able to check whether it was successful
Mikael Hallendal <micke@imendio.com>
parents: 99
diff changeset
    34
gboolean     lm_parser_parse     (LmParser                *parser,
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    35
                                  const gchar             *string);
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    36
void         lm_parser_free      (LmParser                *parser);
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    37
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    38
#endif /* __LM_PARSER_H__ */