| 23 | /* ---- producer callbacks ------------------------------------------------ */ |
| 24 | |
| 25 | static int hello_producer(lmpfs_handle_t /*eng*/, lmpfs_plugin_buffer_t* out) { |
| 26 | const char msg[] = "Hello from a MemNixFS plugin!\n" |
| 27 | "Loaded from sample_plugin.dll, served at\n" |
| 28 | "/plugins/sample_plugin/hello.txt.\n"; |
| 29 | out->length = sizeof(msg) - 1; |
| 30 | out->data = std::malloc(out->length); |
| 31 | if (!out->data) return -1; |
| 32 | std::memcpy(out->data, msg, out->length); |
| 33 | out->free_fn = nullptr; /* default to free() */ |
| 34 | return 0; |
| 35 | } |
| 36 | |
| 37 | static int pid_count_producer(lmpfs_handle_t eng, lmpfs_plugin_buffer_t* out) { |
| 38 | int n = lmpfs_process_count(eng); |
nothing calls this directly
no outgoing calls
no test coverage detected