From 2547d4b3e77b67926fa9fe91d52cc76f6a5c41e1 Mon Sep 17 00:00:00 2001
From: mpc <mpc>
Date: Sat, 30 Oct 2004 12:41:18 +0000
Subject: [PATCH] *** empty log message ***

---
 apps/sam/c/inc/sam.h |  1 +
 apps/sam/c/src/sam.c | 69 ++++++++++++++++++++++----------------------
 2 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/apps/sam/c/inc/sam.h b/apps/sam/c/inc/sam.h
index 1b9d0eec4d..656ef978ab 100644
--- a/apps/sam/c/inc/sam.h
+++ b/apps/sam/c/inc/sam.h
@@ -35,6 +35,7 @@ extern "C" {
 #endif
 
 #include <stdbool.h>
+#include <stddef.h>
 #include <stdint.h>
 
 /*
diff --git a/apps/sam/c/src/sam.c b/apps/sam/c/src/sam.c
index 9f2902f5bc..d426ecea7e 100644
--- a/apps/sam/c/src/sam.c
+++ b/apps/sam/c/src/sam.c
@@ -122,8 +122,7 @@ bool sam_close(sam_sess_t *session)
  * tunneldepth - length of the I2P tunnels created by this program (longer is
  *		more anonymous, but slower)
  *
- * Returns: True on success, false on failure.  If true, `session' will be ready
- *		for use.
+ * Returns: SAM error code.  If SAM_OK, `session' will be ready for use.
  */
 samerr_t sam_connect(sam_sess_t *session, const char *samhost, uint16_t samport,
 	const char *destname, sam_conn_t style, uint_t tunneldepth)
@@ -791,39 +790,6 @@ void sam_sendq_flush(sam_sess_t *session, sam_sid_t stream_id,
 	return;
 }
 
-/*
- * Allocates memory for the session and sets its default values
- *
- * session - pointer to a previously allocated sam_sess_t to initalise, or NULL
- *		if you want memory to be allocated by this function
- */
-sam_sess_t *sam_session_init(sam_sess_t *session)
-{
-	if (session == NULL) {
-		session = malloc(sizeof(sam_sess_t));
-		if (session == NULL) {
-			SAMLOGS("Out of memory");
-			abort();
-		}
-	}
-	session->connected = false;
-	session->prev_id = 0;
-
-	return session;
-}
-
-/*
- * Frees memory used by the session and sets the pointer to NULL
- *
- * session - pointer to a pointer to a sam_sess_t
- */
-void sam_session_free(sam_sess_t **session)
-{
-	assert(*session != NULL);
-	free(*session);
-	*session = NULL;
-}
-
 /*
  * Sends the second SAM handshake command and checks the reply
  *
@@ -880,6 +846,39 @@ static samerr_t sam_session_create(sam_sess_t *session, const char *destname,
 		return SAM_UNKNOWN;
 }
 
+/*
+ * Allocates memory for the session and sets its default values
+ *
+ * session - pointer to a previously allocated sam_sess_t to initalise, or NULL
+ *		if you want memory to be allocated by this function
+ */
+sam_sess_t *sam_session_init(sam_sess_t *session)
+{
+	if (session == NULL) {
+		session = malloc(sizeof(sam_sess_t));
+		if (session == NULL) {
+			SAMLOGS("Out of memory");
+			abort();
+		}
+	}
+	session->connected = false;
+	session->prev_id = 0;
+
+	return session;
+}
+
+/*
+ * Frees memory used by the session and sets the pointer to NULL
+ *
+ * session - pointer to a pointer to a sam_sess_t
+ */
+void sam_session_free(sam_sess_t **session)
+{
+	assert(*session != NULL);
+	free(*session);
+	*session = NULL;
+}
+
 /*
  * Connects to a remote host and returns a connected descriptor
  *
-- 
GitLab