15dfecf96Smrg/*
25dfecf96Smrg * Copyright (c) 2001 by The XFree86 Project, Inc.
35dfecf96Smrg *
45dfecf96Smrg * Permission is hereby granted, free of charge, to any person obtaining a
55dfecf96Smrg * copy of this software and associated documentation files (the "Software"),
65dfecf96Smrg * to deal in the Software without restriction, including without limitation
75dfecf96Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
85dfecf96Smrg * and/or sell copies of the Software, and to permit persons to whom the
95dfecf96Smrg * Software is furnished to do so, subject to the following conditions:
105dfecf96Smrg *
115dfecf96Smrg * The above copyright notice and this permission notice shall be included in
125dfecf96Smrg * all copies or substantial portions of the Software.
135dfecf96Smrg *
145dfecf96Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
155dfecf96Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
165dfecf96Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
175dfecf96Smrg * THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
185dfecf96Smrg * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
195dfecf96Smrg * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
205dfecf96Smrg * SOFTWARE.
215dfecf96Smrg *
225dfecf96Smrg * Except as contained in this notice, the name of the XFree86 Project shall
235dfecf96Smrg * not be used in advertising or otherwise to promote the sale, use or other
245dfecf96Smrg * dealings in this Software without prior written authorization from the
255dfecf96Smrg * XFree86 Project.
265dfecf96Smrg *
275dfecf96Smrg * Author: Paulo César Pereira de Andrade
285dfecf96Smrg */
295dfecf96Smrg
305dfecf96Smrg/* $XFree86: xc/programs/xedit/lisp/lsp.c,v 1.7tsi Exp $ */
315dfecf96Smrg
325dfecf96Smrg#include <stdio.h>
335dfecf96Smrg#include <string.h>
345dfecf96Smrg#include "lisp/lisp.h"
355dfecf96Smrg
365dfecf96Smrg#ifdef NEED_STRCASECMP
375dfecf96Smrgint strcasecmp(const char *s1, const char *s2);
385dfecf96Smrgint strncasecmp(const char *s1, const char *s2, size_t n);
395dfecf96Smrg#endif
405dfecf96Smrg#ifdef NEED_REALPATH
415dfecf96Smrg#include <sys/param.h>
425dfecf96Smrgchar *realpath(const char *pathname, char resolvedname[MAXPATHLEN]);
435dfecf96Smrg#endif
445dfecf96Smrg
455dfecf96Smrgint
465dfecf96Smrgmain(int argc, char *argv[])
475dfecf96Smrg{
485dfecf96Smrg    int i;
495dfecf96Smrg
505dfecf96Smrg    LispBegin();
515dfecf96Smrg
525dfecf96Smrg    i = 1;
535dfecf96Smrg    if (argc > 1 && strcmp(argv[1], "-d") == 0) {
545dfecf96Smrg	LispDebug(1);
555dfecf96Smrg	++i;
565dfecf96Smrg    }
575dfecf96Smrg
585dfecf96Smrg    if (i < argc) {
595dfecf96Smrg	char buffer[2048];
605dfecf96Smrg
615dfecf96Smrg	for (; i < argc; i++) {
625dfecf96Smrg	    snprintf(buffer, sizeof(buffer),
635dfecf96Smrg		     "(load \"%s\" :if-does-not-exist :error)",
645dfecf96Smrg		     argv[i]);
655dfecf96Smrg	    LispExecute(buffer);
665dfecf96Smrg	}
675dfecf96Smrg    }
685dfecf96Smrg    else
695dfecf96Smrg	LispMachine();
705dfecf96Smrg
715dfecf96Smrg    LispEnd();
725dfecf96Smrg
735dfecf96Smrg    return (0);
745dfecf96Smrg}
75