#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "host.h"
#include "tprintf.h"
#include "cutil_class.h"
Go to the source code of this file.
◆ _ARGS
◆ CHARS_PER_LINE
#define CHARS_PER_LINE 500 |
◆ FALSE
◆ new_line
◆ print_string
#define print_string |
( |
|
str | ) |
printf ("%s\n", str) |
◆ TRUE
◆ _ARGS
typedef void* void_star_proc _ARGS((...)) |
◆ int_compare
typedef int(* int_compare) (void *, void *) |
◆ int_void
typedef int(* int_void) (void) |
◆ void_dest
typedef void(* void_dest) (void *) |
◆ void_proc
typedef void(* void_proc) (...) |
◆ void_void
typedef void(* void_void) (void) |
◆ exists_file()
bool exists_file |
( |
const char * |
filename | ) |
|
Check whether the file exists.
Definition at line 92 of file cutil.cpp.
95 if ((f = fopen(
filename,
"rb")) != NULL) {
◆ long_rand()
long long_rand |
( |
long |
limit | ) |
|
Definition at line 56 of file cutil.cpp.
57 #if RAND_MAX < 0x1000000 61 num = (long) rand () << 16;
62 num |= rand () & 0xffff;
64 long result = num % limit;
70 return (
long)((double)limit * rand()/(RAND_MAX + 1.0));
◆ open_file()
FILE* open_file |
( |
const char * |
filename, |
|
|
const char * |
mode |
|
) |
| |
Definition at line 82 of file cutil.cpp.
83 FILE *thisfile = NULL;