Mercurial > hg > octave-lyh
comparison src/ov-struct.cc @ 6065:814f20da2cdb
[project @ 2006-10-20 03:01:43 by jwe]
author | jwe |
---|---|
date | Fri, 20 Oct 2006 03:03:12 +0000 |
parents | 85c7dc4afe6b |
children | 3588fc904484 |
comparison
equal
deleted
inserted
replaced
6064:fede829d805a | 6065:814f20da2cdb |
---|---|
1276 mxArray * | 1276 mxArray * |
1277 octave_struct::as_mxArray (void) const | 1277 octave_struct::as_mxArray (void) const |
1278 { | 1278 { |
1279 int nf = nfields (); | 1279 int nf = nfields (); |
1280 string_vector kv = map_keys (); | 1280 string_vector kv = map_keys (); |
1281 const char **f = static_cast<const char **> (mxArray::malloc (nf * sizeof (const char *))); | 1281 |
1282 OCTAVE_LOCAL_BUFFER (const char *, f, nf); | |
1283 | |
1282 for (int i = 0; i < nf; i++) | 1284 for (int i = 0; i < nf; i++) |
1283 f[i] = mxArray::strsave (kv[i].c_str ()); | 1285 f[i] = kv[i].c_str (); |
1284 | 1286 |
1285 mxArray *retval = new mxArray (dims (), nf, f); | 1287 mxArray *retval = new mxArray (dims (), nf, f); |
1286 | 1288 |
1287 mxArray **elts = static_cast<mxArray **> (retval->get_data ()); | 1289 mxArray **elts = static_cast<mxArray **> (retval->get_data ()); |
1288 | 1290 |