guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The GH interface. (was: Patch for gh.h)


From: Dirk Herrmann
Subject: Re: The GH interface. (was: Patch for gh.h)
Date: Tue, 8 May 2001 23:58:05 +0200 (MEST)

Keisuke Nishida <address@hidden> writes:
> What about renaming all public scm_ interface to gh_ and others to gl_?

On 8 May 2001, Rob Browning wrote:
>   foo.h -- public header containing the publically visible function.
>   foo_p.h -- private header containing functions that other .c files need.
>   foo.c -- foo source.
> 
> Then foo_p.h will include foo.h, and foo.c will include foo_p.h, and
> the _p.h headers don't get installed in /usr/include.  An alternate
> similar strategies would be to use a include/priv directory, but I
> don't particularly like that one during development because it makes
> accessing the foo.h foo_p.h pair harder from your editor.

IMO, the best solution is the one that was proposed by Neil Jerram in
this same thread:

> - invent a macro SCM_INTERNAL, and use it in libguile header files to
>   mark everything not considered portable, stable and appropriate for
>   external use (then Guile would #define SCM_INTERNAL, but
>   applications should normally not do so)

No additional files, no weird renaming.  Making a definition internal is
quite easy and just requires to put it between #ifdef SCM_INTERNAL #endif
pairs.  However, we also have the convention, that internal definitions
should use a scm_i_ or SCM_I_ prefix, but not many definitions follow this
rule yet.  A combination of both ideas (i. e. using SCM_INTERNAL
plus the scm_i_ / SCM_I_ prefix) seems nice.

The main part of the work, however, is to decide which definitions belong
to the public part and which are internal ones.

Best regards,
Dirk Herrmann




reply via email to

[Prev in Thread] Current Thread [Next in Thread]