1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-23 00:00:01 +01:00
VILLASnode/server/include/file.h
2015-05-07 13:01:18 +02:00

54 lines
No EOL
1.3 KiB
C

/** Node type: File
*
* This file implements the file type for nodes.
*
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
* @copyright 2015, Institute for Automation of Complex Power Systems, EONERC
* @file
* @addtogroup file File-IO node type
* @{
*/
#ifndef _FILE_H_
#define _FILE_H_
#include "node.h"
struct file {
FILE *in;
FILE *out;
const char *path_in;
const char *path_out;
const char *mode; /**< The mode for fopen() which is used for the out file. */
double rate; /**< The sending rate. */
int tfd; /**< Timer file descriptor. Blocks until 1/rate seconds are elapsed. */
};
/** @see node_vtable::init */
int file_init(int argc, char *argv[], struct settings *set);
/** @see node_vtable::deinit */
int file_deinit();
/** @see node_vtable::print */
int file_print(struct node *n, char *buf, int len);
/** @see node_vtable::parse */
int file_parse(config_setting_t *cfg, struct node *n);
/** @see node_vtable::open */
int file_open(struct node *n);
/** @see node_vtable::close */
int file_close(struct node *n);
/** @see node_vtable::read */
int file_read(struct node *n, struct msg *pool, int poolsize, int first, int cnt);
/** @see node_vtable::write */
int file_write(struct node *n, struct msg *pool, int poolsize, int first, int cnt);
#endif /** _FILE_H_ @} */