From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Stephani
How should module docstring= be written? We either:
* pick a new syntax and teach make-docfile how to parse it. This is
the clean approach IMO, but it requires more work. We can use a
sufficiently simple syntax so that it can be embedded in comments in
other languages than C.
* define DEFVAR/DEFUN macro in module API header file to a noop so
that make-docfile can parse it as it is.
As for the finalizer, I wanted to add a function in the API:
/* Finalizer prototype */
typedef int (*emacs_finalizer_function)(void *ptr);
emacs_value make_user_ptr (emacs_env *env,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0void *ptr, emacs_fin= alizer_function *fin);
Or we can have a full "method table" with printer function and ot= her
things we might need in the future. Although It's a bit overkill with just finalizer/printer...
/* Printer prototype */
typedef emacs_value (*emacs_printer_function)(void *ptr);
/* User-ptr operations */
typedef struct {
=C2=A0 emacs_finalizer_function *fin;
=C2=A0 emacs_printer_function *print;
=C2=A0 /* ... */
} emacs_user_ptr_ops;
emacs_value make_user_ptr (emacs_env *env,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0void *ptr, emacs_use= r_ptr_ops *ops);