6 |
|
*/ |
7 |
|
|
8 |
|
#include <stdlib.h> |
9 |
– |
#include <unistd.h> |
9 |
|
#include <string.h> |
10 |
|
#include <ctype.h> |
11 |
|
#include "platform.h" |
12 |
|
#include "rtio.h" |
13 |
|
#include "resolu.h" |
14 |
< |
#ifndef _WIN32 |
14 |
> |
#ifdef _WIN32 |
15 |
> |
#undef ftello |
16 |
> |
#define ftello ftell |
17 |
> |
#undef ssize_t |
18 |
> |
#define ssize_t size_t |
19 |
> |
#else |
20 |
|
#include <sys/mman.h> |
21 |
|
#endif |
22 |
|
|
278 |
|
RECINDEX *rp = NULL; |
279 |
|
long nrecords; |
280 |
|
int i, j; |
281 |
+ |
/* propogate sizes */ |
282 |
+ |
if (ni_rows <= 0) |
283 |
+ |
ni_rows = no_columns; |
284 |
+ |
if (ni_columns <= 0) |
285 |
+ |
ni_columns = no_rows; |
286 |
|
/* get # records (& index) */ |
287 |
|
if (record_width > 0) { |
288 |
|
if ((rp = index_records(mp, record_width)) == NULL) |
300 |
|
} else |
301 |
|
nrecords = mp->len / -record_width; |
302 |
|
/* check sizes */ |
294 |
– |
if (ni_rows <= 0) |
295 |
– |
ni_rows = no_columns; |
296 |
– |
if (ni_columns <= 0) |
297 |
– |
ni_columns = no_rows; |
303 |
|
if ((ni_rows <= 0) & (ni_columns > 0)) |
304 |
|
ni_rows = nrecords/ni_columns; |
305 |
|
if ((ni_columns <= 0) & (ni_rows > 0)) |