• Aucun résultat trouvé

ceil, ceill

Dans le document Library Reference (Page 63-67)

Function

cabs (or cabsI) returns the absolute value of z, a double. On overflow, cabs (or cabsI) returns HUGE_VAL (or _LHUGE_ V AL) and sets the global variable errno to

ERANGE Result out of range

Error handling for these functions can be modified through the functions _matherr and_matherrl.

abs, complex, errno (global variable), Jabs, labs, _matherr

stdlib.h

Allocates main memory.

void *calloc(size_t nitems, size_t size) i

Win 16 Win 32

. calloc provides access to the C memory heap. The heap is available for dynamic allocation of variable-sized blocks of memory. Many data structures, such as trees and lists, naturally employ heap memory allocation.

All the space between the end of the data segment and the top of the program stack is available for use in the small data models (small, and medium), except for a small margin immediately before the top of the stack. This margin allows room for the application to grow on the stack, and provides a small amount of room needed by the operating system.

In the large data models (compact,large, and huge), all space beyond the program stack to the end of physical memory is available for the heap.

calloc allocates a block of size nitems x size. The block is cleared to O. If you want to allocate a block larger-than 64K, you must use farcalloc.

calloc returns a pointer to the newly allocated block. If not enough space exists for the new block or if nitems or size is 0, calloc returns NULL.

farcalloc, free, malloc, realloc .

math.h

Rounds up.

Syntax

Remarks Return value See also

Function Syntax

Remarks Return value See also

_cexit

Function Syntax

Remarks

ceil ceill

ceil, ceill

double ceil(double xl i

long double ceill(long double xl i

DOS UNIX Win 16 Win 32 ANSI C ANSI C++ OS/2

• • •

• • • •

• • •

ceil finds the smallest integer not less than x. ceill is the long double version;

it takes a long double argument and returns a long double result.

These functions return the integer found as a double (ceil) or a long double

(ceill).

floor, fmod

process.h

Performs _exit cleanup without terminating the program.

_c_exit performs the same cleanup as _exit, except that it does not terminate the calling process.

None.

abort, atexit, _cexit, exec ... , _exit, exit, signal, spawn ...

process.h

Performs exit cleanup without terminating the program.

void _cexit(voidli

ANSI C++ OS/2

_cexit performs the same cleanup as exit, except that it does not close files or terminate the calling process. Buffered output (waiting to be output) is written, and any registered "exit functions" (posted with atexit) are called.

Return value See also

cgets

Function Syntax

Remarks

None.

abort, atexit, _c_exit,exec ... , _exit, exit, signal, spawn ...

conio.h

Reads a string from the console.

char *cgets(char *str);

cgets reads a string of characters from the console, storing the string (and the string length) in the location pointed to by str.

cgets reads characters until it encounters a carriage-return/linefeed (CR/LF) combination, or until the maximum allowable number of char-acters have been read. If cgets reads a CR/LF combination, it replaces the combination with a \0 (null character) before storing the string.

Before cgets is called, set str[O] to the maximum length of the string to be read. On return, str[l] is set to the number of characters actually read. The characters read start at str[2] and end with a null character. Thus, str must be at least str[O] plus 2 bytes long.

• This function should not be used in Win32s or Win32 GUI applications.

Return value On success, cgets returns a pointer to str[2].

See also cputs, [gets, getch, getche, gets

_chain_intr dos.h

Function Chains to another interrupt handler.

Syntax void _chain_intr(void-(interrupt far *newhandler) ());

Remarks

ANSI C ANSI C++

The _chain_intr function passes control from the currently executing interrupt handler to the new interrupt handler whose address is newhandler. The current register set is not passed to the new handler.

Instead, the new handler receives the registers that were stacked (and

Return value See also

chdir

Function Syntax

Remarks

Return value

See also

_chdrive

Function Syntax

_chainjntr

possibly modified in the stack) by the old handler~ The new handler can simply return, as if it were the original handler. The old handler is not entered again.

The _chain_intr function can be called only by C interrupt functions. It is useful when writing a TSR that needs to insert itself in a chain of interrupt handlers (such as the keyboard interrupt).

None.

_dos~etvect, _dos_setvect,·

dir.h

Changes current directory.

int chdir(const char *path);

chdir causes the directory specified by path to become the current working directory. path must specify an existing directory.

A drive can also be specified iIi. the path argument, such as chdir ("a: \ \Be")

but this changes only the current directory on that drive; it doesn't change the active drive.

Only the current process is affected.

Upon successful completion, chdir returns a value of

o.

Otherwise, it returns a value of -I, and the global variable errno is set to

ENOENT Path or file name not found

getcurdir, getcwd, getdisk, mkdir, rmdir, setdisk, system

Sets current disk drive.

int _chdrive(int drive);

"direct.h

_chdrive

Remarks

Return value See also

chmod

Function Syntax

Remarks

_chdrive sets the current drive to the one associated with drive: 1 for A, 2 for B, 3 for C,·and so on.

This function changes the current drive of the parent process.

_chdrive returns 0 if the current drive was changed successfully; otherwise, it returns -1.

_dos _setdrive

dos.h, io.h

Obsolete function. See _rtCchmod.

Dans le document Library Reference (Page 63-67)