Imported Upstream version 6.3

parents
This diff is collapsed.
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
This diff is collapsed.
ACLOCAL_AMFLAGS = -I m4
lib_LTLIBRARIES = ccp4/libccp4c.la
if FORTRAN_LIB
lib_LTLIBRARIES += fortran/libccp4f.la
endif
if GNU_FORTRAN
AM_FFLAGS = -fno-second-underscore
endif
ccp4datadir = $(datadir)/ccp4
ccp4includedir = $(includedir)/ccp4
ccp4_libccp4c_la_SOURCES = \
ccp4/ccp4_array.c ccp4/cmap_data.c ccp4/cmtzlib.c ccp4/ccp4_general.c \
ccp4/cmap_header.c ccp4/csymlib.c ccp4/ccp4_parser.c ccp4/cmap_labels.c \
ccp4/cvecmat.c ccp4/ccp4_program.c ccp4/cmap_open.c ccp4/library_err.c \
ccp4/ccp4_unitcell.c ccp4/cmap_skew.c ccp4/library_file.c \
ccp4/cmap_accessor.c ccp4/cmap_stats.c ccp4/library_utils.c ccp4/cmap_close.c \
ccp4/cmap_symop.c ccp4/pack_c.c
# FIXME: is ccp4/w32mvs.h needed here?
# is cmaplib_f.h a public header?
ccp4include_HEADERS = \
ccp4/ccp4_file_err.h ccp4/ccp4_program.h ccp4/ccp4_unitcell.h \
ccp4/cmap_errno.h ccp4/cmap_stats.h ccp4/csymlib.h \
ccp4/library_file.h ccp4/w32mvs.h ccp4/ccp4_fortran.h \
ccp4/ccp4_spg.h ccp4/ccp4_utils.h ccp4/cmap_header.h \
ccp4/cmaplib.h ccp4/cvecmat.h ccp4/mtzdata.h \
ccp4/ccp4_array.h ccp4/ccp4_general.h ccp4/ccp4_sysdep.h \
ccp4/ccp4_vars.h ccp4/cmap_labels.h ccp4/cmaplib_f.h \
ccp4/overview.h ccp4/ccp4_errno.h ccp4/ccp4_parser.h \
ccp4/ccp4_types.h ccp4/cmap_data.h ccp4/cmap_skew.h \
ccp4/cmtzlib.h ccp4/pack_c.h
fortran_libccp4f_la_SOURCES = \
fortran/ccp4_diskio_f.c fortran/ccp4_parser_f.c fortran/cmaplib_f.c \
fortran/csymlib_f.c fortran/ccp4_general_f.c fortran/ccp4_unitcell_f.c \
fortran/cmtzlib_f.c fortran/library_f.c \
\
fortran/ccplib.f fortran/fftlib.f fortran/modlib.f fortran/parser.f \
fortran/rwbrook.f fortran/libhtml.f fortran/keyparse.f \
fortran/dna_output.f fortran/pack_f.f fortran/pxxml.f fortran/lgglib.f \
fortran/plot84lib.f fortran/plotsubs.f \
fortran/cciflib.fh fortran/dna_header.fh \
fortran/harderiv.inc fortran/harsymm.inc \
fortran/harshell.inc fortran/harvest.inc
# there are two implementations of SRTBEG/SRTRLS/SRTMRG/SRTRET functions
# the sorting_main.f is probably better, but needs to be reviewed and tested
# before we switch to it on all platforms.
if HAVE_FORK
fortran_libccp4f_la_SOURCES += fortran/binsortint.c fortran/binsort.h
else
fortran_libccp4f_la_SOURCES += fortran/sorting_main.f
endif
nodist_fortran_libccp4f_la_SOURCES = fortran/unix.f
fortran_libccp4f_la_CPPFLAGS = -I$(srcdir)/ccp4
fortran_libccp4f_la_LIBADD = ccp4/libccp4c.la -lmmdb
if CCIF_API
fortran_libccp4f_la_SOURCES += fortran/harvlib.f fortran/cciflib.f
fortran_libccp4f_la_LIBADD += -lccif
else
fortran_libccp4f_la_SOURCES += fortran/harv_dummy.f
endif
BUILT_SOURCES = fortran/unix.f
CLEANFILES = fortran/unix.f
fortran/unix.f: fortran/unix.m4 Makefile
m4 $(M4_ARG) $< > $@
ccp4_libccp4c_la_LDFLAGS = -no-undefined
fortran_libccp4f_la_LDFLAGS = -no-undefined
dist_data_DATA = data/atomsf_neutron.lib data/atomsf.lib \
data/syminfo.lib data/symop.lib
# Files default.def and environ.def are not part of libccp4.
# They are included in CCP4 and may be useful for running programs
# compiled with libccp4 (see http://www.ccp4.ac.uk/dist/html/ccp4.html
# for details)
if FORTRAN_LIB
ccp4data_DATA = data/font84.dat
noinst_PROGRAMS = data/fontpack
data_fontpack_SOURCES = data/fontpack.f
data_fontpack_LDADD = fortran/libccp4f.la
dist_noinst_DATA = data/font84.ascii
CLEANFILES += data/font84.dat
endif
data/font84.dat: data/font84.ascii data/fontpack$(EXEEXT)
rm -f $@
[ -e data/font84.ascii ] || copy_font84_ascii=true; \
$${copy_font84_ascii:=false} && cp $< data/; \
( cd data/ && ./fontpack$(EXEEXT) ) && \
( $$copy_font84_ascii && rm -f data/font84.ascii ||: )
# FIXME: all files but the first are unused now, should they be distributed?
EXTRA_DIST = fortran/unix.m4 \
ccp4/w32mvs.c ccp4/vmslibrary.c \
fortran/vmsdiskio.for fortran/vms.for \
fortran/testlib.f fortran/mthlib.for fortran/w32mvs.f
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
ccp4_array.c: implementation file for resizable array implementation.
Copyright (C) 2002 Kevin Cowtan
This library is free software: you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
version 3, modified in accordance with the provisions of the
license to address the requirements of UK law.
You should have received a copy of the modified GNU Lesser General
Public License along with this library. If not, copies may be
downloaded from http://www.ccp4.ac.uk/ccp4license.php
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 Lesser General Public License for more details.
*/
/** @file ccp4_array.c
* implementation file for resizable array implementation.
* Kevin Cowtan
*/
#include "ccp4_array.h"
/* rcsid[] = "$Id: ccp4_array.c,v 1.5 2008/06/18 16:55:56 mdw Exp $" */
ccp4_ptr ccp4array_new_(ccp4_ptr *p)
{
ccp4array_base *v;
v = (ccp4array_base *)malloc(sizeof(ccp4array_base));
v->size = v->capacity = 0;
*p = (ccp4_ptr *)((ccp4_byteptr)(v)+sizeof(ccp4array_base));
return *p;
}
ccp4_ptr ccp4array_new_size_(ccp4_ptr *p, const int size, const size_t reclen)
{
ccp4array_base *v;
int capacity = (size * 12) / 10 + 2;
v = (ccp4array_base *)malloc(sizeof(ccp4array_base) + capacity * reclen);
v->size = size;
v->capacity = capacity;
*p = (ccp4_ptr *)((ccp4_byteptr)(v)+sizeof(ccp4array_base));
return *p;
}
void ccp4array_resize_(ccp4_ptr *p, const int size, const size_t reclen)
{
ccp4array_base *v;
v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base));
if (size > v->capacity) {
v->capacity = (size * 12) / 10 + 2;
v = (ccp4array_base *)realloc(v, sizeof(ccp4array_base) + v->capacity * reclen);
*p = (ccp4_ptr *)((ccp4_byteptr)(v)+sizeof(ccp4array_base));
}
v->size = size;
}
void ccp4array_reserve_(ccp4_ptr *p, const int size, const size_t reclen)
{
ccp4array_base *v;
v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base));
v->capacity = size;
if ( v->size > size ) v->size = size;
v = (ccp4array_base *)realloc(v, sizeof(ccp4array_base) + v->capacity * reclen);
*p = (ccp4_ptr *)((ccp4_byteptr)(v)+sizeof(ccp4array_base));
}
void ccp4array_append_(ccp4_ptr *p, ccp4_constptr data, const size_t reclen)
{
ccp4array_base *v;
int osize;
v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base));
osize = v->size;
ccp4array_resize_(p, osize+1, reclen);
memcpy((ccp4_byteptr)(*p)+osize*reclen, data, reclen);
}
void ccp4array_append_n_(ccp4_ptr *p, ccp4_constptr data, const int n, const size_t reclen)
{
ccp4array_base *v;
ccp4_byteptr newdata;
int osize, i;
v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base));
osize = v->size;
ccp4array_resize_(p, osize+n, reclen);
newdata = (ccp4_byteptr)(*p)+osize*reclen;
for ( i = 0; i < n; i++ ) {
memcpy(newdata, data, reclen);
newdata += reclen;
}
}
void ccp4array_append_list_(ccp4_ptr *p, ccp4_constptr data, const int n, const size_t reclen)
{
ccp4array_base *v;
int osize;
v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base));
osize = v->size;
ccp4array_resize_(p, osize+n, reclen);
memcpy((ccp4_byteptr)(*p)+osize*reclen, data, n * reclen);
}
void ccp4array_insert_(ccp4_ptr *p, const int i, ccp4_constptr data, const size_t reclen)
{
ccp4array_base *v;
int osize;
v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base));
osize = v->size;
ccp4array_resize_(p, osize+1, reclen);
memmove((ccp4_byteptr)(*p)+(i+1)*reclen, (ccp4_byteptr)(*p)+i*reclen, (osize-i)*reclen);
memcpy((ccp4_byteptr)(*p)+i*reclen, data, reclen);
}
void ccp4array_delete_ordered_(ccp4_ptr *p, const int i, const size_t reclen)
{
ccp4array_base *v;
int nsize;
v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base));
nsize = v->size - 1;
memmove((ccp4_byteptr)(*p)+i*reclen, (ccp4_byteptr)(*p)+(i+1)*reclen, (nsize-i)*reclen);
v->size--; /* ccp4array_resize_(p, nsize, reclen); */
}
void ccp4array_delete_(ccp4_ptr *p, const int i, const size_t reclen)
{
ccp4array_base *v;
int nsize;
v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base));
nsize = v->size - 1;
memcpy((ccp4_byteptr)(*p)+i*reclen, (ccp4_byteptr)(*p)+nsize*reclen, reclen);
v->size--; /* ccp4array_resize_(p, size, reclen); */
}
void ccp4array_delete_last_(ccp4_ptr *p, const size_t reclen)
{
ccp4array_base *v;
v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base));
v->size--; /* ccp4array_resize_(p, v->size-1, reclen); */
}
int ccp4array_size_(ccp4_constptr *p)
{
ccp4array_base *v;
v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base));
return v->size;
}
void ccp4array_free_(ccp4_ptr *p)
{
ccp4array_base *v;
v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base));
free(v);
}
This diff is collapsed.
This diff is collapsed.
/*
ccp4_file_err.h: header file with file handling error codes
Copyright (C) 2001 CCLRC, Charles Ballard
This library is free software: you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
version 3, modified in accordance with the provisions of the
license to address the requirements of UK law.
You should have received a copy of the modified GNU Lesser General
Public License along with this library. If not, copies may be
downloaded from http://www.ccp4.ac.uk/ccp4license.php
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 Lesser General Public License for more details.
*/
#ifndef _GUARD_FILE_ERR
#define _GUARD_FILE_ERR
#define CCP4_ERRNO(y) (CCP4_ERR_FILE | (y))
#define CIO_Ok 0
#define CIO_BadMode 1
#define CIO_CantOpenFile 2
#define CIO_MaxFile 3
#define CIO_ReadFail 4
#define CIO_WriteFail 5
#define CIO_CloseFail 6
#define CIO_SeekFail 7
#define CIO_NullPtr 8
#define CIO_EOF 9
#define CIO_NoFile 10
#define CIO_NotOpen 11
#define CIO_UnlinkFail 12
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
INTEGER*2 IFHT(150,4),IFSTRT(150,4),IFWID(150,4),IFX0(150,4),
+ IFY0(150,4),LENGF(150,4)
INTEGER*1 NFONTS(4,3000,4)
INTEGER IUNITF
DATA IUNITF/11/
C
C
IFAIL = 0
ITEROP = -IUNITF
CALL CCPDPN (-10,'font84.ascii','OLD','F',0,IFAIL)
CALL CCPDPN (ITEROP,'font84.dat','NEW','U',80,IFAIL)
READ(10,2000) IFSTRT,LENGF,IFX0,IFY0,IFWID,IFHT,NFONTS
2000 FORMAT(10I10)
WRITE (IUNITF) IFSTRT,LENGF,IFX0,IFY0,IFWID,IFHT,NFONTS
CLOSE (UNIT=IUNITF)
END
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment