tools/adflib: build only host variant which is used by Sam440 target
[AROS.git] / test / printer / printerinfo.c
blob2ee10de055c6a478a70a36594819fff722bb03e5
1 /*
2 * Copyright (C) 2012, The AROS Development Team. All rights reserved.
3 * Author: Jason S. McMullan <jason.mcmullan@gmail.com>
5 * Licensed under the AROS PUBLIC LICENSE (APL) Version 1.1
6 */
8 #include <proto/dos.h>
9 #include <proto/exec.h>
10 #include <devices/prtbase.h>
12 #include <aros/shcommands.h>
14 AROS_SH0(printerinfo, 1.0)
16 AROS_SHCOMMAND_INIT
18 struct {
19 CONST_STRPTR file;
20 } Args = { };
21 struct RDArgs *ra;
22 struct Library *DOSBase;
24 if (!(DOSBase = OpenLibrary("dos.library", 0)))
25 return RETURN_FAIL;
27 if (!(ra = ReadArgs("FILE", (IPTR *)&Args, NULL)))
28 return RETURN_FAIL;
30 if (Args.file) {
31 BPTR seg = LoadSeg(Args.file);
32 if (seg) {
33 struct PrinterSegment *pseg = BADDR(seg);
34 struct PrinterExtendedData *ped = &pseg->ps_PED;
35 int i;
37 Printf("%s:\n");
38 Printf(" ps_runAlert = 0x%08lx\n", pseg->ps_runAlert);
39 Printf(" ps_Version = %ld\n", pseg->ps_Version );
40 Printf(" ps_Revision = %ld\n", pseg->ps_Revision);
41 Printf(" ped_PrinterName = \"%s\"\n", ped->ped_PrinterName);
43 Printf(" ped_DoSpecial= 0x%08lx\n", ped->ped_DoSpecial);
44 Printf(" ped_ConvFunc = 0x%08lx\n", ped->ped_ConvFunc);
45 Printf(" ped_Commands = 0x%08lx\n", ped->ped_Commands);
46 for (i = 0; i < 76; i++) {
47 if (ped->ped_Commands[i][0] == 255)
48 continue;
49 Printf(" ped_Commands[%ld] = \"%s\"\n", i, ped->ped_Commands[i]);
52 UnLoadSeg(seg);
56 FreeArgs(ra);
57 CloseLibrary(DOSBase);
59 return RETURN_OK;
61 AROS_SHCOMMAND_EXIT