Blame doc/fcatomic.fncs

Packit 352660
/*
Packit 352660
 * fontconfig/doc/fcatomic.fncs
Packit 352660
 *
Packit 352660
 * Copyright © 2003 Keith Packard
Packit 352660
 *
Packit 352660
 * Permission to use, copy, modify, distribute, and sell this software and its
Packit 352660
 * documentation for any purpose is hereby granted without fee, provided that
Packit 352660
 * the above copyright notice appear in all copies and that both that
Packit 352660
 * copyright notice and this permission notice appear in supporting
Packit 352660
 * documentation, and that the name of the author(s) not be used in
Packit 352660
 * advertising or publicity pertaining to distribution of the software without
Packit 352660
 * specific, written prior permission.  The authors make no
Packit 352660
 * representations about the suitability of this software for any purpose.  It
Packit 352660
 * is provided "as is" without express or implied warranty.
Packit 352660
 *
Packit 352660
 * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
Packit 352660
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
Packit 352660
 * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
Packit 352660
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
Packit 352660
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
Packit 352660
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
Packit 352660
 * PERFORMANCE OF THIS SOFTWARE.
Packit 352660
 */
Packit 352660
Packit 352660
@RET@           FcAtomic *
Packit 352660
@FUNC@          FcAtomicCreate
Packit 352660
@TYPE1@         const FcChar8   *           	@ARG1@          file
Packit 352660
@PURPOSE@	create an FcAtomic object
Packit 352660
@DESC@
Packit 352660
Creates a data structure containing data needed to control access to <parameter>file</parameter>.
Packit 352660
Writing is done to a separate file.  Once that file is complete, the original
Packit 352660
configuration file is atomically replaced so that reading process always see
Packit 352660
a consistent and complete file without the need to lock for reading.
Packit 352660
@@
Packit 352660
Packit 352660
@RET@           FcBool
Packit 352660
@FUNC@          FcAtomicLock
Packit 352660
@TYPE1@         FcAtomic *                      @ARG1@          atomic
Packit 352660
@PURPOSE@	lock a file
Packit 352660
@DESC@
Packit 352660
Attempts to lock the file referenced by <parameter>atomic</parameter>.
Packit 352660
Returns FcFalse if the file is already locked, else returns FcTrue and
Packit 352660
leaves the file locked.
Packit 352660
@@
Packit 352660
Packit 352660
@RET@           FcChar8 *
Packit 352660
@FUNC@          FcAtomicNewFile
Packit 352660
@TYPE1@         FcAtomic *                      @ARG1@          atomic
Packit 352660
@PURPOSE@	return new temporary file name 
Packit 352660
@DESC@
Packit 352660
Returns the filename for writing a new version of the file referenced
Packit 352660
by <parameter>atomic</parameter>.
Packit 352660
@@
Packit 352660
Packit 352660
@RET@           FcChar8 *
Packit 352660
@FUNC@          FcAtomicOrigFile
Packit 352660
@TYPE1@         FcAtomic *                      @ARG1@          atomic
Packit 352660
@PURPOSE@	return original file name
Packit 352660
@DESC@
Packit 352660
Returns the file referenced by <parameter>atomic</parameter>.
Packit 352660
@@
Packit 352660
Packit 352660
@RET@           FcBool
Packit 352660
@FUNC@          FcAtomicReplaceOrig
Packit 352660
@TYPE1@         FcAtomic *                      @ARG1@          atomic
Packit 352660
@PURPOSE@	replace original with new
Packit 352660
@DESC@
Packit 352660
Replaces the original file referenced by <parameter>atomic</parameter> with
Packit 352660
the new file. Returns FcFalse if the file cannot be replaced due to
Packit 352660
permission issues in the filesystem. Otherwise returns FcTrue.
Packit 352660
@@
Packit 352660
Packit 352660
@RET@           void
Packit 352660
@FUNC@          FcAtomicDeleteNew
Packit 352660
@TYPE1@         FcAtomic *                      @ARG1@          atomic
Packit 352660
@PURPOSE@	delete new file
Packit 352660
@DESC@
Packit 352660
Deletes the new file.  Used in error recovery to back out changes.
Packit 352660
@@
Packit 352660
Packit 352660
@RET@           void
Packit 352660
@FUNC@          FcAtomicUnlock
Packit 352660
@TYPE1@         FcAtomic *                      @ARG1@          atomic
Packit 352660
@PURPOSE@	unlock a file
Packit 352660
@DESC@
Packit 352660
Unlocks the file.
Packit 352660
@@
Packit 352660
Packit 352660
@RET@           void
Packit 352660
@FUNC@          FcAtomicDestroy
Packit 352660
@TYPE1@         FcAtomic *                      @ARG1@          atomic
Packit 352660
@PURPOSE@	destroy an FcAtomic object
Packit 352660
@DESC@
Packit 352660
Destroys <parameter>atomic</parameter>.
Packit 352660
@@