Index: /trunk/src/hdf5load.m
===================================================================
--- /trunk/src/hdf5load.m	(revision 1012)
+++ /trunk/src/hdf5load.m	(revision 1013)
@@ -13,8 +13,8 @@
 function datasets = hdf5load(filename)
 
-hinfo=hdf5info(filename);
+    hinfo=hdf5info(filename);
 
-datasets=struct;
-hinfo.GroupHierarchy;
-datasets=hdf5load_recursion(datasets,hinfo.GroupHierarchy);
-
+    datasets=struct;
+    hinfo.GroupHierarchy;
+    datasets=hdf5load_recursion(datasets,hinfo.GroupHierarchy);
+end
Index: /trunk/src/hdf5load_recursion.m
===================================================================
--- /trunk/src/hdf5load_recursion.m	(revision 1012)
+++ /trunk/src/hdf5load_recursion.m	(revision 1013)
@@ -14,82 +14,81 @@
 function datastruct = hdf5load_recursive(datastruct,GroupHierarchy)
 
-% Load the datasets (the leafs of the tree):
-for i=[1:size(GroupHierarchy.Datasets,2)]
-    data=hdf5read(GroupHierarchy.Datasets(i));
-    switch class(data)
-	case 'hdf5.h5string'
-	    try
-		if size(data,2)>1
-		    buffer=data ;
-		    data = {} ;
-		    for j=1:size(buffer,2)
-			data{j}=buffer(j).Data;
-		    end
-		else
-		    data=data.Data;
-		end
-	    catch
-	    end
-	case 'hdf5.h5array'
-	    try
-		if size(data,2)>1
-		    buffer=data ;
-		    data = {} ;
-		    for j=1:size(buffer,2)
-			data{j}=buffer(j).Data;
-		    end
-		else
-		    data=data.Data;
-		end
-	    catch
-	    end
-	
+    % Load the datasets (the leafs of the tree):
+    for i=[1:size(GroupHierarchy.Datasets,2)]
+        data=hdf5read(GroupHierarchy.Datasets(i));
+        switch class(data)
+            case 'hdf5.h5string'
+                try
+                    if size(data,2)>1
+                        buffer=data;
+                        data = {};
+                        for j=1:size(buffer,2)
+                            data{j}=buffer(j).Data;
+                        end
+                    else
+                        data=data.Data;
+                    end
+                catch
+                end
+            case 'hdf5.h5array'
+                try
+                    if size(data,2)>1
+                        buffer=data;
+                        data = {};
+                        for j=1:size(buffer,2)
+                       data{j}=buffer(j).Data;
+                        end
+                    else
+                        data=data.Data;
+                    end
+                catch
+                end
+        end
+        name=GroupHierarchy.Datasets(i).Name;
+        name=strrep(name,'/','.');
+        eval(['datastruct' name '= data ;'])
     end
-    name=GroupHierarchy.Datasets(i).Name;
-    name=strrep(name,'/','.');
-    eval(['datastruct' name '= data ;'])
+    for i=[1:size(GroupHierarchy.Attributes,2)] 
+        data=hdf5read(GroupHierarchy.Attributes(i));
+        switch class(data)
+            case 'hdf5.h5string'
+                try
+                    if size(data,2)>1
+                        buffer=data;
+                        data = {};
+                        for j=1:size(buffer,2)
+                       data{j}=buffer(j).Data;
+                        end
+                    else
+                        data=data.Data;
+                    end
+                catch
+                end
+            case 'hdf5.h5array'
+                try
+                    if size(data,2)>1
+                        buffer=data;
+                        data = {};
+                        for j=1:size(buffer,2)
+                       data{j}=buffer(j).Data;
+                        end
+                    else
+                        data=data.Data;
+                    end
+                catch
+                end
+        end
+        name=GroupHierarchy.Attributes(i).Name;
+        name=strrep(name,'/','.');
+        eval(['datastruct' name '= data ;'])
+    end
+
+    % Then load the branches:
+    % Create structures for the group and pass them on recursively:
+    for i=[1:size(GroupHierarchy.Groups,2)]
+        name=GroupHierarchy.Groups(i).Name;
+        name=strrep(name,'/','.');
+        eval(['datastruct' name '= struct ;']);
+        datastruct = hdf5load_recursion(datastruct,GroupHierarchy.Groups(i));
+    end
 end
-for i=[1:size(GroupHierarchy.Attributes,2)] 
-    data=hdf5read(GroupHierarchy.Attributes(i));
-    switch class(data)
-	case 'hdf5.h5string'
-	    try
-		if size(data,2)>1
-		    buffer=data ;
-		    data = {} ;
-		    for j=1:size(buffer,2)
-			data{j}=buffer(j).Data;
-		    end
-		else
-		    data=data.Data;
-		end
-	    catch
-	    end
-	case 'hdf5.h5array'
-	    try
-		if size(data,2)>1
-		    buffer=data ;
-		    data = {} ;
-		    for j=1:size(buffer,2)
-			data{j}=buffer(j).Data;
-		    end
-		else
-		    data=data.Data;
-		end
-	    catch
-        end
-    end
-    name=GroupHierarchy.Attributes(i).Name;
-    name=strrep(name,'/','.');
-    eval(['datastruct' name '= data ;'])
-end
-
-% Then load the branches:
-% Create structures for the group and pass them on recursively:
-for i=[1:size(GroupHierarchy.Groups,2)]
-    name=GroupHierarchy.Groups(i).Name;
-    name=strrep(name,'/','.');
-    eval(['datastruct' name '= struct ;']);
-    datastruct = hdf5load_recursion(datastruct,GroupHierarchy.Groups(i));
-end
-
Index: /trunk/src/hdf5save.m
===================================================================
--- /trunk/src/hdf5save.m	(revision 1012)
+++ /trunk/src/hdf5save.m	(revision 1013)
@@ -13,21 +13,21 @@
 function hdf5save(filename,varargin)
 
-% this is just a wrapper function that calls a recursive function that
-% will save recursively structs.
+    % this is just a wrapper function that calls a recursive function that
+    % will save recursively structs.
 
-nvars=size(varargin,2)/2;
+    nvars=size(varargin,2)/2;
 
-if nvars~=floor(nvars) ;
-    error('expecting a name for each variable') ;
+    if nvars~=floor(nvars);
+        error('expecting a name for each variable');
+    end
+
+    %  Assign variables to save in workspace so as to be able to get them back
+    %  with recursive fonctions.
+    for i=[1:nvars]
+        str=varargin{2*i};
+        var=evalin('caller',str);
+        assignin('base',str,var);
+    end
+
+    hdf5save_recursion(filename,'',1,varargin)
 end
-
-%  Assign variables to save in workspace so as to be able to get them back
-%  with recursive fonctions.
-for i=[1:nvars]
-    str=varargin{2*i};
-    var=evalin('caller',str);
-    assignin('base',str,var);
-end
-
-hdf5save_recursion(filename,'',1,varargin)
-
Index: /trunk/src/hdf5save_recursion.m
===================================================================
--- /trunk/src/hdf5save_recursion.m	(revision 1012)
+++ /trunk/src/hdf5save_recursion.m	(revision 1013)
@@ -15,49 +15,49 @@
 function hdf5save_recursion(filename,prefix,new,varcell)
 
-if ~strcmp(class(filename),'char') ;
-    error('first argument should be a string giving the path to the hdf5 file to save') ;
-end
+    if ~strcmp(class(filename),'char');
+        error('first argument should be a string giving the path to the hdf5 file to save');
+    end
 
-if ~strcmp(class(prefix),'char') ;
-    error('second argument should be a string giving the name of the groupe to save the data in') ;
-end
+    if ~strcmp(class(prefix),'char');
+        error('second argument should be a string giving the name of the groupe to save the data in');
+    end
 
-if new~=1 && new~=0 ;
-    error('third argument should be 0 or 1: 0 to append data, and 1 to create a new file')
-end
+    if new~=1 && new~=0;
+        error('third argument should be 0 or 1: 0 to append data, and 1 to create a new file');
+    end
 
-nvars=size(varcell,2)/2;
+    nvars=size(varcell,2)/2;
 
-if nvars~=floor(nvars) ;
-    error('expecting a name for each variable') ;
-end
+    if nvars~=floor(nvars);
+        error('expecting a name for each variable');
+    end
 
-for i=[1:nvars]
-    str=varcell{2*i};
-    var=evalin('base',str);
-    name=varcell{2*i-1};
-    type=class(var);
-    location=strcat('/',prefix,name);
-    %disp(['variable name in workspace : ',str]);
-    %disp(['variable name to put : ',name]);
-    switch type
-    case 'struct'
-	names=fieldnames(var);
-	for j=1:size(names,1) ;
-	    if (j~=1 || i~=1)
-		new=0 ;
-	    end
-	    varname=strcat(name,'.',names{j});
-	    hdf5save_recursion(filename,strcat(name,'/'),new,{names{j},varname});
-	end
-    otherwise
-	location=strcat('/',prefix,name);
-	if new==1 && i==1 ;
-	    hdf5write(filename,location,var);
-	else
-	    %disp(['location : ',location]);
-	    hdf5write(filename,location,var,'WriteMode', 'append');
-	end
+    for i=[1:nvars]
+        str=varcell{2*i};
+        var=evalin('base',str);
+        name=varcell{2*i-1};
+        type=class(var);
+        location=strcat('/',prefix,name);
+        %disp(['variable name in workspace : ',str]);
+        %disp(['variable name to put : ',name]);
+        switch type
+            case 'struct'
+                names=fieldnames(var);
+                for j=1:size(names,1);
+                    if (j~=1 || i~=1)
+                        new=0;
+                    end
+                    varname=strcat(name,'.',names{j});
+                    hdf5save_recursion(filename,strcat(name,'/'),new,{names{j},varname});
+                end
+            otherwise
+                location=strcat('/',prefix,name);
+                if new==1 && i==1;
+                    hdf5write(filename,location,var);
+                else
+                    %disp(['location : ',location]);
+                    hdf5write(filename,location,var,'WriteMode', 'append');
+                end
+        end
     end
 end
-
