NetSurf
Macros | Functions
libs.c File Reference
#include "amiga/os3support.h"
#include "amiga/libs.h"
#include "amiga/misc.h"
#include "utils/utils.h"
#include "utils/log.h"
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/utility.h>
#include <graphics/gfxbase.h>
#include <proto/arexx.h>
#include <proto/bevel.h>
#include <proto/bitmap.h>
#include <proto/button.h>
#include <proto/chooser.h>
#include <proto/checkbox.h>
#include <proto/clicktab.h>
#include <proto/fuelgauge.h>
#include <proto/getfile.h>
#include <proto/getfont.h>
#include <proto/getscreenmode.h>
#include <proto/integer.h>
#include <proto/label.h>
#include <proto/layout.h>
#include <proto/listbrowser.h>
#include <proto/radiobutton.h>
#include <proto/scroller.h>
#include <proto/space.h>
#include <proto/speedbar.h>
#include <proto/string.h>
#include <proto/window.h>
Include dependency graph for libs.c:

Go to the source code of this file.

Macros

#define AMINS_LIB_OPEN(LIB, LIBVER, PREFIX, INTERFACE, INTVER, FAIL)
 
#define AMINS_LIB_CLOSE(PREFIX)
 
#define AMINS_LIB_STRUCT(PREFIX)    struct PREFIX##Base *PREFIX##Base = NULL;
 
#define AMINS_CLASS_OPEN(CLASS, CLASSVER, PREFIX, CLASSGET, NEEDINTERFACE)
 
#define AMINS_CLASS_CLOSE(PREFIX)
 
#define AMINS_CLASS_STRUCT(PREFIX)
 
#define GraphicsBase   GfxBase /* graphics.library is a bit weird */
 

Functions

 AMINS_LIB_STRUCT (Asl)
 
 AMINS_LIB_STRUCT (DataTypes)
 
 AMINS_LIB_STRUCT (Diskfont)
 
 AMINS_LIB_STRUCT (Graphics)
 
 AMINS_LIB_STRUCT (GadTools)
 
 AMINS_LIB_STRUCT (Icon)
 
 AMINS_LIB_STRUCT (IFFParse)
 
 AMINS_LIB_STRUCT (Intuition)
 
 AMINS_LIB_STRUCT (Keymap)
 
 AMINS_LIB_STRUCT (Layers)
 
 AMINS_LIB_STRUCT (Locale)
 
 AMINS_LIB_STRUCT (P96)
 
 AMINS_LIB_STRUCT (Workbench)
 
 AMINS_LIB_STRUCT (Codesets)
 
 AMINS_LIB_STRUCT (GuiGFX)
 
 AMINS_CLASS_STRUCT (ARexx)
 
 AMINS_CLASS_STRUCT (Bevel)
 
 AMINS_CLASS_STRUCT (BitMap)
 
 AMINS_CLASS_STRUCT (Button)
 
 AMINS_CLASS_STRUCT (Chooser)
 
 AMINS_CLASS_STRUCT (CheckBox)
 
 AMINS_CLASS_STRUCT (ClickTab)
 
 AMINS_CLASS_STRUCT (FuelGauge)
 
 AMINS_CLASS_STRUCT (GetFile)
 
 AMINS_CLASS_STRUCT (GetFont)
 
 AMINS_CLASS_STRUCT (GetScreenMode)
 
 AMINS_CLASS_STRUCT (Integer)
 
 AMINS_CLASS_STRUCT (Label)
 
 AMINS_CLASS_STRUCT (Layout)
 
 AMINS_CLASS_STRUCT (ListBrowser)
 
 AMINS_CLASS_STRUCT (RadioButton)
 
 AMINS_CLASS_STRUCT (Page)
 
 AMINS_CLASS_STRUCT (Scroller)
 
 AMINS_CLASS_STRUCT (Space)
 
 AMINS_CLASS_STRUCT (SpeedBar)
 
 AMINS_CLASS_STRUCT (String)
 
 AMINS_CLASS_STRUCT (Window)
 
bool ami_libs_open (void)
 
void ami_libs_close (void)
 

Macro Definition Documentation

◆ AMINS_CLASS_CLOSE

#define AMINS_CLASS_CLOSE (   PREFIX)
Value:
if(PREFIX##Base) CloseLibrary(PREFIX##Base); \
PREFIX##Base = NULL;

Definition at line 161 of file libs.c.

◆ AMINS_CLASS_OPEN

#define AMINS_CLASS_OPEN (   CLASS,
  CLASSVER,
  PREFIX,
  CLASSGET,
  NEEDINTERFACE 
)
Value:
NSLOG(netsurf, INFO, "Opening %s v%d", CLASS, CLASSVER); \
if((PREFIX##Base = OpenLibrary(CLASS, CLASSVER))) { \
NSLOG(netsurf, INFO, " -> opened v%d.%d", ((struct Library *)PREFIX##Base)->lib_Version, ((struct Library *)PREFIX##Base)->lib_Revision); \
PREFIX##Class = CLASSGET##_GetClass(); \
} \
if(PREFIX##Class == NULL) { \
NSLOG(netsurf, INFO, "Failed to open %s v%d", CLASS, CLASSVER); \
STRPTR error = ASPrintf("Unable to open %s v%d (fatal error)", CLASS, CLASSVER); \
ami_misc_fatal_error(error); \
FreeVec(error); \
return false; \
}
#define NSLOG(catname, level, logmsg, args...)
Definition: log.h:116
char * ASPrintf(const char *fmt,...)
Definition: os3support.c:139

Definition at line 147 of file libs.c.

◆ AMINS_CLASS_STRUCT

#define AMINS_CLASS_STRUCT (   PREFIX)
Value:
struct Library *PREFIX##Base = NULL; \
Class *PREFIX##Class = NULL;

Definition at line 165 of file libs.c.

◆ AMINS_LIB_CLOSE

#define AMINS_LIB_CLOSE (   PREFIX)
Value:
if(PREFIX##Base) CloseLibrary((struct Library *)PREFIX##Base); \
PREFIX##Base = NULL;

Definition at line 140 of file libs.c.

◆ AMINS_LIB_OPEN

#define AMINS_LIB_OPEN (   LIB,
  LIBVER,
  PREFIX,
  INTERFACE,
  INTVER,
  FAIL 
)
Value:
NSLOG(netsurf, INFO, "Opening %s v%d", LIB, LIBVER); \
if((PREFIX##Base = (struct PREFIX##Base *)OpenLibrary(LIB, LIBVER))) { \
NSLOG(netsurf, INFO, " -> opened v%d.%d", ((struct Library *)PREFIX##Base)->lib_Version, ((struct Library *)PREFIX##Base)->lib_Revision); \
} else { \
NSLOG(netsurf, INFO, "Failed to open %s v%d", LIB, LIBVER); \
if(FAIL == true) { \
STRPTR error = ASPrintf("Unable to open %s v%d (fatal error)", LIB, LIBVER); \
ami_misc_fatal_error(error); \
FreeVec(error); \
return false; \
} \
}

Definition at line 126 of file libs.c.

◆ AMINS_LIB_STRUCT

#define AMINS_LIB_STRUCT (   PREFIX)     struct PREFIX##Base *PREFIX##Base = NULL;

Definition at line 144 of file libs.c.

◆ GraphicsBase

#define GraphicsBase   GfxBase /* graphics.library is a bit weird */

Definition at line 171 of file libs.c.

Function Documentation

◆ ami_libs_close()

void ami_libs_close ( void  )

Definition at line 301 of file libs.c.

References AMINS_CLASS_CLOSE, and AMINS_LIB_CLOSE.

Referenced by main().

Here is the caller graph for this function:

◆ ami_libs_open()

bool ami_libs_open ( void  )

Definition at line 221 of file libs.c.

References AMINS_CLASS_OPEN, AMINS_LIB_OPEN, and PageClass.

Referenced by main().

Here is the caller graph for this function:

◆ AMINS_CLASS_STRUCT() [1/22]

AMINS_CLASS_STRUCT ( ARexx  )

◆ AMINS_CLASS_STRUCT() [2/22]

AMINS_CLASS_STRUCT ( Bevel  )

◆ AMINS_CLASS_STRUCT() [3/22]

AMINS_CLASS_STRUCT ( BitMap  )

◆ AMINS_CLASS_STRUCT() [4/22]

AMINS_CLASS_STRUCT ( Button  )

◆ AMINS_CLASS_STRUCT() [5/22]

AMINS_CLASS_STRUCT ( CheckBox  )

◆ AMINS_CLASS_STRUCT() [6/22]

AMINS_CLASS_STRUCT ( Chooser  )

◆ AMINS_CLASS_STRUCT() [7/22]

AMINS_CLASS_STRUCT ( ClickTab  )

◆ AMINS_CLASS_STRUCT() [8/22]

AMINS_CLASS_STRUCT ( FuelGauge  )

◆ AMINS_CLASS_STRUCT() [9/22]

AMINS_CLASS_STRUCT ( GetFile  )

◆ AMINS_CLASS_STRUCT() [10/22]

AMINS_CLASS_STRUCT ( GetFont  )

◆ AMINS_CLASS_STRUCT() [11/22]

AMINS_CLASS_STRUCT ( GetScreenMode  )

◆ AMINS_CLASS_STRUCT() [12/22]

AMINS_CLASS_STRUCT ( Integer  )

◆ AMINS_CLASS_STRUCT() [13/22]

AMINS_CLASS_STRUCT ( Label  )

◆ AMINS_CLASS_STRUCT() [14/22]

AMINS_CLASS_STRUCT ( Layout  )

◆ AMINS_CLASS_STRUCT() [15/22]

AMINS_CLASS_STRUCT ( ListBrowser  )

◆ AMINS_CLASS_STRUCT() [16/22]

AMINS_CLASS_STRUCT ( Page  )

◆ AMINS_CLASS_STRUCT() [17/22]

AMINS_CLASS_STRUCT ( RadioButton  )

◆ AMINS_CLASS_STRUCT() [18/22]

AMINS_CLASS_STRUCT ( Scroller  )

◆ AMINS_CLASS_STRUCT() [19/22]

AMINS_CLASS_STRUCT ( Space  )

◆ AMINS_CLASS_STRUCT() [20/22]

AMINS_CLASS_STRUCT ( SpeedBar  )

◆ AMINS_CLASS_STRUCT() [21/22]

AMINS_CLASS_STRUCT ( String  )

◆ AMINS_CLASS_STRUCT() [22/22]

AMINS_CLASS_STRUCT ( Window  )

◆ AMINS_LIB_STRUCT() [1/15]

AMINS_LIB_STRUCT ( Asl  )

◆ AMINS_LIB_STRUCT() [2/15]

AMINS_LIB_STRUCT ( Codesets  )

◆ AMINS_LIB_STRUCT() [3/15]

AMINS_LIB_STRUCT ( DataTypes  )

◆ AMINS_LIB_STRUCT() [4/15]

AMINS_LIB_STRUCT ( Diskfont  )

◆ AMINS_LIB_STRUCT() [5/15]

AMINS_LIB_STRUCT ( GadTools  )

◆ AMINS_LIB_STRUCT() [6/15]

AMINS_LIB_STRUCT ( Graphics  )

◆ AMINS_LIB_STRUCT() [7/15]

AMINS_LIB_STRUCT ( GuiGFX  )

◆ AMINS_LIB_STRUCT() [8/15]

AMINS_LIB_STRUCT ( Icon  )

◆ AMINS_LIB_STRUCT() [9/15]

AMINS_LIB_STRUCT ( IFFParse  )

◆ AMINS_LIB_STRUCT() [10/15]

AMINS_LIB_STRUCT ( Intuition  )

◆ AMINS_LIB_STRUCT() [11/15]

AMINS_LIB_STRUCT ( Keymap  )

◆ AMINS_LIB_STRUCT() [12/15]

AMINS_LIB_STRUCT ( Layers  )

◆ AMINS_LIB_STRUCT() [13/15]

AMINS_LIB_STRUCT ( Locale  )

◆ AMINS_LIB_STRUCT() [14/15]

AMINS_LIB_STRUCT ( P96  )

◆ AMINS_LIB_STRUCT() [15/15]

AMINS_LIB_STRUCT ( Workbench  )