add_mounted.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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 1993 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" /* SVr4.0 1.8 */
#include "string.h"
#include "errno.h"
#include "stdlib.h"
#include "lp.h"
#include "printers.h"
#define WHO_AM_I I_AM_LPSTAT
#include "oam.h"
#include "lpstat.h"
static MOUNTED mounted_forms_head = { 0, 0, 0 },
mounted_pwheels_head = { 0, 0, 0 };
static void insert_mounted ( MOUNTED * , char * , char * , char * );
static int cs_addlist ( char *** , char * );
/**
** add_mounted() - ADD A FORM, PRINTWHEEL TO LIST
**/
void
{
register char **pcs;
char *ptrForm,*ptrEndForm;
/*
* Add this form to the list of mounted forms.
*/
while (ptrEndForm) {
*ptrEndForm = 0;
(char *)0);
}
} else
/*
* Add this print wheel to the list of mounted print
* wheels.
*/
"!"
);
done(1);
}
/*
* Add the list of administrator supplied character-set
* or print wheel aliases to the list.
*/
*pcs,
(char *)0
);
else {
register char *terminfo_name,
*alias;
if (
)
);
}
/*
* Do the aliases built into the Terminfo database for
* this printer's type. This applies only to printers
* that have defined character sets.
*/
register char *terminfo_name,
*alias;
if (
)
);
}
return;
}
/**
** insert_mounted()
**/
static void
{
register char *nm,
*pnm;
/*
* For forms: Each printer that has the form mounted is
* marked with a leading '!'.
* For print wheels and character sets: Each character
* set name is marked with a leading '!'; each printer
* that has a print wheel mounted is marked with a leading '!'.
*/
nm[0] = '!';
} else
for (
)
;
pnm[0] = '!';
} else if (tag) {
} else
done (1);
}
}
return;
}
/**
** cs_addlist()
**/
static int
{
register char **pl;
register int n;
if (*plist) {
if (
)
break;
if (!*pl) {
n++;
(char *)*plist,
(n + 1) * sizeof(char *)
);
(*plist)[n] = 0;
}
} else {
(*plist)[1] = 0;
}
return (0);
}