[Top][All Lists]

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

Utility functions

From: Dmitry Bogatov
Subject: Utility functions
Date: Thu, 8 Nov 2012 15:38:26 +0400
User-agent: Mutt/1.5.21 (2010-09-15)

Hello, Gnulib team.
I have two questions or proposals.
First, is trivial function like this

    static inline void *
    xrangedup (const void *begin, const void *end)
      return xstrdup (begin, (char *) end - (char *) begin);

I think, that functions like this implemented over and over again across
different projects. So, probably we can add them to gnulib module,
estabilish naming conventions and make them semi-standart. If I read GNU
C source you can expect me to have prior knowledge of libc and gnulib,
but not your code. If make such functions header-only, static inline,
non-used functions will have no impact on binary size.

Second, less trivial is related to my research about Wget code.
In it, there is pretty untrivial code for getting home directory in
non-GNU systems. I cleaned it a bit, but I think, that this function
should find place in gnulib, where it will be used and enchanced.

Another routine, also related to wget, is parsing .netrc file(ftp
default logins/passwords). I admit, it is not too common task, but,
probably it also better fit gnulib, then wget.

Due modular structure of gnulib,
I think my proposals will not hurt.

Ready to discuss with constructive criticism.

And, another, unrelated question, why gl_INIT macro begins with
small letters? There is tradition, that macros are all caps.
Well, emacs think so by default.

Best regards, Dmitry Bogatov <address@hidden>,
        GNU Thales maintainer.
GPG: 54B7F00D

Attachment: pgp8E3nRkAB9n.pgp
Description: PGP signature

reply via email to

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