Previous | Contents | Index |
Returns the complex hyperbolic cosine of its argument.
#include <complex.h>double complex ccosh (double complex z);
float complex ccoshf (float complex z);
long double complex ccoshl (long double complex z);
z
A complex value.
The ccosh functions return the complex hyperbolic cosine of z.
x The complex hyperbolic cosine value.
Returns the smallest integer that is greater than or equal to its argument.
#include <math.h>double ceil (double x);
float ceilf (float x); (INTEGRITY SERVERS, ALPHA)
long double ceill (long double x); (INTEGRITY SERVERS, ALPHA)
x
A real value.
n The smallest integer greater than or equal to the function argument.
Returns the complex exponent of its argument.
#include <complex.h>double complex cexp (double complex z);
float complex cexpf (float complex z);
long double complex cexpl (long double complex z);
z
A complex value.
The cexp functions compute the complex exponential value of z, defined as e**z, where e is the constant used as a base for natural logarithms.
x The complex exponential value of the argument.
Makes available for reallocation the area allocated by a previous calloc , malloc , or realloc call. This function is AST-reentrant.
#include <stdlib.h>void cfree (void *ptr);
ptr
The address returned by a previous call to malloc , calloc , or realloc .
The contents of the deallocated area are unchanged.In HP C for OpenVMS Systems, the free and cfree functions are equivalent. Some other C implementations use free with malloc or realloc , and cfree with calloc . However, since the ANSI C standard does not include cfree , using free may be preferable.
See also free .
Changes the default directory.
#include <unistd.h>int chdir (const char *dir_spec); (ISO POSIX-1)
int chdir (const char *dir_spec, ...); (HP C EXTENSION)
dir_spec
A null-terminated character string naming a directory in either an OpenVMS or UNIX style specification....
This argument is an HP C extension available when not defining any of the standards-related feature-test macros (see Section 1.4) and not compiling in strict ANSI C mode (/STANDARD=ANSI89). The argument is an optional flag of type int that is significant only when calling chdir from USER mode.If the value of the flag is 1, the new directory is effective across images. If the value is not 1, the original default directory is restored when the image exits.
The chdir function changes the default directory. The change can be permanent or temporary. Permanent means that the new directory remains as the default directory after the image exits. Temporary means that on image exit, the default is set to whatever it was before the execution of the image.There are two ways of making the change permanent:
- Call chdir from USER mode with the second argument set to 1.
- Call chdir from SUPERVISOR or EXECUTIVE mode, regardless of the value of the second argument.
Otherwise, the change is temporary.
0 Indicates that the directory is successfully changed to the given name. - 1 Indicates that the change attempt has failed.
Changes the file protection of a file.
#include <stat.h>int chmod (const char *file_spec, mode_t mode);
file_spec
The name of an OpenVMS or UNIX style file specification.mode
A file protection. Modes are constructed by performing a bitwise OR on any of the values shown in Table REF-2.
Table REF-2 File Protection Values and Their Meanings Value Privilege 0400 OWNER:READ 0200 OWNER:WRITE 0100 OWNER:EXECUTE 0040 GROUP:READ 0020 GROUP:WRITE 0010 GROUP:EXECUTE 0004 WORLD:READ 0002 WORLD:WRITE 0001 WORLD:EXECUTE When you supply a mode value of 0, the chmod function gives the file the user's default file protection.
The system is given the same privileges as the owner. A WRITE privilege also implies a DELETE privilege.
You must have a WRITE privilege for the file specified to change the mode.The C RTL does not support the S_ISVTX bit. Setting the S_ISVTX mode has no effect.
0 Indicates that the mode is successfully changed. - 1 Indicates that the change attempt has failed.
Changes the user ID and group ID of the specified file.
#include <unistd.h>int chown (const char *file_spec, uid_t owner, gid_t group);
file_spec
The address of an ASCII filename.owner
The new user ID of the file.group
The new group ID of the file.
0 Indicates success. - 1 Indicates failure.
Returns the imaginary part of its complex argument.
#include <complex.h>double cimag (double complex z);
float cimagf (float complex z);
long double cimagl (long double complex z);
z
A complex value.
The cimag functions return the imaginary part of z as a real number.
x The imaginary part value.
Erase the contents of the specified window and reset the cursor to coordinates (0,0). The clear function acts on the stdscr window.
#include <curses.h>int clear();
int wclear (WINDOW *win);
win
A pointer to the window.
OK Indicates success. ERR Indicates an error.
Resets the error and end-of-file indicators for a file (so that ferror and feof will not return a nonzero value).
#include <stdio.h>void clearerr (FILE *file_ptr);
file_ptr
A file pointer.
Same as the clearerr function, except used only within a scope protected by flockfile and funlockfile .
#include <stdio.h>void clearerr_unlocked (FILE *file_ptr);
file_ptr
A file pointer.
The reentrant version of the clearerr function is locked against multiple threads calling it simultaneously. This incurs overhead to ensure integrity of the stream. The unlocked version of this call, clearerr_unlocked can be used to avoid the overhead. The clearerr_unlocked macro is functionally identical to the clearerr macro, except that it is not required to be implemented in a thread-safe manner. The clearerr_unlocked function can be safely used only within a scope that is protected by the flockfile and funlockfile functions used as a pair. The caller must ensure that the stream is locked before clearerr_unlocked is used.See also flockfile , ftrylockfile , and funlockfile .
Sets the clear flag for the window.
#include <curses.h>clearok (WINDOW *win, bool boolf);
win
The entire size of the terminal screen. You can use the windows stdscr and curscr with clearok .boolf
A Boolean value of TRUE or FALSE. If the argument is TRUE, this forces a clearscreen to be printed on the next call to refresh , or stops the screen from being cleared if boolf is FALSE.The type bool is defined in the <curses.h> header file as follows:
#define bool int
Unlike the clear function, the clearok function does not alter the contents of the window. If the win argument is curscr , the next call to refresh causes a clearscreen, even if the window passed to refresh is not a window the size of the entire terminal screen.
Determines the CPU time (in 10-millisecond units) used since the beginning of the process. The time reported is the sum of the user and system times of the calling process and any terminated child processes for which the calling process has executed wait or system .
#include <time.h>clock_t clock (void);
The value returned by the clock function must be divided by the value of the CLK_TCK, as defined in the standard header file <time.h> , to obtain the time in seconds.The type clock_t is defined in the <time.h> header file as follows:
typedef long int clock_t;Only the accumulated times for child processes running a C main program or a program that calls VAXC$CRTL_INIT or DECC$CRTL_INIT are included.
A typical usage of the clock function is to call it after a program does its initial setup, and then again after the program executes the code to be timed. Then subtract the two values to give elapsed CPU time.
n The processor time used. - 1 Indicates that the processor time used is not available.
Gets the resolution for the specified clock.
#include <time.h>int clock_getres (clockid_t clock_id, struct timespec *res);
clock_id
The clock type used to obtain the resolution. The CLOCK_REALTIME clock is supported and represents the TIME-OF-DAY clock for the system.res
A pointer to the timespec data structure that receives the value of the clock's resolution.
The clock_getres function obtains the resolution value for the specified clock. Clock resolutions are implementation-dependent and cannot be set by a process.If the res argument is not NULL, the resolution of the specified clock is stored in the location pointed to by res.
If res is NULL, the clock resolution is not stored.
If the time argument (tp) of clock_settime is not a multiple of res, then the value is truncated to a multiple of res.
On success, the function returns 0.
On failure, the function returns - 1 and sets errno to indicate the error.
See also clock_gettime , clock_settime , time , and ctime .
0 Indicates success. - 1 Indicates failure; errno is set to the following value:
- EINVAL -- The clock_id argument does not specify a known clock.
Returns the current time (in seconds and nanoseconds) for the specified clock.
#include <time.h>int clock_gettime (clockid_t clock_id, struct timespec *tp);
clock_id
The clock type used to obtain the time for the clock that is set. The CLOCK_REALTIME clock is supported and represents the TIME-OF-DAY clock for the system.tp
A pointer to a timespec data structure.
The clock_gettime function returns the current tp value for the specified clock, clock_id.On success, the function returns 0.
On failure, the function returns - 1 and sets errno to indicate the error.
See also clock_getres , clock_settime , time , and ctime .
0 Indicates success. - 1 Indicates failure; errno is set to the following value:
- EINVAL -- The clock_id argument does not specify a known clock, or the tp argument specifies a nanosecond value less than 0 or greater than or equal to 1 billion.
Sets the specified clock.
#include <time.h>int clock_settime (clockid_t clock_id, const struct timespec *tp);
clock_id
The clock type used for the clock that is to be set. The CLOCK_REALTIME clock is supported and represents the TIME-OF-DAY clock for the system.tp
A pointer to a timespec data structure.
The clock_settime function sets the specified clock, clock_id, to the value specified by tp. Time values that are between two consecutive non-negative integer multiples of the resolution of the specified clock are truncated down to the smaller multiple of the resolution.A clock can be systemwide (that is, visible to all processes) or per-process (measuring time that is meaningful only within a process).
The CLOCK_REALTIME clock, defined in <time.h> , represents the realtime clock for the system. For this clock, the values specified by clock_settime and returned by clock_gettime represent the amount of time elapsed, in seconds and nanoseconds, since the Epoch. The Epoch is defined as 00:00:00:00 January 1, 1970 Greenwich Mean Time (GMT).
You must have OPER, LOG_IO, and SYSPRV privileges to use the clock_settime function.
On success, the function returns 0.
On failure, the function returns - 1 and sets errno to indicate the error.
See also clock_getres , clock_gettime , time , and ctime .
0 Indicates success. - 1 Indicates failure; errno is set to the following value:
- EINVAL -- The clock_id argument does not specify a known clock, or the tp argument is outside the range for the given clock_id or specifies a nanosecond value less than 0 or greater than or equal to 1 billion.
- EPERM -- The requesting process does not have the appropriate privilege to set the specified clock.
Returns the complex natural (base e) logarithm of its argument.
#include <complex.h>double complex clog (double complex z);
float complex clogf (float complex z);
long double complex clogl (long double complex z);
z
A complex value.
The clog functions return the complex natural (base e) logarithm of z, with a branch cut along the negative real axis.
x The complex natural logarithm value in the range of a strip mathematically unbounded along the real axis and in the interval [-iП, +iП] along the imaginary axis.
Previous | Next | Contents | Index |