Commit 09098345 authored by Éric Thiébaut's avatar Éric Thiébaut
Browse files

Re-organize headers

parent 6162bfc9
......@@ -7,9 +7,10 @@
// This file if part of TAO real-time software licensed under the MIT license
// (https://git-cral.univ-lyon1.fr/tao/tao-rt).
//
// Copyright (C) 2019-2021, Éric Thiébaut.
// Copyright (C) 2019-2022, Éric Thiébaut.
#include "tao-alpao.h"
#include "tao-errors.h"
#include "tao-generic.h"
#include <asdkWrapper.h>
......
#include "tao-alpao.h"
#include "tao-errors.h"
#include "tao-generic.h"
#include "tao-mirrors.h"
#include "tao-shared-private.h"
#include "tao-remote-mirrors-private.h"
#include <math.h>
#include <string.h>
......
......@@ -7,12 +7,12 @@
// This file if part of TAO real-time software licensed under the MIT license
// (https://git-cral.univ-lyon1.fr/tao/tao-rt).
//
// Copyright (C) 2019-2021, Éric Thiébaut.
// Copyright (C) 2019-2022, Éric Thiébaut.
#ifndef TAO_ALPAO_H_
#define TAO_ALPAO_H_ 1
#include <tao-mirrors.h>
#include <tao-remote-mirrors.h>
#include <stdbool.h>
......
// andor-core.c --
// andor-core.c -
//
// Core functions for Andor cameras.
//
......@@ -7,9 +7,10 @@
// This file if part of TAO real-time software licensed under the MIT license
// (https://git-cral.univ-lyon1.fr/tao/tao-rt).
//
// Copyright (C) 2019-2021, Éric Thiébaut.
// Copyright (C) 2019-2022, Éric Thiébaut.
#include "tao-andor-private.h"
#include "tao-errors.h"
#include <math.h>
#include <string.h>
......
......@@ -7,12 +7,13 @@
// This file if part of TAO real-time software licensed under the MIT license
// (https://git-cral.univ-lyon1.fr/tao/tao-rt).
//
// Copyright (C) 2019-2021, Éric Thiébaut.
// Copyright (C) 2019-2022, Éric Thiébaut.
#ifndef ANDOR_ERRORS_C_
#define ANDOR_ERRORS_C_ 1
#include "tao-andor-private.h"
#include "tao-errors.h"
static void get_error_details(
int code,
......
// andor-server.c --
// andor-server.c -
//
// Image server for Andor cameras.
//
......@@ -7,12 +7,15 @@
// This file if part of TAO real-time software licensed under the MIT license
// (https://git-cral.univ-lyon1.fr/tao/tao-rt).
//
// Copyright (C) 2019-2021, Éric Thiébaut.
// Copyright (C) 2019-2022, Éric Thiébaut.
#include "tao-andor.h"
#include "tao-config.h"
#include "tao-errors.h"
#include "tao-servers-private.h"
#include "tao-cameras-private.h"
#include "tao-remote-cameras-private.h"
#include "tao-shared-arrays-private.h"
#include <limits.h>
#include <stdlib.h>
......
......@@ -8,9 +8,10 @@
// This file if part of TAO real-time software licensed under the MIT license
// (https://git-cral.univ-lyon1.fr/tao/tao-rt).
//
// Copyright (C) 2019-2021, Éric Thiébaut.
// Copyright (C) 2019-2022, Éric Thiébaut.
#include <tao-andor.h>
#include <tao-errors.h>
int main(
int argc,
......
......@@ -7,11 +7,12 @@
// This file if part of TAO real-time software licensed under the MIT license
// (https://git-cral.univ-lyon1.fr/tao/tao-rt).
//
// Copyright (C) 2019-2021, Éric Thiébaut.
// Copyright (C) 2019-2022, Éric Thiébaut.
#include <string.h>
#include <time.h>
#include <tao-andor-private.h>
#include <tao-errors.h>
static double elapsed_seconds(
const tao_time* t1,
......
......@@ -7,11 +7,12 @@
// This file if part of TAO real-time software licensed under the MIT license
// (https://git-cral.univ-lyon1.fr/tao/tao-rt).
//
// Copyright (C) 2019-2021, Éric Thiébaut.
// Copyright (C) 2019-2022, Éric Thiébaut.
#include <wchar.h>
#include <string.h>
#include <tao-andor-private.h>
#include <tao-errors.h>
static void print_name(
FILE* output,
......
......@@ -8,12 +8,13 @@
// This file if part of TAO real-time software licensed under the MIT license
// (https://git-cral.univ-lyon1.fr/tao/tao-rt).
//
// Copyright (C) 2019-2021, Éric Thiébaut.
// Copyright (C) 2019-2022, Éric Thiébaut.
#include <string.h>
#include <time.h>
#include <tao-fits.h>
#include <tao-andor-private.h>
#include <tao-errors.h>
static double elapsed_seconds(
const tao_time* t1,
......
......@@ -9,11 +9,12 @@
// This file if part of TAO real-time software licensed under the MIT license
// (https://git-cral.univ-lyon1.fr/tao/tao-rt).
//
// Copyright (C) 2019-2021, Éric Thiébaut.
// Copyright (C) 2019-2022, Éric Thiébaut.
#ifndef TAO_ANDOR_PRIVATE_H_
#define TAO_ANDOR_PRIVATE_H_ 1
#include <tao-basics.h>
#include <tao-cameras-private.h>
#include <tao-andor-features.h>
......
......@@ -54,6 +54,7 @@ endif
include_HEADERS = \
tao-arrays.h \
tao-arrays-private.h \
tao-basics.h \
tao-buffers.h \
tao-cameras.h \
tao-cameras-private.h \
......@@ -65,16 +66,26 @@ include_HEADERS = \
tao-generic.h \
tao-locks.h \
tao-macros.h \
tao-mirrors.h \
tao-misc.h \
tao-options.h \
tao-preprocessing.h \
tao-remote-cameras.h \
tao-remote-cameras-private.h \
tao-remote-mirrors.h \
tao-remote-mirrors-private.h \
tao-remote-objects.h \
tao-remote-objects-private.h \
tao-rwlocked-objects.h \
tao-rwlocked-objects-private.h \
tao-servers.h \
tao-servers-private.h \
tao-shared.h \
tao-shared-private.h \
tao-shared-arrays.h \
tao-shared-arrays-private.h \
tao-shared-memory.h \
tao-shared-objects.h \
tao-shared-objects-private.h \
tao-threadpools.h \
tao-utils.h \
tao.h
tao-utils.h
libtao_la_SOURCES = \
arrays.c \
......
// arrays.c --
// arrays.c -
//
// Multi-dimensional arrays in TAO library (TAO is a library for Adaptive
// Optics software).
......@@ -8,10 +8,12 @@
// This file if part of TAO real-time software licensed under the MIT license
// (https://git-cral.univ-lyon1.fr/tao/tao-rt).
//
// Copyright (C) 2018-2021, Éric Thiébaut.
// Copyright (C) 2018-2022, Éric Thiébaut.
#include "tao-arrays-private.h"
#include "tao-utils.h"
#include "tao-errors.h"
#include "tao-macros.h"
#include <string.h>
......
// buffers.c --
// buffers.c -
//
// Implement i/o buffers in TAO library.
// Dynamic i/o buffers in TAO library.
//
//-----------------------------------------------------------------------------
//
// This file if part of TAO real-time software licensed under the MIT license
// (https://git-cral.univ-lyon1.fr/tao/tao-rt).
//
// Copyright (C) 2018-2021, Éric Thiébaut.
// Copyright (C) 2018-2022, Éric Thiébaut.
#include "tao-buffers.h"
#include "tao-macros.h"
#include "tao-errors.h"
#include "tao-utils.h"
#include <errno.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
......
......@@ -10,6 +10,9 @@
// Copyright (C) 2018-2021, Éric Thiébaut.
#include "tao-cameras-private.h"
#include "tao-remote-cameras-private.h"
#include "tao-shared-arrays-private.h"
#include "tao-errors.h"
#include "tao-generic.h"
#include "config.h"
......
// cmdline.c --
// cmdline.c -
//
// Packing of command arguments and parsing of comman lines.
// Packing of command arguments and parsing of command lines.
//
//-----------------------------------------------------------------------------
//
// This file if part of TAO real-time software licensed under the MIT license
// (https://git-cral.univ-lyon1.fr/tao/tao-rt).
//
// Copyright (C) 2018-2021, Éric Thiébaut.
// Copyright (C) 2018-2022, Éric Thiébaut.
#include "tao-utils.h"
#include "tao-buffers.h"
#include "tao-macros.h"
#include "tao-errors.h"
#include <stdbool.h>
#include <string.h>
......
......@@ -7,9 +7,11 @@
// This file if part of TAO real-time software licensed under the MIT license
// (https://git-cral.univ-lyon1.fr/tao/tao-rt).
//
// Copyright (C) 2018-2021, Éric Thiébaut.
// Copyright (C) 2018-2022, Éric Thiébaut.
#include "tao-config.h"
#include "tao-errors.h"
#include "tao-macros.h"
#include <errno.h>
#include <stdarg.h>
......
// copy.c --
// copy.c -
//
// Copy contents of multi-dimensional arrays in TAO library.
//
......@@ -7,11 +7,11 @@
// This file if part of TAO real-time software licensed under the MIT license
// (https://git-cral.univ-lyon1.fr/tao/tao-rt).
//
// Copyright (C) 2018-2021, Éric Thiébaut.
// Copyright (C) 2018-2022, Éric Thiébaut.
#include "tao-encodings.h"
#include "tao-arrays-private.h"
#include "tao-shared-private.h"
#include "tao-shared-arrays-private.h"
#include "tao-errors.h"
#include "config.h"
......
// encodings.c --
// encodings.c -
//
// Utilities for pixel encodings in TAO (TAO is a library for Adaptive Optics
// software).
......@@ -8,13 +8,14 @@
// This file if part of TAO real-time software licensed under the MIT license
// (https://git-cral.univ-lyon1.fr/tao/tao-rt).
//
// Copyright (C) 2018-2021, Éric Thiébaut.
// Copyright (C) 2018-2022, Éric Thiébaut.
#include "tao-encodings.h"
#include <ctype.h>
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......@@ -24,31 +25,28 @@
#define JOIN0(a,b) a##b
#define JOIN(a,b) JOIN0(a,b)
#define TAO__ELTYPE_int8_t TAO_INT8
#define TAO__ELTYPE_uint8_t TAO_UINT8
#define TAO__ELTYPE_int16_t TAO_INT16
#define TAO__ELTYPE_uint16_t TAO_UINT16
#define TAO__ELTYPE_int32_t TAO_INT32
#define TAO__ELTYPE_uint32_t TAO_UINT32
#define TAO__ELTYPE_int64_t TAO_INT64
#define TAO__ELTYPE_uint64_t TAO_UINT64
#define TAO__ELTYPE_float TAO_FLOAT
#define TAO__ELTYPE_double TAO_DOUBLE
// Constant for determining the native byte order.
const union tao__byte_order_mark tao__native_byte_order_mark = {{1, 2, 3, 4}};
#define ELTYPE_int8_t TAO_INT8
#define ELTYPE_uint8_t TAO_UINT8
#define ELTYPE_int16_t TAO_INT16
#define ELTYPE_uint16_t TAO_UINT16
#define ELTYPE_int32_t TAO_INT32
#define ELTYPE_uint32_t TAO_UINT32
#define ELTYPE_int64_t TAO_INT64
#define ELTYPE_uint64_t TAO_UINT64
#define ELTYPE_float TAO_FLOAT
#define ELTYPE_double TAO_DOUBLE
static struct {
const char* name;
const char* name;
const char* descr;
size_t size;
tao_eltype typ;
size_t size;
tao_eltype type;
tao_encoding enc;
} types[] = {
// The following table must be arranged in the same orderas the numbering
// of `tao_eltype`.
#define DEF(T, descr, enc) \
{ #T, descr, sizeof(T), JOIN(TAO__ELTYPE_,T), enc }
{ #T, descr, sizeof(T), JOIN(ELTYPE_,T), enc }
DEF(int8_t, "signed 8-bit integer",
TAO_ENCODING_SIGNED(8)),
DEF(uint8_t, "unsigned 8-bit integer",
......@@ -116,7 +114,7 @@ tao_eltype tao_eltype_of_encoding(
{
for (int i = 0; types[i].descr != NULL; ++i) {
if (types[i].enc == enc) {
return types[i].typ;
return types[i].type;
}
}
return 0;
......@@ -135,43 +133,43 @@ tao_status tao_format_encoding(
}
switch (TAO_ENCODING_COLORANT(enc)) {
case TAO__ENCODING_RAW:
case TAO_COLORANT_RAW:
col = "Raw";
break;
case TAO__ENCODING_MONO:
case TAO_COLORANT_MONO:
col = "Mono";
break;
case TAO__ENCODING_RGB:
case TAO_COLORANT_RGB:
col = "RGB";
break;
case TAO__ENCODING_BGR:
case TAO_COLORANT_BGR:
col = "BGR";
break;
case TAO__ENCODING_ARGB:
case TAO_COLORANT_ARGB:
col = "ARGB";
break;
case TAO__ENCODING_RGBA:
case TAO_COLORANT_RGBA:
col = "RGBA";
break;
case TAO__ENCODING_ABGR:
case TAO_COLORANT_ABGR:
col = "ABGR";
break;
case TAO__ENCODING_BGRA:
case TAO_COLORANT_BGRA:
col = "BGRA";
break;
case TAO__ENCODING_BAYER_RGGB:
case TAO_COLORANT_BAYER_RGGB:
col = "BayerRGGB";
break;
case TAO__ENCODING_BAYER_GRBG:
case TAO_COLORANT_BAYER_GRBG:
col = "BayerGRBG";
break;
case TAO__ENCODING_BAYER_GBRG:
case TAO_COLORANT_BAYER_GBRG:
col = "BayerGBRG";
break;
case TAO__ENCODING_BAYER_BGGR:
case TAO_COLORANT_BAYER_BGGR:
col = "BayerBGGR";
break;
case TAO__ENCODING_YUV444:
case TAO_COLORANT_YUV444:
if (enc == TAO_ENCODING_YUV444) {
col = "YUV444";
goto singleton;
......@@ -179,7 +177,7 @@ tao_status tao_format_encoding(
goto badvalue;
}
break;
case TAO__ENCODING_YUV422:
case TAO_COLORANT_YUV422:
if (enc == TAO_ENCODING_YUV422) {
col = "YUV422";
goto singleton;
......@@ -187,7 +185,7 @@ tao_status tao_format_encoding(
goto badvalue;
}
break;
case TAO__ENCODING_YUV411:
case TAO_COLORANT_YUV411:
if (enc == TAO_ENCODING_YUV411) {
col = "YUV411";
goto singleton;
......@@ -195,7 +193,7 @@ tao_status tao_format_encoding(
goto badvalue;
}
break;
case TAO__ENCODING_YUV420P:
case TAO_COLORANT_YUV420P:
if (enc == TAO_ENCODING_YUV420P) {
col = "YUV420p";
goto singleton;
......@@ -203,7 +201,7 @@ tao_status tao_format_encoding(
goto badvalue;
}
break;
case TAO__ENCODING_YUV420SP:
case TAO_COLORANT_YUV420SP:
if (enc == TAO_ENCODING_YUV420SP) {
col = "YUV420sp";
goto singleton;
......@@ -211,10 +209,10 @@ tao_status tao_format_encoding(
goto badvalue;
}
break;
case TAO__ENCODING_SIGNED:
case TAO_COLORANT_SIGNED:
col = "Signed";
break;
case TAO__ENCODING_FLOAT:
case TAO_COLORANT_FLOAT:
col = "Float";
break;
default:
......@@ -243,36 +241,36 @@ tao_status tao_format_encoding(
}
static struct {
const char* pfx;
const char* pfx;
tao_encoding col;
bool arg;
bool arg;
} encodings[] = {
{"Mono", TAO__ENCODING_MONO, true},
{"Monochrome", TAO__ENCODING_MONO, true},
{"Float", TAO__ENCODING_FLOAT, true},
{"Signed", TAO__ENCODING_SIGNED, true},
{"Unsigned", TAO__ENCODING_UNSIGNED, true},
{"Raw", TAO__ENCODING_RAW, true},
{"ARGB", TAO__ENCODING_ARGB, true},
{"ABGR", TAO__ENCODING_ABGR, true},
{"BGR", TAO__ENCODING_BGR, true},
{"BGRA", TAO__ENCODING_BGRA, true},
{"BayerRGGB", TAO__ENCODING_BAYER_RGGB, true},
{"BayerGRBG", TAO__ENCODING_BAYER_GRBG, true},
{"BayerGBRG", TAO__ENCODING_BAYER_GBRG, true},
{"BayerBGGR", TAO__ENCODING_BAYER_BGGR, true},
{"BAYER_RGGB", TAO__ENCODING_BAYER_RGGB, true},
{"BAYER_GRBG", TAO__ENCODING_BAYER_GRBG, true},
{"BAYER_GBRG", TAO__ENCODING_BAYER_GBRG, true},
{"BAYER_BGGR", TAO__ENCODING_BAYER_BGGR, true},
{"RGB", TAO__ENCODING_RGB, true},
{"RGBA", TAO__ENCODING_RGBA, true},
{"YUV444", TAO_ENCODING_YUV444, false},
{"YUV422", TAO_ENCODING_YUV422, false},
{"YUV411", TAO_ENCODING_YUV411, false},
{"YUV420P", TAO_ENCODING_YUV420P, false},
{"YUV420SP", TAO_ENCODING_YUV420SP, false},
{NULL, TAO_ENCODING_UNKNOWN, false},
{"Mono", TAO_COLORANT_MONO, true},
{"Monochrome", TAO_COLORANT_MONO, true},
{"Float", TAO_COLORANT_FLOAT, true},
{"Signed", TAO_COLORANT_SIGNED, true},
{"Unsigned", TAO_COLORANT_UNSIGNED, true},
{"Raw", TAO_COLORANT_RAW, true},
{"ARGB", TAO_COLORANT_ARGB, true},
{"ABGR", TAO_COLORANT_ABGR, true},
{"BGR", TAO_COLORANT_BGR, true},
{"BGRA", TAO_COLORANT_BGRA, true},
{"BayerRGGB", TAO_COLORANT_BAYER_RGGB, true},
{"BayerGRBG", TAO_COLORANT_BAYER_GRBG, true},
{"BayerGBRG", TAO_COLORANT_BAYER_GBRG, true},
{"BayerBGGR", TAO_COLORANT_BAYER_BGGR, true},
{"BAYER_RGGB", TAO_COLORANT_BAYER_RGGB, true},
{"BAYER_GRBG", TAO_COLORANT_BAYER_GRBG, true},
{"BAYER_GBRG", TAO_COLORANT_BAYER_GBRG, true},
{"BAYER_BGGR", TAO_COLORANT_BAYER_BGGR, true},
{"RGB", TAO_COLORANT_RGB, true},
{"RGBA", TAO_COLORANT_RGBA, true},
{"YUV444", TAO_ENCODING_YUV444, false},
{"YUV422", TAO_ENCODING_YUV422, false},
{"YUV411", TAO_ENCODING_YUV411, false},
{"YUV420P", TAO_ENCODING_YUV420P, false},
{"YUV420SP", TAO_ENCODING_YUV420SP, false},
{NULL, TAO_ENCODING_UNKNOWN, false},
};
tao_encoding tao_parse_encoding(
......@@ -377,11 +375,11 @@ tao_encoding tao_parse_encoding(
encodings[i].pfx[len] == '\0') {
col = encodings[i].col;
if (nargs == 1) {
return TAO__ENCODING_2(col, pxl);
return TAO_ENCODING_2_(col, pxl);
} else if (nargs == 2) {
return TAO__ENCODING_3(col, pxl, pkt);
return TAO_ENCODING_3_(col, pxl, pkt);
} else {
return TAO__ENCODING_4(col, pxl, pkt, flg);
return TAO_ENCODING_4_(col, pxl, pkt, flg);
}
}
}
......
......@@ -7,13 +7,12 @@
// This file if part of TAO real-time software licensed under the MIT license
// (https://git-cral.univ-lyon1.fr/tao/tao-rt).
//
// Copyright (C) 2018-2021, Éric Thiébaut.
// Copyright (C) 2018-2022, Éric Thiébaut.
#ifndef TAO_ERRORS_C_
#define TAO_ERRORS_C_ 1
#include "tao-errors-private.h"
#include "tao-buffers.h"
#include "tao-locks.h"
#include "config.h"
......@@ -83,7 +82,7 @@ static tao_status buffer_reporter(
static tao_status stream_reporter(
void* data,
const char* reason,
const char*func,
const char* func,
const char* info,
int code)
{
......
Supports Markdown
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