/* * Copyright (C) 2013 Bryan Christ * 2014 Johannes Schauer * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2, as published by * the Free Software Foundation. * * 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., 51 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef _MFSHELL_H_ #define _MFSHELL_H_ #include "../mfapi/folder.h" #include "../mfapi/mfconn.h" struct mfcmd; struct mfshell; typedef struct mfcmd mfcmd; typedef struct mfshell mfshell; struct mfcmd { char *name; char *argstring; char *help; int (*handler) (mfshell * mfshell, int argc, char *const argv[]); }; struct mfshell { int app_id; char *app_key; char *server; /* REST API tracking */ mffolder *folder_curr; /* Local tracking */ char *local_working_dir; /* shell commands */ mfcmd *commands; mfconn *conn; }; mfshell *mfshell_create(int app_id, char *app_key, char *server); int mfshell_authenticate_user(mfshell * mfshell); int mfshell_exec(mfshell * mfshell, int argc, char *const argv[]); int mfshell_exec_shell_command(mfshell * mfshell, char *command); void mfshell_destroy(mfshell * shell); #endif