1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) INRIA
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function a = %cblock_c_cblock(a,b)
14    na = length(a)
15    if na==1 then a=b,return,end
16    if length(b)==1 then return,end
17    v1=getfield(na,a)
18    v2=getfield(2,b)
19
20    if size(v1,1)<>size(v2,1) then
21        msg = _("%s: Arguments #%d and #%d: Incompatible sizes.\n")
22        error(msprintf(msg, "%cblock_c_cblock", 1, 2))
23    end
24    if type(v1)==type(v2) then
25        a=setfield(na,[v1 v2],a)
26    else
27        a=setfield(na+1,v2,a);na=na+1
28    end
29
30    for k=3:length(b)
31        a=setfield(na+1,getfield(k,b),a)
32        na=na+1
33    end
34endfunction
35