当前位置: 首页>>代码示例>>C++>>正文


C++ DESCRIPTOR函数代码示例

本文整理汇总了C++中DESCRIPTOR函数的典型用法代码示例。如果您正苦于以下问题:C++ DESCRIPTOR函数的具体用法?C++ DESCRIPTOR怎么用?C++ DESCRIPTOR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DESCRIPTOR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ini_PlcStart

pwr_tStatus
ini_PlcStart (
    pwr_tUInt32	    plcversion,
    char		    *plcfile,
    pwr_tUInt32	    busid
)
{
    pwr_tUInt32	    sts;
    unsigned int	    flags;
    char		    command[128];
    char		    procname[20];
    $DESCRIPTOR(commanddsc, "");
    $DESCRIPTOR(procnamedsc, "");

    commanddsc.dsc$a_pointer  = command;
    commanddsc.dsc$w_length   = sprintf(command, "run %s", plcfile);
    procnamedsc.dsc$a_pointer = procname;
    procnamedsc.dsc$w_length  = sprintf(procname, "PWR_PLC_%d", busid);

    flags = 1; /* Nowait and Notify */
    sts = lib$spawn(&commanddsc, NULL, NULL, &flags, &procnamedsc);
    if (EVEN(sts)) errh_Error("lib$spawn %s\n%m", command, sts);

    return sts;
}
开发者ID:hfuhuang,项目名称:proview,代码行数:25,代码来源:ini_loader.c

示例2: DoMessage

int DoMessage(int id) {
  int status=0;
  static Message *(*processMessage)(Connection *,Message *) = 0;
  Connection *c=FindConnection(id,0);
  if (processMessage == 0) {
    DESCRIPTOR(MdsIpSrvShr,"MdsIpSrvShr");
    DESCRIPTOR(procmsg,"ProcessMessage");
    status = LibFindImageSymbol(&MdsIpSrvShr,&procmsg,&processMessage);
  }
  if (c && processMessage) {
    Message *msgptr = GetMdsMsg(id,&status);
    Message *ans=0;
    if (status & 1) {
      ans = (*processMessage)(c, msgptr);
      if (ans) {
	status = SendMdsMsg(id, ans, 0);
	free(ans);
      }
    }
    else
      CloseConnection(id);
    if (msgptr)
      free(msgptr);
  }
  return status;
}
开发者ID:LucyScott,项目名称:mdsplus,代码行数:26,代码来源:DoMessage.c

示例3: cce_out_open

void cce_out_open(void)
{
	uint4 status;
	static readonly unsigned char sys_output_name[] = "SYS$OUTPUT";
	$DESCRIPTOR(output_qualifier, "OUTPUT");
	char output_name[255];
	$DESCRIPTOR(output_name_desc, output_name);
	short unsigned outnamlen;

	status = cli$get_value(&output_qualifier, &output_name_desc, &outnamlen);
	if (status != 1)
	{
		outnamlen = SIZEOF(sys_output_name) - 1;
		output_name_desc.dsc$a_pointer = sys_output_name;
	}
	cce_output_fab = malloc(SIZEOF(*cce_output_fab));
	cce_output_rab = malloc(SIZEOF(*cce_output_rab));
	*cce_output_fab  = cc$rms_fab;
	*cce_output_rab  = cc$rms_rab;
	cce_output_rab->rab$l_fab = cce_output_fab;
	cce_output_rab->rab$w_usz = 255;
	cce_output_fab->fab$w_mrs = 255;
	cce_output_fab->fab$b_fac = FAB$M_GET | FAB$M_PUT;
	cce_output_fab->fab$b_rat = FAB$M_CR;
	cce_output_fab->fab$l_fna = output_name_desc.dsc$a_pointer;
	cce_output_fab->fab$b_fns = outnamlen;
	status = sys$create(cce_output_fab, 0, 0);
	if ((status & 1) == 0)
		lib$signal(status);
	status = sys$connect(cce_output_rab, 0, 0);
	if ((status & 1) == 0)
		lib$signal(status);
}
开发者ID:ChristopherEdwards,项目名称:fis-gtm,代码行数:33,代码来源:cce_output.c

示例4: proc_Start

pwr_tStatus
proc_Start (
  proc_sProcess *p
)
{
  pwr_tStatus sts;
  char *fmt;
  char nameb[40];
  char buf[512];
  int flags;
  $DESCRIPTOR(com,"");
  $DESCRIPTOR(name,"");

  cdh_ToUpper(nameb, p->name);
  name.dsc$w_length = strlen(nameb);
  name.dsc$a_pointer = nameb;

  if (p->flags.b.user)
    fmt = "@pwr_exe:pwrp_run %s \"%s\" %d %d \"%s\"";
  else
    fmt = "@pwr_exe:pwr_run %s \"%s\" %d %d \"%s\"";

  com.dsc$w_length = sprintf(buf, fmt, p->file, p->name, p->flags.b.debug, p->p_prio, p->arg);
  com.dsc$a_pointer = buf;
  flags = 1; /* Nowait */
  sts = lib$spawn(&com, NULL, NULL, &flags, &name, &p->pid);

  return sts;
}
开发者ID:hfuhuang,项目名称:proview,代码行数:29,代码来源:rt_proc.c

示例5: main

main()
{
    int i,fd;
    $DESCRIPTOR(gsdnam1,"gsd3");
    $DESCRIPTOR(gsdnam2,"gsd4");
    struct _va_range range1, range2;
    struct _secid id1, id2;
    range1.va_range$ps_start_va=0x10000000;
    range1.va_range$ps_end_va=0x10008000;
    range2.va_range$ps_start_va=0x20020000;
    range2.va_range$ps_end_va=0x20030000;
    id1.secid$l_version=0;
    id2.secid$l_version=0;
    fd=open("/file",O_RDONLY);

    sys$create_region_32(0x8000,0,0,0,0,0,range1.va_range$ps_start_va);
    sys$create_region_32(0x10000,0,0,0,0,0,range2.va_range$ps_start_va);

    sys$crmpsc(&range1,0,0,SEC$M_GBL,&gsdnam1,&id1,0,fd,2,0,0,0);
    sys$crmpsc(&range2,0,0,SEC$M_GBL,&gsdnam2,&id2,0,fd,2,1,0,0);

    for(i=0; i<4; i++)
    {
        volatile unsigned long * l1=range1.va_range$ps_start_va+0x2000;
        volatile unsigned long * l2=range2.va_range$ps_start_va+0x1000;
        (*l1)++;
        printf("%x %x\n",getpid(),*l1);
        sleep(2);
        (*l2)++;
        printf("%x %x\n",getpid(),*l2);
        sleep(2);
    }
    close(fd);
}
开发者ID:rroart,项目名称:freevms,代码行数:34,代码来源:memf.c

示例6: la_getdat

void	la_getdat(uint4 kid, int4 code, date *date_ptr, uint4 lo, uint4 hi)
/* kid - virt. keyb. ID		*/
/* code - promt msg code	*/
/* date_ptr - date/time returned	*/
/* lo - min value of date	*/
/* hi - max value of date	*/
{
	int		status;
	bool		valid;
	char		pro[64], res[64];
	unsigned short	length;			/* res. string length	*/
	int4		mlen = 32;		/* max length of result */
	int		smg$read_string(), sys$getmsg();
	int		sys$asctim();
	$DESCRIPTOR(dini, res);			/* initial string	*/
	$DESCRIPTOR(dres, res);			/* resuting string	*/
	$DESCRIPTOR(dprm, pro);			/* prompt string	*/
	error_def(LA_INVAL);

	dprm.dsc$w_length = 64;
	status = sys$getmsg(code, &length, &dprm, 1, 0);
	if (SS$_NORMAL != status)
		lib$signal(status);
	dprm.dsc$w_length = length;
	dres.dsc$w_length = 12;
	if (0 == (*date_ptr)[1])
	{	/* no initial date */
		res[0] = 0;
		length = 0;
	} else
	{
		status = sys$asctim(&length, &dres, date_ptr, 0);
		if (SS$_NORMAL != status)
			lib$signal(status);
	}
	dres.dsc$w_length = 64;
	valid = FALSE;
	while ((SS$_NORMAL != status) || !valid)
	{
		res[length] = ' ';
		dini.dsc$w_length = length;
		status = smg$read_string(&kid, &dres, &dprm, &mlen, 0, 0, 0, &length, 0, 0, &dini);
		if (SS$_NORMAL != status)
			lib$signal(status);
		else  if (0 == length)
		{	/* no datstatus/time */
			(*date_ptr)[0] = (*date_ptr)[1] = lo = 0;
			hi = 1;
		} else  if (0 != length)
		{	/* date/time entered */
			status = lib$convert_date_string(&dres, date_ptr);
			if (SS$_NORMAL != status)
				la_putmsgs(status);
		}
		valid = ((*date_ptr)[1] >= lo || (*date_ptr)[1] < hi);
		if (!valid)
			la_putmsgu(LA_INVAL, 0, 0);
	}
}
开发者ID:ChristopherEdwards,项目名称:fis-gtm,代码行数:59,代码来源:la_getdat.c

示例7: varg_set_symbol

static int varg_set_symbol(char *symbol, char *value)
{
        $DESCRIPTOR(symbol_desc, "");
        $DESCRIPTOR(value_desc, "");
        int status;

        symbol_desc.dsc$w_length = strlen(symbol);
        symbol_desc.dsc$a_pointer = symbol;
        value_desc.dsc$w_length = strlen(value);
        value_desc.dsc$a_pointer = value;
        status = lib$set_symbol(&symbol_desc, &value_desc);
        return status;
}
开发者ID:Distrotech,项目名称:freetds,代码行数:13,代码来源:vmsarg_parse.c

示例8: DESCRIPTOR

	/*****************************************************************
	 * MdsGetMsg:
	 *****************************************************************/
char  *MdsGetMsg(	/* Return: addr of "status" string	*/
    int   sts			/* <r> sts value			*/
   )
   {
     STATIC_CONSTANT DESCRIPTOR(msg_files,"MDSMSG_PATH:*Msg.*");
     STATIC_CONSTANT DESCRIPTOR(getmsg_nam,"getmsg");
     struct descriptor_d filnam = {0, DTYPE_T, CLASS_D, 0};
     int   i;
     char  *facnam, *msgnam, *msgtext;
     int status = 0;
     void *ctx = 0;
     const STATIC_CONSTANT char *severity[] = {"W","S","E","I","F","?","?","?"};
     int (*getmsg)(int,char **,char **,char **);
     int   max;
     struct stsText  *stsText;

     if (sts == 1)
     {
       strcpy((MdsShrGetThreadStatic())->MdsGetMsg_text,"%SS-S-SUCCESS, Success");
       return (MdsShrGetThreadStatic())->MdsGetMsg_text;
     }
     max = getFacility(sts,&facnam,&stsText);
     if (max > 0)
     {
       for (i=0 ; i<max ; i++)
       {
         if ((sts & 0xfffffff8) == (stsText[i].stsL_num & 0xfffffff8))
         {
           sprintf((MdsShrGetThreadStatic())->MdsGetMsg_text,"%%%s-%s-%s, %s",facnam,severity[sts&0x7],stsText[i].stsA_name,stsText[i].stsA_text);
           break;
         }
       }
       if (i == max)
         sprintf((MdsShrGetThreadStatic())->MdsGetMsg_text,"%%%s-%s-NOMSG, Message number 0x%08x",facnam,severity[sts&0x7],sts);
       status = 1;
     }
     while (!(status & 1) && (LibFindFile(&msg_files,&filnam,&ctx)&1))
     {
       status = LibFindImageSymbol(&filnam,&getmsg_nam,&getmsg);
       if (status & 1)
       {
         status = (*getmsg)(sts,&facnam,&msgnam,&msgtext);
         if (status & 1)
           sprintf((MdsShrGetThreadStatic())->MdsGetMsg_text,"%%%s-%s-%s, %s",facnam,severity[sts&0x7],msgnam,msgtext);
       }
     }
     LibFindFileEnd(&ctx);
     if (!(status & 1))
       sprintf((MdsShrGetThreadStatic())->MdsGetMsg_text,"%%NONAME-%s-NOMSG, Message number 0x%08X",severity[sts&0x7],sts);
     return (MdsShrGetThreadStatic())->MdsGetMsg_text;
   }
开发者ID:petermilne,项目名称:mdsshell,代码行数:54,代码来源:mdsmsg.c

示例9: readdir

struct direct  *
readdir(int context)
{
	int		i;
	char		cresult[100];
	char		*pnt;
	int		status;

	$DESCRIPTOR(dpath, searchpath[context]);
	$DESCRIPTOR(result, cresult);

	if (dircontext[context] == -1) {
		dircontext[context] = -2;
		strcpy(d_entry[context].d_name, ".");
		return (&d_entry[context]);
	};

	if (dircontext[context] == -2) {
		dircontext[context] = -3;
		strcpy(d_entry[context].d_name, "..");
		return (&d_entry[context]);
	};

	if (dircontext[context] == -3)
		dircontext[context] = 0;

	dpath.dsc$w_length = strlen(searchpath[context]);
	lib$find_file(&dpath, &result, &dircontext[context],
		0, 0, &status, 0);

	if (status == SS$_NOMOREFILES)
		return (0);

	/* Now trim trailing spaces from the name */
	i = result.dsc$w_length - 1;
	while (i && cresult[i] == ' ')
		i--;
	cresult[i + 1] = 0;

	/* Now locate the actual portion of the file we want */

	pnt = (char *) strrchr(cresult, ']');
	if (pnt)
		pnt++;
	else
		pnt = cresult;

	strcpy(d_entry[context].d_name, pnt);
	return (&d_entry[context]);
}
开发者ID:jobermayr,项目名称:cdrtools,代码行数:50,代码来源:vms.c

示例10: printf

        /* Get next line */
        cip = 0;
#if 1
        if (smg$enable)
        {
            SMG$ERASE_LINE(&disp2_id, &i1, &i1);
            SMG$SET_CURSOR_ABS(&disp2_id,&i1,&i1);
            status = SMG$READ_COMPOSED_LINE(&keyb_id,&key_tab,&input_line,
                                            &prompt,&out_len,&disp2_id,0,0,0,0,0); /*Get next command */
            cip = 1;
        }
        else
            status = SMG$READ_COMPOSED_LINE(&keyb_id,0,&input_line,
                                            &prompt,&out_len,0,0,0,0,0,0); /*Get next command */
#else
        printf("%s",prompt.dsc$a_pointer);
        out_len = read(0,command_line,254);
        out_len--;
        command_line[out_len]=0;
        if (strncmp(command_line,"exit",4)==0)
            return 0;
#endif
    }
}  /* END of MAIN */
int help_command(int mask)
/*	HELP

	Purpose : call on-line help
	Output  : contents of DFUHLP helplib.
*/
{
    unsigned int x,flag=1,tmp=0;
#if 0
    static char help[80];
    $DESCRIPTOR(help_key ,help);
    $DESCRIPTOR(help_item, "helpkey");
    $DESCRIPTOR(help_lib,"dfuhlp");
    $DESCRIPTOR(item,"DFU ");
    $DESCRIPTOR(hlp_txt,"< DFU Help Screen >");

    /* Check if a help item was entered */
    if (cli$present(&help_item) == CLI$_PRESENT)
        cli$get_value(&help_item,&help_key,&help_key);
    else
        help_key.dsc$w_length=0;

    /* Add 'DFU ' to the help key */
    help_key.dsc$w_length +=4;
    str$concat(&help_key,&item,&help_key);
    x = rows - 4;
    /* Reenable line editing... */
    status = SYS$QIOW(0,tchan, IO$_SETMODE,0,0,0,&orgttchar,12,0,0,0,0);
    if (smg$enable)
    {
        SMG$CREATE_VIRTUAL_DISPLAY(&x, &colls, &help_id, 0 , 0, 0);
        SMG$LABEL_BORDER(&help_id, &hlp_txt, 0, 0,&SMG$M_BOLD);
        SMG$PASTE_VIRTUAL_DISPLAY(&help_id, &paste_id, &i2,&i2,0);
        status = SMG$PUT_HELP_TEXT(&help_id, &keyb_id, &help_key, &help_lib,0,0);
        SMG$UNPASTE_VIRTUAL_DISPLAY(&help_id, &paste_id);
        SMG$DELETE_VIRTUAL_DISPLAY(&help_id);
    }
    else
        status = lbr$output_help(lib$put_output,0,&help_key,
                                 &help_lib,&flag,lib$get_input);
    if (status != SS$_NORMAL)
    {
        sprintf(outbuf,"%%DFU-E-HELPERR, Error opening help library,");
        put_disp();
        singlemsg(0,status);
    }
#endif
    return(1);
} /*END help_command */
开发者ID:rroart,项目名称:freevms,代码行数:73,代码来源:dfu.c

示例11: varg_do_help

static int varg_do_help(char *help_library, char *help_command)
{
        $DESCRIPTOR(lib_desc, "");
        $DESCRIPTOR(command_desc, "");
        int status;

        lib_desc.dsc$w_length = strlen(help_library);
        lib_desc.dsc$a_pointer = help_library;
        command_desc.dsc$w_length = strlen(help_command);
        command_desc.dsc$a_pointer = help_command;

        status = lbr$output_help(&lib$put_output, 0, &command_desc, &lib_desc, 0,
                                 &lib$get_input);
        return status;
}
开发者ID:Distrotech,项目名称:freetds,代码行数:15,代码来源:vmsarg_parse.c

示例12: spawn_command

int spawn_command(int mask)
{
#if 0
    /* Saves the screen and spawns a subprocess */

    int save_id;
    $DESCRIPTOR(prompt,"DFU_sub$ ");

    if (smg$enable)
    {
        SMG$SAVE_PHYSICAL_SCREEN(&paste_id, &save_id);
        SMG$DISABLE_BROADCAST_TRAPPING(&paste_id);
    }
    printf("%%DFU-I-SPAWN, Creating subprocess...\n");
    status = lib$spawn(0,0,0,0,0,0,0,0,0,0,&prompt,0,0);
    /* Next call is a workaround for a bug in TTdriver which may inadvertently
       reset the terminal width */
    if (colls > 80) printf("\x1b[?3h");
    else printf("\x1b[?3l");
    if (smg$enable)
    {
        SMG$RESTORE_PHYSICAL_SCREEN(&paste_id, &save_id);
        SMG$SET_BROADCAST_TRAPPING(&paste_id,brdcst_ast,0);
    }
    if ((status & 1) !=1) singlemsg(0,status);
#endif
    return (1);
}
开发者ID:rroart,项目名称:freevms,代码行数:28,代码来源:dfu.c

示例13: lke_showlock

bool	lke_showlock(
		     struct CLB		*lnk,
		     mlk_shrblk_ptr_t	tree,
		     mstr		*name,
		     bool		all,
		     bool		wait,
		     bool		interactive,
		     int4 		pid,
		     mstr		one_lock)
{
	mlk_prcblk	pblk;
	mlk_prcblk_ptr_t r;
	mlk_shrsub_ptr_t value;
	short		len1;
	int4		len2;
	bool		lock = FALSE, owned;
	int4		f[7], gtcmbufidx, item, ret;
	uint4		status;
	char		*msg, format[64], gtcmbuf[64];	/* gtcmbuf[] is to hold ": CLNTNODE = %s : CLNTPID = %s" */
	VMS_ONLY(
		char		sysinfo[NDIM];
		$DESCRIPTOR	(sysinfo_dsc, sysinfo);
	)

	/* ~~~ the following is to exclude any quotes if present ~~~~~	*/
	if ((NULL != one_lock.addr) && ('"' == *(unsigned char *)(one_lock.addr)))
开发者ID:h4ck3rm1k3,项目名称:FIS-GT.M,代码行数:26,代码来源:lke_showlock.c

示例14: trnlog

static char *
trnlog (const char *name)
{
  int stat;
  static char reslt[1024];
  $DESCRIPTOR (reslt_dsc, reslt);
  short resltlen;
  struct dsc$descriptor_s name_dsc;
  char *s;

  /*
   * the string isn't changed, but there is no string descriptor with
   * "const char *dsc$a_pointer"
   */
  INIT_DSC_CSTRING (name_dsc, (char *)name);

  stat = lib$sys_trnlog (&name_dsc, &resltlen, &reslt_dsc);

  if ((stat&1) == 0)
    {
      return "";
    }
  if (stat == SS$_NOTRAN)
    {
      return "";
    }
  reslt[resltlen] = '\0';

  s = xmalloc (resltlen+1);
  strcpy (s, reslt);
  return s;
}
开发者ID:Eliminater74,项目名称:remake,代码行数:32,代码来源:vmsify.c

示例15: er_vmsinit

int er_vmsinit(long dev)
{
    //struct _ucb * u=makeucbetc(&ddb,&ddt,&dpt,&fdt,"hda","hddriver");

    unsigned short chan0, chan1, chan2;
    $DESCRIPTOR(u0,"era0");
    mydevice="era0";
    unsigned long idb=0,orb=0;
    struct _ccb * ccb;
    struct _ucb * newucb0,*newucb1,*newucb2;
    struct _ddb * ddb;

    printk(KERN_INFO "dev here pre\n");

    ddb=er_iodb_vmsinit(dev);

    /* for the fdt init part */
    /* a lot of these? */

    er_iodbunit_vmsinit(ddb,0,&u0);

    printk(KERN_INFO "dev here\n");

    // return chan0;

}
开发者ID:rroart,项目名称:freevms,代码行数:26,代码来源:ne.c


注:本文中的DESCRIPTOR函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。