summaryrefslogtreecommitdiffstats
path: root/src/dabUtils.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-08-22 20:59:28 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-08-22 20:59:28 +0200
commit2b99cb3f3d43c48d9292707725b6618b18944d42 (patch)
treeb53473af2bb46b121669fee9ba006de04520bc12 /src/dabUtils.cpp
parent289f61e5023758f1ca805d19be5f2c19757090e3 (diff)
downloaddabmux-2b99cb3f3d43c48d9292707725b6618b18944d42.tar.gz
dabmux-2b99cb3f3d43c48d9292707725b6618b18944d42.tar.bz2
dabmux-2b99cb3f3d43c48d9292707725b6618b18944d42.zip
Remove dabUtils.{h,cpp}, move to utils
Also remove the obsolete dump code
Diffstat (limited to 'src/dabUtils.cpp')
-rw-r--r--src/dabUtils.cpp52
1 files changed, 0 insertions, 52 deletions
diff --git a/src/dabUtils.cpp b/src/dabUtils.cpp
deleted file mode 100644
index dd2965b..0000000
--- a/src/dabUtils.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the
- Queen in Right of Canada (Communications Research Center Canada)
- */
-/*
- This file is part of ODR-DabMux.
-
- ODR-DabMux is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- ODR-DabMux 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with ODR-DabMux. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "dabUtils.h"
-
-long gregorian2mjd(int year,int month,int day)
-{
- long MJD;
-
- //This is the algorithm for the JD, just substract 2400000.5 for MJD
- year += 8000;
- if(month < 3) {
- year--;
- month += 12;
- }
- MJD = (year * 365) + (year / 4) - (year / 100) + (year / 400) - 1200820
- + ((month * 153 + 3) / 5) - 92 + (day - 1);
-
- return (long)(MJD - 2400000.5); //truncation, loss of data OK!
-}
-
-
-void dumpBytes(void* data, int size, FILE* out)
-{
- fprintf(out, "Packet of %i bytes", size);
-
- for (int index = 0; index < size; ++index) {
- if ((index % 8) == 0) {
- fprintf(out, "\n 0x%.4x(%.4i):", index, index);
- }
- fprintf(out, " 0x%.2x", ((unsigned char*)data)[index]);
- }
- fprintf(out, "\n\n");
-}