0001 function fiff_write_int(fid,kind,data)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 me='MNE:fiff_write_int';
0031
0032 if nargin ~= 3
0033 error(me,'Incorrect number of arguments');
0034 end
0035
0036 FIFFT_INT=3;
0037 FIFFV_NEXT_SEQ=0;
0038 nel=numel(data);
0039 datasize=nel*4;
0040 count = fwrite(fid,int32(kind),'int32');
0041 if count ~= 1
0042 error(me,'write failed');
0043 end
0044 count = fwrite(fid,int32(FIFFT_INT),'int32');
0045 if count ~= 1
0046 error(me,'write failed');
0047 end
0048 count = fwrite(fid,int32(datasize),'int32');
0049 if count ~= 1
0050 error(me,'write failed');
0051 end
0052 count = fwrite(fid,int32(FIFFV_NEXT_SEQ),'int32');
0053 if count ~= 1
0054 error(me,'write failed');
0055 end
0056 count = fwrite(fid,int32(data),'int32');
0057 if count ~= nel
0058 error(me,'write failed');
0059 end
0060
0061 return;