17 #define realpath( a, b ) GetFullPathName( a, PATH_MAX, b, NULL ) 
   22 #if defined __cplusplus 
   28     const char *evaluation, 
const char *projectile, 
const char *
target );
 
   30             int projectile_PoPID, 
int target_PoPID );
 
   32         int projectile_PoPID, 
int target_PoPID );
 
   37 #if defined __cplusplus 
   42 #if defined __cplusplus 
   75     char const *aliases[] = { 
"Co58m1",  
"Ag110m1",  
"Cd115m1",  
"Te127m1",  
"Te129m1",  
"Pm148m1",  
"Ho166m1",  
"Am242m1",  
"Am244m1",  
"Es254m1" };
 
   76     char const *targets[] = { 
"Co58_e1", 
"Ag110_e2", 
"Cd115_e1", 
"Te127_e2", 
"Te129_e1", 
"Pm148_e2", 
"Ho166_e1", 
"Am242_e2", 
"Am244_e1", 
"Es254_e2" };
 
   77     int i1, n1 = 
sizeof( aliases ) / 
sizeof( aliases[1] );
 
   80     for( i1 = 0; i1 < n1; i1++ ) {
 
  102     const char *evaluation, *projectile, *targetName, *path, *schema;
 
  107     if( ( basePath == NULL ) || ( mapFileName[0] == 
'/' ) ) {
 
  108         strcpy( realPath, mapFileName ); }
 
  110         strcpy( realPath, basePath );
 
  111         strcat( realPath, 
"/" );
 
  112         strcat( realPath, mapFileName );
 
  114     if( realpath( realPath, 
p ) == NULL ) {
 
  118     n = (
int) strlen( 
p ) + 2;
 
  122     strcpy( map->
path, 
p );
 
  123     if( ( 
p = strrchr( map->
path, 
'/' ) ) != NULL ) {
 
  126         strcpy( map->
path, 
"." );
 
  133         if( strcmp( child->
name, 
"path" ) == 0 ) {
 
  139         else if( strcmp( child->
name, 
"target" ) == 0 ) {
 
  187     for( entry = map->
mapEntries; entry != NULL; entry = next ) {
 
  213     return( entry->
next );
 
  229     if( entry != NULL ) {
 
  232     return( entry != NULL );
 
  238     const char *path, 
const char *evaluation, 
const char *projectile, 
const char *targetName ) {
 
  256         if( ( entry->
path = (
char *) 
smr_malloc2( smr, strlen( path ) + 1, 0, 
"path" ) ) == NULL ) 
goto err;
 
  257         strcpy( entry->
path, path );
 
  260     if( evaluation != NULL ) {
 
  261         if( ( entry->
evaluation = (
char *) 
smr_malloc2( smr, strlen( evaluation ) + 1, 0, 
"evaluation" ) ) == NULL ) 
goto err;
 
  265     if( projectile != NULL ) {
 
  267         if( ( entry->
projectile = (
char *) 
smr_malloc2( smr, strlen( projectile ) + 1, 0, 
"projectile" ) ) == NULL ) 
goto err;
 
  271     if( targetName != NULL ) {
 
  273         if( ( entry->
targetName = (
char *) 
smr_malloc2( smr, strlen( targetName ) + 1, 0, 
"target" ) ) == NULL ) 
goto err;
 
  277     if( schema != NULL ) {
 
  278         if( ( entry->
schema = (
char *) 
smr_malloc2( smr, strlen( schema ) + 1, 0, 
"schema" ) ) == NULL ) 
goto err;
 
  279         strcpy( entry->
schema, schema );
 
  303     int projectile_PoPID, 
int target_PoPID ) {
 
  311     if( !
smr_isOk( smr ) ) 
return( NULL );
 
  315     if( ( path == NULL ) && 
smr_isOk( smr ) ) {
 
  316         if( evaluation == NULL ) {
 
  318                 targetName, projectileName ); }
 
  321                 targetName, projectileName, evaluation );
 
  330             int projectile_PoPID, 
int target_PoPID ) {
 
  336     if( evaluation != NULL ) {
 
  337         if( strlen( evaluation ) == 0 ) evaluation = NULL;
 
  340     for( entry = map->
mapEntries; entry != NULL; entry = entry->
next ) {
 
  341         switch( entry->
type ) {
 
  344                 if( evaluation == NULL ) {
 
  347                     status = strcmp( evaluation,  entry->
evaluation ) == 0;
 
  350                     n = (
int) strlen( map->
path ) + 1 + (
int) strlen( entry->
path ) + 1;
 
  351                     if( ( path = (
char * ) 
smr_malloc2( smr, n, 0, 
"path" ) ) == NULL ) 
return( NULL );
 
  352                     strcpy( path, map->
path );
 
  354                     if( entry->
path[0] == 
'/' ) {
 
  355                         strcpy( path, entry->
path ); }
 
  357                         strcat( path, entry->
path );
 
  378     int projectile_PoPID, target_PoPID;
 
  396     if( ( mapAllOfTarget = 
MCGIDI_map_new( smr ) ) == NULL ) 
return( NULL );
 
  399     return( mapAllOfTarget );
 
  405         int projectile_PoPID, 
int target_PoPID ) {
 
  409     for( entry = map->
mapEntries; entry != NULL; entry = entry->
next ) {
 
  410         switch( entry->
type ) {
 
  432     int projectile_PoPID, target_PoPID;
 
  445     if( endPath[0] == 
'/' ) {
 
  446         if( ( path = (
char *) 
smr_malloc2( smr, strlen( endPath ) + 1, 0, 
"path" ) ) == NULL ) 
return( NULL );
 
  449         if( ( path = (
char *) 
smr_malloc2( smr, strlen( map->
path ) + strlen( endPath ) + 2, 0, 
"path" ) ) == NULL ) 
return( NULL );
 
  450         strcpy( path, map->
path );
 
  453     strcat( path, endPath );
 
  464     switch( target->
type ) {
 
  485     for( entry = map->
mapEntries; entry != NULL; entry = entry->
next ) {
 
  486         if( handler( entry, level, userData ) != 0 ) 
return( 1 );
 
  505     char targetFormat[] = 
"<target schema=\"%s\" evaluation=\"%s\" projectile=\"%s\" target=\"%s\" path=\"%s\"/>\n";
 
  506     char pathFormat[] = 
"<path projectile=\"%s\" path=\"%s\"/>\n";
 
  507     char start[] = 
"<map>\n";
 
  508     char end[] = 
"</map>";
 
  509     int n = 0, nStart = (
int) strlen( start ), nEnd = (
int) strlen( end );
 
  510     int nTarget = (
int) strlen( targetFormat ) - 10, nPath = (
int) strlen( pathFormat ) - 4;
 
  514     n = nStart + nEnd + 1;
 
  515     for( entry = map->
mapEntries; entry != NULL; entry = entry->
next ) {
 
  516         switch( entry->
type ) {
 
  529     if( ( s = (
char *) 
smr_malloc2( smr, n, 0, 
"xml string" ) ) == NULL ) 
return( NULL );
 
  533     for( entry = map->
mapEntries; entry != NULL; entry = entry->
next ) {
 
  534         switch( entry->
type ) {
 
  558     int n = (
int ) strlen( sLevel ) / 4;
 
  561         fprintf( f, 
"Bad map status = %d\n", map->
status );
 
  564     if( level < n ) sLevel[4 * level] = 0;
 
  565     fprintf( f, 
"%smap->path = %s\n", sLevel, map->
path );
 
  566     fprintf( f, 
"%smap->mapFileName = %s\n", sLevel, map->
mapFileName );
 
  567     for( entry = map->
mapEntries; entry != NULL; entry = entry->
next ) {
 
  568         switch( entry->
type ) {
 
  570             fprintf( f, 
"%sType = target: schema = %s: evaluation = %s: projectile = %s: target = %s: path = %s\n", sLevel, entry->
schema, 
 
  574             fprintf( f, 
"%sType =   path: path = %s\n", sLevel, entry->
path );
 
  578             fprintf( f, 
"%sUnknown type = %d\n", sLevel, entry->
type );
 
  592 #if defined __cplusplus 
MCGIDI_map * MCGIDI_map_new(statusMessageReporting *smr)
 
MCGIDI_mapEntry * MCGIDI_map_getFirstEntry(MCGIDI_map *map)
 
static char * _MCGIDI_map_smrUserInterface(void *userData)
 
int globalPoPsIndexProjectile
 
int MCGIDI_map_walkTree(statusMessageReporting *smr, MCGIDI_map *map, int(*handler)(MCGIDI_mapEntry *entry, int level, void *userData), void *userData)
 
void MCGIDI_map_simpleWrite(FILE *f, MCGIDI_map *map)
 
char const * PoPs_getName_atIndex(statusMessageReporting *smr, int index)
 
#define smr_setReportInfo3(smr, userInterface, libraryID, code, fmt,...)
 
MCGIDI_map * MCGIDI_map_readFile(statusMessageReporting *smr, const char *basePath, const char *mapFileName)
 
xDataXML_document * xDataXML_importFile2(statusMessageReporting *smr, char const *fileName)
 
smr_userInterface smrUserInterface
 
MCGIDI_map * MCGIDI_map_findAllOfTarget(statusMessageReporting *smr, MCGIDI_map *map, const char *projectile, const char *targetName)
 
#define smr_setReportError3p(smr, userInterface, libraryID, code, fmt)
 
static char * _MCGIDI_map_findTargetViaPoPIDs2(statusMessageReporting *smr, MCGIDI_map *map, const char *evaluation, int projectile_PoPID, int target_PoPID)
 
int MCGIDI_map_addPath(statusMessageReporting *smr, MCGIDI_map *map, const char *path)
 
void * MCGIDI_map_free(statusMessageReporting *smr, MCGIDI_map *map)
 
int lPoPs_addParticleIfNeeded(statusMessageReporting *smr, char const *name, char const *special)
 
MCGIDI_mapEntry * MCGIDI_map_getNextEntry(MCGIDI_mapEntry *entry)
 
char * smr_allocateFormatMessage(char const *fmt,...)
 
xDataXML_element * xDataXML_getDocumentsElement(xDataXML_document *doc)
 
#define smr_setReportInfo3p(smr, userInterface, libraryID, code, fmt)
 
#define smr_setReportError2(smr, libraryID, code, fmt,...)
 
MCGIDI_mapEntry * mapEntries
 
static MCGIDI_mapEntry * _MCGIDI_map_addEntry(statusMessageReporting *smr, MCGIDI_map *map, enum MCGIDI_mapEntry_type type, const char *schema, const char *path, const char *evaluation, const char *projectile, const char *target)
 
void * xDataXML_freeDoc(statusMessageReporting *smr, xDataXML_document *doc)
 
char * MCGIDI_map_toXMLString(statusMessageReporting *smr, MCGIDI_map *map)
 
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
 
PoP * PoPs_addAliasIfNeeded(statusMessageReporting *smr, char const *name, char const *alias)
 
#define smr_malloc2(smr, size, zero, forItem)
 
MCGIDI_map * MCGIDI_map_findAllOfTargetViaPoPIDs(statusMessageReporting *smr, MCGIDI_map *map, int projectile_PoPID, int target_PoPID)
 
xDataXML_element * xDataXML_getNextElement(xDataXML_element *element)
 
char * MCGIDI_map_getFullPath(statusMessageReporting *smr, MCGIDI_map *map, const char *endPath)
 
int globalPoPsIndexTarget
 
int smr_isOk(statusMessageReporting *smr)
 
int MCGIDI_map_addTarget(statusMessageReporting *smr, MCGIDI_map *map, const char *method, const char *path, const char *evaluation, const char *projectile, const char *targetName)
 
MCGIDI_map_smr smrUserInterface
 
char const * xDataXML_getAttributesValueInElement(xDataXML_element *element, char const *name)
 
void MCGIDI_map_release(statusMessageReporting *smr, MCGIDI_map *map)
 
void * smr_freeMemory(void **p)
 
#define smr_setReportError3(smr, userInterface, libraryID, code, fmt,...)
 
enum MCGIDI_mapEntry_type type
 
int MCGIDI_map_initialize(statusMessageReporting *smr, MCGIDI_map *map)
 
char * MCGIDI_map_getTargetsFullPath(statusMessageReporting *smr, MCGIDI_mapEntry *target)
 
char * MCGIDI_map_findTargetViaPoPIDs(statusMessageReporting *smr, MCGIDI_map *map, const char *evaluation, int projectile_PoPID, int target_PoPID)
 
char * MCGIDI_map_findTarget(statusMessageReporting *smr, MCGIDI_map *map, const char *evaluation, const char *projectile, const char *targetName)
 
enum MCGIDI_map_status status
 
xDataXML_element * xDataXML_getFirstElement(xDataXML_element *element)
 
static int _MCGIDI_map_walkTree2(statusMessageReporting *smr, MCGIDI_map *map, int level, int(*handler)(MCGIDI_mapEntry *entry, int level, void *userData), void *userData)
 
static int _MCGIDI_map_findAllOfTargetViaPoPIDs2(statusMessageReporting *smr, MCGIDI_map *mapAllOfTarget, MCGIDI_map *map, int projectile_PoPID, int target_PoPID)
 
static void _MCGIDI_map_simpleWrite2(FILE *f, MCGIDI_map *map, int level)