![]() |
|
The reasons for a new API
|
Old program using Old libdar |
Old program using libdar 5.0.x |
#include "libdar.hpp" using namespace libdar; int example() { archive *arch = new archive(....); [...] } |
#include "libdar_4_4.hpp" using namespace libdar_4_4; int example() { archive *arch = new archive(....); [...] } |
#include "libdar.hpp" int example() { libdar::archive *arch = new libdar::archive(....); [...] } |
#include "libdar_4_4.hpp" int example() { libdar_4_4::archive *arch = new libdar_4_4::archive(....); [...] } |
Compilation and linking stay unchanged, thus running sed on your code using the following script-like code should do the trick: for file in *.c *.h *.cpp *.hpp ; do
mv "$file" "$file.bak" sed -r -e 's/libdar::/libdar_4_4::/g' -e 's/using namespace libdar/using namespace libdar_4_4/' -e 's|#include <dar/libdar.hpp>|#include <dar/libdar_4_4.hpp>|' "$file.bak" > "$file" done Want to try the new API instead ?If you want to go one step further and instead of using the backward compatible API, directly use the new libdar API, the first step is to read the API Tutorial. Then, if more detailed information is required, check the API documentation. Finaly you can subscribe to libdar-api mailing-list for any problem, questions or suggestions about the API.
|