![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#include <unistd.h>#include <sys/stat.h>#include "nilorea/n_common.h"#include "nilorea/n_log.h"#include "nilorea/n_disk_cache.h"#include <utime.h>Go to the source code of this file.
Macros | |
| #define | EX_DIR "ex_disk_cache.dir" |
| the scratch directory, made and removed by this example | |
| #define | ex_mkdir(p) |
| owner only elsewhere | |
Functions | |
| static int | exists (const char *path) |
| does a file exist | |
| static void | expect_true (const char *what, int ok) |
| record one check | |
| static int | has (const N_DISK_CACHE *cache, const char *key) |
is the entry for key there | |
| int | main (int argc, char **argv) |
| static int | process_args (int argc, char **argv) |
| read -V LOGLEVEL | |
| static void | put_aged (const N_DISK_CACHE *cache, const char *key, long ago) |
store 100 bytes under key and say it was last used ago seconds ago | |
| static void | write_foreign (const char *name) |
| write a small file that is not an entry | |
Variables | |
| static int | failures = 0 |
| static int | log_level = 3 |
| #define EX_DIR "ex_disk_cache.dir" |
the scratch directory, made and removed by this example
Definition at line 38 of file ex_disk_cache.c.
Referenced by main(), and write_foreign().
| #define ex_mkdir | ( | p | ) |
owner only elsewhere
Definition at line 34 of file ex_disk_cache.c.
Referenced by main().
|
static |
does a file exist
Definition at line 68 of file ex_disk_cache.c.
Referenced by has(), and main().
|
static |
|
static |
is the entry for key there
Definition at line 102 of file ex_disk_cache.c.
References exists(), key, and n_disk_cache_path().
Referenced by main().
| int main | ( | int | argc, |
| char ** | argv ) |
Definition at line 108 of file ex_disk_cache.c.
References EX_DIR, ex_mkdir, exists(), expect_true(), failures, has(), LOG_ERR, log_level, n_disk_cache_close(), n_disk_cache_dir(), n_disk_cache_expire(), n_disk_cache_get(), N_DISK_CACHE_NAME_LEN, n_disk_cache_open(), n_disk_cache_path(), n_disk_cache_prune(), n_disk_cache_prune_group(), n_disk_cache_put(), n_disk_cache_remove(), n_disk_cache_size(), process_args(), put_aged(), set_log_level(), and write_foreign().
|
static |
|
static |
store 100 bytes under key and say it was last used ago seconds ago
Definition at line 88 of file ex_disk_cache.c.
References key, n_disk_cache_path(), and n_disk_cache_put().
Referenced by main().
|
static |
write a small file that is not an entry
Definition at line 75 of file ex_disk_cache.c.
References EX_DIR.
Referenced by main().
|
static |
Definition at line 41 of file ex_disk_cache.c.
|
static |
Definition at line 40 of file ex_disk_cache.c.
Referenced by _n_log(), main(), main(), parse_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), process_args(), and set_log_level().