00001
00002
00003 #include "reGlobalsExtern.h"
00004 #include "icatHighLevelRoutines.h"
00005
00006 int
00007 print_hello(ruleExecInfo_t *rei)
00008 {
00009
00010
00011
00012
00013 RE_TEST_MACRO ("Test for print_hello\n");
00014 fprintf(stdout, "Hello\n");
00015 _writeString("stdout", "Hello\n", rei);
00016 return(0);
00017 }
00018 int
00019 recover_print_hello(ruleExecInfo_t *rei)
00020 {
00021 RE_TEST_MACRO ("\b\b\b\b\b \b\b\b\b\b");
00022 fprintf(stdout,"\b\b\b\b\b \b\b\b\b\b");
00023 return(0);
00024 }
00025
00026 int
00027 print_doi(dataObjInfo_t *doi)
00028 {
00029 if (reTestFlag == COMMAND_TEST_1) {
00030 fprintf(stdout," objPath = %s\n",doi->objPath);
00031 fprintf(stdout," rescName= %s\n",doi->rescName);
00032 fprintf(stdout," dataType= %s\n",doi->dataType);
00033 fprintf(stdout," dataSize= %lld\n",doi->dataSize);
00034 }
00035 else if(reTestFlag == HTML_TEST_1) {
00036 fprintf(stdout," <UL>\n");
00037 fprintf(stdout," <LI> objPath = %s\n",doi->objPath);
00038 fprintf(stdout," <LI> rescName= %s\n",doi->rescName);
00039 fprintf(stdout," <LI> dataType= %s\n",doi->dataType);
00040 fprintf(stdout," <LI> dataSize= %lld\n",doi->dataSize);
00041 fprintf(stdout," </UL>\n");
00042 }
00043 else {
00044 rodsLog (LOG_NOTICE," objPath = %s\n",doi->objPath);
00045 rodsLog (LOG_NOTICE," rescName= %s\n",doi->rescName);
00046 rodsLog (LOG_NOTICE," dataType= %s\n",doi->dataType);
00047 rodsLog (LOG_NOTICE," dataSize= %lld\n",doi->dataSize);
00048 }
00049 return(0);
00050 }
00051
00052
00053 int
00054 print_uoi(userInfo_t *uoi)
00055 {
00056 if (reTestFlag == COMMAND_TEST_1) {
00057 fprintf(stdout," userName = %s\n",uoi->userName);
00058 fprintf(stdout," rodsZone= %s\n",uoi->rodsZone);
00059 fprintf(stdout," userType= %s\n",uoi->userType);
00060 }
00061 else if(reTestFlag == HTML_TEST_1) {
00062 fprintf(stdout," <UL>\n");
00063 fprintf(stdout," <LI> userName= %s\n",uoi->userName);
00064 fprintf(stdout," <LI> rodsZone= %s\n",uoi->rodsZone);
00065 fprintf(stdout," <LI> userType= %s\n",uoi->userType);
00066
00067 fprintf(stdout," </UL>\n");
00068 }
00069 else {
00070 rodsLog (LOG_NOTICE," userName= %s\n",uoi->userName);
00071 rodsLog (LOG_NOTICE," rodsZone= %s\n",uoi->rodsZone);
00072 rodsLog (LOG_NOTICE," userType= %s\n",uoi->userType);
00073
00074 }
00075 return(0);
00076 }
00077
00078 int msiAW1(msParam_t* mPIn, msParam_t* mPOut2, ruleExecInfo_t *rei)
00079 {
00080 char *In;
00081 char *Out2;
00082
00083 In = (char *) mPIn->inOutStruct;
00084
00085 Out2 = (char *) mPOut2->inOutStruct;
00086
00087 rodsLog (LOG_NOTICE,"ALPHA: ------> In:%s\n", In);
00088 mPOut2->type = strdup(STR_MS_T);
00089 mPOut2->inOutStruct = strdup("Microservice_1");
00090 return(0);
00091
00092 }
00093
00094
00095 int msiCutBufferInHalf(msParam_t* mPIn, ruleExecInfo_t *rei)
00096 {
00097
00098 RE_TEST_MACRO ("Test for msiCutBufferInHalf\n");
00099
00100 if (mPIn == NULL || mPIn->inpOutBuf == NULL ) {
00101 rodsLog (LOG_ERROR, "msiCutBufferInHalf: input is NULL.");
00102 return (USER__NULL_INPUT_ERR);
00103 }
00104 mPIn->inpOutBuf->len = (mPIn->inpOutBuf->len) / 2;
00105 return(0);
00106
00107 }
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158 int
00159 msiDoSomething(msParam_t *inParam, msParam_t *outParam, ruleExecInfo_t *rei)
00160 {
00161 keyValPair_t *myKeyVal;
00162
00163
00164 RE_TEST_MACRO (" Calling msiDoSomething")
00165
00166
00167 if (rei == NULL || rei->rsComm == NULL)
00168 {
00169 rodsLog (LOG_ERROR, "msiDoSomething: input rei or rsComm is NULL.");
00170 return (SYS_INTERNAL_NULL_INPUT_ERR);
00171 }
00172
00173
00174 myKeyVal = (keyValPair_t*) malloc (sizeof(keyValPair_t));
00175 memset (myKeyVal, 0, sizeof(keyValPair_t));
00176
00177
00178
00179
00180
00181
00182
00183 outParam->type = strdup(KeyValPair_MS_T);
00184 outParam->inOutStruct = (void*) myKeyVal;
00185
00186 return 0;
00187 }