Commit 56c7f95f authored by Stewart Brodie's avatar Stewart Brodie
Browse files

Update of defmod to the one that accompanies public version 6.21

  UNIX version.
Detail:
  This source set represents that distributed with OSLib 6.21.  I've
    fixed some faults and passed them back to the maintainers (notably
    an uncaught NULL pointer dereference in the chelp_output function).
  This application now builds on Solaris, Linux & FreeBSD.
  The bootstrap code moves to directory 'oslib' instead of 'bs' to avoid
    needing to change lots of includes between RISC OS and non-RISC OS
    variants.
Notes:
  -cstrong seems to produce empty files (on all variants) - I guess it's
    not supported any more (we don't need it either).
Admin:
  Tested on Solaris, Linux, FreeBSD and RISC OS.
  Sources re-released to maintainers as required under GPL licence.


Version 6.21. Tagged as 'defmod-6_21'
parent f99e11dc
......@@ -14,7 +14,7 @@
LIBDIR = ${INSTDIR}.Library.Build
INSTAPP = ${INSTDIR}.Apps.!DefMod
VPATH = @ sources bs support
VPATH = @ sources oslib support
#
# Generic options:
......@@ -28,11 +28,12 @@ RM = remove
LD = link
LB = libfile
TOUCH = create
SQZ = squeeze
SQZ = squeeze
WIPE = -wipe
YACC = GNU.bison
CCFLAGS = -c -depend !Depend -ffa ${INCLUDES} ${THROWBACK} -DTRACE=0 -Wp
DEFINES = -DRISCOS -DEXECUTE_ON_RISCOS -DPACE_BUILD
CCFLAGS = -c -depend !Depend -ffa ${INCLUDES} ${DEFINES} ${THROWBACK} -DTRACE=0 -Wp
YACCDEFS= -DYYDEBUG=0 -DYYMAXDEPTH=0
ASFLAGS = -depend !Depend -Stamp -quit ${THROWBACK} ${ASMINC}
CPFLAGS = ~cfr~v
......@@ -46,20 +47,14 @@ YACCFLAGS = -y
# Libraries
#
CLIB = CLIB:o.stubs
RLIB = RISCOSLIB:o.risc_oslib
RSTUBS = RISCOSLIB:o.rstubs
ROMSTUBS = RISCOSLIB:o.romstubs
ROMCSTUBS = RISCOSLIB:o.romcstubs
ABSSYM = RISC_OSLib:o.AbsSym
UNIXLIB = TCPIPLibs:o.unixlib
DIRS=o._dirs
#
# Include files
#
INCLUDES = -Jbs.,support.,C: -Ibs -Isources -Isupport -IC:
ASMINC = -Ibs -Isources -Isupport
INCLUDES = -J@.,oslib.,support.,C: -Ioslib -Isources -Isupport -IC:
ASMINC = -Ioslib -Isources -Isupport
#
# Program specific options:
......@@ -70,8 +65,7 @@ TARGET = ${COMPONENT}
SOURCE =
EXPORTS =
OBJS=o.asmhelp o.callback o.chelp o.def o.defmod o.cheader o.hdr \
OBJS=o.asmhelp o.callback o.chelp o.def o.defmod o.cheader o.hdr o.x \
o.lookup o.objasm o.realloc o.resource o.riscos o.riscosa o.cstrong
LIBS=${CLIB}
......@@ -79,13 +73,16 @@ LIBS=${CLIB}
#
# Rule patterns
#
.SUFFIXES:
.SUFFIXES: .o .c .y .s
.c.o:; ${CC} ${CCFLAGS} -o $@ $<
.s.o:; ${AS} ${ASFLAGS} -o $@ $<
.c.o:
${CC} ${CCFLAGS} -o $@ $<
.s.o:
${AS} ${ASFLAGS} -o $@ $<
c.defmod: sources.y.defmod
${YACC} ${YACCFLAGS} -o c.defmod sources.y.defmod
${YACC} ${YACCFLAGS} -o c.defmod sources.y.defmod
o.defmod: c.defmod
${CC} ${CCFLAGS} ${YACCDEFS} -o $@ c.defmod
......@@ -105,18 +102,18 @@ install: all
# RISC OS ROM build rules:
#
rom: ${TARGET}
@echo ${COMPONENT}: rom module built
@echo ${COMPONENT}: rom module built
export: export_${PHASE}
install_rom: ${TARGET}
@echo ${COMPONENT}: rom module installed
@echo ${COMPONENT}: rom module installed
clean:
${WIPE} c ${WFLAGS}
${WIPE} o ${WFLAGS}
${RM} ${COMPONENT}
@echo ${COMPONENT}: cleaned
${WIPE} c ${WFLAGS}
${WIPE} o ${WFLAGS}
${RM} ${COMPONENT}
@echo ${COMPONENT}: cleaned
export_hdrs:
@echo ${COMPONENT}: export complete (hdrs)
......@@ -127,15 +124,13 @@ export_libs:
${DIRS}:
${MKDIR} c
${MKDIR} o
create $@
${TOUCH} $@
#
# Final link
#
${TARGET}: ${OBJS} ${LIBS} ${DIRS}
${LD} ${LDFLAGS} -o ${COMPONENT} ${OBJS} ${LIBS}
${SQZ} ${SQZFLAGS} $@
${LD} ${LDFLAGS} -o ${COMPONENT} ${OBJS} ${LIBS}
${SQZ} ${SQZFLAGS} $@
# Dynamic dependencies:
/* (6.01)
/* (6.21)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 6.01
#define Module_MajorVersion_CMHG 6.21
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 18 Apr 2000
#define Module_Date_CMHG 06 Jun 2001
#define Module_MajorVersion "6.01"
#define Module_Version 601
#define Module_MajorVersion "6.21"
#define Module_Version 621
#define Module_MinorVersion ""
#define Module_Date "18 Apr 2000"
#define Module_Date "06 Jun 2001"
#define Module_FullVersion "6.01"
#define Module_ApplicationDate2 "06-Jun-01"
#define Module_ApplicationDate4 "06-Jun-2001"
#define Module_ComponentName "defmod"
#define Module_ComponentPath "RiscOS/Tools/Sources/GNU/defmod"
#define Module_FullVersion "6.21"
#define Module_HelpVersion "6.21 (06 Jun 2001)"
#ifndef fileswitch_H
#define fileswitch_H
/* C header file for FileSwitch
* written by Jonathan Coxhead, jonathan@doves.demon.co.uk.
*/
/*OSLib---efficient, type-safe, transparent, extensible,
/*OSLib---efficient, type-safe, transparent, extensible,\n"
register-safe A P I coverage of RISC O S*/
/*Copyright 1994 Jonathan Coxhead*/
......
/* C header file for Font
* written by Jonathan Coxhead, jonathan@doves.demon.co.uk, 04-Feb-1993.
*/
#ifndef font_H
#define font_H
#include <swis.h>
#ifndef types_H
#include "types.h"
#include "types.h"
#endif
#ifndef os_H
#include "os.h"
#include "os.h"
#endif
#define font_COMMAND_NUL 0
......
/* C header file for HostFS
* written by Jonathan Coxhead, jonathan@doves.demon.co.uk, 04-Feb-1993.
*/
#ifndef hostfs_H
#define hostfs_H
#include <swis.h>
#ifndef types_H
#include "types.h"
#include "types.h"
#endif
#undef HostFS_HostVdu
......
#ifndef macros_H
#define macros_H
/* C header file for Macros
* written by Jonathan Coxhead, jonathan@doves.demon.co.uk.
*/
/*OSLib---efficient, type-safe, transparent, extensible,
/*OSLib---efficient, type-safe, transparent, extensible,\n"
register-safe A P I coverage of RISC O S*/
/*Copyright 1994 Jonathan Coxhead*/
......
#ifndef messagetrans_H
#define messagetrans_H
/* C header file for MessageTrans
* written by Jonathan Coxhead, jonathan@doves.demon.co.uk.
*/
/*OSLib---efficient, type-safe, transparent, extensible,
/*OSLib---efficient, type-safe, transparent, extensible,\n"
register-safe A P I coverage of RISC O S*/
/*Copyright 1994 Jonathan Coxhead*/
......@@ -29,13 +25,15 @@
#include <swis.h>
#ifndef types_H
#include "types.h"
#include "types.h"
#endif
#define messagetrans_DIRECT_ACCESS (1 << 0)
typedef struct {int cb [4];} messagetrans_control_block;
#ifdef EXECUTE_ON_RISCOS
#define xmessagetrans_file_info(file_name, flags, size) \
_swix (MessageTrans_FileInfo, _IN (1) | _OUT (0) | _OUT (2), \
(char *) (file_name), (int *) (flags), (int *) (size))
......@@ -71,7 +69,7 @@ typedef struct {int cb [4];} messagetrans_control_block;
_OUT (2) | _OUT (3) | _OUT (4), \
(messagetrans_control_block *) (cb), (char *) (token), \
(char *) (buffer), (int) (size), (int) (index), \
(bool *) (cont), (int *) (size_out), (int *) (index_out))
(osbool *) (cont), (int *) (size_out), (int *) (index_out))
#define xmessagetrans_error_lookup(error, cb, buffer, size_in, arg0, arg1, \
arg2, arg3) \
......@@ -81,6 +79,14 @@ typedef struct {int cb [4];} messagetrans_control_block;
(char *) (buffer), (int) (size_in), (char *) (arg0), \
(char *) (arg1), (char *) (arg2), (char *) (arg3))
#define messagetrans_error_lookup(error, cb, buffer, size_in, arg0, arg1, \
arg2, arg3) \
_swi (MessageTrans_ErrorLookup, _IN (0) | _IN (1) | _IN (2) | _IN (3) | \
_IN (4) | _IN (5) | _IN (6) | _IN (7), \
(_kernel_oserror *) (error), (messagetrans_control_block *) (cb), \
(char *) (buffer), (int) (size_in), (char *) (arg0), \
(char *) (arg1), (char *) (arg2), (char *) (arg3))
#define xmessagetrans_gs_lookup(cb, token, buffer, size_in, arg0, arg1, \
arg2, arg3, result, size_out) \
_swix (MessageTrans_GSLookup, _IN (0) | _IN (1) | _IN (2) | _IN (3) | \
......@@ -94,4 +100,11 @@ typedef struct {int cb [4];} messagetrans_control_block;
_swix (MessageTrans_CopyError, _IN (0) | _OUT (0), \
(os_error *) (error), (os_error **) (copy))
#else /* EXECUTE_ON_RISCOS */
extern void messagetrans_error_lookup(_kernel_oserror *, void *, _kernel_oserror *,
int, char *, char *, char *, char *);
#endif
#endif
#ifndef os_H
#define os_H
/* C header file for OS
* written by Jonathan Coxhead, jonathan@doves.demon.co.uk.
*/
/*OSLib---efficient, type-safe, transparent, extensible,
/*OSLib---efficient, type-safe, transparent, extensible,\n"
register-safe A P I coverage of RISC O S*/
/*Copyright 1994 Jonathan Coxhead*/
......@@ -29,7 +25,7 @@
#include <swis.h>
#ifndef types_H
#include "types.h"
#include "types.h"
#endif
#define osbyte_IN_KEY ((byte) 129)
......@@ -134,6 +130,8 @@ typedef byte os_date_and_time [5];
#define os_GLOBAL_NO_ANY 9
#define os_GLOBAL_NO_MEM 49
#ifdef EXECUTE_ON_RISCOS
#define xos_writec(c) \
_swix (OS_WriteC, _IN (0), (int) (c))
......@@ -270,7 +268,7 @@ typedef byte os_date_and_time [5];
_swix (OS_change_dynamic_area, )
#define os_generate_error(error) \
_swi (OS_GenerateError, _IN (0), (os_error *) (error));
_swi (OS_GenerateError, _IN (0), (os_error *) (error))
#define xos_read_escape_state() \
_swix (OS_read_escape_state, )
......@@ -602,4 +600,10 @@ typedef byte os_date_and_time [5];
#define xos_convert_file_size() \
_swix (OS_ConvertFileSize, )
#else /* EXECUTE_ON_RISCOS */
extern os_error *xos_pretty_print(char *, void *, void *);
#endif /* EXECUTE_ON_RISCOS */
#endif
#ifndef osargs_H
#define osargs_H
/* C header file for OSArgs
* written by Jonathan Coxhead, jonathan@doves.demon.co.uk.
*/
/*OSLib---efficient, type-safe, transparent, extensible,
/*OSLib---efficient, type-safe, transparent, extensible,\n"
register-safe A P I coverage of RISC O S*/
/*Copyright 1994 Jonathan Coxhead*/
......@@ -26,15 +22,15 @@
*/
#ifndef types_H
#include "types.h"
#include "types.h"
#endif
#ifndef fileswitch_H
#include "fileswitch.h"
#include "fileswitch.h"
#endif
#ifndef os_H
#include "os.h"
#include "os.h"
#endif
#define OSArgs_ReadPtr 0x0
......
#ifndef osfile_H
#define osfile_H
/* C header file for OSFile
* written by Jonathan Coxhead, jonathan@doves.demon.co.uk.
*/
/*OSLib---efficient, type-safe, transparent, extensible,
/*OSLib---efficient, type-safe, transparent, extensible,\n"
register-safe A P I coverage of RISC O S*/
/*Copyright 1994 Jonathan Coxhead*/
......@@ -28,11 +24,11 @@
#include <swis.h>
#ifndef types_H
#include "types.h"
#include "types.h"
#endif
#ifndef fileswitch_H
#include "fileswitch.h"
#include "fileswitch.h"
#endif
#define OSFile_Load 255
......@@ -99,6 +95,8 @@
#define osfile_TYPE(load_addr) ((load_addr & 0xFFF00000) == 0xFFF00000? \
(load_addr) >> 8 & 0xFFF: osfile_TYPE_UNTYPED)
#ifdef EXECUTE_ON_RISCOS
#define xosfile_load(file_name, addr, load_addr, exec_addr, size, attr) \
_swix (OS_File, _IN (0) | _IN (1) | _IN (2) | _IN (3) | _OUT (2) | \
_OUT (3) | _OUT (4) | _OUT (5), OSFile_Load, (char *) (file_name), \
......@@ -136,6 +134,10 @@
_swix (OS_File, _IN (0) | _IN (1) | _IN (4), \
OSFile_CreateDir, (char *) (dir_name), (int) (no_entries))
#define osfile_create_dir(dir_name, no_entries) \
_swi (OS_File, _IN (0) | _IN (1) | _IN (4), \
OSFile_CreateDir, (char *) (dir_name), (int) (no_entries))
#define xosfile_set_stamp() ...
#define xosfile_save_stamped(file_name, osfile_type, start, end) \
......@@ -181,4 +183,13 @@
#define xosfile_read_with_type_no_path() ...
#define xosfile_read_block_size() ...
#else /* EXECUTE_ON_RISCOS */
extern os_error *xosfile_create_dir(char *, int);
extern void osfile_create_dir(char *, int);
extern void os_generate_error(_kernel_oserror *);
#endif /* EXECUTE_ON_RISCOS */
#endif
#ifndef osfind_H
#define osfind_H
/* C header file for OSFind
* written by Jonathan Coxhead, jonathan@doves.demon.co.uk.
*/
/*OSLib---efficient, type-safe, transparent, extensible,
/*OSLib---efficient, type-safe, transparent, extensible,\n"
register-safe A P I coverage of RISC O S*/
/*Copyright 1994 Jonathan Coxhead*/
......@@ -26,15 +22,15 @@
*/
#ifndef types_H
#include "types.h"
#include "types.h"
#endif
#ifndef fileswitch_H
#include "fileswitch.h"
#include "fileswitch.h"
#endif
#ifndef os_H
#include "os.h"
#include "os.h"
#endif
#define OSFind_Close 0x0
......
#ifndef osgbpb_H
#define osgbpb_H
/* C header file for OSGBPB
* written by Jonathan Coxhead, jonathan@doves.demon.co.uk.
*/
/*OSLib---efficient, type-safe, transparent, extensible,
/*OSLib---efficient, type-safe, transparent, extensible,\n"
register-safe A P I coverage of RISC O S*/
/*Copyright 1994 Jonathan Coxhead*/
......@@ -26,15 +22,15 @@
*/
#ifndef types_H
#include "types.h"
#include "types.h"
#endif
#ifndef fileswitch_H
#include "fileswitch.h"
#include "fileswitch.h"
#endif
#ifndef os_H
#include "os.h"
#include "os.h"
#endif
#define OSGBPB_WriteAt 0x1
......
#ifndef osmodule_H
#define osmodule_H
/* C header file for OSModule
* written by Jonathan Coxhead, jonathan@doves.demon.co.uk.
*/
/*OSLib---efficient, type-safe, transparent, extensible,
/*OSLib---efficient, type-safe, transparent, extensible,\n"
register-safe A P I coverage of RISC O S*/
/*Copyright 1994 Jonathan Coxhead*/
......@@ -26,11 +22,11 @@
*/
#ifndef types_H
#include "types.h"
#include "types.h"
#endif
#ifndef os_H
#include "os.h"
#include "os.h"
#endif
#define OSModule_Alloc 0x6
......
#ifndef osspriteop_H
#define osspriteop_H
/* C header file for OSSpriteOp
* written by Jonathan Coxhead, jonathan@doves.demon.co.uk.
*/
/*OSLib---efficient, type-safe, transparent, extensible,
/*OSLib---efficient, type-safe, transparent, extensible,\n"
register-safe A P I coverage of RISC O S*/
/*Copyright 1994 Jonathan Coxhead*/
......@@ -25,8 +21,12 @@
Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, U S A.
*/
#if !defined types_H
#include "types.h"
#endif
#ifndef os_H
#include "os.h"
#include "os.h"
#endif
#define OSSpriteOp_ScreenSave 2
......@@ -99,7 +99,7 @@ typedef void *osspriteop_ptr;
#define xosspriteop_screen_save(file_name, palette_flag) \
_swix (OS_SpriteOp, _IN (0) | _IN (2) | _IN (3), \
OSSpriteOp_ScreenSave, (char *) (file_name), (bool) (palette_flag))
OSSpriteOp_ScreenSave, (char *) (file_name), (osbool) (palette_flag))
#define xosspriteop_screen_load() ...
......@@ -175,7 +175,7 @@ typedef void *osspriteop_ptr;
_IN (0) | _IN (1) | _IN (2) | _OUT (3) | _OUT (4) | _OUT (5) | \
_OUT (6), \
OSSpriteOp_ReadSpriteSize | (int) (bits), (osspriteop_area *) (area), \
(void *) (ptr), (int *) (width), (int *) (height), (bool *) (mask), \
(void *) (ptr), (int *) (width), (int *) (height), (osbool *) (mask), \
(int *) (mode))
#define xosspriteop_read_pixel_colour(bits, area, ptr, x, y, colour, tint) \
......
......@@ -2,10 +2,9 @@
#define taskwindow_H
/* C header file for TaskWindow
* written by Jonathan Coxhead, jonathan@doves.demon.co.uk.
*/
/*OSLib---efficient, type-safe, transparent, extensible,
/*OSLib---efficient, type-safe, transparent, extensible,\n"
register-safe A P I coverage of RISC O S*/
/*Copyright 1994 Jonathan Coxhead*/
......@@ -25,8 +24,12 @@
Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, U S A.
*/
#if !defined types_H
#include "types.h"
#endif
#ifndef os_H
#include "os.h"
#include "os.h"
#endif
#define TaskWindowTaskInfo_WindowTask 0x0
......@@ -50,7 +53,7 @@
#define xtaskwindowtaskinfo_window_task(window_task) \
_swix (TaskWindow_TaskInfo, _IN (0) | _OUT (0), \
TaskWindowTaskInfo_WindowTask, (bool *) (window_task))
TaskWindowTaskInfo_WindowTask, (osbool *) (window_task))
#define xtaskwindowtaskinfo_window_task_parent(parent, txt) \
_swix (TaskWindow_TaskInfo, _IN (0) | _OUT (0) | _OUT (1), \
......
#ifndef territory_H
#define territory_H
/* C header file for Territory
* written by Jonathan Coxhead, jonathan@doves.demon.co.uk.
*/
/*OSLib---efficient, type-safe, transparent, extensible,
/*OSLib---efficient, type-safe, transparent, extensible,\n"
register-safe A P I coverage of RISC O S*/
/*Copyright 1994 Jonathan Coxhead*/
......@@ -28,7 +24,7 @@
#include <swis.h>
#ifndef types_H
#include "types.h"
#include "types.h"
#endif
typedef int territory_t;
......@@ -40,6 +36,8 @@ typedef int territory_t;
#define territory_SYMBOL_DECIMAL_POINT 0
#ifdef EXECUTE_ON_RISCOS
#define xterritory_number() \
_swix (Territory_Number, )
......@@ -149,4 +147,10 @@ typedef int territory_t;
#define xterritory_convert_text_to_string() \
_swix (Territory_ConvertTextToString, )
#else /* EXECUTE_ON_RISCOS */
/* No UNIX definitions required for this component */
#endif /* EXECUTE_ON_RISCOS */
#endif
#ifndef types_H
#define types_H
/* C header file for Types
* written by Jonathan Coxhead, jonathan@doves.demon.co.uk.
*/
/*OSLib---efficient, type-safe, transparent, extensible,
/*OSLib---efficient, type-safe, transparent, extensible,\n"
register-safe A P I coverage of RISC O S*/
/*Copyright 1994 Jonathan Coxhead*/
......@@ -28,15 +24,15 @@
#include <kernel.h>
typedef unsigned int bits, bytes;
typedef int bool;
typedef int osbool;
typedef unsigned char byte;
#ifndef NULL
#define NULL ((void *) 0)
#endif
#define FALSE ((bool) 0)
#define TRUE ((bool) 1)
#define FALSE ((osbool) 0)
#define TRUE ((osbool) 1)