00001 /** 00002 * \file 00003 * Interface for the Contiki shell. 00004 * \author Adam Dunkels <adam@dunkels.com> 00005 * 00006 * Some of the functions declared in this file must be implemented as 00007 * a shell back-end in the architecture specific files of a Contiki 00008 * port. 00009 */ 00010 00011 00012 /* 00013 * Copyright (c) 2003, Adam Dunkels. 00014 * All rights reserved. 00015 * 00016 * Redistribution and use in source and binary forms, with or without 00017 * modification, are permitted provided that the following conditions 00018 * are met: 00019 * 1. Redistributions of source code must retain the above copyright 00020 * notice, this list of conditions and the following disclaimer. 00021 * 2. Redistributions in binary form must reproduce the above copyright 00022 * notice, this list of conditions and the following disclaimer in the 00023 * documentation and/or other materials provided with the distribution. 00024 * 3. The name of the author may not be used to endorse or promote 00025 * products derived from this software without specific prior 00026 * written permission. 00027 * 00028 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 00029 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00030 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00031 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 00032 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00033 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 00034 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00035 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 00036 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00037 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00038 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00039 * 00040 * This file is part of the Contiki desktop OS. 00041 * 00042 * $Id: shell.h,v 1.1 2006/06/07 09:43:54 adam Exp $ 00043 * 00044 */ 00045 #ifndef __SHELL_H__ 00046 #define __SHELL_H__ 00047 00048 /** 00049 * Initialize the shell. 00050 * 00051 * Called when the shell front-end process starts. This function may 00052 * be used to start listening for signals. 00053 */ 00054 void shell_init(void); 00055 00056 /** 00057 * Start the shell back-end. 00058 * 00059 * Called by the front-end when a new shell is started. 00060 */ 00061 void shell_start(void); 00062 00063 /** 00064 * Process a shell command. 00065 * 00066 * This function will be called by the shell GUI / telnet server whan 00067 * a command has been entered that should be processed by the shell 00068 * back-end. 00069 * 00070 * \param command The command to be processed. 00071 */ 00072 void shell_input(char *command); 00073 00074 /** 00075 * Quit the shell. 00076 * 00077 */ 00078 void shell_quit(char *); 00079 00080 00081 /** 00082 * Print a string to the shell window. 00083 * 00084 * This function is implemented by the shell GUI / telnet server and 00085 * can be called by the shell back-end to output a string in the 00086 * shell window. The string is automatically appended with a linebreak. 00087 * 00088 * \param str1 The first half of the string to be output. 00089 * \param str2 The second half of the string to be output. 00090 */ 00091 void shell_output(char *str1, char *str2); 00092 00093 /** 00094 * Print a prompt to the shell window. 00095 * 00096 * This function can be used by the shell back-end to print out a 00097 * prompt to the shell window. 00098 * 00099 * \param prompt The prompt to be printed. 00100 * 00101 */ 00102 void shell_prompt(char *prompt); 00103 00104 #endif /* __SHELL_H__ */