Index: sd-reader_config.h
===================================================================
--- sd-reader_config.h	(.../sd-reader_release_20081121)	(Revision 143)
+++ sd-reader_config.h	(.../sd-reader_release_20090330)	(Revision 143)
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006-2008 by Roland Riegel <feedback@roland-riegel.de>
+ * Copyright (c) 2006-2009 by Roland Riegel <feedback@roland-riegel.de>
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of either the GNU General Public License version 2
@@ -11,6 +11,11 @@
 #ifndef SD_READER_CONFIG_H
 #define SD_READER_CONFIG_H
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 /**
  * \addtogroup config Sd-reader configuration
  *
@@ -40,5 +45,9 @@
  * @}
  */
 
+#ifdef __cplusplus
+}
 #endif
 
+#endif
+
Index: byteordering.h
===================================================================
--- byteordering.h	(.../sd-reader_release_20081121)	(Revision 143)
+++ byteordering.h	(.../sd-reader_release_20090330)	(Revision 143)
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006-2008 by Roland Riegel <feedback@roland-riegel.de>
+ * Copyright (c) 2006-2009 by Roland Riegel <feedback@roland-riegel.de>
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of either the GNU General Public License version 2
@@ -13,6 +13,11 @@
 
 #include <stdint.h>
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 /**
  * \addtogroup byteordering
  *
@@ -131,5 +136,9 @@
 uint32_t htol32(uint32_t h);
 #endif
 
+#ifdef __cplusplus
+}
 #endif
 
+#endif
+
Index: partition_config.h
===================================================================
--- partition_config.h	(.../sd-reader_release_20081121)	(Revision 143)
+++ partition_config.h	(.../sd-reader_release_20090330)	(Revision 143)
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006-2008 by Roland Riegel <feedback@roland-riegel.de>
+ * Copyright (c) 2006-2009 by Roland Riegel <feedback@roland-riegel.de>
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of either the GNU General Public License version 2
@@ -11,6 +11,11 @@
 #ifndef PARTITION_CONFIG_H
 #define PARTITION_CONFIG_H
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 /**
  * \addtogroup partition
  *
@@ -31,5 +36,9 @@
  * @}
  */
 
+#ifdef __cplusplus
+}
 #endif
 
+#endif
+
Index: fat_config.h
===================================================================
--- fat_config.h	(.../sd-reader_release_20081121)	(Revision 143)
+++ fat_config.h	(.../sd-reader_release_20090330)	(Revision 143)
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006-2008 by Roland Riegel <feedback@roland-riegel.de>
+ * Copyright (c) 2006-2009 by Roland Riegel <feedback@roland-riegel.de>
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of either the GNU General Public License version 2
@@ -14,6 +14,11 @@
 #include <stdint.h>
 #include "sd_raw_config.h"
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 /**
  * \addtogroup fat
  *
@@ -97,5 +102,9 @@
     typedef uint16_t cluster_t;
 #endif
 
+#ifdef __cplusplus
+}
 #endif
 
+#endif
+
Index: ChangeLog
===================================================================
--- ChangeLog	(.../sd-reader_release_20081121)	(Revision 143)
+++ ChangeLog	(.../sd-reader_release_20090330)	(Revision 143)
@@ -1,20 +1,30 @@
 
+2009-03-30 sd-reader
+	* Make 8.3 basename and/or extension lowercase when told by Windows NT and later.
+	* Add ATmega328 pin configuration.
+	* Fix MMC/SD/SDHC distinction.
+	* Fix raw block read/write buffering (thanks to Kurt Sterckx).
+	* Fix fat size calculation for FAT16 when configured with FAT32.
+	* Fix compilation for read-only configurations.
+	* Fix card lock detection.
+	* Make it easier to link with a C++ application.
+
 2008-11-21 sd-reader
-	* support for SDHC cards (disabled by default)
-	* support for FAT32 (disabled by default)
+	* Support for SDHC cards (disabled by default).
+	* Support for FAT32 (disabled by default).
 
 2008-06-08 sd-reader
-	* new "init" command to allow reinitialization of memory card
-	* fix searching through multi-cluster directories
-	* fix reading directory entries spanning a cluster border (backport from mega-eth)
-	* do not abort the whole lfn entry when the file name is too long, just drop single characters (backport from mega-eth)
-	* change fat16_get_dir_entry_of_path() to ignore a slash at the end (backport from mega-eth)
-	* make listing a directory's content much faster (backport from mega-eth)
-	* shrink code size by centralizing cluster offset calculation (backport from mega-eth)
-	* some other small fixes and optimizations
+	* New "init" command to allow reinitialization of memory card.
+	* Fix searching through multi-cluster directories.
+	* Fix reading directory entries spanning a cluster border (backport from mega-eth).
+	* Do not abort the whole lfn entry when the file name is too long, just drop single characters (backport from mega-eth).
+	* Change fat16_get_dir_entry_of_path() to ignore a slash at the end (backport from mega-eth).
+	* Make listing a directory's content much faster (backport from mega-eth).
+	* Shrink code size by centralizing cluster offset calculation (backport from mega-eth).
+	* Some other small fixes and optimizations.
 
 2007-12-13 sd-reader
-	* dual-license the major implementation modules under GPL and LGPL
+	* Dual-license the major implementation modules under GPL and LGPL.
 
 2007-06-03 sd-reader
 	* Fix reading beyond cached block (by Benjamin Meier).
@@ -29,9 +39,9 @@
 	* Fix fat16_clear_cluster() which was zeroing only 16 of every 32 bytes.
 
 2007-01-20 sd-reader
-	* fix directory creation
-	  - correctly create "." and ".." directory entries (8.3 <-> lfn versions)
-	  - correctly clear cluster containing the directory entries for new directory
+	* Fix directory creation.
+	  - Correctly create "." and ".." directory entries (8.3 <-> lfn versions).
+	  - Correctly clear cluster containing the directory entries for new directory.
 
 2006-11-01 sd-reader
 	* Implement creation and deletion of directories.
Index: sd_raw_config.h
===================================================================
--- sd_raw_config.h	(.../sd-reader_release_20081121)	(Revision 143)
+++ sd_raw_config.h	(.../sd-reader_release_20090330)	(Revision 143)
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006-2008 by Roland Riegel <feedback@roland-riegel.de>
+ * Copyright (c) 2006-2009 by Roland Riegel <feedback@roland-riegel.de>
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of either the GNU General Public License version 2
@@ -13,6 +13,11 @@
 
 #include <stdint.h>
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 /**
  * \addtogroup sd_raw
  *
@@ -70,7 +75,8 @@
 #if defined(__AVR_ATmega8__) || \
     defined(__AVR_ATmega48__) || \
     defined(__AVR_ATmega88__) || \
-    defined(__AVR_ATmega168__)
+    defined(__AVR_ATmega168__) || \
+    defined(__AVR_ATmega328__)
     #define configure_pin_mosi() DDRB |= (1 << DDB3)
     #define configure_pin_sck() DDRB |= (1 << DDB5)
     #define configure_pin_ss() DDRB |= (1 << DDB2)
@@ -122,5 +128,9 @@
 #define SD_RAW_WRITE_BUFFERING 0
 #endif
 
+#ifdef __cplusplus
+}
 #endif
 
+#endif
+
Index: partition.c
===================================================================
--- partition.c	(.../sd-reader_release_20081121)	(Revision 143)
+++ partition.c	(.../sd-reader_release_20090330)	(Revision 143)
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006-2008 by Roland Riegel <feedback@roland-riegel.de>
+ * Copyright (c) 2006-2009 by Roland Riegel <feedback@roland-riegel.de>
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of either the GNU General Public License version 2
Index: fat.c
===================================================================
--- fat.c	(.../sd-reader_release_20081121)	(Revision 143)
+++ fat.c	(.../sd-reader_release_20090330)	(Revision 143)
@@ -1,6 +1,6 @@
 
 /* 
- * Copyright (c) 2006-2008 by Roland Riegel <feedback@roland-riegel.de>
+ * Copyright (c) 2006-2009 by Roland Riegel <feedback@roland-riegel.de>
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of either the GNU General Public License version 2
@@ -383,7 +383,7 @@
                          partition_offset +
                          /* jump to fat */
                          (offset_t) reserved_sectors * bytes_per_sector;
-    header->fat_size = (data_cluster_count + 2) * sizeof(cluster_t);
+    header->fat_size = (data_cluster_count + 2) * (partition->type == PARTITION_TYPE_FAT16 ? 2 : 4);
 
     header->sector_size = bytes_per_sector;
     header->cluster_size = (uint16_t) bytes_per_sector * sectors_per_cluster;
@@ -1566,6 +1566,14 @@
                 if(raw_entry[i] == ' ')
                     break;
                 long_name[i] = raw_entry[i];
+
+                /* Windows NT and later versions do not store LFN entries
+                 * for 8.3 names which have a lowercase basename, extension
+                 * or both when everything else is uppercase. They use two
+                 * extra bits to signal a lowercase basename or extension.
+                 */
+                if((raw_entry[12] & 0x08) && raw_entry[i] >= 'A' && raw_entry[i] <= 'Z')
+                    long_name[i] += 'a' - 'A';
             }
             if(long_name[0] == 0x05)
                 long_name[0] = (char) FAT_DIRENTRY_DELETED;
@@ -1577,14 +1585,17 @@
                 uint8_t j = 8;
                 for(; j < 11; ++j)
                 {
-                    if(raw_entry[j] != ' ')
-                    {
-                        long_name[i++] = raw_entry[j];
-                    }
-                    else
-                    {
+                    if(raw_entry[j] == ' ')
                         break;
-                    }
+                    long_name[i] = raw_entry[j];
+
+                    /* See above for the lowercase 8.3 name handling of
+                     * Windows NT and later.
+                     */
+                    if((raw_entry[12] & 0x10) && raw_entry[j] >= 'A' && raw_entry[j] <= 'Z')
+                        long_name[i] += 'a' - 'A';
+
+                    ++i;
                 }
             } 
 
Index: uart.c
===================================================================
--- uart.c	(.../sd-reader_release_20081121)	(Revision 143)
+++ uart.c	(.../sd-reader_release_20090330)	(Revision 143)
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006-2008 by Roland Riegel <feedback@roland-riegel.de>
+ * Copyright (c) 2006-2009 by Roland Riegel <feedback@roland-riegel.de>
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
Index: partition.h
===================================================================
--- partition.h	(.../sd-reader_release_20081121)	(Revision 143)
+++ partition.h	(.../sd-reader_release_20090330)	(Revision 143)
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006-2008 by Roland Riegel <feedback@roland-riegel.de>
+ * Copyright (c) 2006-2009 by Roland Riegel <feedback@roland-riegel.de>
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of either the GNU General Public License version 2
@@ -15,6 +15,11 @@
 #include "sd_raw_config.h"
 #include "partition_config.h"
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 /**
  * \addtogroup partition
  *
@@ -199,5 +204,9 @@
  * @}
  */
 
+#ifdef __cplusplus
+}
 #endif
 
+#endif
+
Index: fat.h
===================================================================
--- fat.h	(.../sd-reader_release_20081121)	(Revision 143)
+++ fat.h	(.../sd-reader_release_20090330)	(Revision 143)
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006-2008 by Roland Riegel <feedback@roland-riegel.de>
+ * Copyright (c) 2006-2009 by Roland Riegel <feedback@roland-riegel.de>
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of either the GNU General Public License version 2
@@ -14,6 +14,11 @@
 #include <stdint.h>
 #include "fat_config.h"
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 /**
  * \addtogroup fat
  *
@@ -116,5 +121,9 @@
  * @}
  */
 
+#ifdef __cplusplus
+}
 #endif
 
+#endif
+
Index: sd_raw.c
===================================================================
--- sd_raw.c	(.../sd-reader_release_20081121)	(Revision 143)
+++ sd_raw.c	(.../sd-reader_release_20090330)	(Revision 143)
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006-2008 by Roland Riegel <feedback@roland-riegel.de>
+ * Copyright (c) 2006-2009 by Roland Riegel <feedback@roland-riegel.de>
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of either the GNU General Public License version 2
@@ -441,14 +441,14 @@
  */
 uint8_t sd_raw_read(offset_t offset, uint8_t* buffer, uintptr_t length)
 {
-    uint32_t block_address;
+    offset_t block_address;
     uint16_t block_offset;
     uint16_t read_length;
     while(length > 0)
     {
         /* determine byte count to read at once */
-        block_address = offset / 512;
         block_offset = offset & 0x01ff;
+        block_address = offset - block_offset;
         read_length = 512 - block_offset; /* read up to block border */
         if(read_length > length)
             read_length = length;
@@ -468,9 +468,9 @@
 
             /* send single block request */
 #if SD_RAW_SDHC
-            if(sd_raw_send_command(CMD_READ_SINGLE_BLOCK, ((sd_raw_card_type & SD_RAW_SPEC_SDHC) ? block_address : block_address * 512)))
+            if(sd_raw_send_command(CMD_READ_SINGLE_BLOCK, (sd_raw_card_type & (1 << SD_RAW_SPEC_SDHC) ? block_address / 512 : block_address)))
 #else
-            if(sd_raw_send_command(CMD_READ_SINGLE_BLOCK, block_address * 512))
+            if(sd_raw_send_command(CMD_READ_SINGLE_BLOCK, block_address))
 #endif
             {
                 unselect_card();
@@ -586,9 +586,9 @@
         
         /* send single block request */
 #if SD_RAW_SDHC
-        if(sd_raw_send_command(CMD_READ_SINGLE_BLOCK, ((sd_raw_card_type & SD_RAW_SPEC_SDHC) ? (uint32_t) offset & 0xfffffe00 : offset / 512)))
+        if(sd_raw_send_command(CMD_READ_SINGLE_BLOCK, (sd_raw_card_type & (1 << SD_RAW_SPEC_SDHC) ? offset / 512 : offset - block_offset)))
 #else
-        if(sd_raw_send_command(CMD_READ_SINGLE_BLOCK, offset & 0xfffffe00))
+        if(sd_raw_send_command(CMD_READ_SINGLE_BLOCK, offset - block_offset))
 #endif
         {
             unselect_card();
@@ -634,7 +634,7 @@
         if(length < interval)
             break;
 
-        offset = (offset & 0xfffffe00) + 512;
+        offset = offset - block_offset + 512;
 
     } while(!finished);
     
@@ -665,7 +665,7 @@
  */
 uint8_t sd_raw_write(offset_t offset, const uint8_t* buffer, uintptr_t length)
 {
-    if(get_pin_locked())
+    if(sd_raw_locked())
         return 0;
 
     offset_t block_address;
Index: uart.h
===================================================================
--- uart.h	(.../sd-reader_release_20081121)	(Revision 143)
+++ uart.h	(.../sd-reader_release_20090330)	(Revision 143)
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006-2008 by Roland Riegel <feedback@roland-riegel.de>
+ * Copyright (c) 2006-2009 by Roland Riegel <feedback@roland-riegel.de>
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -13,6 +13,11 @@
 #include <stdint.h>
 #include <avr/pgmspace.h>
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 void uart_init();
 
 void uart_putc(uint8_t c);
@@ -29,5 +34,9 @@
 
 uint8_t uart_getc();
 
+#ifdef __cplusplus
+}
 #endif
 
+#endif
+
Index: main.c
===================================================================
--- main.c	(.../sd-reader_release_20081121)	(Revision 143)
+++ main.c	(.../sd-reader_release_20090330)	(Revision 143)
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006-2008 by Roland Riegel <feedback@roland-riegel.de>
+ * Copyright (c) 2006-2009 by Roland Riegel <feedback@roland-riegel.de>
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -20,10 +20,10 @@
 #define DEBUG 1
 
 /**
- * \mainpage MMC/SD card example application
+ * \mainpage MMC/SD/SDHC card library
  *
- * This project is a small test application which implements read and write
- * support for MMC, SD and SDHC cards.
+ * This project provides a general purpose library which implements read and write
+ * support for MMC, SD and SDHC memory cards.
  *
  * It includes
  * - low-level \link sd_raw MMC, SD and SDHC read/write routines \endlink
@@ -31,7 +31,19 @@
  * - a simple \link fat FAT16/FAT32 read/write implementation \endlink
  *
  * \section circuit The circuit
- * The curcuit board is a self-made and self-soldered board consisting of a single
+ * The circuit which was mainly used during development consists of an Atmel AVR
+ * microcontroller with some passive components. It is quite simple and provides
+ * an easy test environment. The circuit which can be downloaded on the
+ * <a href="http://www.roland-riegel.de/sd-reader/">project homepage</a> has been
+ * improved with regard to operation stability.
+ *
+ * I used different microcontrollers during development, the ATmega8 with 8kBytes
+ * of flash, and its pin-compatible alternative, the ATmega168 with 16kBytes flash.
+ * The first one is the one I started with, but when I implemented FAT16 write
+ * support, I ran out of flash space and switched to the ATmega168. For FAT32, an
+ * ATmega328 is required.
+ * 
+ * The circuit board is a self-made and self-soldered board consisting of a single
  * copper layer and standard DIL components, except of the MMC/SD card connector.
  *
  * The connector is soldered to the bottom side of the board. It has a simple
@@ -39,24 +51,20 @@
  * itself. As an additional feature the connector has two electrical switches
  * to detect wether a card is inserted and wether this card is write-protected.
  * 
- * I used two microcontrollers during development, the Atmel ATmega8 with 8kBytes
- * of flash, and its pin-compatible alternative, the ATmega168 with 16kBytes flash.
- * The first one is the one I started with, but when I implemented FAT16 write
- * support, I ran out of flash space and switched to the ATmega168. For FAT32, an
- * ATmega328 is required.
- * 
  * \section pictures Pictures
  * \image html pic01.jpg "The circuit board used to implement and test this application."
  * \image html pic02.jpg "The MMC/SD card connector on the soldering side of the circuit board."
  *
  * \section software The software
- * The software is written in pure standard ANSI-C. Sure, it might not be the
- * smallest or the fastest one, but I think it is quite flexible.
+ * The software is written in pure standard ANSI-C. It might not be the smallest or
+ * the fastest one, but I think it is quite flexible. See the project's
+ * <a href="http://www.roland-riegel.de/sd-reader/benchmarks/">benchmark page</a> to get an
+ * idea of the possible data rates.
  *
- * I implemented a simple command prompt which is accessible via the UART at 9600 Baud. With
- * commands similiar to the Unix shell you can browse different directories, read and write
- * files, create new ones and delete them again. Not all commands are available in all
- * software configurations.
+ * I implemented an example application providing a simple command prompt which is accessible
+ * via the UART at 9600 Baud. With commands similiar to the Unix shell you can browse different
+ * directories, read and write files, create new ones and delete them again. Not all commands are
+ * available in all software configurations.
  * - <tt>cat \<file\></tt>\n
  *   Writes a hexdump of \<file\> to the terminal.
  * - <tt>cd \<directory\></tt>\n
@@ -81,7 +89,8 @@
  *
  * \htmlonly
  * <p>
- * The following table shows some typical code sizes in bytes, using the 20061101 release with malloc()/free():
+ * The following table shows some typical code sizes in bytes, using the 20090330 release with a
+ * buffered read-write MMC/SD configuration, FAT16 and static memory allocation:
  * </p>
  *
  * <table border="1" cellpadding="2">
@@ -91,47 +100,37 @@
  *         <th>static RAM usage</th>
  *     </tr>
  *     <tr>
- *         <td>MMC/SD (read-only)</td>
- *         <td align="right">1576</td>
- *         <td align="right">0</td>
+ *         <td>MMC/SD</td>
+ *         <td align="right">2410</td>
+ *         <td align="right">518</td>
  *     </tr>
  *     <tr>
- *         <td>MMC/SD (read-write)</td>
- *         <td align="right">2202</td>
- *         <td align="right">517</td>
- *     </tr>
- *     <tr>
  *         <td>Partition</td>
- *         <td align="right">418</td>
- *         <td align="right">0</td>
+ *         <td align="right">456</td>
+ *         <td align="right">17</td>
  *     </tr>
  *     <tr>
- *         <td>FAT16 (read-only)</td>
- *         <td align="right">3834</td>
- *         <td align="right">0</td>
+ *         <td>FAT16</td>
+ *         <td align="right">7928</td>
+ *         <td align="right">188</td>
  *     </tr>
- *     <tr>
- *         <td>FAT16 (read-write)</td>
- *         <td align="right">7932</td>
- *         <td align="right">0</td>
- *     </tr>
  * </table>
  *
  * <p>
- * The static RAM in the read-write case is used for buffering memory card
- * access. Without this buffer, implementation would have been much more complicated.
+ * The static RAM is mostly used for buffering memory card access, which
+ * improves performance and reduces implementation complexity.
  * </p>
  * 
  * <p>
  * Please note that the numbers above do not include the C library functions
- * used, e.g. malloc()/free() and some string functions. These will raise the
- * numbers somewhat if they are not already used in other program parts.
+ * used, e.g. some string functions. These will raise the numbers somewhat
+ * if they are not already used in other program parts.
  * </p>
  * 
  * <p>
  * When opening a partition, filesystem, file or directory, a little amount
- * of dynamic RAM is used, as listed in the following table. Alternatively,
- * the same amount of static RAM can be used.
+ * of RAM is used, as listed in the following table. Depending on the library
+ * configuration, the memory is either allocated statically or dynamically.
  * </p>
  *
  * <table border="1" cellpadding="2">
@@ -149,27 +148,30 @@
  *     </tr>
  *     <tr>
  *         <td>file</td>
- *         <td align="right">51</td>
+ *         <td align="right">53</td>
  *     </tr>
  *     <tr>
  *         <td>directory</td>
- *         <td align="right">47</td>
+ *         <td align="right">49</td>
  *     </tr>
  * </table>
  * 
  * \endhtmlonly
  *
  * \section adaptation Adapting the software to your needs
- * The only hardware dependent part is the communication
- * layer talking to the memory card. The other parts like partition table and FAT
- * support are completely independent, you could use them even for managing
- * Compact Flash cards or standard ATAPI hard disks.
+ * The only hardware dependent part is the communication layer talking to the
+ * memory card. The other parts like partition table and FAT support are
+ * completely independent, you could use them even for managing Compact Flash
+ * cards or standard ATAPI hard disks.
  *
  * By changing the MCU* variables in the Makefile, you can use other Atmel
  * microcontrollers or different clock speeds. You might also want to change
  * the configuration defines in the files fat_config.h, partition_config.h,
  * sd_raw_config.h and sd-reader_config.h. For example, you could disable
  * write support completely if you only need read support.
+ *
+ * For further information, visit the project's
+ * <a href="http://www.roland-riegel.de/sd-reader/faq/">FAQ page</a>.
  * 
  * \section bugs Bugs or comments?
  * If you have comments or found a bug in the software - there might be some
@@ -181,7 +183,7 @@
  * I adapted his work for my circuit. Although this is a very simple
  * solution, I had no problems using it.
  * 
- * \section copyright Copyright 2006-2008 by Roland Riegel
+ * \section copyright Copyright 2006-2009 by Roland Riegel
  * This program is free software; you can redistribute it and/or modify it under
  * the terms of the GNU General Public License version 2 as published by
  * the Free Software Foundation (http://www.gnu.org/copyleft/gpl.html).
@@ -230,8 +232,13 @@
         /* open first partition */
         struct partition_struct* partition = partition_open(sd_raw_read,
                                                             sd_raw_read_interval,
+#if SD_RAW_WRITE_SUPPORT
                                                             sd_raw_write,
                                                             sd_raw_write_interval,
+#else
+                                                            0,
+                                                            0,
+#endif
                                                             0
                                                            );
 
@@ -242,8 +249,13 @@
              */
             partition = partition_open(sd_raw_read,
                                        sd_raw_read_interval,
+#if SD_RAW_WRITE_SUPPORT
                                        sd_raw_write,
                                        sd_raw_write_interval,
+#else
+                                       0,
+                                       0,
+#endif
                                        -1
                                       );
             if(!partition)
Index: sd_raw.h
===================================================================
--- sd_raw.h	(.../sd-reader_release_20081121)	(Revision 143)
+++ sd_raw.h	(.../sd-reader_release_20090330)	(Revision 143)
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006-2008 by Roland Riegel <feedback@roland-riegel.de>
+ * Copyright (c) 2006-2009 by Roland Riegel <feedback@roland-riegel.de>
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of either the GNU General Public License version 2
@@ -14,6 +14,11 @@
 #include <stdint.h>
 #include "sd_raw_config.h"
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 /**
  * \addtogroup sd_raw
  *
@@ -135,5 +140,9 @@
  * @}
  */
 
+#ifdef __cplusplus
+}
 #endif
 
+#endif
+
Index: byteordering.c
===================================================================
--- byteordering.c	(.../sd-reader_release_20081121)	(Revision 143)
+++ byteordering.c	(.../sd-reader_release_20090330)	(Revision 143)
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006-2008 by Roland Riegel <feedback@roland-riegel.de>
+ * Copyright (c) 2006-2009 by Roland Riegel <feedback@roland-riegel.de>
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of either the GNU General Public License version 2
