From 2c7a0370fd13e02590ba52408fbe39d9b93c77e6 Mon Sep 17 00:00:00 2001 From: crunchy Date: Fri, 13 Sep 2002 06:59:38 +0000 Subject: added callback.[ch] --- mpiosh/callback.h | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 mpiosh/callback.h (limited to 'mpiosh/callback.h') diff --git a/mpiosh/callback.h b/mpiosh/callback.h new file mode 100644 index 0000000..4a0f79e --- /dev/null +++ b/mpiosh/callback.h @@ -0,0 +1,84 @@ +/* callback.h + * + * Author: Andreas Büsching + * + * $Id: callback.h,v 1.1 2002/09/13 06:59:38 crunchy Exp $ + * + * Copyright (C) 2001 Andreas Büsching + * + * 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, 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. + */ + +#ifndef CALLBACK_HH +#define CALLBACK_HH + +#include "libmpio/mpio.h" + +/* mpio command callbacks */ +void mpiosh_cmd_debug(char *args[]); +void mpiosh_cmd_version(char *args[]); +void mpiosh_cmd_help(char *args[]); +void mpiosh_cmd_dir(char *args[]); +void mpiosh_cmd_info(char *args[]); +void mpiosh_cmd_mem(char *args[]); +void mpiosh_cmd_open(char *args[]); +void mpiosh_cmd_close(char *args[]); +void mpiosh_cmd_quit(char *args[]); +void mpiosh_cmd_get(char *args[]); +void mpiosh_cmd_mget(char *args[]); +void mpiosh_cmd_put(char *args[]); +void mpiosh_cmd_mput(char *args[]); +void mpiosh_cmd_del(char *args[]); +void mpiosh_cmd_mdel(char *args[]); +void mpiosh_cmd_dump(char *args[]); +void mpiosh_cmd_free(char *args[]); +void mpiosh_cmd_format(char *args[]); +void mpiosh_cmd_switch(char *args[]); + +/* local command callbacks */ +void mpiosh_cmd_ldir(char *args[]); +void mpiosh_cmd_lcd(char *args[]); +void mpiosh_cmd_lmkdir(char *args[]); + +/* progress callbacks */ +BYTE mpiosh_callback_get(int read, int total); +BYTE mpiosh_callback_put(int read, int total); +BYTE mpiosh_callback_del(int read, int total); +BYTE mpiosh_callback_format(int read, int total); + +/* check situation */ + +#define MPIOSH_CHECK_CONNECTION_OPEN \ + if (mpiosh.dev != NULL) { \ + printf("connection to MPIO player is open\n"); \ + return; \ + } + +#define MPIOSH_CHECK_CONNECTION_CLOSED \ + if (mpiosh.dev == NULL) { \ + printf("connection to MPIO player is closed\n"); \ + return; \ + } + +#define MPIOSH_CHECK_ARG \ + if (args[0] == NULL) { \ + printf("error: no argument given\n"); \ + return; \ + } + + +#endif + +/* end of callback.h */ -- cgit v1.2.3