Mercurial > hg > octave-terminal
changeset 12928:0dc4d9f1366c
maint: periodic merge of stable to default
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 05 Aug 2011 18:52:40 -0400 |
parents | 838ada8779a5 (current diff) f9c1f7c1ead0 (diff) |
children | 135ec8155eeb |
files | src/data.cc |
diffstat | 4 files changed, 27 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/interpreter/container.txi +++ b/doc/interpreter/container.txi @@ -974,7 +974,7 @@ a = @{1, [2, 3], 4, 5, 6@}; b = [a@{1:4@}] @result{} b = - 1 2 3 4 + 1 2 3 4 5 @end group @end example
--- a/src/c-file-ptr-stream.cc +++ b/src/c-file-ptr-stream.cc @@ -193,6 +193,20 @@ } int +c_file_ptr_buf::seek (long offset, int origin) +{ + // gnulib::fseek doesn't seem to work, so don't use it until problem + // can be properly diagnosed and fixed. + return f ? fseek (f, offset, origin) : -1; +} + +long +c_file_ptr_buf::tell (void) +{ + return f ? gnulib::ftell (f) : -1; +} + +int c_file_ptr_buf::file_close (FILE *f) { return gnulib::fclose (f);
--- a/src/c-file-ptr-stream.h +++ b/src/c-file-ptr-stream.h @@ -74,10 +74,9 @@ int file_number () const { return f ? fileno (f) : -1; } - int seek (long offset, int origin) - { return f ? gnulib::fseek (f, offset, origin) : -1; } + int seek (long offset, int origin); - long tell (void) { return f ? gnulib::ftell (f) : -1; } + long tell (void); void clear (void) { if (f) clearerr (f); }
--- a/src/data.cc +++ b/src/data.cc @@ -2060,6 +2060,16 @@ @var{a}(@var{idx1}, @var{idx2}, @dots{})\n\ @end example\n\ \n\ +Note that the indices do not have to be numerical. For example\n\ +\n\ +@example\n\ + @var{a} = 1;\n\ + @var{b} = ones (2, 3);\n\ + numel (@var{a}, @var{b});\n\ +@end example\n\ +\n\ +will return 6, as this is the number of ways to index with @var{b}.\n\ +\n\ This method is also called when an object appears as lvalue with cs-list\n\ indexing, i.e., @code{object@{@dots{}@}} or @code{object(@dots{}).field}.\n\ @seealso{size}\n\