Пример #1
0
/*
**++
**  ROUTINE:	sp_once
**
**  FUNCTIONAL DESCRIPTION:
**
**
**  RETURNS:	cond_value, longword (unsigned), write only, by value
**
**  PROTOTYPE:
**
**  	sp_once(struct dsc$descriptor *cmd, struct dsc$descriptor *rcvstr,
**  	    	    	int *rcvlen)
**
**  IMPLICIT INPUTS:	None.
**
**  IMPLICIT OUTPUTS:	None.
**
**  COMPLETION CODES:
**  	    SS$_NORMAL:  normal successful completion
**  	    SS$_NONEXPR: subprocess doesn't exist any more
**
**  SIDE EFFECTS:   	None.
**
**--
*/
void sp_once (void *cmd, void (*actrtn)(void *, struct dsc$descriptor *),
	      void *param) {

    struct ONCE ctx;
    int status;
    struct dsc$descriptor eomcmd;

    static char *eom = "MMK___SP_ONCE_EOM";
    static $DESCRIPTOR(eomfao, "WRITE SYS$OUTPUT \"!AZ\"");

    memset(&ctx, 0, sizeof(struct ONCE));
    ctx.actrtn = actrtn;
    ctx.param = param;
    ctx.eom = eom;
    ctx.eom_len = sizeof(eom)-1;

    INIT_DYNDESC(eomcmd);
    lib$sys_fao(&eomfao, 0, &eomcmd, eom);

    status = sp_open(&ctx.spctx, cmd, sp_once_ast, &ctx);
    if (OK(status)) {
	status = sp_send(&ctx.spctx, &eomcmd);
	if (OK(status)) {
	    do {
		sys$hiber();
	    } while (!ctx.command_complete);
	}
	sp_close(&ctx.spctx);
    }
    str$free1_dx(&eomcmd);
} /* sp_once */
Пример #2
0
/*
**++
**  ROUTINE:	netlib_version
**
**  FUNCTIONAL DESCRIPTION:
**
**  	Returns the NETLIB version string.
**
**  RETURNS:	cond_value, condition value, longword (unsigned), write only, by value
**
**  PROTOTYPE:
**
**  	NETLIB_VERSION  ver [,retlen]
**
**  ver:    	char_string, character string, write only, by descriptor
**  retlen: 	word_unsigned, word (unsigned), write only, by reference
**
**  IMPLICIT INPUTS:	None.
**
**  IMPLICIT OUTPUTS:	None.
**
**  COMPLETION CODES:	None.
**
**  SIDE EFFECTS:   	None.
**
**--
*/
unsigned int netlib_version (struct dsc$descriptor *ver, unsigned short *retlen) {

    int argc;
    unsigned int status;
    static char version_string[] = NETLIB_T_VERSION;
    static $DESCRIPTOR(faodsc, "!AD");

    SETARGCOUNT(argc);
    if (argc < 1) return SS$_INSFARG;
    if (ver == 0) return SS$_BADPARAM;

    return lib$sys_fao(&faodsc, (argc > 1 ? retlen : 0), ver,
    	    	    	sizeof(version_string)-1, version_string);

} /* netlib_version */
Пример #3
0
static void xsyslog(BIO *bp, int priority, const char *string)
{
	struct dsc$descriptor_s opc_dsc;
	struct opcdef *opcdef_p;
	char buf[10240];
	unsigned int len;
        struct dsc$descriptor_s buf_dsc;
	$DESCRIPTOR(fao_cmd, "!AZ: !AZ");
	char *priority_tag;

	switch (priority)
	  {
	  case LOG_EMERG: priority_tag = "Emergency"; break;
	  case LOG_ALERT: priority_tag = "Alert"; break;
	  case LOG_CRIT: priority_tag = "Critical"; break;
	  case LOG_ERR: priority_tag = "Error"; break;
	  case LOG_WARNING: priority_tag = "Warning"; break;
	  case LOG_NOTICE: priority_tag = "Notice"; break;
	  case LOG_INFO: priority_tag = "Info"; break;
	  case LOG_DEBUG: priority_tag = "DEBUG"; break;
	  }

	buf_dsc.dsc$b_dtype = DSC$K_DTYPE_T;
	buf_dsc.dsc$b_class = DSC$K_CLASS_S;
	buf_dsc.dsc$a_pointer = buf;
	buf_dsc.dsc$w_length = sizeof(buf) - 1;

	lib$sys_fao(&fao_cmd, &len, &buf_dsc, priority_tag, string);

	/* we know there's an 8 byte header.  That's documented */
	opcdef_p = (struct opcdef *) OPENSSL_malloc(8 + len);
	opcdef_p->opc$b_ms_type = OPC$_RQ_RQST;
	memcpy(opcdef_p->opc$z_ms_target_classes, &VMS_OPC_target, 3);
	opcdef_p->opc$l_ms_rqstid = 0;
	memcpy(&opcdef_p->opc$l_ms_text, buf, len);

	opc_dsc.dsc$b_dtype = DSC$K_DTYPE_T;
	opc_dsc.dsc$b_class = DSC$K_CLASS_S;
	opc_dsc.dsc$a_pointer = (char *)opcdef_p;
	opc_dsc.dsc$w_length = len + 8;

	sys$sndopr(opc_dsc, 0);

	OPENSSL_free(opcdef_p);
}
Пример #4
0
static void xsyslog(BIO *bp, int priority, const char *string)
{
    struct dsc$descriptor_s opc_dsc;

/* Arrange 32-bit pointer to opcdef buffer and malloc(), if needed. */
#  if __INITIAL_POINTER_SIZE == 64
#   pragma pointer_size save
#   pragma pointer_size 32
#   define OPCDEF_TYPE __char_ptr32
#   define OPCDEF_MALLOC _malloc32
#  else                         /* __INITIAL_POINTER_SIZE == 64 */
#   define OPCDEF_TYPE char *
#   define OPCDEF_MALLOC OPENSSL_malloc
#  endif                        /* __INITIAL_POINTER_SIZE == 64 [else] */

    struct opcdef *opcdef_p;

#  if __INITIAL_POINTER_SIZE == 64
#   pragma pointer_size restore
#  endif                        /* __INITIAL_POINTER_SIZE == 64 */

    char buf[10240];
    unsigned int len;
    struct dsc$descriptor_s buf_dsc;
    $DESCRIPTOR(fao_cmd, "!AZ: !AZ");
    char *priority_tag;

    switch (priority) {
    case LOG_EMERG:
        priority_tag = "Emergency";
        break;
    case LOG_ALERT:
        priority_tag = "Alert";
        break;
    case LOG_CRIT:
        priority_tag = "Critical";
        break;
    case LOG_ERR:
        priority_tag = "Error";
        break;
    case LOG_WARNING:
        priority_tag = "Warning";
        break;
    case LOG_NOTICE:
        priority_tag = "Notice";
        break;
    case LOG_INFO:
        priority_tag = "Info";
        break;
    case LOG_DEBUG:
        priority_tag = "DEBUG";
        break;
    }

    buf_dsc.dsc$b_dtype = DSC$K_DTYPE_T;
    buf_dsc.dsc$b_class = DSC$K_CLASS_S;
    buf_dsc.dsc$a_pointer = buf;
    buf_dsc.dsc$w_length = sizeof(buf) - 1;

    lib$sys_fao(&fao_cmd, &len, &buf_dsc, priority_tag, string);

    /* We know there's an 8-byte header.  That's documented. */
    opcdef_p = OPCDEF_MALLOC(8 + len);
    opcdef_p->opc$b_ms_type = OPC$_RQ_RQST;
    memcpy(opcdef_p->opc$z_ms_target_classes, &VMS_OPC_target, 3);
    opcdef_p->opc$l_ms_rqstid = 0;
    memcpy(&opcdef_p->opc$l_ms_text, buf, len);

    opc_dsc.dsc$b_dtype = DSC$K_DTYPE_T;
    opc_dsc.dsc$b_class = DSC$K_CLASS_S;
    opc_dsc.dsc$a_pointer = (OPCDEF_TYPE) opcdef_p;
    opc_dsc.dsc$w_length = len + 8;

    sys$sndopr(opc_dsc, 0);

    OPENSSL_free(opcdef_p);
}