Editing
Library Reference
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=C API= ==Macros== The following useful macros are accessible through the C and C++ APIs: {|class="wikitable" |- ! colspan="3" style="background:#ffdead;"|Functions |- | '''Name''' || '''Value''' || '''Meaning''' |- | SF_ABS(a) || (a) >= 0 ? (a) : (-(a)) || Absolute value |- | SF_MAX(a,b) || (a) < (b) ? (b) : (a) || Maximum of two values |- | SF_MIN(a,b) || (a) < (b) ? (a) : (b) || Minimum of two values |- | SF_SIG(a) || (a) >= 0 ? 1 : -1 || Sign function |} {|class="wikitable" |- ! colspan="3" style="background:#ffdead;"|General constants |- | '''Name''' || '''Value''' || '''Meaning''' |- | SF_EOL || '\014' || End-of-line ASCII character |- | SF_EOT || '\004' || End-of-transmission ASCII character |- | SF_EPS || FLT_EPSILON || The smallest X of type float such that 1.0 + X != 1.0. From <tt>float.h</tt> |- | SF_HUGE || FLT_MAX || The largest finite representable value of type float. From <tt>float.h</tt> |- | SF_MAX_DIM || 9 || Maximum number of dimensions in a RSF file |- | SF_PI || 3.141592653589793 || The number pi |} {|class="wikitable" |- ! colspan="3" style="background:#ffdead;"|SEG-Y-related constants |- | '''Name''' || '''Value''' || '''Meaning''' |- | SF_SEGY_FORMAT || 24 || Byte position in SEG-Y binary reel header, where info on encoding of data samples is kept ([[Guide_to_madagascar_programs#SEG-Y_specific_parameters|format parameter in sfsegyread]]) |- | SF_SEGY_NS || 20 || Byte position in SEG-Y binary reel header, where info on nr of samples in one trace is kept ([[Guide_to_madagascar_programs#Common_parameters|ns parameter in sfsegyread]]) |- | SF_SEGY_DT || 16 || Byte position in SEG-Y binary reel header, where info on time sampling is kept |- | SF_EBCBYTES || 3200 || Bytes in the SEG-Y EBCDIC reel header |- | SF_BNYBYTES || 400 || Bytes in the SEG-Y binary reel header |- | SF_HDRBYTES || 240 || Bytes in each individual SEG-Y trace header |- | SF_NKEYS || 71 || Number of mandated header fields |- | SF_BHKEYS || 27 || Number of mandated binary fields |} These macros were found with: <bash>grep '# define SF_' $RSFROOT/include/rsf.h</bash> ==Data types== See the [http://m8r.info/RSF/book/rsf/manual/manual_html/node8.html Data Types section of the Programming Reference Manual] ==Functions== See the [http://www.reproducibility.org/RSF/book/rsf/manual/manual_html/ Programming Reference Manual]. ==Function wrappers== These programs make the respective function callable from the command line, so that it can be used directly with files/other programs through "metaprograms" (shell/Python scripts). This allows the user to get the best of all worlds -- fast development in Python, all of Madagascar's visualization tools for debugging, and the speed of code written in C. This allows fast prototyping, followed by writing a production version in C calling the functions used. {| class="wikitable" align="center" cellspacing="0" border="1" !Library function || Program |- | sf_filedims || [http://reproducibility.org/RSF/sffiledims.html filedims] |- | sf_leftsize || [http://reproducibility.org/RSF/sfleftsize.html leftsize] |- | sf_quantile || [http://reproducibility.org/RSF/sfquantile.html quantile] |}
Summary:
Please note that all contributions to Madagascar are considered to be released under the GNU Free Documentation License 1.3 or later (see
My wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Getting Madagascar
download
Installation
GitHub repository
SEGTeX
Introduction
Package overview
Tutorial
Hands-on tour
Reproducible documents
Hall of Fame
User Documentation
List of programs
Common programs
Popular programs
The RSF file format
Reproducibility with SCons
Developer documentation
Adding programs
Contributing programs
API demo: clipping data
API demo: explicit finite differences
Community
Conferences
User mailing list
Developer mailing list
GitHub organization
LinkedIn group
Development blog
Twitter
Slack
Tools
What links here
Related changes
Special pages
Page information