Update of /cvsroot/blob/blob/src/commands
In directory usw-pr-cvs1:/tmp/cvs-serv11717/src/commands
Added Files:
Makefile.am dummy.c
Log Message:
Add a directory for the commands. The idea is to have a single file per
command so the linker will automatically link in the correct object files
from libcommands.a.
--- NEW FILE: Makefile.am ---
# -*- makefile -*-
#
# Makefile.am
#
# Copyright (C) 2002 Erik Mouw (J.A...@it...)
#
# $Id: Makefile.am,v 1.1 2002/01/29 17:47:23 erikm Exp $
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
noinst_LIBRARIES = \
libcommands.a
libcommands_a_SOURCES = \
dummy.c
INCLUDES += \
-I${top_builddir}/include \
-I${top_srcdir}/include
CLEANFILES = ${srcdir}/*~
DISTCLEANFILES = ${builddir}/.deps/*.P
--- NEW FILE: dummy.c ---
/*
* dummy.c: Dummy command that only shows how things work
*
* Copyright (C) 2002 Erik Mouw <J.A...@it...>
*
* $Id: dummy.c,v 1.1 2002/01/29 17:47:23 erikm Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ident "$Id: dummy.c,v 1.1 2002/01/29 17:47:23 erikm Exp $"
#ifdef HAVE_CONFIG_H
# include <blob/config.h>
#endif
#include <blob/serial.h>
int dummy_cmd(int argc, char *argv[])
{
int i;
for(i = 0; i < argc; i++) {
SerialOutputString("arg[");
SerialOutputDec(i);
SerialOutputString("] = ");
SerialOutputString(argv[i]);
serial_write('\n');
}
return 0;
}
char dummy_help[] = "dummy\n"
"Dummy command that only shows all arguments and returns\n";
/*
* To use this command, just add this line somewhere in the
* application (src/blob/commands, for example):
*
* __commandlist(dummy_cmd, "dummy", dummy_help);
*
*/
|