Blame src/PtyShell.h

Packit Service a2489d
/*
Packit Service a2489d
 * lftp - file transfer program
Packit Service a2489d
 *
Packit Service a2489d
 * Copyright (c) 1996-2012 by Alexander V. Lukyanov (lav@yars.free.net)
Packit Service a2489d
 *
Packit Service a2489d
 * This program is free software; you can redistribute it and/or modify
Packit Service a2489d
 * it under the terms of the GNU General Public License as published by
Packit Service a2489d
 * the Free Software Foundation; either version 3 of the License, or
Packit Service a2489d
 * (at your option) any later version.
Packit Service a2489d
 *
Packit Service a2489d
 * This program is distributed in the hope that it will be useful,
Packit Service a2489d
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service a2489d
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service a2489d
 * GNU General Public License for more details.
Packit Service a2489d
 *
Packit Service a2489d
 * You should have received a copy of the GNU General Public License
Packit Service a2489d
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit Service a2489d
 */
Packit Service a2489d
Packit Service a2489d
#ifndef PTYSHELL_H
Packit Service a2489d
#define PTYSHELL_H
Packit Service a2489d
Packit Service a2489d
#include "Filter.h"
Packit Service a2489d
Packit Service a2489d
class PtyShell : public FDStream
Packit Service a2489d
{
Packit Service a2489d
   Ref<ArgV> a;
Packit Service a2489d
   SMTaskRef<ProcWait> w;
Packit Service a2489d
   pid_t pg;
Packit Service a2489d
Packit Service a2489d
   xstring_c oldcwd;
Packit Service a2489d
Packit Service a2489d
   bool closed;
Packit Service a2489d
   bool use_pipes;
Packit Service a2489d
   int pipe_in;
Packit Service a2489d
   int pipe_out;
Packit Service a2489d
Packit Service a2489d
   void Init();
Packit Service a2489d
Packit Service a2489d
public:
Packit Service a2489d
   PtyShell(const char *filter);
Packit Service a2489d
   PtyShell(ArgV *a);
Packit Service a2489d
   ~PtyShell();
Packit Service a2489d
Packit Service a2489d
   void SetCwd(const char *);
Packit Service a2489d
   void UsePipes() { use_pipes=true; }
Packit Service a2489d
Packit Service a2489d
   int getfd();
Packit Service a2489d
   int getfd_pipe_in()  { return pipe_in; }
Packit Service a2489d
   int getfd_pipe_out() { return pipe_out; }
Packit Service a2489d
   bool Done();
Packit Service a2489d
Packit Service a2489d
   void Kill(int sig=SIGTERM) { if(w) w->Kill(sig); }
Packit Service a2489d
   pid_t GetProcGroup() const { return pg; }
Packit Service a2489d
Packit Service a2489d
   bool broken();
Packit Service a2489d
};
Packit Service a2489d
Packit Service a2489d
#endif // PTYSHELL_H