X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fsubmesh.h;h=d6122d8fd10f3bf8aedcbef7da26fe1aaf5eaf2a;hb=a5a8005b2d89712e124ab7295165a3e229abdad5;hp=958ce9c7baeed8ffb5246880768923662524935b;hpb=ed1f31db1e8840ffd6849b48bcad93e9975a24bb;p=meshlink diff --git a/src/submesh.h b/src/submesh.h index 958ce9c7..d6122d8f 100644 --- a/src/submesh.h +++ b/src/submesh.h @@ -2,8 +2,8 @@ #define MESHLINK_SUBMESH_H /* - submesh.h -- header for node.c - Copyright (C) 2014, 2017 Guus Sliepen + submesh.h -- header for submesh.c + Copyright (C) 2019 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,19 +22,20 @@ #include "meshlink_internal.h" +#define CORE_MESH "." + typedef struct submesh_t { char *name; /* name of this Sub-Mesh */ void *priv; - struct meshlink_handle *mesh; /* the mesh this submesh belongs to */ + struct meshlink_handle *mesh; /* the mesh this submesh belongs to */ } submesh_t; extern void init_submeshes(struct meshlink_handle *mesh); extern void exit_submeshes(struct meshlink_handle *mesh); -extern submesh_t *new_submesh(void) __attribute__((__malloc__)); -extern void free_submesh(submesh_t *); -extern void submesh_add(struct meshlink_handle *mesh, submesh_t *); -extern void submesh_del(struct meshlink_handle *mesh, submesh_t *); +extern submesh_t *create_submesh(struct meshlink_handle *mesh, const char *); extern submesh_t *lookup_submesh(struct meshlink_handle *mesh, const char *); +extern submesh_t *lookup_or_create_submesh(struct meshlink_handle *mesh, const char *); +extern bool submesh_allows_node(const submesh_t *submesh, const struct node_t *node); #endif