00001 /*************************************************************** 00002 * File: nml_oi.cc 00003 ***************************************************************/ 00004 00005 /* 00006 MODIFICATIONS: 00007 00008 29-May-1997 WPS took functions from nml_emc.cc 00009 */ 00010 00011 #include "nml_oi.hh" 00012 00013 // NML operator interface messages for errors, text, and display 00014 00015 void 00016 NML_ERROR::update (CMS * cms) 00017 { 00018 cms->update (error, NML_ERROR_LEN); 00019 } 00020 00021 void 00022 NML_TEXT::update (CMS * cms) 00023 { 00024 cms->update (text, NML_TEXT_LEN); 00025 } 00026 00027 void 00028 NML_DISPLAY::update (CMS * cms) 00029 { 00030 cms->update (display, NML_DISPLAY_LEN); 00031 } 00032 00033 void 00034 NML_OPERATOR_REQUEST::update (CMS * cms) 00035 { 00036 cms->update (key); 00037 cms->update (request, NML_OPERATOR_REQUEST_LEN); 00038 } 00039 00040 void 00041 NML_OPERATOR_REPLY::update (CMS * cms) 00042 { 00043 cms->update (key); 00044 cms->update (reply, NML_OPERATOR_REPLY_LEN); 00045 } 00046 00047 int RCS_EXPORT 00048 nmlErrorFormat (NMLTYPE type, void *buffer, CMS * cms) 00049 { 00050 switch (type) 00051 { 00052 case NML_ERROR_TYPE: 00053 ((NML_ERROR *) buffer)->update (cms); 00054 break; 00055 00056 case NML_TEXT_TYPE: 00057 ((NML_TEXT *) buffer)->update (cms); 00058 break; 00059 00060 case NML_DISPLAY_TYPE: 00061 ((NML_DISPLAY *) buffer)->update (cms); 00062 break; 00063 00064 case NML_OPERATOR_REQUEST_TYPE: 00065 ((NML_OPERATOR_REQUEST *) buffer)->update (cms); 00066 break; 00067 00068 case NML_OPERATOR_REPLY_TYPE: 00069 ((NML_OPERATOR_REPLY *) buffer)->update (cms); 00070 break; 00071 00072 // unknown type 00073 default: 00074 return 0; // 0 signifies didn't find 00075 } 00076 00077 return 1; // 1 signifies found it 00078 }