|
tan
#include <math.h>
double tan (
double x
);
|
stand-alone
|
tan returns the tangent of its radian argument. You should check the magnitude of the argument to make sure the result is meaningful.
Common error: If you forget to include math.h, the compiler automatically declares a function returning int and will give unpredictable results.
|
|
tanh
#include <math.h>
double tanh (
double x
);
|
stand-alone
|
tanh returns the hyperbolic tangent of its argument. You should check the magnitude of the argument to make sure the result is meaningful.
Common error: If you forget to include math.h, the compiler automatically declares a function returning int and will give unpredictable results.
|
|
task_id
#include <application.h>
const char *task_id(void);
|
stand-alone
|
proc_id returns a pointer to a constant string that is the name used in the configuration file for the task running the code.
|
|
thread...
time
#include <time.h>
time_t time (
time_t *timer
);
|
server
|
The time function determines the current calendar time. The type (time_t) of the value returned by time is int. The value returned is the number of seconds that have elapsed sinc 00:00:00 GMT on 1st January, 1970, according to the host system clock.
If the timer argument is not a null pointer, the result of time is also assigned to the variable pointed to by time. Therefore, the time function can be used in either of two ways, as shown in the following example, where the two statements each assign the current calendar time to the variable t:
t = time((time_t *)0);
(void)time(&t);
Although the PC software on which time depends attempts to give you the time in GMT, by default it does this on the assumption that you are in the Pacific Standard Time zone. As most people in the world are not in that zone, you will almost certainly need to make the system aware of your actual time zone. Defining the MS-DOS environment variable TZ does this. For example, if you live in Great Britain, you could define TZ like this:
# set tz=GMT
# set tz=GMT1BST (during Summer Time)
|
|
timer_after
#include <timer.h>
int timer_after (
int t1,
int t2
);
|
stand-alone
|
This function returns non-zero if the kernel clock value t1 is after the kernel clock value t2, and zero otherwise. The kernel clock, available to threads of all priorities, ticks timer_rate() times per second.
|
|
timer_delay
#include <timer.h>
void timer_delay (
int d
);
|
stand-alone
|
This function causes the current thread to wait for at least d ticks of the kernel’s clock. This timer is used by threads of all priorities and ticks timer_rate() times per second.
|
|
timer_now
#include <timer.h>
int timer_now(void);
|
stand-alone
|
This function returns the current value of the kernel’s clock. This clock is used by threads of all priorities and ticks timer_rate() times per second.
|
|
timer_rate
#include <timer.h>
long int timer_rate(void);
|
stand-alone
|
This function returns the number of times the kernel’s clock ticks per second. This is usually 1000.
It is likely that the tick rate will be changed in future releases of Diamond. Applications should not assume any particular value for timer_rate.
|
|
timer_wait
#include <timer.h>
void timer_wait (
int t
);
|
stand-alone
|
This function causes the current thread to wait until the value of the kernel’s clock is t. This clock is used by threads of all priorities and ticks timer_rate() times per second. The function does not wait if the clock is already at or has passed time t.
timer_wait(t); is equivalent to timer_delay(t – timer_now());.
|
|
tmpfile
#include <stdio.h>
FILE *tmpfile(void);
|
server
|
This function creates a temporary binary file that will automatically be deleted at the end of the program run. The file is opened for update with wb+ mode.
|
|
tmpnam
#include <stdio.h>
char *tmpnam (
char *s
);
|
server
|
This function generates a unique filename that is not the name of any existing file. Despite the name of the function, a file opened with this name is not automatically deleted at the end of the program run. If the argument s is a null pointer, the filename is generated in an internal buffer; otherwise, s is assumed to be a pointer to an array of at least L_tmpnam chars, and the filename is written there. The value returned is in both cases a pointer to the place where the filename has been written. You may call tmpnam a maximum of TMP_MAX times, and each time it generates a different filename. The internal buffer is only guaranteed to remain unchanged until the next call to tmpnam.
In the current implementation, TMP_MAX is 1000016, and L_tmpnam is 9. The form of the generated filenames is tmp$nnnn, where nnnn is a hexadecimal number (using lower-case letters, rather than upper-case.)
|
|
tolower
#include <ctype.h>
int tolower (
int cval
);
|
stand-alone
|
If cval is the ASCII code for an upper-case letter, tolower returns the code for the corresponding lower-case letter. Otherwise, the value of cval is returned unchanged.
|
|
toupper
#include <ctype.h>
int toupper (
int cval
);
|
stand-alone
|
If cval is the ASCII code for a lower-case letter, toupper returns the code for the corresponding upper-case letter. Otherwise, the value of cval is returned unchanged.
|
|
|