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/util.C | |
parent | ac0febb27e3309affa0cd34918bc76ff95cf6760 (diff) | |
download | blt-a89bcfda29cc45526eb3d6ab0a04c11bba317455.zip blt-a89bcfda29cc45526eb3d6ab0a04c11bba317455.tar.gz blt-a89bcfda29cc45526eb3d6ab0a04c11bba317455.tar.bz2 |
libfitsy
Diffstat (limited to 'util/util.C')
-rw-r--r-- | util/util.C | 25 |
1 files changed, 10 insertions, 15 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 |