diff options
| author | 2025-11-16 20:52:57 -0600 | |
|---|---|---|
| committer | 2025-11-16 20:52:57 -0600 | |
| commit | d026e93405655129e46debfca2124ee132e9b134 (patch) | |
| tree | 8adf037dd69c4226ef9a5d2a3dd8fa63eb783761 /connection.c | |
| parent | [wip] plugin stuff (diff) | |
build config + more plugin stuff
Diffstat (limited to 'connection.c')
| -rw-r--r-- | connection.c | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/connection.c b/connection.c deleted file mode 100644 index ecbb7fa..0000000 --- a/connection.c +++ /dev/null @@ -1,45 +0,0 @@ -#include "connection.h" -#include "pipeline.h" -#include <stdlib.h> - -struct ptx_connection *ptx_connection_new(void) -{ - struct ptx_connection *conn = malloc(sizeof(struct ptx_connection)); - if (!conn) return NULL; - - /* initialize these in case we goto cleanup later */ - conn->cli_read = NULL; - conn->cli_write = NULL; - conn->srv_read = NULL; - conn->srv_write = NULL; - - /* do initialization */ - - if (!(conn->cli_read = ptx_pipeline_new(4))) goto cleanup; - if (!(conn->cli_write = ptx_pipeline_new(4))) goto cleanup; - if (!(conn->srv_read = ptx_pipeline_new(4))) goto cleanup; - if (!(conn->srv_write = ptx_pipeline_new(4))) goto cleanup; - - return conn; - -cleanup: - ptx_connection_free(conn); - - return NULL; -} - -void ptx_connection_free(struct ptx_connection *conn) -{ - /* NOTE: this function might be called with a partially-constructed or inconsistent object */ - - if (!conn) return; - - /* do cleanup */ - - ptx_pipeline_free(conn->cli_read); - ptx_pipeline_free(conn->cli_write); - ptx_pipeline_free(conn->srv_read); - ptx_pipeline_free(conn->srv_write); - - free(conn); -} |
