00001 #include "nml.hh"
00002 #include "nmlmsg.hh"
00003 #include "cms.hh"
00004
00005 #include "stat_msg.hh"
00006
00007 #include <string.h>
00008
00009 RCS_STAT_MSG::RCS_STAT_MSG (NMLTYPE t, size_t sz):NMLmsg (t, sz)
00010 {
00011
00012 command_type = -1;
00013 echo_serial_number = -1;
00014 status = -1;
00015 state = -1;
00016 line = -1;
00017 source_line = -1;
00018 memset (source_file, 0, 64);
00019
00020 }
00021
00022 int
00023 RCS_STAT_MSG_format (NMLTYPE t, void RCS_FAR * buf, CMS RCS_FAR * cms)
00024 {
00025 cms->update (((RCS_STAT_MSG *) buf)->command_type);
00026 cms->update (((RCS_STAT_MSG *) buf)->echo_serial_number);
00027 cms->update (((RCS_STAT_MSG *) buf)->status);
00028 cms->update (((RCS_STAT_MSG *) buf)->state);
00029 cms->update (((RCS_STAT_MSG *) buf)->line);
00030 cms->update (((RCS_STAT_MSG *) buf)->source_line);
00031 cms->update (((RCS_STAT_MSG *) buf)->source_file, 64);
00032
00033 switch (t)
00034 {
00035 case RCS_GENERIC_STATUS_TYPE:
00036 ((RCS_GENERIC_STATUS *) buf)->update (cms);
00037 return (1);
00038
00039 default:
00040 return (0);
00041 }
00042 return (0);
00043 }
00044
00045 RCS_GENERIC_STATUS::RCS_GENERIC_STATUS ():
00046 RCS_STAT_MSG (RCS_GENERIC_STATUS_TYPE, sizeof (RCS_GENERIC_STATUS))
00047 {
00048
00049 }
00050
00051 void
00052 RCS_GENERIC_STATUS::update (CMS *)
00053 {
00054
00055 }
00056
00057 RCS_STAT_CHANNEL::RCS_STAT_CHANNEL (NML_FORMAT_PTR f_ptr, char *name,
00058 char *process, char *file,
00059 int set_to_server):
00060 NML (name, process, file, set_to_server)
00061 {
00062 format_chain = new RCS_LINKED_LIST;
00063 prefix_format_chain (f_ptr);
00064 prefix_format_chain (RCS_STAT_MSG_format);
00065
00066 channel_type = RCS_STAT_CHANNEL_TYPE;
00067 sizeof_message_header = sizeof (RCS_STAT_MSG);
00068
00069 if (NULL != cms)
00070 {
00071 cms->sizeof_message_header = sizeof_message_header;
00072 }
00073
00074 register_with_server ();
00075 }
00076
00077 RCS_STAT_CHANNEL::~RCS_STAT_CHANNEL ()
00078 {
00079
00080 }