]> arthur.barton.de Git - netatalk.git/blobdiff - doc/DEVELOPER
Merge master
[netatalk.git] / doc / DEVELOPER
index 888606af579e9746342f7a88338e8444c6f3da09..297398f7430aafa7351776001615b4ef3486a565 100644 (file)
@@ -3,10 +3,11 @@ Information for Netatalk Developers
 
 For basic installation instructions, see the INSTALL file.
 
-Netatalk is an implementation of the AppleTalk Protocol Suite and
-the Apple Filing Protocol (AFP).  The current release contains support
-for EtherTalk Phase I and II, DDP, RTMP, NBP, ZIP, AEP, ATP, PAP, ASP
-and AFP.  The complete stack looks like this on a BSD-derived system:
+Netatalk is an implementation of "AFP over TCP".
+Netatalk also support the AppleTalk Protocol Suite for legacy Macs.
+The current release contains support for EtherTalk Phase I and II, 
+DDP, RTMP, NBP, ZIP, AEP, ATP, PAP, ASP, AFP and DSI.
+The complete stack looks like this on a BSD-derived system:
 
     AFP                          AFP
      |                            |
@@ -24,6 +25,7 @@ and AFP.  The complete stack looks like this on a BSD-derived system:
     |                Network-Interface                  |
     +---------------------------------------------------+
 
+DSI is a session layer used to carry AFP over TCP.
 DDP is in the kernel.  "atalkd" implements RTMP, NBP, ZIP, and AEP.  It
 is the AppleTalk equivalent of Unix "routed".  There is also a
 client-stub library for NBP.  ATP and ASP are implemented as
@@ -66,23 +68,7 @@ Libtool encapsulates the platform specific dependencies for the
 creation of libraries. It determines if the local platform can support
 shared libraries or if it only supports static libraries.
 
-Netatalk currently requires libtool 1.4 or higher (1.4b for OpenBSD).
-If you are using Tru64 you must apply the following patch to the file
-acinclude.m4 (normally found in /usr/share/libtool/libltdl).
-
---- acinclude.m4.old   Tue Nov 20 15:30:23 2001
-+++ acinclude.m4       Tue Nov 20 15:31:54 2001
-@@ -2226,6 +2226,7 @@
- osf3* | osf4* | osf5*)
-   version_type=osf
-+  need_lib_prefix=no
-   need_version=no
-   soname_spec='${libname}${release}.so'
-   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
-
 Documentation: http://www.gnu.org/software/libtool/
-Program: (see the GNU mirrors) /gnu/libtool/libtool-1.4.tar.gz
 
 2. GNU m4
 GNU m4 is an implementation of the Unix macro processor. It reads
@@ -90,20 +76,17 @@ stdin and copies to stdout expanding defined macros as it processes
 the text.
 
 Documentation: http://www.gnu.org/software/m4/
-Program: (see the GNU mirrors) /gnu/m4/m4-1.4.tar.gz
 
 3. Autoconf
 Autoconf is a package of m4 macros that produce shell scripts to
 configure source code packages.
 
 Documentation: http://www.gnu.org/software/autoconf/
-Program: (see the GNU mirrors) /gnu/autoconf/autoconf-2.52.tar.gz
 
 4. Automake
 Automake is a tool that generates  'Makefile.in' files.
 
 Documentation: http://www.gnu.org/software/automake/
-Program: (see the GNU mirrors) /gnu/automake/automake-1.5.tar.gz
 
 Optional
 ========
@@ -142,16 +125,96 @@ Author: Andrew Morgan <morgan@linux.kernel.org>
 
 Linux-PAM is a suite of shared libraries that enable the local system
 administrator to choose how applications authenticate users.
-
 You can get the Linux PAM documentation and sources from
 http://www.kernel.org/pub/linux/libs/pam/
-
 Netatalk also supports other standard PAM implementations such as OpenPAM.
 
-8 Berkeley DB
+8. Berkeley DB
 Berkeley DB is a programmatic toolkit that provides fast, reliable,
 scalable, and mission-critical database support to software
 developers. BDB can downloaded from
 http://www.oracle.com/database/berkeley-db/index.html
 Netatalk's CNID database uses the library and header files from BDB.
-Currently, Netatalk supports BDB 4.4 and later.
+Currently, Netatalk supports BDB 4.6 and later.
+
+Error checking and logging
+==========================
+We wan't rigid error checking and concise log messages. This often leads
+to signifant code bloat where the relevant function call is buried in error
+checking and logging statements.
+In order to alleviate error checking and code readability, we provide a set
+of error checking macros in <atalk/errchk.h>. These macros compare the return
+value of statements againt 0, NULL, -1 (and maybe more, check it out).
+Every macro comes in four flavours: EC_CHECK, EC_CHECK_LOG, EC_CHECK_LOG_ERR
+and EC_CHECK_CUSTOM:
+- EC_CHECK just checks the CHECK
+- EC_CHECK_LOG additionally logs the stringified function call.
+- EC_CHECK_LOG_ERR allows specifying the return value
+- EC_CHECK_CUSTOM allows custom actions
+The macros EC_CHECK* unconditionally jump to a cleanup label where the
+neccessary cleanup can be done alongside controlling the return value.
+EC_CHECK_CUSTOM doesn't do that, so an extra "goto EC_CLEANUP" may be
+performed as appropiate.
+
+Example:
+- stat() without EC macro:
+  static int func(const char *name) {
+    int ret = 0;
+    ...
+    if ((ret = stat(name, &some_struct_stat)) != 0) {
+      LOG(...);
+      ret = -1; /* often needed to explicitly set the error indicating return value */
+      goto cleanup;
+    }
+
+    return ret;
+
+  cleanup:
+    ...
+    return ret;
+  }
+
+- stat() with EC macro:
+  static int func(const char *name) {
+    EC_INIT; /* expands to int ret = 0; */
+
+    char *uppername = NULL
+    EC_NULL(uppername = strdup(name));
+    EC_ZERO(strtoupper(uppername));
+
+    EC_ZERO(stat(uppername, &some_struct_stat)); /* expands to complete if block from above */
+
+    EC_STATUS(0);
+
+EC_CLEANUP:
+    if (uppername) free(uppername);
+    EC_EXIT;
+  }
+
+A boileplate function template is:
+
+int func(void)
+{
+    EC_INIT;
+
+    ...your code here...
+
+    EC_STATUS(0);
+
+EC_CLEANUP:
+    EC_EXIT;
+}
+
+Ini Parser
+==========
+
+The ini parser is taken from <http://ndevilla.free.fr/iniparser/>.
+It has been slightly modified:
+- case-sensitive
+- "include" directive added
+- iniparser_getstrdup() to complemnt iniparser_getstring(), it return allocated strings
+  which the caller must free as necessary
+- the API has been modifed such that all iniparser_get* funcs take a section and a parameter
+  as sepereta args instead of one string of the form "section:parameter" in the original
+  library
+