/*
 * Portions of this file Copyright 1999-2005 University of Chicago
 * Portions of this file Copyright 1999-2005 The University of Southern California.
 *
 * This file or a portion of this file is licensed under the
 * terms of the Globus Toolkit Public License, found at
 * http://www.globus.org/toolkit/download/license.html.
 * If you redistribute this file, with or without
 * modifications, you must include this notice in the file.
 */


#ifndef _RESOURCEPROPERTIESTESTSERVICE_INTERNAL_SKELETON_H_
#define _RESOURCEPROPERTIESTESTSERVICE_INTERNAL_SKELETON_H_

#include "globus_common.h"

EXTERN_C_BEGIN

#include "ResourcePropertiesTestService.h"

GlobusDebugDeclare(RESOURCEPROPERTIESTESTSERVICE);

extern globus_module_descriptor_t ResourcePropertiesTestService_module;
#define RESOURCEPROPERTIESTESTSERVICE_MODULE &ResourcePropertiesTestService_module

#define RESOURCEPROPERTIESTESTSERVICE_INFO  1
#define RESOURCEPROPERTIESTESTSERVICE_DEBUG 2
#define RESOURCEPROPERTIESTESTSERVICE_TRACE 4
#define RESOURCEPROPERTIESTESTSERVICE_WARN  8
#define RESOURCEPROPERTIESTESTSERVICE_ERROR 16

#define ResourcePropertiesTestServiceDebugPrintf(LEVEL, MESSAGE) \
    GlobusDebugPrintf(RESOURCEPROPERTIESTESTSERVICE, LEVEL, MESSAGE)

#define ResourcePropertiesTestServiceDebugEnter() \
    ResourcePropertiesTestServiceDebugPrintf(RESOURCEPROPERTIESTESTSERVICE_TRACE, \
                       ("[%s] Entering\n", _globus_func_name))

#define ResourcePropertiesTestServiceDebugExit() \
    ResourcePropertiesTestServiceDebugPrintf(RESOURCEPROPERTIESTESTSERVICE_TRACE, \
                       ("[%s] Exiting\n", _globus_func_name))

enum
{
    RESOURCEPROPERTIESTESTSERVICE_ERROR_TYPE_INVOKE_FAILED = 1024,
    RESOURCEPROPERTIESTESTSERVICE_ERROR_RETURNED_UNKNOWN_FAULT,
    RESOURCEPROPERTIESTESTSERVICE_ERROR_NOT_IMPLEMENTED
};

#define ResourcePropertiesTestServiceErrorInvokeFailed(result, message)               \
    globus_error_put(                                           \
        globus_error_construct_error(                           \
            RESOURCEPROPERTIESTESTSERVICE_MODULE,                       \
            (result ? globus_error_get(result) : NULL),         \
            RESOURCEPROPERTIESTESTSERVICE_ERROR_TYPE_INVOKE_FAILED,     \
            __FILE__,                                           \
            _globus_func_name,                                  \
            __LINE__,                                           \
            "Operation invocation failed: %s", message))

#define ResourcePropertiesTestServiceErrorReturnedUnknownFault(opname)                 \
     globus_error_put(                                           \
         globus_error_construct_error(                           \
             RESOURCEPROPERTIESTESTSERVICE_MODULE,                       \
             NULL,                                               \
             RESOURCEPROPERTIESTESTSERVICE_ERROR_RETURNED_UNKNOWN_FAULT, \
             __FILE__,                                           \
             _globus_func_name,                                  \
             __LINE__,                                           \
             "Operation %s returned unknown fault", opname))

#define ResourcePropertiesTestServiceErrorNotImplemented(opname)                       \
     globus_error_put(                                           \
         globus_error_construct_error(                           \
             RESOURCEPROPERTIESTESTSERVICE_MODULE,                       \
             NULL,                                               \
             RESOURCEPROPERTIESTESTSERVICE_ERROR_NOT_IMPLEMENTED,        \
             __FILE__,                                           \
             _globus_func_name,                                  \
             __LINE__,                                           \
             "Operation %s Unimplemented", opname))
        
EXTERN_C_END

#endif
