This helps keeping the compiler happy while we refactor the global variables
into meshlink_handle_t one by one.
return errstr[errno];
}
+// TODO: hack, remove once all global variables are gone.
+static void set_mesh(meshlink_handle_t *localmesh) {
+ mesh = localmesh;
+}
+
static meshlink_handle_t *meshlink_setup(meshlink_handle_t *mesh) {
+ set_mesh(mesh);
return mesh;
}
return meshlink_close(mesh), NULL;
}
+ set_mesh(mesh);
return mesh;
}
void *priv;
};
+// This is a *temporary* global variable which will keep the compiler happy
+// while refactoring the code to get rid of global variables.
+// TODO: remove this when no other global variables remain.
+
+extern meshlink_handle_t *mesh;
+
#endif // MESHLINK_INTERNAL_H