2 * Copyright 2004-2010, Jérôme Duval. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 * Original code from ZipOMatic by jonas.sundstrom@kirilla.com
6 #ifndef _EXPANDER_THREAD_H
7 #define _EXPANDER_THREAD_H
14 #include <FindDirectory.h>
16 #include "GenericThread.h"
21 extern const char* ExpanderThreadName
;
24 class ExpanderThread
: public GenericThread
{
26 ExpanderThread(BMessage
* refs_message
,
27 BMessenger
* messenger
);
30 status_t
SuspendExternalExpander();
31 status_t
ResumeExternalExpander();
32 status_t
InterruptExternalExpander();
33 status_t
WaitOnExternalExpander();
35 void PushInput(BString text
);
38 virtual status_t
ThreadStartup();
39 virtual status_t
ExecuteUnit();
40 virtual status_t
ThreadShutdown();
42 virtual void ThreadStartupFailed(status_t a_status
);
43 virtual void ExecuteUnitFailed(status_t a_status
);
44 virtual void ThreadShutdownFailed(status_t a_status
);
46 status_t
ProcessRefs(BMessage
* message
);
48 thread_id
PipeCommand(int argc
, const char** argv
,
49 int& in
, int& out
, int& err
,
50 const char** envp
= (const char**)environ
);
52 BMessenger
* fWindowMessenger
;
58 FILE* fExpanderOutput
;
60 char fExpanderOutputBuffer
[LINE_MAX
];
64 #endif // _EXPANDER_THREAD_H