TinyMUSH 3.3
TinyMUSH Server
|
File cache management. More...
#include "config.h"
#include "constants.h"
#include "typedefs.h"
#include "macros.h"
#include "externs.h"
#include "prototypes.h"
#include <stdbool.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
Functions | |
void | do_list_file (dbref player, dbref cause __attribute__((unused)), int extra __attribute__((unused)), char *arg) |
Show text file. More... | |
FBLOCK * | fcache_fill (FBLOCK *fp, char ch) |
Add date to a file block. More... | |
int | fcache_read (FBLOCK **cp, char *filename) |
Read a file into cache. More... | |
void | fcache_rawdump (int fd, int num) |
Raw dump a cache file to a file descriptor. More... | |
void | fcache_dump (DESC *d, int num) |
Dump a file to a descriptor. More... | |
void | fcache_send (dbref player, int num) |
Send the content of a file cache to a player. More... | |
void | fcache_load (dbref player) |
Load all files into cache. More... | |
void | fcache_init (void) |
Initialize the file cache. More... | |
Variables | |
FCACHE | fcache [] |
Text files cache. More... | |
File cache management.
void do_list_file | ( | dbref | player, |
dbref cause | __attribute__(unused), | ||
int extra | __attribute__(unused), | ||
char * | arg | ||
) |
Show text file.
player | DBref of player |
cause | Not used |
extra | Not used |
arg | File to show |
void fcache_dump | ( | DESC * | d, |
int | num | ||
) |
Dump a file to a descriptor.
d | Descriptor |
num | Index of the file in the file cache |
Add date to a file block.
fp | File block |
ch | character to add |
We filled the current buffer. Go get a new one.
void fcache_init | ( | void | ) |
Initialize the file cache.
void fcache_load | ( | dbref | player | ) |
Load all files into cache.
player | DBref of player |
void fcache_rawdump | ( | int | fd, |
int | num | ||
) |
Raw dump a cache file to a file descriptor.
fd | File descriptor |
num | Index of the file in the file cache |
int fcache_read | ( | FBLOCK ** | cp, |
char * | filename | ||
) |
Read a file into cache.
cp | Cache buffer |
filename | File to read |
Free a prior buffer chain
Set up the initial cache buffer to make things easier
Read the text file into a new chain
Failure: log the event
Process the file, one lbuf at a time
If we didn't read anything in, toss the initial buffer
void fcache_send | ( | dbref | player, |
int | num | ||
) |
Send the content of a file cache to a player.
player | DBref of player |
num | Index of the file in the file cache |
FCACHE fcache[] |
Text files cache.