⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 eixfrm.c

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 C
📖 第 1 页 / 共 2 页
字号:
#ifndef lintstatic char sccsid[]  =  "@(#)eixfrm.c	4.3   (ULTRIX)   9/11/90"; #endif  lint/* DEC/CMS REPLACEMENT HISTORY, Element EIXFRM.C*//* *1    20-FEB-1986 13:14:41 EMLICH "Raw to standard transformation engine - first base-level"*//* DEC/CMS REPLACEMENT HISTORY, Element EIXFRM.C*//**	.TITLE	EIXFRM - Transformation system for ERIT*	.IDENT	/1-001/** COPYRIGHT (C) 1986 DIGITAL EQUIPMENT CORP.,* CSSE SOFTWARE ENGINEERING* MARLBOROUGH, MASSACHUSETTS** THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY ON A * SINGLE COMPUTER SYSTEM AND MAY BE COPIED ONLY WITH THE INCLUSION* OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE,  OR ANY OTHER* COPIES THEREOF, MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE* TO ANY OTHER PERSON EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO* AGREES TO THESE LICENSE TERMS.  TITLE TO AND OWNERSHIP OF THE* SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.** THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT* NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL* EQUIPMENT CORPORATION.** DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF* ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.**++** FACILITY:             ERIT - Event Record Input Transformer** ABSTRACT:**	This module contains the code for making transformations*       between the raw entry and the standard entry. It is called by*       the ERIT process to build one segment. This module calls the*       DSD system to get raw and standard definitions and to set the*       field validity code.*	* ENVIRONMENT:	VAX/VMS C,  ULTRIX-32 C, (and hopefully beyond)** AUTHOR:  Larry Emlich,  CREATION DATE:  22-Nov-85 (templates)*                                          7-Feb-86 (code)** MODIFIED BY:***--*/#include <stdio.h>#include <sys/types.h>#include <sys/time.h>#include <sys/errlog.h>#include "erms.h"#include "eiliterals.h"   /* For return codes  */#include "generic_dsd.h"  /* For DSD interface */#include "std_dsd.h" 	  /* For DSD interface */#include "os_dsd.h" 	  /* For DSD interface *//**++*=*=*=MODULE FLOW - eixfrm.c*=*=  a - os_std(os_ptr,os_id,std_id)                 OS_item moved & transformed*=                                                  to the std segment*=          find_os_item_dsd(os_id)                         (dsd_access.c)*=          decode_os_item(os_id,data)                      (dsd_access.c)*=          chk_fld(item_ptr)                               (* c)*=          set_validity_code(seg,seq,val)                  (dsd_access.c)*=*=  b - ini_seg(seg_buf)                            Info for seg_items saved*=          get_std_segment_dsd(ctx)                        (dsd_access.c)*=          get_next_item_dsd(ctx)                          (dsd_access.c)*=*=  c - chk_fld()                                   Null routine (for future*=                                                  field value checking)*=**--*//**	.SBTTL	INTERNAL_DATA - Internal structures and stuff*++* FUNCTIONAL DESCRIPTION:		**     Structures and other things global to this module but not*     useful outside it.*--*//********************  STUCTURE FOR SEGMENT INFO ********************/struct    {    DD$STD_HEADER_PTR	beg_seg;	/* Begining of segment		*/    char 		*end_seg;	/* End of segment		*/    char 		*str_loc;	/* next string storage area     */    short   		seg_size;	/* segment size			*/    }  seg[] =    {    {0,0,0,0},    {0,0,0,ES$EISIZE},		/* ES$EIS is 1 */    {0,0,0,ES$DISIZE},		/* ES$DIS is 2 */    {0,0,0,ES$SDSIZE},		/* ES$SDS is 3 */    {0,0,0,ES$CDSIZE},		/* ES$CDS is 4 */    {0,0,0,ES$ADSIZE},		/* ES$ADS is 5 */    {0,0,0,ES$SISIZE},		/* ES$SIS is 6 */    {0,0,0,ES$CISIZE}		/* ES$CIS is 7 */    };/*********************  STRUCTURES FOR STD ITEM INFO  *************/ITEM_INFO       item_info[300];short           next_item;/*******************  MODULE WIDE FUNCTIONS ****************/long    chk_fld();long    get_next_item_dsd();	/* external functions		*/long    set_validity_code();long    get_std_segment_dsd();DD$OS_ITEMS_DSD_PTR find_os_item_dsd();/********************   MACRO  ************************//******************** DECODE_RTN ***********************/#define DECODE_RTN(src_type, dst_type) \    if ((*((dst_type *) item_info[i].item_ptr) = \	  decode_os_item (raw_id, gen_item.gen_long)) \	  == DD$UNKNOWN_CODE) \	    { \	    s = DD$N_V; \	    *((dst_type *) item_info[i].item_ptr) = \	    (src_type) gen_item.gen_long;\	    }\        break;/********************** END OF MACROS ******************//**	.SBTTL	OS_TO_STD - Moves data from the OS record to the *                           STD segment.*++* FUNCTIONAL DESCRIPTION:		**    Controls the transformation of raw data to a standard segment.*	* CALLING SEQUENCE:		CALL OS_TO_STD (..See Below..)*                                   Called by EI$BLD once per item.** FORMAL PARAMETERS:		raw item pointer*                               raw item type*                               std item id** IMPLICIT INPUTS:              type-move matrix** IMPLICIT OUTPUTS:		NONE*                  * COMPLETION CODES:             Transformation successful (success)*                                   (may have invalid fields)  *                               Fatal Program error** SIDE EFFECTS:                 Lower routines fill the segment buffer*              *--*//*...	ROUTINE OS_TO_STD ()		    */long os_std (raw_item, raw_id, std_id)DD$BYTE *raw_item;short   raw_id;short   std_id;{long size;long len;long s;				/* for status			*/union {      long   gen_long;      char   *gen_string;      short  gen_short;      char   gen_char[4];      } gen_item;long item;short i, j;short s_type;short raw_type;short std_type;DD$OS_ITEMS_DSD_PTR os_item_dsd;for (i = next_item - 1; i >= 0; i--)    {    if (std_id == item_info[i].id)	/* find std item in item_info table */	break;    }if (std_id != item_info[i].id)    {    return EI$FAIL;    }s_type = item_info[i].seg_type;os_item_dsd = find_os_item_dsd(raw_id);if (os_item_dsd == DD$UNKNOWN_ITEM)    return EI$FAIL;s = DD$VALID;		/* preset to valid */raw_type = os_item_dsd->TYPE;std_type = item_info[i].type;/********************************************************************** ************ the following is moved by chars to guarantee  *********** ************ alignment for cpus such as PMAX               *********** **********************************************************************/switch ((100 * raw_type) + std_type)    {    case (100 * DT_LONG                 + DT_LONG):    case (100 * DT_LONG                 + DT_INDEXED):    case (100 * DT_LONG                 + DT_REGISTER):    case (100 * DT_REGISTER             + DT_REGISTER):    case (100 * DT_DATE                 + DT_DATE):    case (100 * DT_LONG                 + DT_DATE):	((char *) item_info[i].item_ptr)[0] = *(raw_item+0);	((char *) item_info[i].item_ptr)[1] = *(raw_item+1);	((char *) item_info[i].item_ptr)[2] = *(raw_item+2);	((char *) item_info[i].item_ptr)[3] = *(raw_item+3);    break;    case (100 * DT_LONG                 + DT_VMS_TIME):	((char *) item_info[i].item_ptr)[0] = *(raw_item+0);	((char *) item_info[i].item_ptr)[1] = *(raw_item+1);	((char *) item_info[i].item_ptr)[2] = *(raw_item+2);	((char *) item_info[i].item_ptr)[3] = *(raw_item+3);	((char *) item_info[i].item_ptr)[4] = *(raw_item+4);	((char *) item_info[i].item_ptr)[5] = *(raw_item+5);	((char *) item_info[i].item_ptr)[6] = *(raw_item+6);	((char *) item_info[i].item_ptr)[7] = *(raw_item+7);    break;    case (100 * DT_LONG                 + DT_SHORT):    case (100 * DT_LONG                 + DT_SHORT_INDEX):	((char *) item_info[i].item_ptr)[0] = *(raw_item+0);	((char *) item_info[i].item_ptr)[1] = *(raw_item+1);    break;    case (100 * DT_SHORT                + DT_SHORT):    case (100 * DT_SHORT                + DT_SHORT_INDEX):    case (100 * DT_SHORT                + DT_SHORT_REGISTER):    case (100 * DT_SHORT_REGISTER       + DT_SHORT_REGISTER):	((char *) item_info[i].item_ptr)[0] = *(raw_item+0);	((char *) item_info[i].item_ptr)[1] = *(raw_item+1);    break;    case (100 * DT_SHORT                + DT_LONG):    case (100 * DT_SHORT                + DT_INDEXED):

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -