/* Copyright 1997 Acorn Computers Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /***************************************************/ /* File : TokenUtils.h */ /* */ /* Purpose: Utility functions for finding out */ /* information about tokens. */ /* */ /* Author : A.D.Hodgkinson */ /* */ /* History: 09-Apr-97: Created. */ /***************************************************/ /* Structures */ typedef struct token_path { int line; /* Parent line of the table */ int chunk; /* Parent chunk of the table */ table_headdata * head; /* Pointer to the stream */ } token_path; /* Function prototypes */ void tokenutils_anchor_range (browser_data * b, HStream * token, HStream ** first, HStream ** last); int tokenutils_line_range (browser_data * b, HStream * token, int * fline, int * fchunk, int * lline, int * lchunk, token_path ** path); int tokenutils_find_ancestor_line (browser_data * b, HStream * t); void tokenutils_find_token (browser_data * b, reformat_cell * d, HStream * token, int * fline, int * fchunk, int * lline, int * lchunk); reformat_cell * tokenutils_find_cell (reformat_cell * cell, int depth, token_path * path); void tokenutils_token_offset (browser_data * b, token_path * path, int * offset_x, int * offset_y); reformat_cell * tokenutils_token_cell (browser_data * b, HStream * token); int tokenutils_within_distance (browser_data * b, HStream * t1, HStream * t2, int distance);