10.11.2012 Views

Reference Manual of the nadc-tools API and Libraries - SRON

Reference Manual of the nadc-tools API and Libraries - SRON

Reference Manual of the nadc-tools API and Libraries - SRON

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2.32 NADC SELECT<br />

Identifier NADC SELECT<br />

Author R.M. van Hees<br />

Language ANSI C<br />

Purpose return <strong>the</strong> kk-th smallest value <strong>of</strong> an array<br />

Usage val = SELECTx( kk, dim, xa );<br />

Input size t kk : index number <strong>of</strong> <strong>the</strong> array to return<br />

size t dim : dimension <strong>of</strong> <strong>the</strong> array to be sorted<br />

array *xa : pointer to array<br />

Returns value <strong>of</strong> <strong>the</strong> kk-th smallest value <strong>of</strong> an array<br />

Comment Contains SELECTs, SELECTi, SELECTr, SELECTd<br />

”x” specifies <strong>the</strong> data type <strong>of</strong> <strong>the</strong> input array, as follows:<br />

”s” short<br />

”i” integer<br />

”r” float<br />

”d” double<br />

2.33 NADC SHOW PARAM<br />

Identifier NADC SHOW PARAM<br />

Author R.M. van Hees<br />

Language ANSI C<br />

Purpose show comm<strong>and</strong>-line settings, as stored in <strong>the</strong> param-record<br />

Usage NADC SHOW PARAM( instrument, param );<br />

Input int instrument : code for instrument en data product level<br />

struct param record (A.1)<br />

param : struct holding user-defined settings<br />

Returns Nothing<br />

Comment None<br />

2.34 NADC STRING<br />

Identifier NADC STRING<br />

Author R.M. van Hees<br />

Language ANSI C<br />

Comment Compatible with *BSD<br />

contains: strlcpy, strlcat<br />

2.34.1 strlcpy<br />

Identifier strlcpy<br />

Purpose copy a NULL-terminated string into a sized buffer<br />

Usage nchar = strlcpy( dest, src, size );<br />

Input char *src : where to copy <strong>the</strong> string from<br />

size t size : size <strong>of</strong> destination buffer<br />

Output char *dest : where to copy <strong>the</strong> string to<br />

Returns length <strong>of</strong> <strong>the</strong> destination string<br />

Comment Compatible with *BSD: <strong>the</strong> result is always a valid<br />

NULL-terminated string that fits in <strong>the</strong> buffer (unless,<br />

<strong>of</strong> course, <strong>the</strong> buffer size is zero). It does not pad<br />

out <strong>the</strong> result like strncpy() does.<br />

50

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!