00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "rsApiHandler.h"
00014 #include "objMetaOpr.h"
00015 #include "resource.h"
00016 #include "examplesMS.h"
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 int
00028 msiHello( msParam_t *name, msParam_t *outParam,
00029 ruleExecInfo_t *rei )
00030 {
00031 char *tmpPtr;
00032 char outStr[MAX_NAME_LEN];
00033
00034 RE_TEST_MACRO( " Calling msiHello" );
00035
00036 tmpPtr = parseMspForStr (name);
00037
00038 if (tmpPtr == NULL) {
00039 rodsLog (LOG_ERROR, "msiHello: missing name input");
00040 rei->status = USER__NULL_INPUT_ERR;
00041 return USER__NULL_INPUT_ERR;
00042 }
00043
00044 snprintf (outStr, MAX_NAME_LEN, "Hello world from %s", tmpPtr);
00045
00046 fillStrInMsParam (outParam, outStr);
00047
00048 rei->status = 0;
00049 return 0;
00050 }
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 int
00062 msiGetRescAddr( msParam_t *rescName, msParam_t *outAddress,
00063 ruleExecInfo_t *rei )
00064 {
00065 char *tmpPtr;
00066 int status;
00067 rescGrpInfo_t *rescGrpInfo = NULL;
00068
00069 RE_TEST_MACRO( " Calling msiGetRescAddr" );
00070
00071 tmpPtr = parseMspForStr (rescName);
00072
00073 if (tmpPtr == NULL) {
00074 rodsLog (LOG_ERROR, "msiGetRescAddr: missing name input");
00075 rei->status = USER__NULL_INPUT_ERR;
00076 return USER__NULL_INPUT_ERR;
00077 }
00078
00079 status = _getRescInfo (rei->rsComm, tmpPtr, &rescGrpInfo);
00080 if ( rescGrpInfo == NULL || status < 0) {
00081 rodsLog (LOG_ERROR,
00082 "msiGetRescAddr: _getRescInfo of %s error. stat = %d",
00083 rescName, status);
00084 return status;
00085 }
00086
00087 fillStrInMsParam (outAddress, rescGrpInfo->rescInfo->rescLoc);
00088
00089 rei->status = 0;
00090 return 0;
00091 }
00092