Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

cr-tknzr.h

Go to the documentation of this file.
00001 /* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
00002 
00003 /*
00004  * This file is part of The Croco Library
00005  *
00006  * Copyright (C) 2002-2003 Dodji Seketeli <dodji@seketeli.org>
00007  *
00008  * This program is free software; you can redistribute it and/or
00009  * modify it under the terms of version 2.1 of the GNU Lesser General Public
00010  * License as published by the Free Software Foundation.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00020  * USA
00021  */
00022 
00023 /*
00024  *$Id: cr-tknzr.h,v 1.5 2003/06/22 21:19:01 dodji Exp $
00025  */
00026 
00027 /**
00028  *@file
00029  *The declaration of the #CRTknzr (tokenizer)
00030  *class.
00031  */
00032 
00033 #ifndef __CR_TKNZR_H__
00034 #define __CR_TKNZR_H__
00035 
00036 #include "cr-utils.h"
00037 #include "cr-parser-input.h"
00038 #include "cr-token.h"
00039 
00040 G_BEGIN_DECLS
00041         
00042         
00043 typedef struct _CRTknzr CRTknzr ;
00044 typedef struct _CRTknzrPriv CRTknzrPriv ;
00045 
00046 /**
00047  *The tokenizer is the class that knows
00048  *about all the css token. Its main job is
00049  *to return the next token found in the character 
00050  *input stream.
00051  */
00052 struct _CRTknzr
00053 {
00054         /*the private data of the tokenizer.*/
00055         CRTknzrPriv *priv ;
00056 } ;
00057 
00058 CRTknzr *
00059 cr_tknzr_new (CRInput *a_input) ;
00060 
00061 CRTknzr *
00062 cr_tknzr_new_from_uri (const guchar *a_file_uri,
00063                        enum CREncoding a_enc) ;
00064 
00065 CRTknzr *
00066 cr_tknzr_new_from_buf (const guchar *a_buf, gulong a_len,
00067                        enum CREncoding a_enc,
00068                        gboolean a_free_at_destroy) ;
00069 
00070 gboolean
00071 cr_tknzr_unref (CRTknzr *a_this) ;
00072         
00073 void
00074 cr_tknzr_ref (CRTknzr *a_this) ;
00075 
00076 enum CRStatus
00077 cr_tknzr_read_byte (CRTknzr *a_this, guchar *a_byte) ;
00078         
00079 enum CRStatus
00080 cr_tknzr_read_char (CRTknzr *a_this, guint32 *a_char);
00081 
00082 enum CRStatus
00083 cr_tknzr_peek_char (CRTknzr *a_this, guint32 *a_char) ;
00084 
00085 enum CRStatus
00086 cr_tknzr_peek_byte (CRTknzr *a_this, gulong a_offset, 
00087                     guchar *a_byte) ;
00088 
00089 guchar
00090 cr_tknzr_peek_byte2 (CRTknzr *a_this, gulong a_offset, 
00091                      gboolean *a_eof) ;
00092 
00093 enum CRStatus
00094 cr_tknzr_set_cur_pos (CRTknzr *a_this, CRInputPos *a_pos) ;
00095 
00096 glong
00097 cr_tknzr_get_nb_bytes_left (CRTknzr *a_this) ;
00098 
00099 enum CRStatus
00100 cr_tknzr_get_cur_pos (CRTknzr *a_this, CRInputPos *a_pos) ;
00101 
00102 enum CRStatus
00103 cr_tknzr_seek_index (CRTknzr *a_this,
00104                      enum CRSeekPos a_origin,
00105                      gint a_pos) ;
00106 
00107 enum CRStatus
00108 cr_tknzr_get_cur_byte_addr (CRTknzr *a_this, guchar **a_addr) ;
00109 
00110 
00111 enum CRStatus
00112 cr_tknzr_consume_chars (CRTknzr *a_this, guint32 a_char,
00113                         glong *a_nb_char) ;
00114 
00115 enum CRStatus
00116 cr_tknzr_get_next_token (CRTknzr *a_this, CRToken ** a_tk) ;
00117 
00118 enum CRStatus
00119 cr_tknzr_unget_token (CRTknzr *a_this, CRToken *a_token) ;
00120 
00121 
00122 enum CRStatus
00123 cr_tknzr_parse_token (CRTknzr *a_this, enum CRTokenType a_type,
00124                       enum CRTokenExtraType a_et, gpointer a_res,
00125                       gpointer a_extra_res) ;
00126 enum CRStatus
00127 cr_tknzr_set_input (CRTknzr *a_this, CRInput *a_input) ;
00128 
00129 enum CRStatus
00130 cr_tknzr_get_input (CRTknzr *a_this, CRInput **a_input) ;
00131 
00132 void
00133 cr_tknzr_destroy (CRTknzr *a_this) ;
00134         
00135 G_END_DECLS
00136 
00137 #endif /*__CR_TKZNR_H__*/

Generated on Wed Oct 1 01:36:49 2003 for Libcroco by doxygen 1.3.3