Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 91bcabdccb824ec72a416086efeaaf0e > files > 14

adime-devel-2.2.1-10.fc15.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><head><title>
Adime - API Reference: Other Functions
</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head><body bgcolor=white text=black link="#0000ee" alink="#ff0000" vlink="#551a8b">
<h1><a name="Other Functions">Other Functions</a></h1>

<ul>
<li><a href="#adime_double2string">adime_double2string</a>
<li><a href="#adime_evaluate">adime_evaluate</a>
<li><a href="#adime_scancode_to_pretty_name">adime_scancode_to_pretty_name</a>
<li><a href="#adime_scancode_to_short_name">adime_scancode_to_short_name</a>
<li><a href="#adime_short_name_to_scancode">adime_short_name_to_scancode</a>
<li><a href="#adime_udouble2string">adime_udouble2string</a>
<li><a href="#adime_uevaluate">adime_uevaluate</a>
</ul>

<p><br>
<hr><font size="+1"><b>double <a name="adime_evaluate">adime_evaluate</a>(const char *equation, int *error,
                      double (*var)(const char *name));</b></font><br>
   Helper function for evaluating arithmetic expressions, which may be
   useful in your programs even though it isn't really logically connected
   to the other functions (i.e. it's not a gui function). It evaluates the
   provided equation, returning the result, and storing a nonzero value in
   <tt>`error'</tt> if anything goes wrong. If the <tt>`var'</tt> function is not NULL, this
   will be called whenever a variable is encountered in the expression,
   allowing you to look up and return a suitable value for it. For more
   information on the expressions, see expressi.txt


<blockquote><font size="-1" face="helvetica,verdana"><em><b>See also:</b></em>
<a href="#adime_uevaluate">adime_uevaluate</a>.</font></blockquote>
<hr><font size="+1"><b>double <a name="adime_uevaluate">adime_uevaluate</a>(const char *equation, int *error,
                       double (*var)(const char *name));</b></font><br>
   Like `adime_evaluate()', but tweaked to fit Adime's purposes better: It
   silently accepts an empty string without error (being equivalent to "0"),
   it supports Unicode and it gives an error if the result is NaN.


<blockquote><font size="-1" face="helvetica,verdana"><em><b>See also:</b></em>
<a href="#adime_evaluate">adime_evaluate</a>.</font></blockquote>
<hr><font size="+1"><b>void <a name="adime_double2string">adime_double2string</a>(double x, char *buf);</b></font><br>
   Function for pretty-printing floating point numbers: The number gets at
   most 10 digits to the left of the decimal point, at most 9 to the right
   of it, and at most 10 totally. If the absolute value of the number is
   &gt;= 10000000000 or &lt; 0.000001, it is written in exponential form
   instead. Exponential form has at most 6 digits in the mantissa, so that
   the total number of digits never exceeds 9. Does not support Unicode.


<blockquote><font size="-1" face="helvetica,verdana"><em><b>See also:</b></em>
<a href="#adime_udouble2string">adime_udouble2string</a>.</font></blockquote>
<hr><font size="+1"><b>void <a name="adime_udouble2string">adime_udouble2string</a>(double val, char *buf)</b></font><br>
   Unicode-aware version of `adime_double2string()'.


<blockquote><font size="-1" face="helvetica,verdana"><em><b>See also:</b></em>
<a href="#adime_double2string">adime_double2string</a>.</font></blockquote>
<hr><font size="+1"><b>char *<a name="adime_scancode_to_short_name">adime_scancode_to_short_name</a>(int scancode, char *buf)</b></font><br>
   Converts a keyboard scancode to a string. The string is exactly the text
   after <tt>`KEY_'</tt> in the macro name for the key (so the function returns
   "DELETE" if you feed it with KEY_DELETE). Returns the buffer, or NULL if
   the scancode didn't match any known key.


<blockquote><font size="-1" face="helvetica,verdana"><em><b>See also:</b></em>
<a href="#adime_scancode_to_pretty_name">adime_scancode_to_pretty_name</a>,
<a href="#adime_short_name_to_scancode">adime_short_name_to_scancode</a>.</font></blockquote>
<hr><font size="+1"><b>char *<a name="adime_scancode_to_pretty_name">adime_scancode_to_pretty_name</a>(int scancode, char *buf)</b></font><br>
   The result from `adime_scancode_to_short_name()' is sometimes an
   abbreviation and may contain underscores. You may want to use this
   function instead if you are going to display the result for the user: it
   returns more user-friendly strings.


<blockquote><font size="-1" face="helvetica,verdana"><em><b>See also:</b></em>
<a href="#adime_scancode_to_short_name">adime_scancode_to_short_name</a>,
<a href="#adime_short_name_to_scancode">adime_short_name_to_scancode</a>.</font></blockquote>
<hr><font size="+1"><b>int <a name="adime_short_name_to_scancode">adime_short_name_to_scancode</a>(const char *short_name)</b></font><br>
   Given the name for a key as a string (in the format given by
   `adime_scancode_to_short_name()'), this function returns the scancode for
   the key, or -1 if the string doesn't represent any known scancode.




<blockquote><font size="-1" face="helvetica,verdana"><em><b>See also:</b></em>
<a href="#adime_scancode_to_short_name">adime_scancode_to_short_name</a>,
<a href="#adime_scancode_to_pretty_name">adime_scancode_to_pretty_name</a>.</font></blockquote>
<hr><a href="adime.html">Back to Contents</a>

</body>
</html>