src/gedlib/charmaps.c
/*===================================================
 * custom_translate -- Translate string via custom translation table
 *  str:  [IN]  string to be translated
 *  tt:   [IN]  custom translation table
 * returns translated string
 *=================================================*/
- Translate string via custom translation table
str:  [IN]  string to be translated
tt:   [IN]  custom translation table
returns translated string
- Translate string via custom translation table str : [ IN ] string to be translated tt : [ IN ] custom translation table returns translated string
ZSTR
custom_translate (CNSTRING str, TRANTABLE tt)
{
	ZSTR zout = zs_newn((unsigned int)(strlen(str)*1.3+2));
	CNSTRING p = str;
	while (*p) {
		CNSTRING tmp;
		INT len = translate_match(tt, p, &tmp);
		if (len) {
			p += len;
			zs_apps(zout, tmp);
		} else {
			zs_appc(zout, *p++);
		}
	}
	return zout;
}
ZSTR custom_translate ( CNSTRING str , TRANTABLE tt ) { ZSTR zout = zs_newn ( ( unsigned int ) ( strlen ( str ) * 1.3 + 2 ) ) ; CNSTRING p = str ; while ( * p ) { CNSTRING tmp ; INT len = translate_match ( tt , p , & tmp ) ; if ( len ) { p += len ; zs_apps ( zout , tmp ) ; } else { zs_appc ( zout , * p ++ ) ; } } return zout ; }
custom_translate -- Translate string via custom translation table
  str:  [IN]  string to be translated
  tt:   [IN]  custom translation table
 returns translated string
custom_translate -- Translate string via custom translation table str : [ IN ] string to be translated tt : [ IN ] custom translation table returns translated string