Hi.  I extracted getpath.c out of Python and modified it to make a
generally useful facility for C and C++ programming.  These comments
are at the top of my .c file, and I would like to know if they pass
muster for meeting licensing, copyright, and aesthetics requirements:

// -*- Mode: C; fill-column: 79 -*-

//=============================================================================
// Description:
//
//      pathToExecutable.c is a module that allows a Unix program to find the
//      location of its executable.  This capability is extremely useful for
//      writing programs that don't have to recompiled in order to be relocated
//      within the filesystem.  Any auxiliary files (dynamically loaded
//      libraries, help files, configuration files, etc.) can just be placed in
//      the same directory as the executable, and the function
//      pathToExecutable() can be used by the program at runtime to locate its
//      executable file and from there the program can locate any auxiliary
//      files it needs in order to operate.
//
//      pathToExecutable() is smart enough to follow a symlink (or even a chain
//      of symlinks) in order to find the true location of the executable.  In
//      this manner, for instance, you might install all of the files used by a
//      program (let's say it's called "my-program"), including the executable,
//      into the directory /usr/local/lib/my-program, and then put a symlink
//      into /usr/local/bin that points to the executable
//      /usr/local/lib/my-program/my-program.  Initially pathToExecutable()
//      will identify /usr/local/bin/my-program as the executable, but it will
//      then notice that this "file" is really a symbolic link.
//      pathToExecutable() will then follow the symbolic link and return
//      "/usr/local/lib/my-program/my-pogram" instead.
//
//      Before a program can call pathToExecutable(), setArgv() must be called
//      (canonically in main()) so that pathToExecutable() can fetch the value
//      of argv[0] and use it to help figure out where the executable is
//      located.
//
// Copyright and licensing information:
//
//      This software is a heavily modified version of getpath.c from the
//      Python 2.5.1 release.  Both this software and the original software
//      from which it is derived are freely distributable under the terms of
//      the permissive freeware license, Python Software Foundation License
//      Version 2.  You can read more about this license here:
//
//           http://www.python.org/psf/license
//
//      The original software from which this software is derived carries the
//      following copyright:
//
//         Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Python
//         Software Foundation.
//
//      The modifications to the original software, which are contained herein,
//      are
//
//         Copyright (c) 2007 Douglas Alan <doug AT alum.mit.edu>
//
//=============================================================================

Thanks,
|>oug
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to