@@ -1228,9 +1228,9 @@ the @var{runtime} structure with the value compiled into the module:
1228
1228
1229
1229
@example
1230
1230
int
1231
- emacs_module_init (struct emacs_runtime *ert )
1231
+ emacs_module_init (struct emacs_runtime *runtime )
1232
1232
@{
1233
- if (ert ->size < sizeof (*ert ))
1233
+ if (runtime ->size < sizeof (*runtime ))
1234
1234
return 1;
1235
1235
@}
1236
1236
@end example
@@ -1247,7 +1247,7 @@ assumes it is part of the @code{emacs_module_init} function shown
1247
1247
above:
1248
1248
1249
1249
@example
1250
- emacs_env *env = ert ->get_environment (ert );
1250
+ emacs_env *env = runtime ->get_environment (runtime );
1251
1251
if (env->size < sizeof (*env))
1252
1252
return 2;
1253
1253
@end example
@@ -1264,7 +1264,7 @@ Emacs, by comparing the size of the environment passed by Emacs with
1264
1264
known sizes, like this:
1265
1265
1266
1266
@example
1267
- emacs_env *env = ert ->get_environment (ert );
1267
+ emacs_env *env = runtime ->get_environment (runtime );
1268
1268
if (env->size >= sizeof (struct emacs_env_26))
1269
1269
emacs_version = 26; /* Emacs 26 or later. */
1270
1270
else if (env->size >= sizeof (struct emacs_env_25))
@@ -1388,7 +1388,7 @@ Combining the above steps, code that arranges for a C function
1388
1388
look like this, as part of the module initialization function:
1389
1389
1390
1390
@example
1391
- emacs_env *env = ert ->get_environment (ert );
1391
+ emacs_env *env = runtime ->get_environment (runtime );
1392
1392
emacs_value func = env->make_function (env, min_arity, max_arity,
1393
1393
module_func, docstring, data);
1394
1394
emacs_value symbol = env->intern (env, "module-func");
@@ -1508,9 +1508,10 @@ overflow in the size calculation.
1508
1508
@end deftypefn
1509
1509
1510
1510
@deftp {Type alias} emacs_limb_t
1511
- This is an unsigned integer type,
1512
- used as the element type for the magnitude arrays for the big
1513
- integer conversion functions.
1511
+ This is an unsigned integer type, used as the element type for the
1512
+ magnitude arrays for the big integer conversion functions. The type
1513
+ is guaranteed to have unique object representations, i.e., no padding
1514
+ bits.
1514
1515
@end deftp
1515
1516
1516
1517
@defvr Macro EMACS_LIMB_MAX
@@ -1524,12 +1525,11 @@ This function returns the value of a Lisp float specified by
1524
1525
@var {arg }, as a C @code {double } value.
1525
1526
@end deftypefn
1526
1527
1527
- @deftypefn Function struct timespec extract_time (emacs_env * @var {env }, emacs_value @var {time })
1528
- This function, which is available since Emacs 27, interprets
1529
- @var {time } as an Emacs Lisp time value and returns the corresponding
1530
- @code {struct timespec }. @xref {Time of Day }. @code {struct timespec }
1531
- represents a timestamp with nanosecond precision. It has the
1532
- following members:
1528
+ @deftypefn Function struct timespec extract_time (emacs_env * @var {env }, emacs_value @var {arg })
1529
+ This function, which is available since Emacs 27, interprets @var {arg }
1530
+ as an Emacs Lisp time value and returns the corresponding @code {struct
1531
+ timespec }. @xref {Time of Day }. @code {struct timespec } represents a
1532
+ timestamp with nanosecond precision. It has the following members:
1533
1533
1534
1534
@table @code
1535
1535
@item time_t tv_sec
@@ -1727,9 +1727,9 @@ next_prime (emacs_env *env, ptrdiff_t nargs, emacs_value *args,
1727
1727
@}
1728
1728
1729
1729
int
1730
- emacs_module_init (struct emacs_runtime *ert )
1730
+ emacs_module_init (struct emacs_runtime *runtime )
1731
1731
@{
1732
- emacs_env *env = ert ->get_environment (ert );
1732
+ emacs_env *env = runtime ->get_environment (runtime );
1733
1733
emacs_value symbol = env->intern (env, "next-prime");
1734
1734
emacs_value func
1735
1735
= env->make_function (env, 1, 1, next_prime, NULL, NULL);
@@ -1756,16 +1756,15 @@ there's no requirement that @var{time} be normalized. This means that
1756
1756
@code {@var {time }.tv_nsec } can be negative or larger than 999,999,999.
1757
1757
@end deftypefn
1758
1758
1759
- @deftypefn Function emacs_value make_string (emacs_env * @var {env }, const char * @var {str }, ptrdiff_t @var {strlen })
1759
+ @deftypefn Function emacs_value make_string (emacs_env * @var {env }, const char * @var {str }, ptrdiff_t @var {len })
1760
1760
This function creates an Emacs string from C text string pointed by
1761
1761
@var {str } whose length in bytes, not including the terminating null
1762
- byte, is @var {strlen }. The original string in @var {str } can be either
1763
- an @acronym {ASCII } string or a UTF-8 encoded non-@acronym {ASCII }
1764
- string; it can include embedded null bytes, and doesn't have to end in
1765
- a terminating null byte at @code {@var {str }[ @var {strlen }] }. The
1766
- function raises the @code {overflow-error } error condition if
1767
- @var {strlen } is negative or exceeds the maximum length of an Emacs
1768
- string.
1762
+ byte, is @var {len }. The original string in @var {str } can be either an
1763
+ @acronym {ASCII } string or a UTF-8 encoded non-@acronym {ASCII } string;
1764
+ it can include embedded null bytes, and doesn't have to end in a
1765
+ terminating null byte at @code {@var {str }[ @var {len }] }. The function
1766
+ raises the @code {overflow-error } error condition if @var {len } is
1767
+ negative or exceeds the maximum length of an Emacs string.
1769
1768
@end deftypefn
1770
1769
1771
1770
The @acronym {API } does not provide functions to manipulate Lisp data
@@ -1822,25 +1821,27 @@ garbage-collected. Don't run any expensive code in a finalizer,
1822
1821
because GC must finish quickly to keep Emacs responsive.
1823
1822
@end deftypefn
1824
1823
1825
- @deftypefn Function void *get_user_ptr (emacs_env * @var {env }, emacs_value val )
1824
+ @deftypefn Function void *get_user_ptr (emacs_env * @var {env }, emacs_value @var { arg } )
1826
1825
This function extracts the C pointer from the Lisp object represented
1827
- by @var {val }.
1826
+ by @var {arg }.
1828
1827
@end deftypefn
1829
1828
1830
- @deftypefn Function void set_user_ptr (emacs_env * @var {env }, emacs_value @var {value }, void * @var {ptr })
1829
+ @deftypefn Function void set_user_ptr (emacs_env * @var {env }, emacs_value @var {arg }, void * @var {ptr })
1831
1830
This function sets the C pointer embedded in the @code {user-ptr }
1832
- object represented by @var {value } to @var {ptr }.
1831
+ object represented by @var {arg } to @var {ptr }.
1833
1832
@end deftypefn
1834
1833
1835
- @deftypefn Function emacs_finalizer get_user_finalizer (emacs_env * @var {env }, emacs_value val )
1834
+ @deftypefn Function emacs_finalizer get_user_finalizer (emacs_env * @var {env }, emacs_value @var { arg } )
1836
1835
This function returns the finalizer of the @code {user-ptr } object
1837
- represented by @var {val }, or @code {NULL } if it doesn't have a finalizer.
1836
+ represented by @var {arg }, or @code {NULL } if it doesn't have a
1837
+ finalizer.
1838
1838
@end deftypefn
1839
1839
1840
- @deftypefn Function void set_user_finalizer (emacs_env * @var {env }, emacs_value @var {val }, emacs_finalizer @var {fin })
1840
+ @deftypefn Function void set_user_finalizer (emacs_env * @var {env }, emacs_value @var {arg }, emacs_finalizer @var {fin })
1841
1841
This function changes the finalizer of the @code {user-ptr } object
1842
- represented by @var {val } to be @var {fin }. If @var {fin } is a
1843
- @code {NULL } pointer, the @code {user-ptr } object will have no finalizer.
1842
+ represented by @var {arg } to be @var {fin }. If @var {fin } is a
1843
+ @code {NULL } pointer, the @code {user-ptr } object will have no
1844
+ finalizer.
1844
1845
@end deftypefn
1845
1846
1846
1847
@node Module Misc
@@ -1853,20 +1854,20 @@ be called via the @code{emacs_env} pointer. Description of functions
1853
1854
that were introduced after Emacs 25 calls out the first version where
1854
1855
they became available.
1855
1856
1856
- @deftypefn Function bool eq (emacs_env * @var {env }, emacs_value @var {val1 }, emacs_value @var {val2 })
1857
+ @deftypefn Function bool eq (emacs_env * @var {env }, emacs_value @var {a }, emacs_value @var {b })
1857
1858
This function returns @code {true } if the Lisp objects represented by
1858
- @var {val1 } and @var {val2 } are identical, @code {false } otherwise. This
1859
- is the same as the Lisp function @code {eq } (@pxref {Equality
1860
- Predicates }), but avoids the need to intern the objects represented by
1861
- the arguments.
1859
+ @var {a } and @var {b } are identical, @code {false } otherwise. This is
1860
+ the same as the Lisp function @code {eq } (@pxref {Equality Predicates }),
1861
+ but avoids the need to intern the objects represented by the
1862
+ arguments.
1862
1863
1863
1864
There are no @acronym {API } functions for other equality predicates, so
1864
1865
you will need to use @code {intern } and @code {funcall }, described
1865
1866
below, to perform more complex equality tests.
1866
1867
@end deftypefn
1867
1868
1868
- @deftypefn Function bool is_not_nil (emacs_env * @var {env }, emacs_value @var {val })
1869
- This function tests whether the Lisp object represented by @var {val }
1869
+ @deftypefn Function bool is_not_nil (emacs_env * @var {env }, emacs_value @var {arg })
1870
+ This function tests whether the Lisp object represented by @var {arg }
1870
1871
is non-@code {nil }; it returns @code {true } or @code {false } accordingly.
1871
1872
1872
1873
Note that you could implement an equivalent test by using
@@ -1875,12 +1876,12 @@ then use @code{eq}, described above, to test for equality. But using
1875
1876
this function is more convenient.
1876
1877
@end deftypefn
1877
1878
1878
- @deftypefn Function emacs_value type_of (emacs_env * @var {env }, emacs_value @code {object })
1879
- This function returns the type of @var {object } as a value that
1880
- represents a symbol: @code {string } for a string, @code {integer } for an
1881
- integer, @code {process } for a process, etc. @xref {Type Predicates }.
1882
- You can use @code {intern } and @code {eq } to compare against known type
1883
- symbols, if your code needs to depend on the object type.
1879
+ @deftypefn Function emacs_value type_of (emacs_env * @var {env }, emacs_value @code {arg })
1880
+ This function returns the type of @var {arg } as a value that represents
1881
+ a symbol: @code {string } for a string, @code {integer } for an integer,
1882
+ @code {process } for a process, etc. @xref {Type Predicates }. You can
1883
+ use @code {intern } and @code {eq } to compare against known type symbols,
1884
+ if your code needs to depend on the object type.
1884
1885
@end deftypefn
1885
1886
1886
1887
@anchor {intern }
@@ -2054,11 +2055,12 @@ One use of this function is when you want to re-throw a non-local exit
2054
2055
from one of the called @acronym {API } or Lisp functions.
2055
2056
@end deftypefn
2056
2057
2057
- @deftypefn Function void non_local_exit_signal (emacs_env * @var {env }, emacs_value @var {error }, emacs_value @var {data })
2058
- This function signals the error represented by @var {error } with the
2059
- specified error data @var {data }. The module function should return
2060
- soon after calling this function. This function could be useful,
2061
- e.g., for signaling errors from module functions to Emacs.
2058
+ @deftypefn Function void non_local_exit_signal (emacs_env * @var {env }, emacs_value @var {symbol }, emacs_value @var {data })
2059
+ This function signals the error represented by the error symbol
2060
+ @var {symbol } with the specified error data @var {data }. The module
2061
+ function should return soon after calling this function. This
2062
+ function could be useful, e.g., for signaling errors from module
2063
+ functions to Emacs.
2062
2064
@end deftypefn
2063
2065
2064
2066
0 commit comments