| 1 | /* |
| 2 | $Header: d:/cvsroot/tads/TADS2/LTK.H,v 1.2 1999/05/17 02:52:12 MJRoberts Exp $ |
| 3 | */ |
| 4 | |
| 5 | /* |
| 6 | * Copyright (c) 1993 by Steve McAdams. All Rights Reserved. |
| 7 | * |
| 8 | * Please see the accompanying license file, LICENSE.TXT, for information |
| 9 | * on using and copying this software. |
| 10 | */ |
| 11 | /* |
| 12 | Name |
| 13 | ltk.h - Library porting Tool Kit definitions |
| 14 | Function |
| 15 | |
| 16 | Notes |
| 17 | These are generic definitions which should be applicable to any system. |
| 18 | The implementation will be in a file call LTKxxx, where 'xxx' is the os |
| 19 | that the toolkit is written for. |
| 20 | |
| 21 | Modified |
| 22 | 02/11/93 SMcAdams - Creation |
| 23 | */ |
| 24 | |
| 25 | #ifndef LTK |
| 26 | #define LTK |
| 27 | |
| 28 | #include <lib.h> |
| 29 | |
| 30 | |
| 31 | /* |
| 32 | * ltkini - allocate and INItialize ltk context. 'heapsiz' is the |
| 33 | * requested size for the local heap. Returns 0 if the request cannot be |
| 34 | * satisfied. |
| 35 | */ |
| 36 | void ltkini(unsigned short heapsiz); |
| 37 | |
| 38 | |
| 39 | /* |
| 40 | * ltkfre - FREe ltk context. |
| 41 | */ |
| 42 | void ltkfre(); |
| 43 | |
| 44 | |
| 45 | /* |
| 46 | * ltk_dlg - DiaLoG. Present user with informational dialog message. |
| 47 | * 'title' specifies the title to use in the dialog box, 'msg' is the |
| 48 | * text message, which may contain printf-style formatting. |
| 49 | * printf-style arguments must be passed in also, if the message |
| 50 | * requires them. |
| 51 | */ |
| 52 | void ltk_dlg(char *title, char *msg, ...); |
| 53 | |
| 54 | |
| 55 | /* |
| 56 | * ltk_errlog - Error logging function for LER routines. |
| 57 | */ |
| 58 | void ltk_errlog(void *ctx, char *fac, int errno, |
| 59 | int agrc, union erradef *argv); |
| 60 | |
| 61 | |
| 62 | /* |
| 63 | * ltk_alloc - ALLOCate permanent global memory. Returns 0 if the |
| 64 | * request cannot be satisfied. |
| 65 | */ |
| 66 | void *ltk_alloc(size_t siz); |
| 67 | |
| 68 | /* ltk_realloc - reallocate memory; analogous to realloc() */ |
| 69 | void *ltk_realloc(void *ptr, size_t siz); |
| 70 | |
| 71 | |
| 72 | /* |
| 73 | * ltk_sigalloc - ALLOCate permanent global memory, signals error on |
| 74 | * failure. |
| 75 | */ |
| 76 | void *ltk_sigalloc(struct errcxdef *errcx, size_t siz); |
| 77 | |
| 78 | |
| 79 | /* |
| 80 | * ltk_free - FREE memory allocated using ltk_alloc. |
| 81 | */ |
| 82 | void ltk_free(void *ptr); |
| 83 | |
| 84 | |
| 85 | /* |
| 86 | * ltk_suballoc - SUB-ALLOCate memory from user heap. Returns 0 if the |
| 87 | * request cannot be satisfied. |
| 88 | */ |
| 89 | void *ltk_suballoc(size_t siz); |
| 90 | |
| 91 | |
| 92 | /* |
| 93 | * ltk_sigsuballoc - SUB-ALLOCate memory from user heap, signals error |
| 94 | * on failure. |
| 95 | */ |
| 96 | void *ltk_sigsuballoc(struct errcxdef *errcx, size_t siz); |
| 97 | |
| 98 | |
| 99 | /* |
| 100 | * ltk_subfree - SUBsegment FREE. Frees memory allocated by |
| 101 | * ltk_suballoc. |
| 102 | */ |
| 103 | void ltk_subfree(void *ptr); |
| 104 | |
| 105 | |
| 106 | /* |
| 107 | * ltk_beep - BEEP the user. |
| 108 | */ |
| 109 | void ltk_beep(void); |
| 110 | |
| 111 | |
| 112 | /* |
| 113 | * ltk_beg_wait - signal that the user needs to wait. |
| 114 | */ |
| 115 | void ltk_beg_wait(void); |
| 116 | |
| 117 | |
| 118 | /* |
| 119 | * ltk_end_wait - end the waiting period . |
| 120 | */ |
| 121 | void ltk_end_wait(void); |
| 122 | |
| 123 | |
| 124 | #endif /* LTK */ |