Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

lsfInterface.h

Go to the documentation of this file.
00001 #ifndef LSF_INTERFACE_H
00002 #define LSF_INTERFACE_H
00003 /************************************************************************
00004 * E.S.O. - VLT project
00005 *
00006 * "@(#) $Id: lsfInterface.h,v 1.101 2003/11/18 13:47:39 vltsccm Exp $"
00007 *
00008 * who       when        what
00009 * --------  ----------  ----------------------------------------------
00010 * pduhoux   2000-02-23  created
00011 */
00012 
00013 /************************************************************************/
00014 
00015 #ifdef __cplusplus
00016 extern "C" {
00017 #endif
00018 
00019 #define lsfACI_FUNCTION(mod,fct) \
00020 ccsCOMPL_STAT I ## mod ## fct ( \
00021     IN  const char   *parameters,       /* Formatted input parameters   */ \
00022     IN  msgMSG       *msg,              /* Message body used for reply  */ \
00023     OUT char         **replyBuffer,     /* Output buffer                */ \
00024     OUT msgLENGTH    *replyBufferSize,  /* Output buffer size           */ \
00025     OUT ccsERROR     *error )           /* Returned error structure     */
00026 
00027 #define lsfACI_PARAMS  \
00028     parameters,msg,replyBuffer,replyBufferSize,error
00029 
00030 #define lsfVERBOSE_CMD_RECV(cmd) \
00031     if (lcuVerbose(msg,cmd ## ": Command received",error) != SUCCESS) \
00032         return FAILURE
00033 #define lsfVERBOSE_CMD_DONE(cmd) \
00034     if (lcuVerbose(msg,cmd ## ": Command executed",error) != SUCCESS) \
00035         return FAILURE
00036 
00037 #define lsfSTD_COMMAND(mod,fct,cmd) \
00038     lsfACI_FUNCTION(mod,Std ## fct) \
00039     { \
00040     ccsCOMPL_STAT status;                           \
00041     lsfVERBOSE_CMD_RECV(cmd);                       \
00042     status = mod ## Std ## fct (parameters,error);  \
00043     lsfVERBOSE_CMD_DONE(cmd);                       \
00044     lsfSTD_REPLY;                                   \
00045     }
00046 
00047 #define lsfSTD_REPLY \
00048     if (status == SUCCESS)                      \
00049         {                                       \
00050         sprintf(msg->body,"OK");                \
00051         *replyBuffer=(char *)&msg->body;        \
00052         *replyBufferSize=strlen(msg->body) + 1; \
00053         }                                       \
00054     return (status)
00055 
00056 #define lsfREPLY_OK(status,msg,buffer,size) \
00057     if (status == SUCCESS)                      \
00058         {                                       \
00059         sprintf(msg->body,"OK");                \
00060         *buffer=(char *)&msg->body;             \
00061         *size=strlen(msg->body) + 1;            \
00062         }
00063 
00064 #define lsfTASK_REGISTER(mod,id) \
00065   {                                           \
00066   ccsPROCNAME ccsProcName;                    \
00067   sprintf(ccsProcName,"%.8s%.4s%04X",mod,id,(taskIdSelf() & 0x0000FFFF));  \
00068   if (ccsInit(ccsProcName,0,NULL,NULL,error) != SUCCESS)               \
00069       return FAILURE;                                                  \
00070   }
00071 
00072 #ifdef __cplusplus
00073 }
00074 #endif
00075 
00076 #endif 

Generated on Wed Dec 3 14:52:13 2003 for ATCS API by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001