/************************************************************************
 * dsoshadeop.h -- handy macros for making "DSO Shadeops", C routines 
 *                 callable from Entropy shaders.
 *
 * (c) Copyright 2001 Exluna, Inc.  All rights reserved.
 *
 * $Revision: 1.1.4.1 $
 ************************************************************************/

#ifndef DSOSHADEOP_H
#define DSOSHADEOP_H


/*
 * In Windows, routines in a DLL that are visible to the main program
 * must be tagged with a special code.  This is not necessary in Unix.
 * We therefore define the symbol EXPORT that does the right magic
 * in either case.  Make sure that you use EXPORT to declare any routines
 * that must be exported from the DSO/DLL.
 */
#ifndef EXPORT
# ifdef _WIN32
#   define EXPORT __declspec(dllexport)
# else
#   define EXPORT
# endif
#endif


/*
 * Define the protocol version.  To give the renderer a helping hand in
 * deciding if the DSO/DLL follows the same protocol, you should include
 * in your DSO/DLL:
 *
 *    EXPORT int protocol_version = DS_PROTOCOL_VERSION;
 */
#define DS_PROTOCOL_VERSION 1


typedef struct {
    const char *implementation_prototype;
    const char *initializer;
    const char *cleanup_routine;
} DS_DispatchTableEntry;


/*
 * The dispatch table is an array of DS_DispatchTableEntry records, with
 * the last one having a blank prototype ("").  The table *must* be named
 * <op>_shadeops, where <op> is the name of the function we are implementing.
 * For example, to implement a function called myabs, the dispatch table
 * might look like this:
 *
 *   EXPORT DS_DispatchTableEntry myabs_shadeops[] = {
 *       { "float myabs_f(float)", "", "" },
 *       { "point myabs_p(point)", "", "" },
 *       { "vector myabs_v(vector)", "", "" },
 *       { "", "", "" }
 *   };
 */



#endif /* DSOSHADEOP_H */
