| 1 |
#ifdef RCSID |
| 2 |
static char RCSid[] = |
| 3 |
"$Header: d:/cvsroot/tads/tads3/vmbifreg.cpp,v 1.2 1999/05/17 02:52:29 MJRoberts Exp $"; |
| 4 |
#endif |
| 5 |
|
| 6 |
/* |
| 7 |
* Copyright (c) 1998, 2002 Michael J. Roberts. All Rights Reserved. |
| 8 |
* |
| 9 |
* Please see the accompanying license file, LICENSE.TXT, for information |
| 10 |
* on using and copying this software. |
| 11 |
*/ |
| 12 |
/* |
| 13 |
Name |
| 14 |
vmbifreg_core.cpp - core built-in function set registry (no UI) |
| 15 |
Function |
| 16 |
Defines the built-in functions that are linked in to this |
| 17 |
implementation of the VM. This is the "core" set, which includes the |
| 18 |
normal TADS 3 sets but excludes the user interface (specifically, we |
| 19 |
exclude tads-io, the console I/O function set that is part of the standard |
| 20 |
TADS 3 function set complement). |
| 21 |
|
| 22 |
This core function set is specifically designed to be extended by the |
| 23 |
host application, since it is expected that applications will want to add |
| 24 |
one or more new function sets to provide a user interface. To extend this |
| 25 |
registration table with application-specific function sets, follow these |
| 26 |
steps: |
| 27 |
|
| 28 |
1. Make a copy of this file (DO NOT MODIFY THE ORIGINAL). |
| 29 |
|
| 30 |
2. Remove this file (and/or derived files, such as object files) from |
| 31 |
your makefile, and add your modified version instead. |
| 32 |
|
| 33 |
3. In the table below, add an entry for each of your extra function |
| 34 |
sets. (Of course, for each of your added function sets, you must |
| 35 |
implement the function set and link the implementation into your host |
| 36 |
application executable.) |
| 37 |
|
| 38 |
Notes |
| 39 |
|
| 40 |
Modified |
| 41 |
04/05/02 MJRoberts - creation (from vmbifreg.cpp) |
| 42 |
*/ |
| 43 |
|
| 44 |
#include "vmbifreg.h" |
| 45 |
|
| 46 |
/* ------------------------------------------------------------------------ */ |
| 47 |
/* |
| 48 |
* Include the function set vector definitions. Define |
| 49 |
* VMBIF_DEFINE_VECTOR so that the headers all generate vector |
| 50 |
* definitions. |
| 51 |
*/ |
| 52 |
#define VMBIF_DEFINE_VECTOR |
| 53 |
|
| 54 |
#include "vmbiftad.h" |
| 55 |
#include "vmbift3.h" |
| 56 |
|
| 57 |
// Include the header for our sample t3core function set |
| 58 |
#include "vmcore.h" |
| 59 |
|
| 60 |
// !!! INCLUDE HOST-SPECIFIC FUNCTION SET HEADERS HERE ("vmbifxxx.h") |
| 61 |
|
| 62 |
/* done with the vector definition */ |
| 63 |
#undef VMBIF_DEFINE_VECTOR |
| 64 |
|
| 65 |
#define MAKE_ENTRY(entry_name, cls) \ |
| 66 |
{ entry_name, countof(cls::bif_table), cls::bif_table, \ |
| 67 |
&cls::attach, &cls::detach } |
| 68 |
|
| 69 |
/* ------------------------------------------------------------------------ */ |
| 70 |
/* |
| 71 |
* The function set registration table. Each entry in the table |
| 72 |
* provides the definition of one function set, keyed by the function |
| 73 |
* set's universally unique identifier. |
| 74 |
*/ |
| 75 |
vm_bif_entry_t G_bif_reg_table[] = |
| 76 |
{ |
| 77 |
/* T3 VM system function set, v1 */ |
| 78 |
MAKE_ENTRY("t3vm/010003", CVmBifT3), |
| 79 |
|
| 80 |
/* T3 VM Testing interface, v1 */ |
| 81 |
MAKE_ENTRY("t3vmTEST/010000", CVmBifT3Test), |
| 82 |
|
| 83 |
/* TADS generic data manipulation functions */ |
| 84 |
MAKE_ENTRY("tads-gen/030008", CVmBifTADS), |
| 85 |
|
| 86 |
// Our sample function set for the t3core build |
| 87 |
MAKE_ENTRY("core-sample/010000", CVmBifSample), |
| 88 |
|
| 89 |
// !!! ADD ANY HOST-SPECIFIC FUNCTION SETS HERE |
| 90 |
|
| 91 |
/* end of table marker */ |
| 92 |
{ 0, 0, 0 } |
| 93 |
}; |
| 94 |
|
| 95 |
/* we don't need the MAKE_ENTRY macro any longer */ |
| 96 |
#undef MAKE_ENTRY |
| 97 |
|