mirror of https://github.com/BOINC/boinc.git
Move the definiton of logical names for stdout/stderr/client log to dc_common.h
and rename them to DC_LABEL_* git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@569 a7169a2c-3604-0410-bc95-c702d8d87f7a
This commit is contained in:
parent
86cd636aa0
commit
de652249dc
|
@ -252,7 +252,7 @@ static void callbackResult(DC_Workunit *wu_result, DC_Result *result)
|
|||
|
||||
if (testlevel != TEST_LOW_LVL)
|
||||
{
|
||||
outfile = DC_getResultOutput(result, DC_RESULT_STDOUT);
|
||||
outfile = DC_getResultOutput(result, DC_LABEL_STDOUT);
|
||||
if (!outfile)
|
||||
{
|
||||
printf("callbackResult: DC_getResultOutput returned with NULL for stdout. Exit application.\n");
|
||||
|
|
|
@ -7,6 +7,9 @@ DC_ErrorCode
|
|||
DC_GridCapabilities
|
||||
DC_FileMode
|
||||
DC_CONFIG_FILE
|
||||
DC_LABEL_STDOUT
|
||||
DC_LABEL_STDERR
|
||||
DC_LABEL_CLIENTLOG
|
||||
DC_getCfgStr
|
||||
DC_getCfgInt
|
||||
DC_log
|
||||
|
|
|
@ -67,6 +67,27 @@ Default name of the DC-API configuration file.
|
|||
|
||||
|
||||
|
||||
<!-- ##### MACRO DC_LABEL_STDOUT ##### -->
|
||||
<para>
|
||||
Logical name of the client's standard output used with DC_getResultOutput().
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO DC_LABEL_STDERR ##### -->
|
||||
<para>
|
||||
Logical name of the client's standard error used with DC_getResultOutput().
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO DC_LABEL_CLIENTLOG ##### -->
|
||||
<para>
|
||||
Logical name of the client's ifrastructure log used with DC_getResultOutput().
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### FUNCTION DC_getCfgStr ##### -->
|
||||
<para>
|
||||
Returns the value belonging to the specified key @name in the configuration file.
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
|
||||
DC_WUState
|
||||
DC_EventType
|
||||
DC_RESULT_STDOUT
|
||||
DC_RESULT_STDERR
|
||||
DC_RESULT_LOG
|
||||
DC_Workunit
|
||||
DC_Result
|
||||
DC_PhysicalFile
|
||||
|
@ -47,6 +44,7 @@ DC_sendWUMessage
|
|||
<SUBSECTION>
|
||||
DC_getClientCfgStr
|
||||
DC_getClientCfgInt
|
||||
DC_getClientCfgDouble
|
||||
|
||||
<SUBSECTION>
|
||||
DC_getResultCapabilities
|
||||
|
|
|
@ -41,27 +41,6 @@ Types of events the master application may receive.
|
|||
@DC_EVENT_SUBRESULT: a subresult has arrived.
|
||||
@DC_EVENT_MESSAGE: a message has arrived.
|
||||
|
||||
<!-- ##### MACRO DC_RESULT_STDOUT ##### -->
|
||||
<para>
|
||||
Logical name of the client's standard output used with DC_getResultOutput().
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO DC_RESULT_STDERR ##### -->
|
||||
<para>
|
||||
Logical name of the client's standard error used with DC_getResultOutput().
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO DC_RESULT_LOG ##### -->
|
||||
<para>
|
||||
Logical name of the client's ifrastructure log used with DC_getResultOutput().
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### STRUCT DC_Workunit ##### -->
|
||||
<para>
|
||||
Opaque type representing a work unit. A work unit consists of an executable
|
||||
|
@ -94,10 +73,10 @@ Describes an event received by the master application.
|
|||
</para>
|
||||
|
||||
@type: the type of the event.
|
||||
@wu:
|
||||
@wu: the work unit that generated the event.
|
||||
@result: the received #DC_Result if @type is %DC_EVENT_RESULT.
|
||||
@subresult: the received subresult if @type is %DC_EVENT_SUBRESULT.
|
||||
@message:
|
||||
@message: the received message if @type is %DC_EVENT_MESSAGE.
|
||||
|
||||
<!-- ##### USER_FUNCTION DC_ResultCallback ##### -->
|
||||
<para>
|
||||
|
@ -475,6 +454,23 @@ file. Unit suffixes like 'KB', 'GB' or 'hour' are also allowed.
|
|||
config file.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION DC_getClientCfgDouble ##### -->
|
||||
<para>
|
||||
Returns the double precision floating point value belonging to the specified
|
||||
key @key for the specific client application @clientName in the configuration
|
||||
file. Unit suffixes like 'KB', 'GB' or 'hour' are also allowed.
|
||||
</para>
|
||||
|
||||
@clientName: the name of the client application.
|
||||
@key: the key to look up.
|
||||
@defaultValue: the default value to return if the key is not defined or its value
|
||||
cannot be interpreted as a number.
|
||||
@fallbackGlobal: if %TRUE and the key is not defined in the client configuration,
|
||||
it will be looked up in the master configuration as well.
|
||||
@Returns: the value belonging to the key or @defaultValue if it is not defined in the
|
||||
config file.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION DC_getResultCapabilities ##### -->
|
||||
<para>
|
||||
Determines what kind of information is present in the received result.
|
||||
|
|
|
@ -50,13 +50,6 @@ typedef enum {
|
|||
DC_EVENT_MESSAGE /* A message has arrived */
|
||||
} DC_EventType;
|
||||
|
||||
/* Special result files, used by DC_getResultOutput() */
|
||||
#define DC_RESULT_STDOUT "__DC_STDOUT_" /* The client's standard
|
||||
output */
|
||||
#define DC_RESULT_STDERR "__DC_STDERR_" /* The client's standard
|
||||
error */
|
||||
#define DC_RESULT_LOG "__DC_LOG_" /* The system's log */
|
||||
|
||||
|
||||
/********************************************************************
|
||||
* Data types
|
||||
|
|
|
@ -64,6 +64,11 @@ typedef enum {
|
|||
/* Default name of the configuration file */
|
||||
#define DC_CONFIG_FILE "dc-api.conf"
|
||||
|
||||
/* Logical names for special files */
|
||||
#define DC_LABEL_STDOUT "dc_stdout.txt"
|
||||
#define DC_LABEL_STDERR "dc_stderr.txt"
|
||||
#define DC_LABEL_CLIENTLOG "dc_clientlog.txt"
|
||||
|
||||
|
||||
/********************************************************************
|
||||
* Function prototypes
|
||||
|
|
|
@ -110,7 +110,7 @@ char *DC_getResultOutput(const DC_Result *result, const char *logicalFileName)
|
|||
}
|
||||
}
|
||||
|
||||
if (!strcmp(logicalFileName, DC_RESULT_STDOUT))
|
||||
if (!strcmp(logicalFileName, DC_LABEL_STDOUT))
|
||||
{
|
||||
char *tmp = g_strdup_printf("%s%c%s", result->wu->workdir, G_DIR_SEPARATOR, STDOUT_LABEL);
|
||||
physicalFileName = strdup(tmp);
|
||||
|
@ -118,7 +118,7 @@ char *DC_getResultOutput(const DC_Result *result, const char *logicalFileName)
|
|||
return physicalFileName;
|
||||
}
|
||||
|
||||
if (!strcmp(logicalFileName, DC_RESULT_STDERR))
|
||||
if (!strcmp(logicalFileName, DC_LABEL_STDERR))
|
||||
{
|
||||
char *tmp = g_strdup_printf("%s%c%s", result->wu->workdir, G_DIR_SEPARATOR, STDERR_LABEL);
|
||||
physicalFileName = strdup(tmp);
|
||||
|
|
Loading…
Reference in New Issue