EDT PDV SDK Documentation 6.1.0
|
Functions | |
double | edt_dtime (void) |
Return the time in seconds since the last call to edt_dtime. More... | |
double | edt_timestamp (void) |
Gets the seconds + fractional seconds since the Epoch, OS independent. Uses system time; accuracy is OS dependent. More... | |
void | edt_msleep (int msecs) |
Causes the process to sleep for the specified number of milliseconds. More... | |
void | edt_usleep (int usecs) |
Causes process to sleep for specified number of microseconds. More... | |
void | edt_free (void *ptr) |
Convenience routine to free the memory allocated with edt_alloc. More... | |
void * | edt_alloc (size_t size) |
Convenience routine to allocate memory in a system-independent way. The buffer returned is page aligned. Uses VirtualAlloc on Windows NT systems, valloc on UNIX-based systems. More... | |
void | edt_closedir (DIRHANDLE h) |
Cross platform function to close a directory handle. More... | |
DIRHANDLE | edt_opendir (const char *dirname) |
Cross platform function to open a directory for reading. More... | |
int | edt_readdir (DIRHANDLE h, char *name) |
Cross platform function to read the next directory entry. More... | |
void | edt_correct_slashes (char *str) |
Change the slashes in str from forward to back or vice versa depending on whether it's Windows or Unix. More... | |
void | edt_fwd_to_back (char *str) |
void | edt_back_to_fwd (char *str) |
int | edt_access (const char *fname, int perm) |
Determines file access, independent of operating system. More... | |
Utility functions with OS-specific implementations.
double edt_dtime | ( | void | ) |
Return the time in seconds since the last call to edt_dtime.
Each time edt_dtime is called, it returns the time delta since the last time it was called. Therefore the first time edt_dtime is called in a process the delta may be meaningless. Time is in seconds and fractions of a second.
This call uses system time, which is system dependent and may be too coarse for some applications. For more accurate time stamping consider the IRIG option and an external IRIG timestamp source, available with some EDT boards.
double edt_timestamp | ( | void | ) |
Gets the seconds + fractional seconds since the Epoch, OS independent. Uses system time; accuracy is OS dependent.
void edt_msleep | ( | int | msecs | ) |
Causes the process to sleep for the specified number of milliseconds.
msecs | The number of milliseconds for the process to sleep. |
void edt_usleep | ( | int | usecs | ) |
Causes process to sleep for specified number of microseconds.
usecs | Number of microseconds for process to sleep. |
void edt_free | ( | void * | ptr | ) |
Convenience routine to free the memory allocated with edt_alloc.
ptr | Address of memory buffer to free. |
void * edt_alloc | ( | size_t | size | ) |
Convenience routine to allocate memory in a system-independent way. The buffer returned is page aligned. Uses VirtualAlloc on Windows NT systems, valloc on UNIX-based systems.
size | Number of bytes of memory to allocate. |
void edt_closedir | ( | DIRHANDLE | h | ) |
Cross platform function to close a directory handle.
h | Open directory handle. |
DIRHANDLE edt_opendir | ( | const char * | dirname | ) |
Cross platform function to open a directory for reading.
dirname | The name of the directory to open. |
int edt_readdir | ( | DIRHANDLE | h, |
char * | name | ||
) |
Cross platform function to read the next directory entry.
h | A handle for the directory, returned by edt_opendir. |
name | A pointer to a string into which the name of the next file in the directory will be written. The string must be allocated by the caller to at least 256 bytes. |
void edt_correct_slashes | ( | char * | str | ) |
Change the slashes in str from forward to back or vice versa depending on whether it's Windows or Unix.
str | String to process. |
void edt_fwd_to_back | ( | char * | str | ) |
fwd_to_back: for use by edt_correct_slashes
void edt_back_to_fwd | ( | char * | str | ) |
int edt_access | ( | const char * | fname, |
int | perm | ||
) |
Determines file access, independent of operating system.
This a convenience routine that maps to access() on Unix/Linux systems and _access() on Windows systems.
fname | Path name of file to check access permissions. |
perm | Permission flag(s) to test for. See documentation for access() (Unix/Linux) or _access() (Windows) for valid values. |
\Example