fnkdat

Name

fnkdat --  get a directory name

Synopsis

#include "fnkdat.h"

int fnkdat ( const char* target , char* buffer , int len , int flags );

INTRODUCTION

system-independent, adj.:
   Works equally poorly on all systems.
                             -- unknown
         

Fnkdat provides an interface for determining common directory names in Win32 and UNIX applications.

Appications organize files differently on different platforms. On Win32 systems, an application is generally installed by a user and it is usually (more-or-less) installed entirely under a single tree. For example, the game OmniHype might be installed in the directory C:\Program Files\OmniHype\. Its maps or data may be in C:\Program Files\OmniHype\maps\, and the system configuration might be C:\Program Files\OmniHype\config.dat. Information specific to the user straczynski (such as keyboard/mouse settings) might be stored under G:\Documents and Settings\Straczynski\Application Data\OmniHype\ in Windows NT and its derivatives, and under C:\Program Files\OmniHype\users\straczynski\ in Windows 95 and its derivatives.

On a UNIX system the story is completely different. An application may be compiled by a user or a packager, and file locations (at least one of them, anyway) are often defined at compile-time. The application is then installed by a user or a system administrator, relative to a prefix (such as /usr/). Following the above example, the binary for the game OmniHype may be installed as /usr/bin/omnihype. Its maps or data may be in /usr/share/omnihype/maps/. The system configuration may be /etc/omnihype.conf, and information specific to the user straczynski may be stored under ~straczynski/.omnihype/.

fnkdat is an attempt to cope with these differences.

USAGE

fnkdat is implemented as a single function. The source is released under a GUILE style license and may be statically linked to both public and commercial software. The license text, links to the source, and a couple tutorials are listed below.

PLATFORMS

fnkdat has been tested, and runs on the following platforms:

fnkdat compiles on the following, though I doubt very much that the values being returned are correct. Patches welcome.

DOWNLOAD

You can get fnkdat as a tarball, zip, or RedHat RPM. fnkdat-0.0.8.tar.gz, fnkdat-0.0.8.zip

MANUAL

The fnkdat manpage is avaliable in several formats: HTML, PS, PDF, TXT

TUTORIALS

fnkapp

HTML, PS, PDF, TXT A tutorial of how to use fnkdat with a simple Makefile. The complete tutorial is included in the distributions listed above.

VERSION

fnkdat-0.0.8

WEBPAGE

This project is hosted by the GNU Savannah Website; Patches, mailing lists, and distributions can be found there. http://savannah.nongnu.org/projects/fnkdat/.

You can join the mailing lists here http://savannah.gnu.org/mail/?group_id=1650.

The latest version, additional information, tutorials, and source can be found on the project homepage at http://www.maccormack.net/~djm/fnkdat/

AUTHOR

Written by David MacCormack

REPORTING BUGS

Report bugs to djm at maccormack dot net

COPYING

fnkdat - an interface for determining common directory names

Copyright (C) 2001, 2002 David MacCormack

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

As a special exception, David MacCormack gives permission for additional uses of the text contained in the files named ``fnkdat.h'' and ``fnkdat.c'', hereafter known as FNKDAT.

The exception is that, if you link the FNKDAT with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the FNKDAT code into it.

This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License.

This exception applies only to the code released by David MacCormack under the name FNKDAT. If you copy code from other software into a copy of FNKDAT, as the General Public License permits, the exception does not apply to the code that you add in this way. To avoid misleading anyone as to the status of such modified files, you must delete this exception notice from them.

If you write modifications of your own for FNKDAT, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice.

David MacCormack (djm at maccormack dot net)

FILES

fnkdat.h, fnkdat.c, fnkdat.sgm, ChangeLog