[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference azur::mcc

Title:DECmcc user notes file. Does not replace IPMT.
Notice:Use IPMT for problems. Newsletter location in note 6187
Moderator:TAEC::BEROUD
Created:Mon Aug 21 1989
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:6497
Total number of notes:27359

1122.0. "Need someone with VMS5.3 to test this code" by MCDOUG::MCPHERSON (i'm only 5 foot one...) Tue Jun 11 1991 17:11

I'm trying to isolate a problem with a vendor whose code keeps croaking in 
the mcc_time_convert() routine.    I have attached a sample program and the MMS
procedure (in the next reply).   The program runs w/o errors on my system 
(VMS V5.4-2) but he gets an error on his system running VMS 5.3 (just plain 
vanilla 5.3, no "dash"release).

I would appreciate if someone out there with *plain* VMS5.3 and MCC V1.1 
would build and run this program and mail me their output.   It's a very small 
example and wouldn't take long.

regards, 
doug

File BUG.C is below, with BUG.MMS in reply .1

-----------------------cut here-------------------------------------------------
#include <mcc_interface_def.h>
#include <mcc_msg.h>
#include <mcc_descrip.h>

unsigned long convert (
        unsigned long ul_value
        );

main (void)
     {
        unsigned long ul_status;
        unsigned long ul_value;        

        ul_value = 0;
        printf ("time = %d\n", ul_value);
        ul_status = convert (ul_value);
        if (ul_status == MCC_S_NORMAL )
                {
                printf ( "normal\n");
                }
        else if (ul_status = MCC_S_INVALIDTIME)
                {
                printf ("Invalid time\n");
                }
        else
                {
                printf ("Other error = %d\n", ul_status);
                }


        ul_value = 1;
        printf ("time = %d\n", ul_value);
        ul_status = convert (ul_value);
        if (ul_status == MCC_S_NORMAL )
                {
                printf ( "normal\n");
                }
        else if (ul_status = MCC_S_INVALIDTIME)
                {
                printf ("Invalid time\n");
                }
        else
                {
                printf ("Other error = %d\n", ul_status);
                }


        ul_value = 99;
        printf ("time = %d\n", ul_value);
        ul_status = convert (ul_value);
        if (ul_status == MCC_S_NORMAL )
                {
                printf ( "normal\n");
                }
        else if (ul_status = MCC_S_INVALIDTIME)
                {
                printf ("Invalid time\n");
                }
        else
                {
                printf ("Other error = %d\n", ul_status);
                }


        ul_value = 65536;
        printf ("time = %d\n", ul_value);
        ul_status = convert (ul_value);
        if (ul_status == MCC_S_NORMAL )
                {
                printf ( "normal\n");
                }
        else if (ul_status = MCC_S_INVALIDTIME)
                {
                printf ("Invalid time\n");
                }
        else
                {
                printf ("Other error = %d\n", ul_status);
                }



     }


unsigned long convert (
        unsigned long ul_value
        )

        {
        unsigned long ul_status;
        MCC_T_Descriptor *p_dst_time = MCC_K_NULL_PTR;
        MCC_T_Descriptor *p_src_time = MCC_K_NULL_PTR;
        char *pab_value;
        unsigned short uw_size;
        unsigned long ul_mcc_type = MCC_K_DT_BIN_REL_TIM;
        unsigned long ul_time_type;

        pab_value = (char *) &ul_value;
        uw_size = sizeof (ul_value);

        /*
         *      Create destination time descriptor to contain BinRelTim
         */

        ul_status = mcc_time_create (
                &p_dst_time, 
                &ul_mcc_type, 
                0,
                0
                );
        if ( ul_status != MCC_S_NORMAL ) 
                {
                return (ul_status);
                }


        /*
         *      Create source time descriptor to contain Unsigned32
         */

        ul_time_type = MCC_K_DT_UNSIGNED32;
        ul_status  = mcc_time_create (
                &p_src_time, 
                &ul_mcc_type, 
                &uw_size,
                pab_value
                );
        if ( ul_status != MCC_S_NORMAL ) 
                {
                mcc_time_delete ( &p_dst_time );
                return ( ul_status );
                }
                


        /*
         *      Convert from Unsigned32 to BinRelTim
         */

        ul_status  = mcc_time_convert ( p_src_time, p_dst_time );
        if ( ul_status != MCC_S_NORMAL )
                {
                mcc_time_delete ( &p_dst_time );
                mcc_time_delete ( &p_src_time );
                return ( ul_status );
                }

        /* 
         *  Delete destination time descriptor
         */

        ul_status = mcc_time_delete ( &p_dst_time );
        if ( ul_status != MCC_S_NORMAL )
                {
                mcc_time_delete ( &p_src_time );
                return ( ul_status ); 
                }

        /*
         *      Delete source time descriptor
         */

        ul_status = mcc_time_delete ( & p_src_time );
        if ( ul_status != MCC_S_NORMAL )
                {
                printf ( "Status = %d\n", ul_status );
                return ( ul_status ); 
                }

        return (MCC_S_NORMAL);

        }
T.RTitleUserPersonal
Name
DateLines
1122.1BUG.MMS (mms procedure for code in .0)MCDOUG::MCPHERSONi'm only 5 foot one...Tue Jun 11 1991 17:1247
!
! ALL will build all components and include all kit files
!
!ALL : BUG

!
! BUG will build only BUG.EXE
!

BUG : BUG.EXE
        DIR/SIZE/DATE   BUG.EXE;


CCSWITCHES = /DEBUG/NOOPT/LIST/STANDARD=PORTABLE
LINKSWITCHES = /DEBUG/TRACE

!
! Build header and require files
!

!
! Build BUG object modules
!

BUG.OBJ : BUG.C -
                SYS$LIBRARY:MCC_INTERFACE_DEF.H -
                SYS$LIBRARY:MCC_MSG.H -
                SYS$LIBRARY:MCC_DESCRIP.H 
        CC $(CCSWITCHES) BUG.C

!
! Build BUG object library
!

BUGOBJ1 = -
         BUG.OBJ

BUG.OLB : $(BUGOBJ1)
        LIBRARY/OBJECT/CREATE BUG $(BUGOBJ1)

!
! Build BUG.EXE
!

BUG.EXE : BUG.OLB, BUG.OPT
        LINK $(LINKSWITCHES) /EXECUTABLE=BUG -
                BUG.OPT/OPTION
1122.2BUG.OPT (options file for BUG.C)MCDOUG::MCPHERSONi'm only 5 foot one...Tue Jun 11 1991 17:434
BUG/INCLUDE=(BUG)/LIBRARY
SYS$SHARE:MCC_KERNEL_INIT.OBJ
SYS$SHARE:MCC_KERNEL_SHR/SHARE
SYS$SHARE:VAXCRTL/SHARE