copydir prototype

Started by Robert Haasover 15 years ago3 messageshackers
Jump to latest
#1Robert Haas
robertmhaas@gmail.com

This patch:

http://git.postgresql.org/gitweb?p=postgresql.git;a=commit;h=bb0fe9feb9fd75a6aaa960028a9f810c883b0fc4

...did not tidy up after itself as well as it might have. In
particular, it left the prototype for copydir() in src/include/port.h,
while moving the source file from src/port/copydir.c to
src/backend/storage/file/copydir.c. I think this should probably be
cleaned up, but I'm a little uncertain where the best place to put
that prototype is. I am tempted to just put this in a new header file
named according to our usual conventions, namely
src/include/storage/copydir.c, but since there's only one public
function at present perhaps someone would like to argue for including
it in some other, already-exstant header.

A patch I'm working on needs to expose the copy_file() function, which
is currently static to copydir.c, so maybe it would be preferable to
rename copydir.c to copy.c and add the header as
src/include/storage/copy.h.

Thoughts?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Haas (#1)
Re: copydir prototype

Robert Haas <robertmhaas@gmail.com> writes:

This patch:
http://git.postgresql.org/gitweb?p=postgresql.git;a=commit;h=bb0fe9feb9fd75a6aaa960028a9f810c883b0fc4
...did not tidy up after itself as well as it might have. In
particular, it left the prototype for copydir() in src/include/port.h,
while moving the source file from src/port/copydir.c to
src/backend/storage/file/copydir.c. I think this should probably be
cleaned up, but I'm a little uncertain where the best place to put
that prototype is. I am tempted to just put this in a new header file
named according to our usual conventions, namely
src/include/storage/copydir.c, but since there's only one public
function at present perhaps someone would like to argue for including
it in some other, already-exstant header.

copydir.h I assume you meant? Seems reasonable.

A patch I'm working on needs to expose the copy_file() function, which
is currently static to copydir.c, so maybe it would be preferable to
rename copydir.c to copy.c and add the header as
src/include/storage/copy.h.

-1 for that. Aside from being generally opposed to inessential file
renamings, I think this will risk confusion with commands/copy.[ch].

regards, tom lane

#3Robert Haas
robertmhaas@gmail.com
In reply to: Tom Lane (#2)
Re: copydir prototype

On Fri, Nov 12, 2010 at 4:13 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Robert Haas <robertmhaas@gmail.com> writes:

This patch:
http://git.postgresql.org/gitweb?p=postgresql.git;a=commit;h=bb0fe9feb9fd75a6aaa960028a9f810c883b0fc4
...did not tidy up after itself as well as it might have.  In
particular, it left the prototype for copydir() in src/include/port.h,
while moving the source file from src/port/copydir.c to
src/backend/storage/file/copydir.c.  I think this should probably be
cleaned up, but I'm a little uncertain where the best place to put
that prototype is.  I am tempted to just put this in a new header file
named according to our usual conventions, namely
src/include/storage/copydir.c, but since there's only one public
function at present perhaps someone would like to argue for including
it in some other, already-exstant header.

copydir.h I assume you meant?  Seems reasonable.

A patch I'm working on needs to expose the copy_file() function, which
is currently static to copydir.c, so maybe it would be preferable to
rename copydir.c to copy.c and add the header as
src/include/storage/copy.h.

-1 for that.  Aside from being generally opposed to inessential file
renamings, I think this will risk confusion with commands/copy.[ch].

Good point. OK, I'll just go with copydir.h then.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company