📄 phylip.h
字号:
#ifndef _PHYLIP_H_#define _PHYLIP_H_/* version 3.6a3. (c) Copyright 1993-2002 by the University of Washington. Written by Joseph Felsenstein, Akiko Fuseki, Sean Lamont, Andrew Keeffe, Mike Palczewski, Doug Buxton and Dan Fineman. Permission is granted to copy and use this program provided no fee is charged for it and provided that this copyright notice is not removed. */#define VERSION "3.6a3"/* machine-specific stuff: based on a number of factors in the library stdlib.h, we will try to determine what kind of machine/compiler this program is being built on. However, it doesn't always succeed. However, if you have ANSI conforming C, it will probably work. We will try to figure out machine type based on defines in stdio, and compiler-defined things as well.: */#include <stdio.h>#include <stdlib.h>#ifdef WIN32#include <windows.h>void phyClearScreen(void);void phySaveConsoleAttributes(void);void phySetConsoleAttributes(void);void phyRestoreConsoleAttributes(void);void phyFillScreenColor(void);#endif// #ifndef WIN32// #include <unistd.h> /* Contains the close(FILE *f) declaration */// #endif#ifdef GNUDOS#define DJGPP#define DOS#endif#ifdef THINK_C#define MAC#endif#ifdef __MWERKS__#ifndef WIN32#define MAC#endif#endif#ifdef __CMS_OPEN#define CMS#define EBCDIC true#define INFILE "infile data"#define OUTFILE "outfile data"#define FONTFILE "fontfile data"#define PLOTFILE "plotfile data"#define INTREE "intree data"#define INTREE2 "intree data 2"#define OUTTREE "outtree data"#define CATFILE "categories data"#define WEIGHTFILE "weights data"#define ANCFILE "ancestors data"#define MIXFILE "mixture data"#define FACTFILE "factors data"#else#define EBCDIC false#define INFILE "infile"#define OUTFILE "outfile"#define FONTFILE "fontfile" /* on unix this might be /usr/local/lib/fontfile */#define PLOTFILE "plotfile"#define INTREE "intree"#define INTREE2 "intree2"#define OUTTREE "outtree"#define CATFILE "categories"#define WEIGHTFILE "weights"#define ANCFILE "ancestors"#define MIXFILE "mixture"#define FACTFILE "factors"#endif#ifdef L_ctermid /* try and detect for sysV or V7. */#define SYSTEM_FIVE#endif#ifdef sequent#define SYSTEM_FIVE#endif#ifndef SYSTEM_FIVE#include <stdlib.h># if defined(_STDLIB_H_) || defined(_H_STDLIB) || defined(H_SCCSID) || defined(unix)# define UNIX# define MACHINE_TYPE "BSD Unix C"# endif#endif#ifdef __STDIO_LOADED#define VMS#define MACHINE_TYPE "VAX/VMS C"#endif#ifdef __WATCOMC__#define QUICKC#define WATCOM#define DOS#include "graph.h"#endif/* watcom-c has graphics library calls that are almost identical to * * quick-c, so the "QUICKC" symbol name stays. */#ifdef _QC#define MACHINE_TYPE "MS-DOS / Quick C"#define QUICKC#include "graph.h"#define DOS#endif#ifdef _DOS_MODE#define MACHINE_TYPE "MS-DOS /Microsoft C "#define DOS /* DOS is always defined if on a DOS machine */#define MSC /* MSC is defined for microsoft C */#endif#ifdef __MSDOS__ /* TURBO c compiler, ONLY (no other DOS C compilers) */#define DOS#define TURBOC#include <stdlib.h>#include <graphics.h>#endif#ifdef DJGPP /* DJ Delorie's original gnu C/C++ port */#include <graphics.h>#endif#ifndef MACHINE_TYPE#define MACHINE_TYPE "ANSI C"#endif#ifdef DOS#define MALLOCRETURN void #else#define MALLOCRETURN void#endif#ifdef VMS#define signed /* signed doesn't exist in VMS */#endif/* default screen types *//* if on a DOS but not a Windows system can use IBM PC screen controls */#ifdef DOS#ifndef WIN32#define IBMCRT true#define ANSICRT false#endif#endif/* if on a Mac cannot use screen controls */#ifdef MAC#define IBMCRT false #define ANSICRT false#endif/* if on a Windows system cannot use screen controls */#ifdef WIN32#define IBMCRT false #define ANSICRT false#endif/* otherwise, let's assume we are on a Linux or Unix system with no ANSI terminal controls */#ifndef MAC#ifndef DOS#ifndef WIN32#define IBMCRT false #define ANSICRT false#endif#endif#endif#ifdef DJGPP#undef MALLOCRETURN#define MALLOCRETURN void#endif/* includes: */#ifdef UNIX#include <strings.h>#else#include <string.h>#endif#include <math.h>#include <ctype.h>#ifdef MAC/* debug beerli */#ifdef DRAW#include "interface.h"#else#include "macface.h"#endif#define getch gettch#endif/* directory delimiters */#ifdef MAC#define DELIMITER ':'#else #ifdef WIN32#define DELIMITER '\\'#else #define DELIMITER '/'#endif#endif#define FClose(file) if (file) fclose(file) ; file=NULL#define Malloc(x) mymalloc((long)x)typedef void *Anyptr;#define Signed signed#define Const const#define Volatile volatile#define Char char /* Characters (not bytes) */#define Static static /* Private global funcs and vars */#define Local static /* Nested functions */typedef unsigned char boolean;#define true 1#define false 0#define SETBITS 31MALLOCRETURN *mymalloc(long);#define FNMLNGTH 200 /* length of array to store a file name */#define MAXNCH 20#define nmlngth 10 /* number of characters in species name */#define maxcategs 9 /* maximum number of site types */#define maxcategs2 11 /* maximum number of site types + 2 */#define point "."#define pointe '.'#define down 2#define smoothings 4 /* number of passes through smoothing algorithm */#define iterations 4 /* number of iterates for each branch */#define epsilon 0.0001 /* small number used in makenewv */#define EPSILON 0.00001 /* small number used in hermite root-finding */#define initialv 0.1 /* starting branch length unless otherwise */#define over 60 /* maximum width all branches of tree on screen */#define SQRTPI 1.7724538509055160273#define SQRT2 1.4142135623730950488typedef long *steptr;typedef long longer[6];typedef char naym[MAXNCH];typedef long *bitptr;typedef double raterootarray[maxcategs2][maxcategs2];typedef struct bestelm { long *btree; boolean gloreange; boolean locreange; boolean collapse;} bestelm;extern FILE *infile, *outfile, *intree, *intree2, *outtree, *weightfile, *catfile, *ancfile, *mixfile, *factfile;extern long spp, words, bits;extern boolean ibmpc, ansi, tranvsp;extern naym *nayme; /* names of species */#define ebcdic EBCDICtypedef Char plotstring[MAXNCH];/* Approx. 1GB, used to test for memory request errors */#define TOO_MUCH_MEMORY 1000000000/* The below pre-processor commands define the type used to store group arrays. We can't use #elif for metrowerks, so we use cascaded if statements */#include <limits.h>/* K&R says that there should be a plus in front of the number, but no machine we've seen actually uses one; we'll include it just in case. */#define MAX_32BITS 2147483647#define MAX_32BITS_PLUS +2147483647/* If ints are 4 bytes, use them */#if INT_MAX == MAX_32BITStypedef int group_type;#else #if INT_MAX == MAX_32BITS_PLUS
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -