|
Lines 141-168
Link Here
|
| 141 |
|
141 |
|
| 142 |
/* |
142 |
/* |
| 143 |
* Scan through the database of printers using cgetfirst/cgetnext. |
143 |
* Scan through the database of printers using cgetfirst/cgetnext. |
| 144 |
* Return false of error or end-of-database; else true. |
144 |
* Return false if error or end-of-database; else true. |
| 145 |
*/ |
145 |
*/ |
| 146 |
int |
146 |
int |
| 147 |
firstprinter(struct printer *pp, int *error) |
147 |
firstprinter(struct printer *pp, int *error) |
| 148 |
{ |
148 |
{ |
| 149 |
int status; |
|
|
| 150 |
char *bp; |
| 151 |
|
| 152 |
init_printer(pp); |
149 |
init_printer(pp); |
| 153 |
status = cgetfirst(&bp, printcapdb); |
150 |
return ( nextprinter(pp, error) ); |
| 154 |
if (firstnextmap(&status) == 0) { |
|
|
| 155 |
if (error) |
| 156 |
*error = status; |
| 157 |
return 0; |
| 158 |
} |
| 159 |
if (error) |
| 160 |
*error = status; |
| 161 |
status = getprintcap_int(bp, pp); |
| 162 |
free(bp); |
| 163 |
if (error && status) |
| 164 |
*error = status; |
| 165 |
return 1; |
| 166 |
} |
151 |
} |
| 167 |
|
152 |
|
| 168 |
int |
153 |
int |