Blame IbAccess/UserLinux/Public/idebuggrabber_osd.h

Packit Service 3470d1
/* BEGIN_ICS_COPYRIGHT3 ****************************************
Packit Service 3470d1
Packit Service 3470d1
Copyright (c) 2015, Intel Corporation
Packit Service 3470d1
Packit Service 3470d1
Redistribution and use in source and binary forms, with or without
Packit Service 3470d1
modification, are permitted provided that the following conditions are met:
Packit Service 3470d1
Packit Service 3470d1
    * Redistributions of source code must retain the above copyright notice,
Packit Service 3470d1
      this list of conditions and the following disclaimer.
Packit Service 3470d1
    * Redistributions in binary form must reproduce the above copyright
Packit Service 3470d1
      notice, this list of conditions and the following disclaimer in the
Packit Service 3470d1
     documentation and/or other materials provided with the distribution.
Packit Service 3470d1
    * Neither the name of Intel Corporation nor the names of its contributors
Packit Service 3470d1
      may be used to endorse or promote products derived from this software
Packit Service 3470d1
      without specific prior written permission.
Packit Service 3470d1
Packit Service 3470d1
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Packit Service 3470d1
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Packit Service 3470d1
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Packit Service 3470d1
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
Packit Service 3470d1
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit Service 3470d1
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Packit Service 3470d1
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Packit Service 3470d1
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Packit Service 3470d1
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Packit Service 3470d1
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit Service 3470d1
Packit Service 3470d1
** END_ICS_COPYRIGHT3   ****************************************/
Packit Service 3470d1
Packit Service 3470d1
/* [ICS VERSION STRING: unknown] */
Packit Service 3470d1
Packit Service 3470d1
Packit Service 3470d1
#ifndef _IBA_PUBLIC_IDEBUG_GRABBER_OSD_H_
Packit Service 3470d1
#define _IBA_PUBLIC_IDEBUG_GRABBER_OSD_H_
Packit Service 3470d1
Packit Service 3470d1
#include <stdlib.h>
Packit Service 3470d1
#include <sys/wait.h>
Packit Service 3470d1
#include "iba/public/datatypes.h"
Packit Service 3470d1
#include "iba/public/idebug.h"
Packit Service 3470d1
Packit Service 3470d1
#ifdef __cplusplus
Packit Service 3470d1
extern "C" {
Packit Service 3470d1
#endif
Packit Service 3470d1
Packit Service 3470d1
static _inline void
Packit Service 3470d1
DebugGrabberRunScript(char * GrabberScript)
Packit Service 3470d1
{
Packit Service 3470d1
	int ret;
Packit Service 3470d1
Packit Service 3470d1
	ret = system(GrabberScript);
Packit Service 3470d1
	if (ret < 0)
Packit Service 3470d1
		MsgOut("DebugGrab via %s failed: ret=%d, errno=%d\n", GrabberScript, ret, errno);
Packit Service 3470d1
	else if (! WIFEXITED(ret))
Packit Service 3470d1
		MsgOut("DebugGrab via %s failed: wait ret=0x%x\n", GrabberScript, ret);
Packit Service 3470d1
	else if (WEXITSTATUS(ret))
Packit Service 3470d1
		MsgOut("DebugGrab via %s failed: ret=%d\n", GrabberScript, WEXITSTATUS(ret));
Packit Service 3470d1
}
Packit Service 3470d1
Packit Service 3470d1
#ifdef __cplusplus
Packit Service 3470d1
}	/* extern "C" */
Packit Service 3470d1
#endif
Packit Service 3470d1
Packit Service 3470d1
#endif /* _IBA_PUBLIC_IDEBUG_GRABBER_OSD_H_ */