#!/usr/local/bin/octave -q
#
# print the hierarchy of the structures 
# in a GDS II file.
#
# Example:  gdstree *.gds
#
# Ulf Griesmann, November 2012

# check if we have a file name
if ~nargin
   fprintf('\nUsage   :  gdstree <list of GDS II file names>\n');
   fprintf('Example :\n');
   fprintf('             gdstree demo.gds\n');
   exit(-1);
endif

# process the files
arg_list = argv();
for k=1:nargin
   layout = read_gds_library(arg_list{k});
   treeview(layout);
   fprintf('\n');
endfor
