Annotation of MiNT/src/mint.h, revision 1.1.1.2

1.1       root        1: /*
                      2: 
                      3: Copyright 1990,1991,1992 Eric R. Smith. All rights reserved.
                      4: 
                      5: */
                      6: 
                      7: 
                      8: 
1.1.1.2 ! root        9: #ifdef GENMAGIC
1.1       root       10: 
1.1.1.2 ! root       11: #undef OWN_LIB
1.1       root       12: 
                     13: #endif
                     14: 
                     15: 
                     16: 
1.1.1.2 ! root       17: #ifdef OWN_LIB
1.1       root       18: 
1.1.1.2 ! root       19: #include "ctype.h"
1.1       root       20: 
1.1.1.2 ! root       21: #else
1.1       root       22: 
1.1.1.2 ! root       23: #include <ctype.h>
1.1       root       24: 
1.1.1.2 ! root       25: #include <string.h>
1.1       root       26: 
                     27: #endif
                     28: 
1.1.1.2 ! root       29: #include <osbind.h>
1.1       root       30: 
                     31: 
                     32: 
                     33: /* configuration options */
                     34: 
                     35: 
                     36: 
                     37: /* make real processor exceptions (bus error, etc.) raise a signal */
                     38: 
                     39: #define EXCEPTION_SIGS
                     40: 
                     41: 
                     42: 
                     43: /* deliberately fill memory with junk when allocating: used for testing */
                     44: 
                     45: #undef JUNK_MEM
                     46: 
                     47: 
                     48: 
                     49: /* PATH_MAX is the maximum path allowed. The kernel uses this in lots of
                     50: 
                     51:  * places, so there isn't much point in file systems allowing longer
                     52: 
                     53:  * paths (they can restrict paths to being shorter if they want).
                     54: 
                     55:  */
                     56: 
                     57: #define PATH_MAX 128
                     58: 
                     59: 
                     60: 
                     61: /* maximum length of a string passed to ksprintf: this should be
                     62: 
                     63:  * no more than PATH_MAX
                     64: 
                     65:  */
                     66: 
                     67: #define SPRINTF_MAX    PATH_MAX
                     68: 
                     69: 
                     70: 
                     71: /* NOTE: NAME_MAX is a "suggested" maximum name length only. Individual
                     72: 
                     73:  * file systems may choose a longer or shorter NAME_MAX, so do _not_
                     74: 
                     75:  * use this in the kernel for anything!
                     76: 
                     77:  */
                     78: 
                     79: #define NAME_MAX 14
                     80: 
                     81: 
                     82: 
                     83: /*
                     84: 
                     85:  * configuration section: put compiler specific stuff here
                     86: 
                     87:  */
                     88: 
                     89: 
                     90: 
                     91: #ifdef __GNUC__
                     92: 
                     93: #define EXITING volatile       /* function never returns */
                     94: 
                     95: #else
                     96: 
                     97: #define EXITING
                     98: 
                     99: #endif
                    100: 
                    101: 
                    102: 
                    103: #ifdef dLibs
                    104: 
                    105: #define fullpath full_path
                    106: 
                    107: #define SHORT_NAMES
                    108: 
                    109: #endif
                    110: 
                    111: 
                    112: 
1.1.1.2 ! root      113: /* define to indicate unused variables */
        !           114: 
        !           115: #ifdef __TURBOC__
        !           116: 
        !           117: #define UNUSED(x)      (void)x
        !           118: 
        !           119: #else
        !           120: 
        !           121: #define UNUSED(x)
        !           122: 
        !           123: #endif
        !           124: 
        !           125: 
        !           126: 
        !           127: /* define how to call functions with stack parameter passing */
        !           128: 
        !           129: #ifdef __TURBOC__
        !           130: 
        !           131: #define ARGS_ON_STACK cdecl
        !           132: 
        !           133: #else
        !           134: 
        !           135: #define ARGS_ON_STACK
        !           136: 
        !           137: #endif
        !           138: 
        !           139: 
        !           140: 
        !           141: /* WARNING: Bconmap is defined incorrectly
        !           142: 
        !           143:  * in the MiNT library osbind.h at patchlevel
        !           144: 
        !           145:  * <= 19 and in early versions of the GNU C
        !           146: 
        !           147:  * library. So use this binding for safety's sake.
        !           148: 
        !           149:  */
        !           150: 
        !           151: 
        !           152: 
        !           153: #ifdef __GNUC__
        !           154: 
        !           155: #undef Bconmap
        !           156: 
        !           157: #define Bconmap(dev) (long)trap_14_ww(0x2c, dev)
        !           158: 
        !           159: #endif
        !           160: 
        !           161: 
        !           162: 
        !           163: #ifndef __TURBOC__
        !           164: 
        !           165: #ifndef Bconmap
        !           166: 
        !           167: extern long xbios();
        !           168: 
        !           169: #define Bconmap(dev) xbios(0x2c, dev)
        !           170: 
        !           171: #endif
        !           172: 
        !           173: #endif
        !           174: 
        !           175: 
        !           176: 
        !           177: /* Binding for Flock */
        !           178: 
        !           179: #ifndef __TURBOC__
        !           180: 
        !           181: #ifndef Flock
        !           182: 
        !           183: extern long gemdos();
        !           184: 
        !           185: /* this may need to be adjusted for your compiler/library */
        !           186: 
        !           187: #define Flock(handle, mode, start, len) gemdos(0x5c, handle, mode, start, len)
        !           188: 
        !           189: #endif
        !           190: 
        !           191: #endif
        !           192: 
        !           193: 
        !           194: 
1.1       root      195: #ifdef OWN_LIB
                    196: 
                    197: /* Sigh. Some compilers are too clever for their
                    198: 
                    199:  * own good; gcc 2.1 now makes strcpy() and some
                    200: 
                    201:  * other string functions built-in; the built-in
                    202: 
                    203:  * definitions disagree with ours. So we redefine
                    204: 
                    205:  * them here. This also helps us to avoid conflict
                    206: 
                    207:  * with any library stuff, in the event that we
                    208: 
                    209:  * have to link in a library.
                    210: 
                    211:  */
                    212: 
                    213: 
                    214: 
                    215: #define strlen MS_len
                    216: 
                    217: #define strcpy MS_cpy
                    218: 
                    219: #define strncpy        MS_ncpy
                    220: 
                    221: #define strcat MS_cat
                    222: 
                    223: #define strncat        MS_ncat
                    224: 
                    225: #define strcmp MS_cmp
                    226: 
                    227: #define strncmp        MS_ncmp
                    228: 
                    229: #define strnicmp       MS_nicmp
                    230: 
                    231: #define stricmp        MS_icmp
                    232: 
                    233: #define strlwr MS_lwr
                    234: 
                    235: #define strupr MS_upr
                    236: 
                    237: #define sleep  M_sleep
                    238: 
                    239: #endif
                    240: 
                    241: 
                    242: 
                    243: #ifdef SHORT_NAMES
                    244: 
                    245: #define dispose_fileptr ds_fileptr
                    246: 
                    247: #define dispose_region ds_region
                    248: 
                    249: #define dispose_proc ds_proc
                    250: 
                    251: #endif
                    252: 
                    253: 
                    254: 
                    255: /* prototype macro thingy */
                    256: 
                    257: #ifdef __STDC__
                    258: 
                    259: #define P_(x) x
                    260: 
                    261: #else
                    262: 
                    263: #define P_(x) ()
                    264: 
                    265: #define const
                    266: 
1.1.1.2 ! root      267: #define volatile
        !           268: 
1.1       root      269: #endif
                    270: 
                    271: 
                    272: 
1.1.1.2 ! root      273: #ifndef GENMAGIC
        !           274: 
1.1       root      275: #include "assert.h"
                    276: 
1.1.1.2 ! root      277: #endif
        !           278: 
1.1       root      279: #include "atarierr.h"
                    280: 
                    281: #include "basepage.h"
                    282: 
                    283: #include "types.h"
                    284: 
                    285: #include "signal.h"
                    286: 
                    287: #include "mem.h"
                    288: 
                    289: #include "proc.h"
                    290: 
1.1.1.2 ! root      291: 
        !           292: 
        !           293: #ifndef GENMAGIC
        !           294: 
1.1       root      295: #include "proto.h"
                    296: 
                    297: #include "sproto.h"
                    298: 
1.1.1.2 ! root      299: #endif
        !           300: 
1.1       root      301: 
                    302: 
                    303: #ifndef NULL
                    304: 
                    305: #define NULL ((void *)0)
                    306: 
                    307: #endif
                    308: 
                    309: 
                    310: 
                    311: #ifndef TRUE
                    312: 
                    313: #define TRUE 1
                    314: 
                    315: #define FALSE 0
                    316: 
                    317: #endif
                    318: 
                    319: 
                    320: 
1.1.1.2 ! root      321: /* is debugging info included? */
        !           322: 
        !           323: #ifdef EZMINT
        !           324: 
        !           325: #define NO_DEBUG_INFO
        !           326: 
        !           327: #endif
        !           328: 
        !           329: 
        !           330: 
        !           331: #ifdef NO_DEBUG_INFO
        !           332: 
        !           333: #define TRACE(x)
        !           334: 
        !           335: #define DEBUG(x)
        !           336: 
        !           337: #else
        !           338: 
        !           339: #define TRACE(x) Trace x
        !           340: 
        !           341: #define DEBUG(x) Debug x
        !           342: 
        !           343: #endif
        !           344: 
        !           345: 
        !           346: 
1.1       root      347: #define check_addr(x) 0
                    348: 
                    349: #define yield() sleep(READY_Q, 0L)
                    350: 
                    351: 
                    352: 
                    353: #define CTRL(x) ((x) & 0x1f)
                    354: 
                    355: 
                    356: 
1.1.1.2 ! root      357: #ifndef GENMAGIC
        !           358: 
        !           359: 
        !           360: 
1.1       root      361: extern short timestamp, datestamp;     /* in timeout.c */
                    362: 
                    363: 
                    364: 
                    365: typedef struct kbdvbase {
                    366: 
                    367:        long midivec;
                    368: 
                    369:        long vkbderr;
                    370: 
                    371:        long vmiderr;
                    372: 
                    373:        long statvec;
                    374: 
                    375:        long mousevec;
                    376: 
                    377:        long clockvec;
                    378: 
                    379:        long joyvec;
                    380: 
                    381:        long midisys;
                    382: 
                    383:        long ikbdsys;
                    384: 
                    385: } KBDVEC;
                    386: 
                    387: 
                    388: 
                    389: extern KBDVEC *syskey;
                    390: 
                    391: 
                    392: 
                    393: #define ST     0
                    394: 
                    395: #define STE    0x00010000L
                    396: 
                    397: #define MEGASTE 0x00010010L
                    398: 
                    399: #define TT     0x00020000L
                    400: 
                    401: 
                    402: 
                    403: extern long mch;
                    404: 
                    405: 
                    406: 
                    407: extern int has_bconmap;        /* set in main() */
                    408: 
                    409: extern int curbconmap;  /* see xbios.c */
                    410: 
1.1.1.2 ! root      411: 
        !           412: 
        !           413: /*
        !           414: 
        !           415:  * load some inline functions, perhaps
        !           416: 
        !           417:  */
        !           418: 
        !           419: #include "inline.h"
        !           420: 
        !           421: 
        !           422: 
        !           423: #endif /* GENMAGIC */
        !           424: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.