home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 6
/
Sonderheft_6-96.iso
/
pd
/
libraries
/
patchlibv4
/
patchlist
/
patchlist.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-11-03
|
2KB
|
72 lines
#include <stdio.h>
#include <exec/types.h>
#include <exec/libraries.h>
#include "ASMSources:PatchLibrary/PatchInclude/patch_protos.h"
#include "ASMSources:PatchLibrary/PatchInclude/patch.h"
#include "ASMSources:PatchLibrary/PatchInclude/patchtags.h"
char *ver="$VER: PatchList 1.52 (27.12.94) by Stefan Fuchs";
struct PatchBase *patchBase;
void Open_All();
void Close_All();
void main()
{
struct MasterPatch *MPatchPointer;
struct Patch *PatchPointer;
printf("PatchList V1.52 © 1993/94 by Stefan Fuchs\n");
printf("LIBRARY: LVO: PRI: TYPE: NAME:\n");
Open_All();
for (MPatchPointer = (struct MasterPatch *)patchBase->PB_MasterPatchHeader.lh_Head;
MPatchPointer->MPS_Node.ln_Succ;
MPatchPointer = (struct MasterPatch *)MPatchPointer->MPS_Node.ln_Succ)
{
if (MPatchPointer->MPS_Node.ln_Type == PS_TYPE_MASTER)
{
for (PatchPointer = (struct Patch *)MPatchPointer->MPS_PatchHeader.mlh_Head;
PatchPointer->PS_Node.ln_Succ;
PatchPointer = (struct Patch *)PatchPointer->PS_Node.ln_Succ)
{
if ((PatchPointer->PS_Node.ln_Type == PS_TYPE_USER) || (PatchPointer->PS_Node.ln_Type == PS_TYPE_SYSTEM))
{
printf("%-25s",MPatchPointer->MPS_Node.ln_Name);
printf(" $%4X %4d ",MPatchPointer->MPS_PatchedLVO,PatchPointer->PS_Node.ln_Pri);
if (PatchPointer->PS_Node.ln_Type == PS_TYPE_USER) printf("USER ");
else printf("SYSTEM ");
if (PatchPointer->PS_Node.ln_Name)
printf("%s\n",PatchPointer->PS_Node.ln_Name);
else
printf("<unnamed>\n");
}
}
}
}
Close_All("");
}
void Open_All()
{
if((patchBase = (struct PatchBase *) OpenLibrary(PatchName, 2)) == NULL)
Close_All("Can't open V2+ patch.library !\n");
ObtainSemaphore(&patchBase->PB_Semaphore);
}
void Close_All(s)
char *s;
{
printf("%s",s);
if(patchBase)
{
ReleaseSemaphore(&patchBase->PB_Semaphore);
CloseLibrary(patchBase);
}
exit(TRUE);
}