Commit 8d1948ce authored by claes's avatar claes

utl list attribute objects added to search

parent 2d21ee55
/* /*
* Proview $Id: wb_trv.cpp,v 1.2 2007-09-17 07:08:59 claes Exp $ * Proview $Id: wb_trv.cpp,v 1.3 2007-09-26 11:53:15 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -2200,6 +2200,84 @@ int trv_object_search( ...@@ -2200,6 +2200,84 @@ int trv_object_search(
return GSX__SUCCESS; return GSX__SUCCESS;
} }
// Get all objects and attribute objects matching the search criteria.
// Call the backcall function for found objects and attribute objects.
int trv_aobject_search(
trv_tCtx trvctx,
trv_tBcFunc backcall,
void *arg1,
void *arg2,
void *arg3,
void *arg4,
void *arg5
)
{
int sts;
pwr_tObjid objdid;
pwr_tClassId obj_class;
pwr_tVolumeId *volume_ptr;
if ( cdh_ObjidIsNotNull( trvctx->hierobjid)) {
sts = ldh_GetObjectClass( trvctx->ldhses, trvctx->hierobjid,
&obj_class);
if ( EVEN(sts)) return sts;
if ( !( obj_class == pwr_eClass_ClassHier ||
obj_class == pwr_eClass_TypeHier ||
obj_class == pwr_eClass_MountObject ||
obj_class == pwr_eClass_LibHier)) {
/* Hierarchy object is supplied. Check if the children */
sts = trv_get_attrobjects( trvctx->ldhses, trvctx->hierobjid, trvctx->classid,
trvctx->name, trv_eDepth_Deep,
backcall, arg1, arg2, arg3, arg4, arg5);
if ( EVEN(sts)) return sts;
}
}
else if ( trvctx->volume) {
volume_ptr = trvctx->volume;
while( *volume_ptr) {
sts = ldh_GetVolumeRootList( trvctx->ldhses, *volume_ptr, &objdid);
while ( ODD(sts)) {
sts = ldh_GetObjectClass( trvctx->ldhses, objdid, &obj_class);
if ( EVEN(sts)) return sts;
/* Check that the class of the object is correct */
if ( !( obj_class == pwr_eClass_ClassHier ||
obj_class == pwr_eClass_TypeHier ||
obj_class == pwr_eClass_MountObject ||
obj_class == pwr_eClass_LibHier)) {
/* Check if the children */
sts = trv_get_attrobjects( trvctx->ldhses, objdid, trvctx->classid, trvctx->name,
trv_eDepth_Deep,
backcall, arg1, arg2, arg3, arg4, arg5);
if ( EVEN(sts)) return sts;
}
sts = ldh_GetNextSibling( trvctx->ldhses, objdid, &objdid);
}
volume_ptr++;
}
}
else {
sts = ldh_GetRootList( trvctx->ldhses, &objdid);
while ( ODD(sts)) {
sts = ldh_GetObjectClass( trvctx->ldhses, objdid, &obj_class);
if ( EVEN(sts)) return sts;
/* Check that the class of the node object is correct */
if ( !( obj_class == pwr_eClass_ClassHier ||
obj_class == pwr_eClass_TypeHier)) {
/* Check if the children */
sts = trv_get_attrobjects( trvctx->ldhses, objdid, trvctx->classid, trvctx->name,
trv_eDepth_Deep,
backcall, arg1, arg2, arg3, arg4, arg5);
if ( EVEN(sts)) return sts;
}
sts = ldh_GetNextSibling( trvctx->ldhses, objdid, &objdid);
}
}
return GSX__SUCCESS;
}
......
/* /*
* Proview $Id: wb_trv.h,v 1.7 2007-01-04 07:29:04 claes Exp $ * Proview $Id: wb_trv.h,v 1.8 2007-09-26 11:53:15 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -204,5 +204,14 @@ int trv_get_attrobjects ( ...@@ -204,5 +204,14 @@ int trv_get_attrobjects (
void *arg5 void *arg5
); );
int trv_aobject_search(
trv_tCtx trvctx,
trv_tBcFunc backcall,
void *arg1,
void *arg2,
void *arg3,
void *arg4,
void *arg5
);
#endif #endif
/* /*
* Proview $Id: wb_utl.cpp,v 1.4 2007-09-05 08:22:18 claes Exp $ * Proview $Id: wb_utl.cpp,v 1.5 2007-09-26 11:53:15 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -7557,7 +7557,7 @@ int utl_list ( ...@@ -7557,7 +7557,7 @@ int utl_list (
volume_p); volume_p);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
sts = trv_object_search( trvctx, sts = trv_aobject_search( trvctx,
(trv_tBcFunc) utl_ctxlist_insert, (trv_tBcFunc) utl_ctxlist_insert,
&(utlctx->list[0]), &(utlctx->listcount[0]), 0, 0, 0); &(utlctx->list[0]), &(utlctx->listcount[0]), 0, 0, 0);
if ( EVEN (sts)) return sts; if ( EVEN (sts)) return sts;
...@@ -11579,7 +11579,7 @@ static int cross_crosslist_load( ldh_tSesContext ldhses) ...@@ -11579,7 +11579,7 @@ static int cross_crosslist_load( ldh_tSesContext ldhses)
volume_p); volume_p);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
sts = trv_object_search( trvctx, sts = trv_aobject_search( trvctx,
(trv_tBcFunc) cross_crosslist_object_insert, ldhses, 0,0,0,0); (trv_tBcFunc) cross_crosslist_object_insert, ldhses, 0,0,0,0);
if (EVEN(sts)) return sts; if (EVEN(sts)) return sts;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment