John R. Jackson on Mon 27/01 21:37 -0500: > > - the #ifdef NO_AMANDA stuff is pretty much exact duplication. > > Anyone consider just moving this out into a library instead of > > duplicating whole routines in rait-*.c ? > > Yes, but Marc Mengel really (really :-) wanted to keep the code > isolated from Amanda so it could be used in other packages, so we > ended up with the "NO_AMANDA" stuff.
Yeah but I mean...there's two copies of each of those routines :) How would moving the needed routines into a library that both Amanda itself, and amdd could link to (I gather that's what it's for, so an amdd can be compiled standalone), prevent it from being used in other packages? here is a list of duplicated symbols: struct am_mt_status amfree() amtable_alloc() tapeio_init_devname() P() I'm looking at these notes: * tape-src/amdd.c: Make sure this compiles "stand-alone". To do so, use: gcc -Wall -DNO_AMANDA amdd.c output-rait.c output-tape.c. * tape-src/ammt.c: Make sure this compiles "stand-alone". To do so, use: gcc -Wall -DNO_AMANDA ammt.c output-rait.c output-tape.c. for one, it looks like stralloc() changes in 2.5 prevent these from compiling anyways. So looks like now you have to duplicate that function too. How about we just move the functions to a library installed as /usr/lib/am* and the other stuff to a common header they both include? Apologies if this has already been discussed. one more thing I'm curious about: is the backwards C idiom if (0 != sometestfunc()) instead of the usual if (sometestfunc() != 0) preferred by amanda developers, or Mr. Mengel? It's very strange to read, I've never seen it before :)