/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 1997 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
#include "uucp.h"
static struct {
int job;
int subjob;
static int nsys = 0;
static int sysseq();
/* generate file name
* pre -> file prefix
* sys -> system name
* grade -> service grade
* file -> buffer to return filename must be of size MAXBASENAME+1
* return:
* none
*/
void
{
int n;
if (*sys == '\0') {
}
} else
return;
}
/*
* get next sequence number
* returns:
* number between 1 and 0xffff
*
* sequence number 0 is reserved for polling
*/
static int
char *sys;
{
register int i;
unsigned int n;
for (i = 1; i < SLOCKTRIES; i++) {
break;
sleep(5);
}
/* read sequence number file */
n = rand();
}
} else {
/* can not read file - create a new one */
n = rand();
}
n++;
n &= 0xffff; /* 4 byte sequence numbers */
return(nsys++);
}
/*
* initSeq() exists because it is sometimes important to forget any
* cached work files. for example, when processing a bunch of spooled X.
* files, we must not re-use any C. files used to send back output.
*/
void
initSeq()
{
nsys = 0;
return;
}
/*
* retseq() is used to get the sequence number of a job
* for functions outside of this file.
*
* returns
*
* the sequence number of the job for the system.
*/
int
char *sys;
{
int i;
for (i = 0; i < nsys; i++)
break;
}
static int
char *sys;
{
int i;
for (i = 0; i < nsys; i++)
return(i);
}