1/*
2 * Copyright 2010-2013 Intel Corporation.
3 *
4 * This library is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License as published
6 * by the Free Software Foundation, version 2.1.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 * 02110-1301 USA.
17 *
18 * Disclaimer: The codes contained in these modules may be specific
19 * to the Intel Software Development Platform codenamed Knights Ferry,
20 * and the Intel product codenamed Knights Corner, and are not backward
21 * compatible with other Intel products. Additionally, Intel will NOT
22 * support the codes or instruction set in future products.
23 *
24 * Intel offers no warranty of any kind regarding the code. This code is
25 * licensed on an "AS IS" basis and Intel is not obligated to provide
26 * any support, assistance, installation, training, or other services
27 * of any kind. Intel is also not obligated to provide any updates,
28 * enhancements or extensions. Intel specifically disclaims any warranty
29 * of merchantability, non-infringement, fitness for any particular
30 * purpose, and any other warranty.
31 *
32 * Further, Intel disclaims all liability of any kind, including but
33 * not limited to liability for infringement of any proprietary rights,
34 * relating to the use of the code, even if Intel is notified of the
35 * possibility of such liability. Except as expressly stated in an Intel
36 * license agreement provided with this code and agreed upon with Intel,
37 * no license, express or implied, by estoppel or otherwise, to any
38 * intellectual property rights is granted herein.
39 */
40
41#ifndef _COIPROCESS_SINK_H
42#define _COIPROCESS_SINK_H
43
44/** @ingroup COIProcess
45 *  @addtogroup COIProcessSink
46@{
47* @file sink/COIProcess_sink.h
48*/
49#ifndef DOXYGEN_SHOULD_SKIP_THIS
50
51#include "../common/COITypes_common.h"
52#include "../common/COIResult_common.h"
53
54#ifdef __cplusplus
55extern "C" {
56#endif
57#endif // DOXYGEN_SHOULD_SKIP_THIS
58
59//////////////////////////////////////////////////////////////////////////////
60///
61/// This call will block while waiting for the source to send a process destroy
62/// message. This provides the sink side application with an event to keep the
63/// main() function from exiting until it is directed to by the source. When
64/// the shutdown message is received this function will stop any future run
65/// functions from executing but will wait for any current run functions to
66/// complete. All Intel�� Coprocessor Offload Infrastructure (Intel�� COI)  resources will be cleaned up and no additional Intel�� Coprocessor Offload Infrastructure (Intel�� COI)  APIs
67/// should be called after this function returns.  This function does not
68/// invoke exit() so the application can perform any of its own cleanup once
69/// this call returns.
70///
71/// @return COI_SUCCESS once the process receives the shutdown message.
72///
73COIRESULT
74COIProcessWaitForShutdown();
75
76//////////////////////////////////////////////////////////////////////////////
77///
78/// This call will block until all stdout and stderr output has been proxied
79/// to and written by the source. This call guarantees that any output in a
80/// run function is transmitted to the source before the run function signals
81/// its completion event back to the source.
82///
83/// Note that having an additional thread printing forever while another
84/// calls COIProxyFlush may lead to a hang because the process will be forced
85/// to wait until all that output can be flushed to the source before returning
86/// from this call.
87///
88/// @return COI_SUCCESS once the proxy output has been flushed to and written
89///         written by the host. Note that Intel�� Coprocessor Offload Infrastructure (Intel�� COI)  on the source writes to stdout
90///         and stderr, but does not flush this output.
91/// @return COI_SUCCESS if the process was created without enabling
92///         proxy IO this function.
93///
94COIRESULT
95COIProcessProxyFlush();
96
97#ifdef __cplusplus
98} /* extern "C" */
99#endif
100
101#endif /* _COIPROCESS_SINK_H */
102
103/*! @} */
104