[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

2536.0. "FullEntityName ILV encoding" by CCIIS1::ROGGEBAND (_ �hili��e _) Wed Mar 11 1992 09:47

    Hi,
    
    I'm trying to ILV encode a FullEntityName datatype, which is defined in
    the SRM as a constructed Datatype. I assume I have to start with an
    mcc_ilv_put_cons_begin (), but then ??? I'm not sure whether I need to
    perform Mcc_ilV-put of the class, then the instance, or wether I just
    mcc_ilv_put the AES ? 
    
    Thanks,
    
    Philippe.
T.RTitleUserPersonal
Name
DateLines
2536.1AES is supported as a primitive type by mcc_ilv_*KAJUN::NELSONWed Mar 11 1992 13:1235
The Full Entity Name datatype actually refers to the object that is 
declared in your C code as an AES (for example, in_entity or out_entity,
or some other entity). The mcc_ilv_* routines support this datatype as if
it was a primitive type. You just do an ilv_put with the descriptor
pointing to the AES and fill in the other fields (curlen, dt, id, etc)
in an appropriate manner for the AES an object of type AES.

	descriptor.mcc_a_pointer = my_entity;
	descriptor.mcc_w_curlen = 4;  /* it's a pointer to a structure */
	descriptor.mcc_l_id = <your symbol code>;
	descriptor.mcc_l_dt = MCC_K_DT_FULL_ENTITY;

	status = mcc_ilv_put ( &ilv_context, 
			       &descriptor,
			       &reason_code );

...kjn



             <<< Note 2536.0 by CCIIS1::ROGGEBAND "_ �hili��e _" >>>
                        -< FullEntityName ILV encoding >-

    Hi,
    
    I'm trying to ILV encode a FullEntityName datatype, which is defined in
    the SRM as a constructed Datatype. I assume I have to start with an
    mcc_ilv_put_cons_begin (), but then ??? I'm not sure whether I need to
    perform Mcc_ilV-put of the class, then the instance, or wether I just
    mcc_ilv_put the AES ? 
    
    Thanks,
    
    Philippe.

2536.2Code segment to encode itTOOK::TANEd TanWed Mar 11 1992 13:12101
    
    The following is a code segment to build a FullEntityName data in an
    ILV descriptor. Start with a mcc_ilv_put_param_begin and
    mcc_ilv_put_cons_begin. Then use mcc_ilv_put to put the AES. Close with
    mcc_ilv_put_cons_end and then mcc_ilv_put_param_end.
    
    Is this what you need?
    
    ==================================================================
    
    struct MCC_R_ILV_CONTEXT ilvctx;
    unsigned long int mode;
    unsigned long int status = MCC_S_NORMAL;
    unsigned long temp_constant;

    MCC_T_Descriptor dsc;
    MCC_T_Descriptor aes_dsc;

    dsc.mcc_w_maxstrlen		= 1500;
    dsc.mcc_b_dtype		= DSC_K_DTYPE_T;
    dsc.mcc_b_class		= DSC_K_CLASS_S;
    dsc.mcc_a_pointer		= MCC_K_NULL_PTR;
    dsc.mcc_w_curlen		= 0;
    dsc.mcc_b_flags		= 0;
    dsc.mcc_b_ver		= 1;
    dsc.mcc_l_id		= 0;
    dsc.mcc_l_dt		= MCC_K_DT_ILV;
    dsc.mcc_a_link		= MCC_K_NULL_PTR;

    aes_dsc.mcc_w_maxstrlen	= 0;
    aes_dsc.mcc_b_dtype		= DSC_K_DTYPE_T;
    aes_dsc.mcc_b_class		= DSC_K_CLASS_S;
    aes_dsc.mcc_a_pointer	= MCC_K_NULL_PTR;
    aes_dsc.mcc_w_curlen	= 0;
    aes_dsc.mcc_b_flags		= 0;
    aes_dsc.mcc_b_ver		= 1;
    aes_dsc.mcc_l_id		= 0;
    aes_dsc.mcc_l_dt		= 0;
    aes_dsc.mcc_a_link		= MCC_K_NULL_PTR;

    if (status == MCC_S_NORMAL)
      {
	/* Allocate buffer for descriptor */

    	if (!(dsc.mcc_a_pointer =
    		(unsigned char *)mcc_malloc(dsc.mcc_w_maxstrlen)))
    	  {
    	    status = MCC_S_OUTOFMEM;
    	  }
      }

    if (status == MCC_S_NORMAL)
      {
    	status = mcc_ilv_put_param_begin(&ilvctx, &dsc);
      }

    if (status == MCC_S_NORMAL)
      {
	/* MCC_K_CONS_ID is the id code of this construction. You supply this.
	 */

    	temp_constant = MCC_K_CONS_ID;
    	dsc.mcc_l_id = MCC_K_CONS_ID;
    	mode = MCC_K_ILV_NATIVE_VALUE;
    	status = mcc_ilv_put_cons_begin(&ilvctx,
    					&temp_constant,
    					MCC_K_NULL_PTR,
    					MCC_K_NULL_PTR,
    					&mode);
      }

    if (status == MCC_S_NORMAL)
      {
    	aes_dsc.mcc_l_id = 1;
    	aes_dsc.mcc_l_dt = MCC_K_DT_FULL_ENTITY;

	/* Assume p_entity is of type MCC_A_AES which is your AES. */

    	aes_dsc.mcc_a_pointer = (unsigned char *)p_entity;

    	status = mcc_ilv_put(&ilvctx, &aes_dsc, MCC_K_NULL_PTR);
      }

    if (status == MCC_S_NORMAL)
      {
    	status = mcc_ilv_put_cons_end(&ilvctx);
      }

    if (status == MCC_S_NORMAL)
      {
    	status = mcc_ilv_put_param_end(&ilvctx, &dsc);
      }


    /* Cleanup */

    if (dsc.mcc_a_pointer)
      mcc_free(dsc.mcc_a_pointer);

    /* delete p_entity with mcc_aes_delete if necessary. */