digitalmars.com                      
Last update Sun Mar 4 12:00:58 2018

Data Types

This chapter describes the standard defined types found in the Digital Mars C++ Runtime Library.

A number of library routines use values whose types are defined in header files. The defined types are listed in this section, along with the header file, description, declaration, and what function to see.


clock_t

Stores elapsed time in hundredths of a second. See function clock

Declared in time.h as:

typedef long clock_t

COUNTRY

Stores country-specific information. See dos.h

Declared in dos.h as:

struct COUNTRY
{
   short co_date;
   char co_curr[5];
   char co_thsep[2];
   char co_desep[2];
   char co_dtsep[2];
   char co_tmsep[2];
   char co_currstyle;
   char co_digits;
   char co_time;
   long co_case;
   char co_dasep[2];
   char co_fill[10];
};

date
Stores the current system date. See function getdate

Declared in dos.h as:

struct date {
  int da_year;
  char da_day;
  char da_mon;
};

_dev_t

Stores a device identifier. See functions _fstat, _stat

Declared in sys\types.h as:

typedef short dev_t;

_diskfree_t

Stores disk information. See functions _dos_getdiskfree, _getdiskfree

Declared in dos.h as:

struct diskfree_t
{
  unsigned total_clusters;
  unsigned avail_clusters;
  unsigned sectors_per_cluster;
  unsigned bytes_per_sector;
};

_diskinfo_t

Stores information about disk drives. See function _bios_disk

Declared in bios.h as:

struct diskinfo_t
{
  unsigned drive;
  unsigned head;
  unsigned track;
  unsigned sector;
  unsigned nsectors;
  void __far *buffer;
};

div_t

Stores the quotient and remainder of integer division. See function div

Declared in stdlib.h as:

typedef struct _DIV
{
 int quot;
 int rem;
}div_t;

_dosdate_t

Stores the system date. See functions _dos_setdate, _dos_getdate

Declared in dos.h as:

struct dosdate_t
{
 unsigned char day;
 unsigned char month;
 unsigned short year;
 unsigned char dayofweek;
};

_DOSERROR

Stores DOS extended error information. See function _dosexterr

Declared in dos.h as:

struct DOSERROR
{
 int exterror;
 char errclass;
 char action;
 char locus;
};

_dostime_t

Stores the system time. See functions _dos_settime, _dos_gettime

Declared in dos.h as:

struct dostime_t
{
 unsigned char hour;
 unsigned char minute;
 unsigned char second;
 unsigned char hsecond;
};

double_t

The most efficient type for double precision floating point calculations. Not explicitly returned by any function.

Declared in fltpnt.h as:

typedef double double_t;

emm_handle_s

Stores the number of pages allocated to EMM handles. See function emm_gethandlespages

Declared in emm.h as:

struct emm_handle_s
{
 int handle;
 int pages;
};

exception

Stores information about math exceptions. See function matherr

Declared in math.h as:

struct exception
{
 int type;
 char *name;
 double arg1;
 double arg2;
 double retval;
};

_exceptionl

Stores information about long double math exceptions. See function _matherrl

Declared in math.h as:

struct exceptionl
{
 int type;
 char *name;
 long double arg1;
 long double arg2;
 long double retval;
};

_fatinfo

Stores DOS file allocation table information. See functions getfat, getfatd

Declared in dos.h as:

struct _fatinfo
{
 char fi_sclus;
 char fi_fatid;
 unsigned fi_nclus;
 int fi_bysec;
};

fcb

The structure of a DOS file control block. See function parsfnm

Declared in dos.h as:

struct fcb
{
 char fcb_drive;
 char fcb_name[8];
 char fcb_ext[3];
 short fcb_curblk;
 short fcb_filesize;
 short fcb_date;
 char fcb_resv[10];
 char fcb_crrec;
 long fcb_random;
};

fenv_t

Stores floating point environment information. See functions fegetenv, fesetenv, feprocentry, feprocexit

Declared in fltenv.h as:

typedef struct __fenv_t
{
 unsigned short status;
 unsigned short control;
 unsigned short round;
 unsigned short reserved[2]
}fenv_t;

fexcept_t

Stores floating point exception flags. See functions fegetexcept, fesetexcept

Declared in fltenv.h as:

typedef int fexcept_t;

FILE

Stores information about a stream. See functions fopen, _fsopen, freopen, fseek, ftell, fgets, fgetc, fflush, fclose, fputs, getc, fputc, putc, ungetc, fread, fwrite, fprintf, vfprintf, fscanf, setbuf, setvbuf, rewind, clearerr, feof, ferror, fgetpos, fsetpos, _getw, _putw, _fdopen

Declared in stdio.h and is system-dependent.


FIND

Stores information about files found. See functions findfirst, findnext

Declared in dos.h as:

struct FIND
{
 char reserved[21];
 char attribute;
 unsigned short time;
 unsigned short date;
 unsigned long size;
 char name[13]
};

_find_t

Stores information about files found. See functions _dos_findfirst, _dos_findnext

Declared in dos.h as:

struct find_t
{
 char reserved[21];
 char attrib;
 unsigned short wr_time, wr_date;
 unsigned long size;
 char name[13]
};

float_t

The most efficient type for single precision floating point calculations. Not explicitly returned by any function.

Declared in fltpnt.h as:

typedef float float_t;

_fonexit_t

The type for functions registered by function _fonexit. See function _fonexit

Declared in stdlib.h as:

typedef void(__cdecl *_fonexit_t)(void);

fpos_t

Stores information about the position of a file. See functions fgetpos, fsetpos

Declared in stdio.h and is system dependent.

typedef long fpos_t

INT_DATA

Contains registers and other information at the time of an interrupt. See functions int_intercept, int_prev

Declared in int.h as:

struct INT_DATA
{
 union REGS regs;
 struct SREGS sregs;
};

jmp_buf

Stores register information that is reset after a longjmp. See functions setjmp, longjmp

Declared in setjmp.h and is sytem dependent.

typedef int jmp_buf[_JBLEN]

lconv

Stores information about number formatting for different countries. See function localeconv

Declared in locale.h as:

struct lconv
{
 char *decimal_point;
 char *thousands_sep;
 char *grouping;
 char *int_curr_symbol;
 char *currency_symbol;
 char *mon_decimal_point;
 char *mon_thousands_sep;
 char *mon_grouping;
 char *positive_sign;
 char *negative_sign;
 char int_frac_digits;
 char p_cs_precedes;
 char p_sep_by_space;
 char n_cs_precedes;
 char n_sep_by_space;
 char p_sign_posn;
 char n_sign_posn;
 char lc[6];
};

ldiv_t

Stores the quotient and remainder of long integer division. See function ldiv

Declared in stdlib.h as:

typedef struct _LDIV
{
 long quot;
 long rem;
}ldiv_t;

_onexit_t

The type for functions registered by the _onexit function. See function _onexit

Declared in stdlib.h as:

typedef void(__cdecl *__onexit_t)(void);

_PNH

This is the type for functions that handle failures of the C++ new operator. See function _set_new_handler

Declared in new.h as:

typedef int(__cdecl *_PNH)(unsigned);

ptrdiff_t

This is the type for the result of the subtraction of two pointers. It is not explicitly returned by any function.

Declared in stddef.h as:

typedef int ptrdiff_t;

_REGS

Stores the contents of the 80x86 general purpose and flags registers. See functions _int86, _int86x, _intdos, _intdosx, int86_real, int86x_real

Declared in dos.h.

For DOS and Windows 3.x as:

union _REGS
{
 struct
 {
  unsigned char al, ah;
  unsigned char bl, bh;
  unsigned char cl, ch;
  unsigned char dl, dh;
 }h;
 struct
 {
  unsigned ax;
  unsigned bx;
  unsigned cx;
  unsigned dx;
  unsigned si;
  unsigned di;
  unsigned cflag;
  unsigned flags;
 }x;
}
For Phar Lap as:
union _REGS
{
 struct
 {
  unsigned char al, ah, ax2, ax3;
  unsigned char bl, bh, bx2, bx3;
  unsigned char cl, ch, cx2, cx3;
  unsigned char dl, dh, dx2, dx3;
 }h;
 struct
 {
  unsigned short ax, eaxmsw;
  unsigned short bx, ebxmsw;
  unsigned short cx, ecxmsw;
  unsigned short dx, edxmsw;
  unsigned short si, esimsw;
  unsigned short di, edimsw;
  unsigned cflag;
  unsigned flags;
 }x;
 struct
 {
  unsigned eax;
  unsigned ebx;
  unsigned ecx;
  unsigned edx;
  unsigned esi;
  unsigned edi;
  unsigned cflag;
  unsigned flags;
 }e;
};

sig_atomic_t

This is the type of an object that can be modified as an atomic entity in the presence of asynchronous interrupts. See function signal

Declared in signal.h as:

typedef volatile int sig_atomic_t;

size_t

The type of the result of the sizeof operator. size_t is the argument or return value of many memory allocation, string, memory buffer, sorting and searching, and other functions.

Declared in stddef.h and others as:

typedef unsigned size_t;

_SREGS

Stores the contents of the 80x86 segment registers. See functions _int86x, _intdosx, _segread, int86x_real

Declared in dos.h.

For DOS and Windows 3.x as:

struct _SREGS
{
  unsigned short es;
  unsigned short cs;
  unsigned short ss;
  unsigned short ds;
};
For Phar Lap as:
struct _SREGS
{
  unsigned short es;
  unsigned short cs;
  unsigned short ss;
  unsigned short ds;
  unsigned short fs;
  unsigned short gs;
};

_stat

Contains status information about files. See function _fstat, _stat

Declared in sys\stat.h as:

struct stat
{
  short st_dev;
  unsigned short st_mode;
  short st_nlink;
  short st_rdev;
  long st_size;
  long st_atime;
  long st_mtime;
  long st_ctime;
};

time

Stores the current system time. See function gettime

Declared in dos.h as:

struct time
{
  unsigned char ti_min;
  unsigned char ti_hour;
  unsigned char ti_hund;
  unsigned char ti_sec;
};

_timeb

Stores the current system time. See function _ftime

Declared in \sys\timeb.h as:

struct timeb
{
  time_t time;
  unsigned short millitm;
  short timezone;
  short dstflag;
};

time_t

Stores the number of seconds since midnight, January 1, 1968 (UCT). See functions time, mktime, ctime, localtime, gmtime, sleep, _utime

Declared in time.h and others as:

typedef long time_t;

tm

Stores information about the time and date. See functions mktime, asctime, localtime, gmtime, strftime

Declared in time.h as:

struct tm
{
 int tm_sec;
 int tm_min;
 int tm_hour;
 int tm_mday;
 int tm_mon;
 int tm_year;
 int tm_wday;
 int tm_yday;
 int tm_isdst;
};

_utimbuf

Stores file access and modification times. See function _utime

Declared in utime.h as:

struct utimbuf
{
 time_t actime;
 time_t modtime;
};

va_list

Points to a list of function arguments. See functions va_start, va_arg, vprintf, vfprintf, vsprintf, _vsnprintf

Declared in stdarg.h as:

typedef char __ss *va_list;

wchar_t

Stores a wide character. See functions mbtowc, wctomb, mbstowcs, wcstombs

Declared in stdlib.h as:

typedef unsigned short wchart_t;
Home | Compiler & Tools | IDDE Reference | STL | Search | Download | Forums