Stubs for function man pages added

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 164d07e..f14f921 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -42,6 +42,20 @@
         sp_ipc.7
         sp_tcp.7
 
+        #  Functions.
+        sp_version.3
+        sp_errno.3
+        sp_strerror.3
+        sp_init.3
+        sp_term.3
+        sp_socket.3
+        sp_close.3
+        sp_bind.3
+        sp_connect.3
+        sp_shutdown.3
+        sp_send.3
+        sp_recv.3
+
         )
 
     #  Generate the rules to build the documentation.
diff --git a/doc/nanomsg.7.txt b/doc/nanomsg.7.txt
index c6b68f8..38a8a17 100644
--- a/doc/nanomsg.7.txt
+++ b/doc/nanomsg.7.txt
@@ -15,6 +15,50 @@
 DESCRIPTION
 -----------
 
+Following functions are exported by nanomsg library:
+
+Initialise the library::
+    linknanomsg:sp_init[3]
+
+Uninitialise the library::
+    linknanomsg:sp_term[3]
+
+Create an SP socket::
+    linknanomsg:sp_socket[3]
+
+Close an SP socket::
+    linknanomsg:sp_close[3]
+
+Set a socket option::
+    linknanomsg:sp_setsockopt[3]
+
+Retreive a socket option::
+    linknanomsg:sp_getsockopt[3]
+
+Add a local endpoint to the socket::
+    linknanomsg:sp_bind[3]
+
+Add a remote endpoint to the socket::
+    linknanomsg:sp_connect[3]
+
+Remove an endpoint from the socket::
+    linknanomsg:sp_shutdown[3]
+
+Send a message::
+    linknanomsg:sp_send[3]
+
+Receive a message::
+    linknanomsg:sp_recv[3]
+
+Retreive the current errno::
+    linknanomsg:sp_errno[3]
+
+Convert an error number into human-readable string::
+    linknanomsg:sp_strerror[3]
+
+Report the version of nanomsg library::
+    linknanomsg:sp_version[3]
+
 Following messaging patterns are provided by nanomsg:
 
 One-to-one communication pattern::
diff --git a/doc/sp_bind.3.txt b/doc/sp_bind.3.txt
new file mode 100644
index 0000000..e9be2f2
--- /dev/null
+++ b/doc/sp_bind.3.txt
@@ -0,0 +1,15 @@
+sp_bind(3)
+==========
+
+NAME
+----
+sp_bind - add a local endpoint to the socket
+
+
+SYNOPSIS
+--------
+int sp_bind (int s, const char *addr);
+
+DESCRIPTION
+-----------
+Blah-blah.
diff --git a/doc/sp_close.3.txt b/doc/sp_close.3.txt
new file mode 100644
index 0000000..a476cc0
--- /dev/null
+++ b/doc/sp_close.3.txt
@@ -0,0 +1,16 @@
+sp_close(3)
+===========
+
+NAME
+----
+sp_close - close an SP socket
+
+
+SYNOPSIS
+--------
+int sp_close (int s);
+
+
+DESCRIPTION
+-----------
+Blah-blah.
diff --git a/doc/sp_connect.3.txt b/doc/sp_connect.3.txt
new file mode 100644
index 0000000..7b4bc99
--- /dev/null
+++ b/doc/sp_connect.3.txt
@@ -0,0 +1,15 @@
+sp_connect(3)
+=============
+
+NAME
+----
+sp_connect - add a remote endpoint to the socket
+
+
+SYNOPSIS
+--------
+int sp_connect (int s, const char *addr);
+
+DESCRIPTION
+-----------
+Blah-blah.
diff --git a/doc/sp_errno.3.txt b/doc/sp_errno.3.txt
new file mode 100644
index 0000000..5640dea
--- /dev/null
+++ b/doc/sp_errno.3.txt
@@ -0,0 +1,16 @@
+sp_errno(3)
+===========
+
+NAME
+----
+sp_errno - retreive the current errno
+
+
+SYNOPSIS
+--------
+int sp_errno (void);
+
+
+DESCRIPTION
+-----------
+Blah-blah.
diff --git a/doc/sp_getsockopt.3.txt b/doc/sp_getsockopt.3.txt
new file mode 100644
index 0000000..78b15cc
--- /dev/null
+++ b/doc/sp_getsockopt.3.txt
@@ -0,0 +1,15 @@
+sp_getsockopt(3)
+================
+
+NAME
+----
+sp_getsockopt - retreive a socket option
+
+
+SYNOPSIS
+--------
+int sp_getsockopt (int s, int level, int option, void *optval, size_t *optvallen);
+
+DESCRIPTION
+-----------
+Blah-blah.
diff --git a/doc/sp_init.3.txt b/doc/sp_init.3.txt
new file mode 100644
index 0000000..7a5e0d5
--- /dev/null
+++ b/doc/sp_init.3.txt
@@ -0,0 +1,16 @@
+sp_init(3)
+==========
+
+NAME
+----
+sp_init - initialise the nanomsg library
+
+
+SYNOPSIS
+--------
+int sp_init (void);
+
+
+DESCRIPTION
+-----------
+Blah-blah.
diff --git a/doc/sp_recv.3.txt b/doc/sp_recv.3.txt
new file mode 100644
index 0000000..0a59ced
--- /dev/null
+++ b/doc/sp_recv.3.txt
@@ -0,0 +1,15 @@
+sp_send(3)
+==========
+
+NAME
+----
+sp_recv - receive a message
+
+
+SYNOPSIS
+--------
+int sp_recv (int s, void *buf, size_t len, int flags);
+
+DESCRIPTION
+-----------
+Blah-blah.
diff --git a/doc/sp_send.3.txt b/doc/sp_send.3.txt
new file mode 100644
index 0000000..e09ca2c
--- /dev/null
+++ b/doc/sp_send.3.txt
@@ -0,0 +1,15 @@
+sp_send(3)
+==========
+
+NAME
+----
+sp_send - send a message
+
+
+SYNOPSIS
+--------
+int sp_send (int s, const void *buf, size_t len, int flags);
+
+DESCRIPTION
+-----------
+Blah-blah.
diff --git a/doc/sp_setsockopt.3.txt b/doc/sp_setsockopt.3.txt
new file mode 100644
index 0000000..a9f548d
--- /dev/null
+++ b/doc/sp_setsockopt.3.txt
@@ -0,0 +1,16 @@
+sp_setsockopt(3)
+================
+
+NAME
+----
+sp_setsockopt - set a socket option
+
+
+SYNOPSIS
+--------
+int sp_setsockopt (int s, int level, int option, const void *optval, size_t optvallen);
+
+
+DESCRIPTION
+-----------
+Blah-blah.
diff --git a/doc/sp_shutdown.3.txt b/doc/sp_shutdown.3.txt
new file mode 100644
index 0000000..4da500b
--- /dev/null
+++ b/doc/sp_shutdown.3.txt
@@ -0,0 +1,15 @@
+sp_shutdown(3)
+==============
+
+NAME
+----
+sp_shutdown - remove an endpoint from a socket
+
+
+SYNOPSIS
+--------
+int sp_shutdown (int s, int how);
+
+DESCRIPTION
+-----------
+Blah-blah.
diff --git a/doc/sp_socket.3.txt b/doc/sp_socket.3.txt
new file mode 100644
index 0000000..e6d4133
--- /dev/null
+++ b/doc/sp_socket.3.txt
@@ -0,0 +1,16 @@
+sp_socket(3)
+============
+
+NAME
+----
+sp_socket - create an SP socket
+
+
+SYNOPSIS
+--------
+int sp_socket (int domain, int protocol);
+
+
+DESCRIPTION
+-----------
+Blah-blah.
diff --git a/doc/sp_strerror.3.txt b/doc/sp_strerror.3.txt
new file mode 100644
index 0000000..a3a29e6
--- /dev/null
+++ b/doc/sp_strerror.3.txt
@@ -0,0 +1,16 @@
+sp_strerror(3)
+==============
+
+NAME
+----
+sp_strerror - convert an error number into human-readable string
+
+
+SYNOPSIS
+--------
+const char *sp_strerror (int errnum);
+
+
+DESCRIPTION
+-----------
+Blah-blah.
diff --git a/doc/sp_term.3.txt b/doc/sp_term.3.txt
new file mode 100644
index 0000000..a0483ee
--- /dev/null
+++ b/doc/sp_term.3.txt
@@ -0,0 +1,16 @@
+sp_term(3)
+==========
+
+NAME
+----
+sp_term - uninitialise the nanomsg library
+
+
+SYNOPSIS
+--------
+int sp_term (void);
+
+
+DESCRIPTION
+-----------
+Blah-blah.
diff --git a/doc/sp_version.3.txt b/doc/sp_version.3.txt
new file mode 100644
index 0000000..6809839
--- /dev/null
+++ b/doc/sp_version.3.txt
@@ -0,0 +1,15 @@
+sp_version(3)
+=============
+
+NAME
+----
+sp_version - report the version of nanomsg library
+
+
+SYNOPSIS
+--------
+void sp_version (int *major, int *minor, int *patch);
+
+DESCRIPTION
+-----------
+Blah-blah.