NetSurf
Data Structures | Macros | Functions
os3support.c File Reference

Compatibility functions for AmigaOS 3. More...

#include "os3support.h"
#include <inttypes.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <proto/bullet.h>
#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/dos.h>
#include <proto/utility.h>
#include <diskfont/diskfont.h>
#include <diskfont/diskfonttag.h>
#include <intuition/gadgetclass.h>
#include "utils/log.h"
Include dependency graph for os3support.c:

Go to the source code of this file.

Data Structures

struct  FormatContext
 

Macros

#define SUCCESS   (TRUE)
 
#define FAILURE   (FALSE)
 
#define NO   !
 

Functions

STATIC VOID ASM StuffChar (REG(a3, struct FormatContext *Context), REG(d0, UBYTE Char))
 
BOOL VSPrintfN (LONG MaxLen, STRPTR Buffer, const STRPTR FormatString, const va_list VarArgs)
 
BOOL SPrintfN (LONG MaxLen, STRPTR Buffer, const STRPTR FormatString,...)
 
char * ASPrintf (const char *fmt,...)
 
char * strlwr (char *str)
 
char * strsep (char **s1, const char *s2)
 
int alphasort (const struct dirent **d1, const struct dirent **d2)
 
int scandir (const char *dir, struct dirent ***namelist, int(*filter)(const struct dirent *), int(*compar)(const struct dirent **, const struct dirent **))
 
long long int strtoll (const char *nptr, char **endptr, int base)
 
struct OutlineFontOpenOutlineFont (STRPTR fileName, struct List *list, ULONG flags)
 
void CloseOutlineFont (struct OutlineFont *of, struct List *list)
 
int64 GetFileSize (BPTR fh)
 
void FreeSysObject (ULONG type, APTR obj)
 
struct Node * GetHead (struct List *list)
 
struct Node * GetPred (struct Node *node)
 
struct Node * GetSucc (struct Node *node)
 
uint32 GetAttrs (Object *obj, Tag tag1,...)
 
ULONG RefreshSetGadgetAttrsA (struct Gadget *g, struct Window *w, struct Requester *r, struct TagItem *tags)
 
ULONG RefreshSetGadgetAttrs (struct Gadget *g, struct Window *w, struct Requester *r, Tag tag1,...)
 
APTR NewObject (struct IClass *classPtr, CONST_STRPTR classID, ULONG tagList,...)
 

Detailed Description

Compatibility functions for AmigaOS 3.

Definition in file os3support.c.

Macro Definition Documentation

◆ FAILURE

#define FAILURE   (FALSE)

Definition at line 45 of file os3support.c.

◆ NO

#define NO   !

Definition at line 46 of file os3support.c.

◆ SUCCESS

#define SUCCESS   (TRUE)

Definition at line 44 of file os3support.c.

Function Documentation

◆ alphasort()

int alphasort ( const struct dirent **  d1,
const struct dirent **  d2 
)

Definition at line 184 of file os3support.c.

◆ ASPrintf()

char * ASPrintf ( const char *  fmt,
  ... 
)

Definition at line 139 of file os3support.c.

References buffer, and VSPrintfN().

Referenced by ami_download_check_overwrite(), ami_gui_commandline(), ami_gui_get_cache_favicon_name(), ami_gui_get_screen_title(), ami_gui_get_user_dir(), ami_gui_hotlist_add(), ami_gui_opts_open(), ami_gui_read_tooltypes(), ami_locale_langs(), ami_menu_hotlist_add(), ami_nsoption_set_location(), amiga_plugin_hack_execute(), amiga_warn_user(), amiga_warn_user_multi(), gui_init2(), gui_launch_url(), gui_window_save_link(), HOOKF(), main(), OpenOutlineFont(), and utf8_to_local_encoding().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CloseOutlineFont()

void CloseOutlineFont ( struct OutlineFont of,
struct List *  list 
)

Definition at line 323 of file os3support.c.

References OutlineFont::BulletBase, OutlineFont::GEngine, OutlineFont::olf_OTagList, and OutlineFont::OTagPath.

Referenced by ami_font_bullet_close(), and ami_font_scan_font().

Here is the caller graph for this function:

◆ FreeSysObject()

void FreeSysObject ( ULONG  type,
APTR  obj 
)

Definition at line 350 of file os3support.c.

References ASOT_IOREQUEST, ASOT_PORT, and type.

Referenced by ami_gui_resources_free(), ami_print_close_device(), ami_print_free(), ami_schedule_close_timer(), amiga_bitmap_destroy(), schedule_remove(), and schedule_remove_all().

Here is the caller graph for this function:

◆ GetAttrs()

uint32 GetAttrs ( Object *  obj,
Tag  tag1,
  ... 
)

Definition at line 389 of file os3support.c.

Referenced by ami_gadget_hit(), ami_gui_event(), and ami_gui_splash_open().

Here is the caller graph for this function:

◆ GetFileSize()

int64 GetFileSize ( BPTR  fh)

Definition at line 337 of file os3support.c.

Referenced by ami_download_check_overwrite(), and OpenOutlineFont().

Here is the caller graph for this function:

◆ GetHead()

struct Node * GetHead ( struct List *  list)

◆ GetPred()

struct Node * GetPred ( struct Node *  node)

Definition at line 375 of file os3support.c.

Referenced by ami_change_tab(), and gui_window_destroy().

Here is the caller graph for this function:

◆ GetSucc()

struct Node * GetSucc ( struct Node *  node)

◆ NewObject()

APTR NewObject ( struct IClass *  classPtr,
CONST_STRPTR  classID,
ULONG  tagList,
  ... 
)

Definition at line 434 of file os3support.c.

Referenced by ami_help_init(), ami_init_mouse_pointers(), ami_menu_layout_gt(), ami_menu_load_glyphs(), and gui_window_create().

Here is the caller graph for this function:

◆ OpenOutlineFont()

struct OutlineFont * OpenOutlineFont ( STRPTR  fileName,
struct List *  list,
ULONG  flags 
)

Definition at line 204 of file os3support.c.

References ASPrintf(), buffer, OutlineFont::BulletBase, OutlineFont::GEngine, GetFileSize(), NSLOG, OutlineFont::olf_OTagList, and OutlineFont::OTagPath.

Referenced by ami_font_open(), and ami_font_scan_font().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RefreshSetGadgetAttrs()

ULONG RefreshSetGadgetAttrs ( struct Gadget *  g,
struct Window *  w,
struct Requester *  r,
Tag  tag1,
  ... 
)

◆ RefreshSetGadgetAttrsA()

ULONG RefreshSetGadgetAttrsA ( struct Gadget *  g,
struct Window *  w,
struct Requester *  r,
struct TagItem *  tags 
)

Definition at line 408 of file os3support.c.

Referenced by RefreshSetGadgetAttrs().

Here is the caller graph for this function:

◆ scandir()

int scandir ( const char *  dir,
struct dirent ***  namelist,
int(*)(const struct dirent *)  filter,
int(*)(const struct dirent **, const struct dirent **)  compar 
)

Definition at line 190 of file os3support.c.

Referenced by fetch_file_process_dir().

Here is the caller graph for this function:

◆ SPrintfN()

BOOL SPrintfN ( LONG  MaxLen,
STRPTR  Buffer,
const STRPTR  FormatString,
  ... 
)

Definition at line 119 of file os3support.c.

References FAILURE, result, and VSPrintfN().

Here is the call graph for this function:

◆ strlwr()

char * strlwr ( char *  str)

Definition at line 160 of file os3support.c.

Referenced by ami_mime_guess_add_datatype().

Here is the caller graph for this function:

◆ strsep()

char * strsep ( char **  s1,
const char *  s2 
)

Definition at line 171 of file os3support.c.

Referenced by ami_font_scan_init().

Here is the caller graph for this function:

◆ strtoll()

long long int strtoll ( const char *  nptr,
char **  endptr,
int  base 
)

Definition at line 198 of file os3support.c.

References base.

Referenced by ascii_string_to_int(), and nsc_snptimet().

Here is the caller graph for this function:

◆ StuffChar()

STATIC VOID ASM StuffChar ( REG(a3, struct FormatContext *Context)  ,
REG(d0, UBYTE Char)   
)

Definition at line 57 of file os3support.c.

References FormatContext::Index, FormatContext::Overflow, and FormatContext::Size.

Referenced by VSPrintfN().

Here is the caller graph for this function:

◆ VSPrintfN()

BOOL VSPrintfN ( LONG  MaxLen,
STRPTR  Buffer,
const STRPTR  FormatString,
const va_list  VarArgs 
)

Definition at line 86 of file os3support.c.

References FAILURE, FormatContext::Index, NO, FormatContext::Overflow, result, FormatContext::Size, StuffChar(), and SUCCESS.

Referenced by ASPrintf(), and SPrintfN().

Here is the call graph for this function:
Here is the caller graph for this function: