tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
* Re: mdocml: Split apropos.c into db.c and apropos.h with simpler code
       [not found] <201111090124.pA91OOxI003613@krisdoz.my.domain>
@ 2011-11-12 23:14 ` Ingo Schwarze
  0 siblings, 0 replies; only message in thread
From: Ingo Schwarze @ 2011-11-12 23:14 UTC (permalink / raw)
  To: tech

Hi,

i fully agree with sharing code between apropos and man.cgi,
and i also think that having one interface (.h) file
and one file implementing that interface (.c) is fine,
so i'm looking forward to merging that to OpenBSD.

However, i dislike the file names for three reasons:

 1) The name db.c is too generic.
    There is a danger of confusing it with db(3) itself.
    On top of that, _if_ the name db.c would be apropriate
    for anything, then for code shared among apropos, man.cgi
    *and* mandocdb - this file, however, contains a lot of code
    that is for apropos and man.cgi only and will never be needed
    in mandocdb.

 2) The name apropos.h is too generic as well.
    This is not an interface of apropos in general,
    but instead an interface defining apropos-database
    interactions.

 3) It's unfortunate that an interface and the code implementing it
    bear different, even unrelated names - who would have thought
    that db.c implements apropos.h?  These names seem to imply
    that the two files belong to different layers, db.c to the
    lowest and apropos.h to the highest, while in fact both belong
    to the same, specifically the middle layer.

Do you agree to move both files to apropos_db.{h,c}?
I think that is what they really are: Database-related
functionality for apropos-like programs.

Yours,
  Ingo


kristaps@mdocml.bsd.lv wrote on Tue, Nov 08, 2011 at 08:24:24PM -0500:

> Log Message:
> -----------
> Split apropos.c into db.c and apropos.h with simpler code (re-written, but
> inspired by apropos.c and mandoc-tools' mandoc-cgi.c).  This uses UTF-8
> right now for its re-writing, but will soon accomodate for the regular
> suspects (this is a rather simple matter).
> 
> I also introduce man.cgi (cgi.c), which is a standalone CGI that replaces
> mandoc-tools' mandoc.cgi.  Right now it's just a framework.
> 
> Modified Files:
> --------------
>     mdocml:
>         Makefile
>         apropos.c
> 
> Added Files:
> -----------
>     mdocml:
>         apropos.h
>         cgi.c
>         db.c
[...]
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-11-12 23:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <201111090124.pA91OOxI003613@krisdoz.my.domain>
2011-11-12 23:14 ` mdocml: Split apropos.c into db.c and apropos.h with simpler code Ingo Schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).