calling non-unix systems AND dial(3) problems....

Intergalactic Psychic Police Of Uranus jmg at dolphy.UUCP
Wed Oct 2 10:27:09 AEST 1985


*** help ***

In my struggle to put out an esoteric art magazine called, "The Act",
which is about 'performance art', I have found a typesetter who will
allow files to be downloaded straight to his typesetter. (The files
must be loaded with macros very similar to troff...)  My problem
is to figure out how to send files to him.

As far as I understand things, cu, ct and uucp won't work because the
typesetter isn't running UNIX, but a proprietary system put out
by Compugraphic.  My first question is, am I correct in thinking cu,
ct & uucp are of no use to me?

My second question, presumes that they are of no value to me:
I have written a utility that dials a number, fiddles with the parity
and character size so the typesetter is happy, prompts the user about
which files to send, and sends em.  The code uses dial(3)
which is supplied with system 5...unfortunately, I can't get it to work...
that is, dial(3) has an option to look in the L-devices file and
select whatever device it can (the 'line' pointer in the CALL structure
is set to NULL).  Invariably, dial(3) fails and returns an error that
indicates "requested device not known", that is dial(3) returns -9.
Now, I never requested anything other than for dial(3) to find a device
for itself, so it's generating its own error?...  What is wrong?
There are devices in the 'L-devices' file...  though on our 3b2/300 Sys5.2
there originally was no 'L-devices', but a 'Devices' file for uucp, instead.
I merely copied Devices to L-devices which I believe is sufficient.
(Also, I've been doing this work as root, so no permission problems...)

Code fragment (one sbrtn) follows...

Thank you,
jeffrey greenberg


/* dial a computer given the telephone number and the line attributes
 */
#include <dial.h>

dialit( telno, t)
char *telno;
struct termio *t;
{
	CALL call;

	/* Put in the passed arguments
	 */
	call.attr = t;		/* line attributes for new dialed line */
	call.telno = telno;	/* telephone number to dial */

	/* Put in what we want
	 */
	call.baud = 0;		/* dependent on the line found */
	call.speed = 1200;	/* desire 1200 baud (high speed modem)... */
	call.line = 0;		/* let dial(3) select what it can */
	call.modem = 0;		/* depends on 'line' above */
	
	printf("Dialing %s...\n",telno);
	out_fd = dial( &call );

	/* See if call succeeded
	 */
	if( out_fd >= 0 ) {
		printf("Connected!\n");
		return;
	}

	/* Something's wrong.  Cleanup, print error and exit.
	 */
	undial( out_fd );
	switch( out_fd ) {
	case INTRPT:
		pexit("Interrupt Occurred");
		break;
	case D_HUNG:
		pexit("Dialer hung (no return from write)");
		break;
	case NO_ANS:
		pexit("Wouldn't answer within 10 seconds");
		break;
	case ILL_BD:
		pexit("Illegal baud-rate");
		break;
	case A_PROB:
		pexit("ACU problem (open() failure)");
		break;
	case L_PROB:
		pexit("Line problem (open() failure)");
		break;
	case NO_Ldv:
		pexit("Can't open LDEVS file");
		break;
	case DV_NT_A:
		pexit("Requested device not available");
		break;
	case DV_NT_K:
		pexit("Requested device not known");
		break;
	case NO_BD_A:
		pexit("No device available at requested baud");
		break;
	case NO_BD_K:
		pexit("No device known at requested baud");
		break;
	default:
		printf("Got unknown error %d when dialing\n",out_fd);
		pexit("UNKNOWN ERROR WHEN DIALING????");
		break;
	}
}

Thank you,

jeffrey greenberg
212-966-1334
allegra!phri!dolphy!jmg



More information about the Comp.unix mailing list