[Devel] utility functions

Henning Westerholt henning.westerholt at 1und1.de
Wed Mar 28 13:21:54 CEST 2007


Hello all,

during my journey through the openser code is noticed a few places for 
improvement.. The same issues exists with some of our internal modules. 

There is a huge duplication of effort regarding utility functions for data 
type conversion or data handling in general. Many modules defines their own, 
slightly different functions. Only for str and char* copying there existing 
at the moment at least five different functions in the code:
str_dup, str_duplicate, strdup (own definition and from strings.h), 
shm_strdup, dupl_string, and in some places of course several macros with the 
same purpose. As i mentioned before, the same problem exist with some of our 
internal modules.

It is the same with the str_fixup functions (char* to str) and in the db layer 
with the converter functions, i allready submit a patch some time ago for 
this.

The current situation is in my opinion not optimal from the maintenace point 
of view, it also increases the code size and could decrease the performance.

I'm willing to work on this, i only need to know if this work is welcome. One 
normal str_dup function that uses string.h, and one for shm_memory should be 
sufficient.

Furthermore i propose a change to the contribution rules on the OpenSER 
webpage, that any new modules should use the existing utility functions in 
the core.

Part of the problem is the lack of a good hacking guide for OpenSER, many 
module authors don't know probably about the e.g. ut.h header file.

Cheers,

Henning



More information about the Devel mailing list