🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: mod.computers.vax
1 messages
1 total messages Started by m1b Thu, 09 Apr 1987 16:34
Creating Logical Names from VAX C
#4154
Author: m1b
Date: Thu, 09 Apr 1987 16:34
52 lines
2094 bytes

I am trying to create a logical name in my process table from within
a C program.  I am using SYS$CRELNM.  SYS$CRELOG is obsolete so I don't
want to use that.  LIB$SET_LOGICAL works fine but I want to know what I
am doing wrong.  I am running VMS V4.4 using C V2.2.  Here is a sample
program that does not produce the logical name NEWNAME.  Strangely
enough, it exits with SS$_NORMAL.  Can someone who has successfully
used this system service help me out?  Thanks.

---- Snip here ----
#include	descrip
#include	lnmdef
#include	psldef
#define	MAXLEN	100

main()
{
	extern	unsigned long	sys$crelnm();

	unsigned char	acmode = PSL$C_USER;
	unsigned long	attr = 0;
	long	status;
	char	defname[MAXLEN];
	char	logname[MAXLEN];

	struct	{
		struct
		{
			short	len;
			short	code;
			long	*baddr;
			long	*rladdr;
		} log;
		long	eos;
	} loglst = {
		{ MAXLEN, LNM$_STRING, defname, 0}, 0 };

	$DESCRIPTOR(LOGNAME,logname);
	$DESCRIPTOR(TABLE_NAME, "LNM$PROCESS_TABLE");

	strcpy(defname, "abc.xyz");
	strcpy(logname, "NEWNAME");
	TABLE_NAME.dsc$w_length = strlen("LNM$PROCESS_TABLE");
	loglst.log.len = strlen(defname);
	LOGNAME.dsc$w_length = strlen(logname);
	status = sys$crelnm(&attr, &TABLE_NAME, &LOGNAME, &acmode, &loglst);
	exit(status);
}

Joe Barone ---------------------------> m1b@rayssd.RAY.COM
{cbosgd, gatech, ihnp4, linus, mirror, uiucdcs}!rayssd!m1b
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads