1/*
2 * Copyright (c) 2001 by The XFree86 Project, Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17 * THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
19 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 * SOFTWARE.
21 *
22 * Except as contained in this notice, the name of the XFree86 Project shall
23 * not be used in advertising or otherwise to promote the sale, use or other
24 * dealings in this Software without prior written authorization from the
25 * XFree86 Project.
26 *
27 * Author: Paulo César Pereira de Andrade
28 */
29
30/* $XFree86: xc/programs/xedit/lisp/helper.h,v 1.15tsi Exp $ */
31
32#ifndef Lisp_helper_h
33#define Lisp_helper_h
34
35#include "lisp/private.h"
36
37/*
38 * Prototypes
39 */
40void LispCheckSequenceStartEnd(LispBuiltin*, LispObj*,
41			       LispObj*, LispObj*, long*, long*, long*);
42long LispLength(LispObj*);
43LispObj *LispCharacterCoerce(LispBuiltin*, LispObj*);
44LispObj *LispStringCoerce(LispBuiltin*, LispObj*);
45LispObj *LispCoerce(LispBuiltin*, LispObj*, LispObj*);
46
47/*
48 do init test &rest body
49 do* init test &rest body
50 */
51LispObj *LispDo(LispBuiltin*, int);
52
53/*
54 dolist init &rest body
55 dotimes init &rest body
56 */
57LispObj *LispDoListTimes(LispBuiltin*, int);
58
59#define FEQ	1
60#define FEQL	2
61#define FEQUAL	3
62#define FEQUALP	4
63LispObj *LispObjectCompare(LispObj*, LispObj*, int);
64#define XEQ(x, y)	LispObjectCompare(x, y, FEQ)
65#define XEQL(x, y)	LispObjectCompare(x, y, FEQL)
66#define XEQUAL(x, y)	LispObjectCompare(x, y, FEQUAL)
67#define XEQUALP(x, y)	LispObjectCompare(x, y, FEQUALP)
68
69LispObj *LispLoadFile(LispObj*, int, int, int);
70
71/*
72 string= string1 string2 &key start1 end1 start2 end2
73 string< string1 string2 &key start1 end1 start2 end2
74 string> string1 string2 &key start1 end1 start2 end2
75 string<= string1 string2 &key start1 end1 start2 end2
76 string>= string1 string2 &key start1 end1 start2 end2
77 string/= string1 string2 &key start1 end1 start2 end2
78 string-equal string1 string2 &key start1 end1 start2 end2
79 string-lessp string1 string2 &key start1 end1 start2 end2
80 string-greaterp string1 string2 &key start1 end1 start2 end2
81 string-not-lessp string1 string2 &key start1 end1 start2 end2
82 string-not-greaterp string1 string2 &key start1 end1 start2 end2
83 string-not-equal string1 string2 &key start1 end1 start2 end2
84*/
85void LispGetStringArgs(LispBuiltin*,
86			char**,	/* string1 */
87			char**,	/* string2 */
88			long*,	/* start1 */
89			long*,	/* end1 */
90			long*,	/* start2 */
91			long*);	/* end2 */
92
93/*
94 pathname-host pathname
95 pathname-device pathname
96 pathname-directory pathname
97 pathname-name pathname
98 pathname-type pathname
99 pathname-version pathname
100 */
101LispObj *LispPathnameField(int, int);
102
103/*
104 truename pathname
105 probe-file pathname
106 */
107LispObj *LispProbeFile(LispBuiltin*, int);
108
109/*
110 write-string string &optional output-stream &key start end
111 write-line string &optional output-stream &key start end
112 */
113LispObj *LispWriteString_(LispBuiltin*, int);
114
115#endif	/* Lisp_helper_h */
116