PIKApp/libpikaconfig/pikascanner.h

81 lines
3.8 KiB
C

/* LIBPIKA - The PIKA Library
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* pikascanner.h
* Copyright (C) 2002 Sven Neumann <sven@gimp.org>
* Michael Natterer <mitch@gimp.org>
*
* This library is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <https://www.gnu.org/licenses/>.
*/
#if !defined (__PIKA_CONFIG_H_INSIDE__) && !defined (PIKA_CONFIG_COMPILATION)
#error "Only <libpikaconfig/pikaconfig.h> can be included directly."
#endif
#ifndef __PIKA_SCANNER_H__
#define __PIKA_SCANNER_H__
/**
* PIKA_TYPE_SCANNER:
*
* The type ID of the PIKA scanner type which is a boxed type, used to
* read config files.
*
* Since: 3.0
*/
#define PIKA_TYPE_SCANNER (pika_scnner_get_type ())
GType pika_scanner_get_type (void) G_GNUC_CONST;
PikaScanner * pika_scanner_new_file (GFile *file,
GError **error);
PikaScanner * pika_scanner_new_stream (GInputStream *input,
GError **error);
PikaScanner * pika_scanner_new_string (const gchar *text,
gint text_len,
GError **error);
PikaScanner * pika_scanner_ref (PikaScanner *scanner);
void pika_scanner_unref (PikaScanner *scanner);
gboolean pika_scanner_parse_token (PikaScanner *scanner,
GTokenType token);
gboolean pika_scanner_parse_identifier (PikaScanner *scanner,
const gchar *identifier);
gboolean pika_scanner_parse_string (PikaScanner *scanner,
gchar **dest);
gboolean pika_scanner_parse_string_no_validate (PikaScanner *scanner,
gchar **dest);
gboolean pika_scanner_parse_data (PikaScanner *scanner,
gint length,
guint8 **dest);
gboolean pika_scanner_parse_int (PikaScanner *scanner,
gint *dest);
gboolean pika_scanner_parse_int64 (PikaScanner *scanner,
gint64 *dest);
gboolean pika_scanner_parse_float (PikaScanner *scanner,
gdouble *dest);
gboolean pika_scanner_parse_boolean (PikaScanner *scanner,
gboolean *dest);
gboolean pika_scanner_parse_color (PikaScanner *scanner,
PikaRGB *dest);
gboolean pika_scanner_parse_matrix2 (PikaScanner *scanner,
PikaMatrix2 *dest);
#endif /* __PIKA_SCANNER_H__ */