struct fd_info {
int fd;
- struct fd_ops *ops;
+ const struct fd_ops *ops;
const char *name;
void *priv_data;
};
bool should_filter;
};
-struct fd_info *fdi_create(struct fd_ops *ops, const char *name);
+struct fd_info *fdi_create(const struct fd_ops *ops, const char *name);
void fdi_free(struct fd_info *fdi);
void fdi_array_free(struct fd_info ***arr);
bool fdi_has_log(struct fd_info *fdi);
#include "fd_info.h"
-extern struct fd_ops ops_logger;
+extern const struct fd_ops ops_logger;
#include "fd_info.h"
-extern struct fd_ops ops_pipe;
+extern const struct fd_ops ops_pipe;
* @param[in] ops source-dependent operation set
* @return FD created struct or NULL on memory allocation failure
*/
-struct fd_info *fdi_create(struct fd_ops *ops, const char *name)
+struct fd_info *fdi_create(const struct fd_ops *ops, const char *name)
{
assert(ops);
return lpd->entry != NULL;
}
-struct fd_ops ops_logger = {
+const struct fd_ops ops_logger = {
.create = logger_create,
.destroy = logger_destroy,
.read = logger_read,
return ppd->eof;
}
-struct fd_ops ops_pipe = {
+const struct fd_ops ops_pipe = {
.create = pipe_create,
.destroy = pipe_destroy,
.read = pipe_read,