diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2020-03-23 20:58:53 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2020-03-23 20:58:53 (GMT) |
commit | a89bcfda29cc45526eb3d6ab0a04c11bba317455 (patch) | |
tree | 837bf6ea9076d3ac979963d24b77850a93881927 /util | |
parent | ac0febb27e3309affa0cd34918bc76ff95cf6760 (diff) | |
download | blt-a89bcfda29cc45526eb3d6ab0a04c11bba317455.zip blt-a89bcfda29cc45526eb3d6ab0a04c11bba317455.tar.gz blt-a89bcfda29cc45526eb3d6ab0a04c11bba317455.tar.bz2 |
libfitsy
Diffstat (limited to 'util')
-rw-r--r-- | util/util.C | 25 | ||||
-rw-r--r-- | util/util.h | 17 |
2 files changed, 11 insertions, 31 deletions
diff --git a/util/util.C b/util/util.C index 00a9da3..1abc0e1 100644 --- a/util/util.C +++ b/util/util.C @@ -2,25 +2,28 @@ // Smithsonian Astrophysical Observatory, Cambridge, MA, USA // For conditions of distribution and use, see copyright notice in "copyright" -#include <tk.h> +#include <iostream> +#include <sstream> +#include <iomanip> +using namespace std; #include "util.h" -Tcl_Interp *global_interp; +static char tobuf[1024]; -static void swap2(char* src, char* dest) { +void swap2(char* src, char* dest) { *(dest ) = *(src+1); *(dest+1) = *(src ); } -static void swap4(char* src, char* dest) { +void swap4(char* src, char* dest) { *(dest ) = *(src+3); *(dest+1) = *(src+2); *(dest+2) = *(src+1); *(dest+3) = *(src ); } -static void swap8(char* src, char* dest) { +void swap8(char* src, char* dest) { *(dest ) = *(src+7); *(dest+1) = *(src+6); *(dest+2) = *(src+5); @@ -31,18 +34,12 @@ static void swap8(char* src, char* dest) { *(dest+7) = *(src ); } -static int lsb() +int lsb() { return (*(short *)"\001\000" & 0x0001); } -static void internalError(const char* msg) -{ - Tcl_SetVar2(global_interp, "ds9", "msg", msg, TCL_GLOBAL_ONLY); - Tcl_SetVar2(global_interp, "ds9", "msg,level", "error", TCL_GLOBAL_ONLY); -} - -static char* dupstr(const char* str) +char* dupstr(const char* str) { char* copy; if (str) { @@ -113,5 +110,3 @@ char* toConstUpper(const char* str) } return tobuf; } - -#endif diff --git a/util/util.h b/util/util.h index 096117d..fcbdb98 100644 --- a/util/util.h +++ b/util/util.h @@ -1,31 +1,16 @@ -// Copyright (C) 1999-2018 +// Copyright (C) 1999-2020 // Smithsonian Astrophysical Observatory, Cambridge, MA, USA // For conditions of distribution and use, see copyright notice in "copyright" -// important note: needs to be included first as X11 defs are here - #ifndef __util_h__ #define __util_h__ -#include <stdlib.h> -#include <string.h> -#include <limits.h> -#include <float.h> -#include <math.h> - -#include <iostream> -#include <sstream> -#include <iomanip> -using namespace std; - extern int lsb(); extern void swap2(char* src, char* dest); extern void swap4(char* src, char* dest); extern void swap8(char* src, char* dest); -extern void internalError(const char*); - extern char* dupstr(const char*); extern char* trim(const char*); extern char* toLower(const char*); |