]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Changed spandsp from using TRUE and FALSE to using C99 true and false. It seems
authorSteve Underwood <steveu@haswell.coppice.org>
Thu, 8 Aug 2013 13:40:28 +0000 (21:40 +0800)
committerSteve Underwood <steveu@haswell.coppice.org>
Thu, 8 Aug 2013 13:40:28 +0000 (21:40 +0800)
like the quirks we used to get using those with C++ have gone away.

212 files changed:
libs/spandsp/configure.ac
libs/spandsp/src/Makefile.am
libs/spandsp/src/ademco_contactid.c
libs/spandsp/src/adsi.c
libs/spandsp/src/alloc.c
libs/spandsp/src/async.c
libs/spandsp/src/at_interpreter.c
libs/spandsp/src/bell_r2_mf.c
libs/spandsp/src/bert.c
libs/spandsp/src/bitstream.c
libs/spandsp/src/complex_vector_float.c
libs/spandsp/src/complex_vector_int.c
libs/spandsp/src/crc.c
libs/spandsp/src/dtmf.c
libs/spandsp/src/echo.c
libs/spandsp/src/fax.c
libs/spandsp/src/fax_modems.c
libs/spandsp/src/filter_tools.c
libs/spandsp/src/fsk.c
libs/spandsp/src/g722.c
libs/spandsp/src/g726.c
libs/spandsp/src/gsm0610_rpe.c
libs/spandsp/src/hdlc.c
libs/spandsp/src/image_translate.c
libs/spandsp/src/logging.c
libs/spandsp/src/lpc10_analyse.c
libs/spandsp/src/lpc10_decode.c
libs/spandsp/src/lpc10_encode.c
libs/spandsp/src/lpc10_placev.c
libs/spandsp/src/lpc10_voicing.c
libs/spandsp/src/make_modem_filter.c
libs/spandsp/src/modem_connect_tones.c
libs/spandsp/src/playout.c
libs/spandsp/src/plc.c
libs/spandsp/src/power_meter.c
libs/spandsp/src/queue.c
libs/spandsp/src/schedule.c
libs/spandsp/src/sig_tone.c
libs/spandsp/src/silence_gen.c
libs/spandsp/src/spandsp.h.in
libs/spandsp/src/spandsp/alloc.h
libs/spandsp/src/spandsp/async.h
libs/spandsp/src/spandsp/at_interpreter.h
libs/spandsp/src/spandsp/bell_r2_mf.h
libs/spandsp/src/spandsp/bitstream.h
libs/spandsp/src/spandsp/crc.h
libs/spandsp/src/spandsp/dtmf.h
libs/spandsp/src/spandsp/expose.h
libs/spandsp/src/spandsp/fax.h
libs/spandsp/src/spandsp/hdlc.h
libs/spandsp/src/spandsp/logging.h
libs/spandsp/src/spandsp/modem_connect_tones.h
libs/spandsp/src/spandsp/playout.h
libs/spandsp/src/spandsp/plc.h
libs/spandsp/src/spandsp/power_meter.h
libs/spandsp/src/spandsp/private/async.h
libs/spandsp/src/spandsp/private/at_interpreter.h
libs/spandsp/src/spandsp/private/bell_r2_mf.h
libs/spandsp/src/spandsp/private/bitstream.h
libs/spandsp/src/spandsp/private/dtmf.h
libs/spandsp/src/spandsp/private/fax_modems.h
libs/spandsp/src/spandsp/private/g722.h
libs/spandsp/src/spandsp/private/hdlc.h
libs/spandsp/src/spandsp/private/lpc10.h
libs/spandsp/src/spandsp/private/modem_connect_tones.h
libs/spandsp/src/spandsp/private/playout.h [new file with mode: 0644]
libs/spandsp/src/spandsp/private/plc.h [new file with mode: 0644]
libs/spandsp/src/spandsp/private/power_meter.h [new file with mode: 0644]
libs/spandsp/src/spandsp/private/sig_tone.h
libs/spandsp/src/spandsp/private/t30.h
libs/spandsp/src/spandsp/private/t31.h
libs/spandsp/src/spandsp/private/t38_core.h
libs/spandsp/src/spandsp/private/t38_gateway.h
libs/spandsp/src/spandsp/private/t38_non_ecm_buffer.h
libs/spandsp/src/spandsp/private/t38_terminal.h
libs/spandsp/src/spandsp/private/t4_t6_decode.h
libs/spandsp/src/spandsp/private/t4_t6_encode.h
libs/spandsp/src/spandsp/private/t4_tx.h
libs/spandsp/src/spandsp/private/t85.h
libs/spandsp/src/spandsp/private/timezone.h
libs/spandsp/src/spandsp/private/v17rx.h
libs/spandsp/src/spandsp/private/v17tx.h
libs/spandsp/src/spandsp/private/v18.h
libs/spandsp/src/spandsp/private/v22bis.h
libs/spandsp/src/spandsp/private/v27ter_rx.h
libs/spandsp/src/spandsp/private/v27ter_tx.h
libs/spandsp/src/spandsp/private/v29rx.h
libs/spandsp/src/spandsp/private/v29tx.h
libs/spandsp/src/spandsp/private/v42.h
libs/spandsp/src/spandsp/private/v42bis.h
libs/spandsp/src/spandsp/private/v8.h
libs/spandsp/src/spandsp/queue.h
libs/spandsp/src/spandsp/stdbool.h [new file with mode: 0644]
libs/spandsp/src/spandsp/t30.h
libs/spandsp/src/spandsp/t30_api.h
libs/spandsp/src/spandsp/t31.h
libs/spandsp/src/spandsp/t35.h
libs/spandsp/src/spandsp/t38_core.h
libs/spandsp/src/spandsp/t38_gateway.h
libs/spandsp/src/spandsp/t38_non_ecm_buffer.h
libs/spandsp/src/spandsp/t38_terminal.h
libs/spandsp/src/spandsp/t4_rx.h
libs/spandsp/src/spandsp/t4_t6_decode.h
libs/spandsp/src/spandsp/t4_tx.h
libs/spandsp/src/spandsp/telephony.h
libs/spandsp/src/spandsp/v17rx.h
libs/spandsp/src/spandsp/v17tx.h
libs/spandsp/src/spandsp/v18.h
libs/spandsp/src/spandsp/v22bis.h
libs/spandsp/src/spandsp/v27ter_rx.h
libs/spandsp/src/spandsp/v27ter_tx.h
libs/spandsp/src/spandsp/v29rx.h
libs/spandsp/src/spandsp/v29tx.h
libs/spandsp/src/spandsp/v42.h
libs/spandsp/src/spandsp/v8.h
libs/spandsp/src/swept_tone.c
libs/spandsp/src/t30.c
libs/spandsp/src/t30_api.c
libs/spandsp/src/t30_logging.c
libs/spandsp/src/t31.c
libs/spandsp/src/t35.c
libs/spandsp/src/t38_core.c
libs/spandsp/src/t38_gateway.c
libs/spandsp/src/t38_non_ecm_buffer.c
libs/spandsp/src/t38_terminal.c
libs/spandsp/src/t42.c
libs/spandsp/src/t43.c
libs/spandsp/src/t4_rx.c
libs/spandsp/src/t4_t6_decode.c
libs/spandsp/src/t4_t6_encode.c
libs/spandsp/src/t4_tx.c
libs/spandsp/src/t81_t82_arith_coding.c
libs/spandsp/src/t85_decode.c
libs/spandsp/src/t85_encode.c
libs/spandsp/src/time_scale.c
libs/spandsp/src/timezone.c
libs/spandsp/src/v17rx.c
libs/spandsp/src/v17tx.c
libs/spandsp/src/v18.c
libs/spandsp/src/v22bis_rx.c
libs/spandsp/src/v22bis_tx.c
libs/spandsp/src/v27ter_rx.c
libs/spandsp/src/v27ter_tx.c
libs/spandsp/src/v29rx.c
libs/spandsp/src/v29tx.c
libs/spandsp/src/v42.c
libs/spandsp/src/v42bis.c
libs/spandsp/src/v8.c
libs/spandsp/tests/ademco_contactid_tests.c
libs/spandsp/tests/adsi_tests.c
libs/spandsp/tests/alloc_tests.c
libs/spandsp/tests/async_tests.c
libs/spandsp/tests/bell_mf_rx_tests.c
libs/spandsp/tests/bert_tests.c
libs/spandsp/tests/bitstream_tests.c
libs/spandsp/tests/dtmf_rx_tests.c
libs/spandsp/tests/dtmf_tx_tests.c
libs/spandsp/tests/echo_tests.c
libs/spandsp/tests/fax_decode.c
libs/spandsp/tests/fax_tester.c
libs/spandsp/tests/fax_tester.h
libs/spandsp/tests/fax_tests.c
libs/spandsp/tests/fsk_tests.c
libs/spandsp/tests/g1050_tests.c
libs/spandsp/tests/g168_tests.c
libs/spandsp/tests/g711_tests.c
libs/spandsp/tests/g722_tests.c
libs/spandsp/tests/g726_tests.c
libs/spandsp/tests/gsm0610_tests.c
libs/spandsp/tests/hdlc_tests.c
libs/spandsp/tests/ima_adpcm_tests.c
libs/spandsp/tests/image_translate_tests.c
libs/spandsp/tests/line_model_tests.c
libs/spandsp/tests/logging_tests.c
libs/spandsp/tests/lpc10_tests.c
libs/spandsp/tests/modem_connect_tones_tests.c
libs/spandsp/tests/modem_echo_tests.c
libs/spandsp/tests/oki_adpcm_tests.c
libs/spandsp/tests/plc_tests.c
libs/spandsp/tests/power_meter_tests.c
libs/spandsp/tests/pseudo_terminals.c
libs/spandsp/tests/queue_tests.c
libs/spandsp/tests/r2_mf_rx_tests.c
libs/spandsp/tests/r2_mf_tx_tests.c
libs/spandsp/tests/rfc2198_sim_tests.c
libs/spandsp/tests/sig_tone_tests.c
libs/spandsp/tests/swept_tone_tests.c
libs/spandsp/tests/t31_pseudo_terminal_tests.c
libs/spandsp/tests/t31_tests.c
libs/spandsp/tests/t35_tests.c
libs/spandsp/tests/t38_core_tests.c
libs/spandsp/tests/t38_decode.c
libs/spandsp/tests/t38_non_ecm_buffer_tests.c
libs/spandsp/tests/t42_tests.c
libs/spandsp/tests/t43_tests.c
libs/spandsp/tests/t4_t6_tests.c
libs/spandsp/tests/t4_tests.c
libs/spandsp/tests/t81_t82_arith_coding_tests.c
libs/spandsp/tests/t85_tests.c
libs/spandsp/tests/time_scale_tests.c
libs/spandsp/tests/timezone_tests.c
libs/spandsp/tests/tone_generate_tests.c
libs/spandsp/tests/tsb85_tests.c
libs/spandsp/tests/udptl.c
libs/spandsp/tests/v17_tests.c
libs/spandsp/tests/v18_tests.c
libs/spandsp/tests/v22bis_tests.c
libs/spandsp/tests/v27ter_tests.c
libs/spandsp/tests/v29_tests.c
libs/spandsp/tests/v42_tests.c
libs/spandsp/tests/v42bis_tests.c
libs/spandsp/tests/v8_tests.c

index 8a6158fc80df57eb3fd0bf33cb2e0885d4fabbd3..13e31152a452bab8bc54dce39f19160cfefe26b3 100644 (file)
@@ -187,6 +187,9 @@ AC_HEADER_TIME
 AC_CHECK_HEADERS([socket.h])
 AC_CHECK_HEADERS([inttypes.h], [INSERT_INTTYPES_HEADER="#include <inttypes.h>"])
 AC_CHECK_HEADERS([stdint.h], [INSERT_STDINT_HEADER="#include <stdint.h>"])
+AC_CHECK_HEADERS([stdatomic.h])
+AC_CHECK_HEADERS([stdbool.h], [INSERT_STDBOOL_HEADER="#include <stdbool.h>"], [INSERT_STDBOOL_HEADER="#include <spandsp/stdbool.h>"])
+AC_CHECK_HEADERS([stdfix.h])
 AC_CHECK_HEADERS([unistd.h])
 AC_CHECK_HEADERS([stdlib.h])
 AC_CHECK_HEADERS([string.h])
@@ -592,6 +595,7 @@ AC_SUBST(INSERT_INTTYPES_HEADER)
 AC_SUBST(INSERT_STDINT_HEADER)
 AC_SUBST(INSERT_TGMATH_HEADER)
 AC_SUBST(INSERT_MATH_HEADER)
+AC_SUBST(INSERT_STDBOOL_HEADER)
 
 AC_CONFIG_FILES([Makefile
                  doc/Makefile
index 7a28c27aadc615037d5c12cc290bf3c590764199..812100f9cb0d04e30e431ca06a510c95d09adf03 100644 (file)
@@ -224,6 +224,7 @@ nobase_include_HEADERS = spandsp/ademco_contactid.h \
                          spandsp/queue.h \
                          spandsp/saturated.h \
                          spandsp/schedule.h \
+                         spandsp/stdbool.h \
                          spandsp/sig_tone.h \
                          spandsp/silence_gen.h \
                          spandsp/super_tone_rx.h \
index 29d1130b9913ff801901bb51ed1736efefd3070a..453ccc039411dc65f9c044f651f290c4335cf2e4 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <memory.h>
 #include <string.h>
@@ -448,7 +453,7 @@ static const struct ademco_code_s ademco_codes[] =
 #define TONE_TO_TOTAL_ENERGY        45.2233f        /* -0.85dB [GOERTZEL_SAMPLES_PER_BLOCK*10^(-0.85/10.0)] */
 #endif
 
-static int tone_rx_init = FALSE;
+static int tone_rx_init = false;
 static goertzel_descriptor_t tone_1400_desc;
 static goertzel_descriptor_t tone_2300_desc;
 
@@ -794,7 +799,7 @@ SPAN_DECLARE(int) ademco_contactid_sender_tx(ademco_contactid_sender_state_t *s,
         case 0:
             if (!s->clear_to_send)
                 return 0;
-            s->clear_to_send = FALSE;
+            s->clear_to_send = false;
             s->step++;
             s->remaining_samples = ms_to_samples(250);
             /* Fall through */
@@ -811,7 +816,7 @@ SPAN_DECLARE(int) ademco_contactid_sender_tx(ademco_contactid_sender_state_t *s,
             samples = dtmf_tx(&s->dtmf, &amp[sample], max_samples - sample);
             if (samples == 0)
             {
-                s->clear_to_send = FALSE;
+                s->clear_to_send = false;
                 s->step = 0;
                 return sample;
             }
@@ -948,7 +953,7 @@ SPAN_DECLARE(int) ademco_contactid_sender_rx(ademco_contactid_sender_state_t *s,
                             s->callback(s->callback_user_data, -1, 0, 0);
                         s->tone_state = 4;
                         /* Release the transmit side, and it will time the 250ms post tone delay */
-                        s->clear_to_send = TRUE;
+                        s->clear_to_send = true;
                         s->tries = 0;
                         if (s->tx_digits_len)
                             s->timer = ms_to_samples(3000);
@@ -969,7 +974,7 @@ SPAN_DECLARE(int) ademco_contactid_sender_rx(ademco_contactid_sender_state_t *s,
             case 5:
                 if (hit == 0)
                 {
-                    s->busy = FALSE;
+                    s->busy = false;
                     if (s->duration < ms_to_samples(400)  ||  s->duration > ms_to_samples(1500))
                     {
                         span_log(&s->logging, SPAN_LOG_FLOW, "Bad kissoff duration %d\n", s->duration);
@@ -983,18 +988,18 @@ SPAN_DECLARE(int) ademco_contactid_sender_rx(ademco_contactid_sender_state_t *s,
                         {
                             s->timer = 0;
                             if (s->callback)
-                                s->callback(s->callback_user_data, FALSE, 0, 0);
+                                s->callback(s->callback_user_data, false, 0, 0);
                         }
                     }
                     else
                     {
                         span_log(&s->logging, SPAN_LOG_FLOW, "Received good kissoff\n");
-                        s->clear_to_send = TRUE;
+                        s->clear_to_send = true;
                         s->tx_digits_len = 0;
                         if (s->callback)
-                            s->callback(s->callback_user_data, TRUE, 0, 0);
+                            s->callback(s->callback_user_data, true, 0, 0);
                         s->tone_state = 4;
-                        s->clear_to_send = TRUE;
+                        s->clear_to_send = true;
                         s->tries = 0;
                         if (s->tx_digits_len)
                             s->timer = ms_to_samples(3000);
@@ -1024,7 +1029,7 @@ SPAN_DECLARE(int) ademco_contactid_sender_rx(ademco_contactid_sender_state_t *s,
                     {
                         s->timer = 0;
                         if (s->callback)
-                            s->callback(s->callback_user_data, FALSE, 0, 0);
+                            s->callback(s->callback_user_data, false, 0, 0);
                     }
                 }
             }
@@ -1059,7 +1064,7 @@ SPAN_DECLARE(int) ademco_contactid_sender_put(ademco_contactid_sender_state_t *s
         return -1;
     if ((s->tx_digits_len = encode_msg(s->tx_digits, report)) < 0)
         return -1;
-    s->busy = TRUE;
+    s->busy = true;
     return dtmf_tx_put(&s->dtmf, s->tx_digits, s->tx_digits_len);
 }
 /*- End of function --------------------------------------------------------*/
@@ -1096,7 +1101,7 @@ SPAN_DECLARE(ademco_contactid_sender_state_t *) ademco_contactid_sender_init(ade
     {
         make_goertzel_descriptor(&tone_1400_desc, 1400.0f, GOERTZEL_SAMPLES_PER_BLOCK);
         make_goertzel_descriptor(&tone_2300_desc, 2300.0f, GOERTZEL_SAMPLES_PER_BLOCK);
-        tone_rx_init = TRUE;
+        tone_rx_init = true;
     }
     goertzel_init(&s->tone_1400, &tone_1400_desc);
     goertzel_init(&s->tone_2300, &tone_2300_desc);
index 24e87d65ecb35dcd6373fca55932d3338cbd8b1a..1f711bf44f9ed933f35cacb37d0e31c4f43e2ff4 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <assert.h>
 
@@ -64,6 +69,7 @@
 #include "spandsp/private/queue.h"
 #include "spandsp/private/tone_generate.h"
 #include "spandsp/private/async.h"
+#include "spandsp/private/power_meter.h"
 #include "spandsp/private/fsk.h"
 #include "spandsp/private/dtmf.h"
 #include "spandsp/private/adsi.h"
@@ -151,7 +157,7 @@ static int adsi_tx_get_bit(void *user_data)
         if (s->tx_signal_on)
         {
             /* The FSK should now be switched off. */
-            s->tx_signal_on = FALSE;
+            s->tx_signal_on = false;
             s->msg_len = 0;
         }
     }
@@ -170,7 +176,7 @@ static int adsi_tdd_get_async_byte(void *user_data)
     if (s->tx_signal_on)
     {
         /* The FSK should now be switched off. */
-        s->tx_signal_on = FALSE;
+        s->tx_signal_on = false;
         s->msg_len = 0;
     }
     return 0x1F;
@@ -386,12 +392,12 @@ static void start_tx(adsi_tx_state_t *s)
         break;
     case ADSI_STANDARD_TDD:
         fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_WEITBRECHT_4545], async_tx_get_bit, &s->asynctx);
-        async_tx_init(&s->asynctx, 5, ASYNC_PARITY_NONE, 2, FALSE, adsi_tdd_get_async_byte, s);
+        async_tx_init(&s->asynctx, 5, ASYNC_PARITY_NONE, 2, false, adsi_tdd_get_async_byte, s);
         /* Schedule an explicit shift at the start of baudot transmission */
         s->baudot_shift = 2;
         break;
     }
-    s->tx_signal_on = TRUE;
+    s->tx_signal_on = true;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -489,7 +495,7 @@ SPAN_DECLARE(int) adsi_tx(adsi_tx_state_t *s, int16_t amp[], int max_len)
             if (len < max_len)
             {
                 if ((lenx = fsk_tx(&s->fsktx, amp + len, max_len - len)) <= 0)
-                    s->tx_signal_on = FALSE;
+                    s->tx_signal_on = false;
                 len += lenx;
             }
             break;
@@ -672,7 +678,7 @@ SPAN_DECLARE(adsi_tx_state_t *) adsi_tx_init(adsi_tx_state_t *s, int standard)
                              60,
                              0,
                              0,
-                             FALSE);
+                             false);
     s->standard = standard;
     adsi_tx_set_preamble(s, -1, -1, -1, -1);
     span_log_init(&s->logging, SPAN_LOG_NONE, NULL);
index 386da04669ac6e4856a10d36a06c79e3654e3b23..06600adb309dccb3e9c2fdf75fae165d0594e168 100644 (file)
@@ -33,7 +33,9 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include <fcntl.h>
+#if !defined(__USE_ISOC11)
 #define __USE_ISOC11
+#endif
 #include <stdlib.h>
 #if defined(HAVE_MALLOC_H)
 #include <malloc.h>
 #include "spandsp/telephony.h"
 #include "spandsp/alloc.h"
 
-static void *fake_aligned_alloc(size_t alignment, size_t size);
-
 #ifdef _MSC_VER
 #pragma warning(push)
 #pragma warning(disable:4232)  /* address of dllimport is not static, identity not guaranteed */
 #endif
 
-span_alloc_t __span_alloc = malloc;
 #if defined(HAVE_ALIGNED_ALLOC)
-span_aligned_alloc_t __span_aligned_alloc = aligned_alloc;
+static span_aligned_alloc_t __span_aligned_alloc = aligned_alloc;
 #elif defined(HAVE_MEMALIGN)
-span_aligned_alloc_t __span_aligned_alloc = memalign;
+static span_aligned_alloc_t __span_aligned_alloc = memalign;
 #elif defined(HAVE_POSIX_MEMALIGN)
 static void *fake_posix_memalign(size_t alignment, size_t size);
-span_aligned_alloc_t __span_aligned_alloc = fake_posix_memalign;
+static span_aligned_alloc_t __span_aligned_alloc = fake_posix_memalign;
 #else
-span_aligned_alloc_t __span_aligned_alloc = fake_aligned_alloc;
+static void *fake_aligned_alloc(size_t alignment, size_t size);
+static span_aligned_alloc_t __span_aligned_alloc = fake_aligned_alloc;
 #endif
-span_realloc_t __span_realloc = realloc;
-span_free_t __span_free = free;
+static span_alloc_t __span_alloc = malloc;
+static span_realloc_t __span_realloc = realloc;
+static span_free_t __span_free = free;
 
 #ifdef _MSC_VER
 #pragma warning(pop)
@@ -85,23 +86,23 @@ static void *fake_posix_memalign(size_t alignment, size_t size)
     return ptr;
 }
 /*- End of function --------------------------------------------------------*/
-#endif
-
+#else
 static void *fake_aligned_alloc(size_t alignment, size_t size)
 {
-    return NULL;
+    return malloc(size);
 }
 /*- End of function --------------------------------------------------------*/
+#endif
 
-SPAN_DECLARE(void *) span_alloc(size_t size)
+SPAN_DECLARE(void *) span_aligned_alloc(size_t alignment, size_t size)
 {
-    return __span_alloc(size);
+    return __span_aligned_alloc(alignment, size);
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(void *) span_aligned_alloc(size_t alignment, size_t size)
+SPAN_DECLARE(void *) span_alloc(size_t size)
 {
-    return __span_aligned_alloc(alignment, size);
+    return __span_alloc(size);
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -117,20 +118,27 @@ SPAN_DECLARE(void) span_free(void *ptr)
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(int) span_mem_allocators(span_alloc_t custom_alloc,
-                                      span_aligned_alloc_t custom_aligned_alloc,
+SPAN_DECLARE(int) span_mem_allocators(span_aligned_alloc_t custom_aligned_alloc,
+                                      span_alloc_t custom_alloc,
                                       span_realloc_t custom_realloc,
                                       span_free_t custom_free)
 {
-    if (custom_alloc == NULL  ||  custom_realloc == NULL  ||  custom_free == NULL)
-        return -1;
-    __span_alloc = custom_alloc;
-    if (custom_aligned_alloc)
-        __span_aligned_alloc = custom_aligned_alloc;
-    else
-        __span_aligned_alloc = fake_aligned_alloc;
-    __span_realloc = custom_realloc;
-    __span_free = custom_free;
+    __span_aligned_alloc = (custom_aligned_alloc)
+                            ?
+                            custom_aligned_alloc
+                            :
+#if defined(HAVE_ALIGNED_ALLOC)
+                            aligned_alloc;
+#elif defined(HAVE_MEMALIGN)
+                            memalign;
+#elif defined(HAVE_POSIX_MEMALIGN)
+                            fake_posix_memalign;
+#else
+                            fake_aligned_alloc;
+#endif
+    __span_alloc = (custom_alloc)  ?  custom_alloc  :  malloc;
+    __span_realloc = (custom_realloc)  ?  custom_realloc  :  realloc;
+    __span_free = (custom_free)  ?  custom_free  :  free;
     return 0;
 }
 /*- End of function --------------------------------------------------------*/
index 15c73adcc000d95721a13b85b033647958d79743..d1bf5bda5bb4b677a104e3ff8ab9e961a38753a8 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 #include <assert.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 
 #include "spandsp/telephony.h"
 #include "spandsp/alloc.h"
@@ -169,7 +174,7 @@ SPAN_DECLARE(async_rx_state_t *) async_rx_init(async_rx_state_t *s,
                                                int data_bits,
                                                int parity,
                                                int stop_bits,
-                                               int use_v14,
+                                               bool use_v14,
                                                put_byte_func_t put_byte,
                                                void *user_data)
 {
@@ -269,7 +274,7 @@ SPAN_DECLARE(async_tx_state_t *) async_tx_init(async_tx_state_t *s,
                                                int data_bits,
                                                int parity,
                                                int stop_bits,
-                                               int use_v14,
+                                               bool use_v14,
                                                get_byte_func_t get_byte,
                                                void *user_data)
 {
index d36532afbd5d8e2d7a14a65f494932064791c267..d43ffb3671f2b46ac4e300f1fd865a2e79f5ce80 100644 (file)
 #include <memory.h>
 #include <string.h>
 #include <ctype.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include <assert.h>
 
 #include "spandsp/telephony.h"
@@ -78,20 +83,20 @@ static at_profile_t profiles[3] =
 {
     {
 #if defined(_MSC_VER)  ||  defined(__sunos)  ||  defined(__solaris)  ||  defined(__sun)
-        /*.echo =*/ TRUE,
-        /*.verbose =*/ TRUE,
+        /*.echo =*/ true,
+        /*.verbose =*/ true,
         /*.result_code_format =*/ ASCII_RESULT_CODES,
-        /*.pulse_dial =*/ FALSE,
-        /*.double_escape =*/ FALSE,
-        /*.adaptive_receive =*/ FALSE,
+        /*.pulse_dial =*/ false,
+        /*.double_escape =*/ false,
+        /*.adaptive_receive =*/ false,
         /*.s_regs[100] =*/ {0, 0, 0, '\r', '\n', '\b', 1, 60, 5, 0, 0}
 #else
-        .echo = TRUE,
-        .verbose = TRUE,
+        .echo = true,
+        .verbose = true,
         .result_code_format = ASCII_RESULT_CODES,
-        .pulse_dial = FALSE,
-        .double_escape = FALSE,
-        .adaptive_receive = FALSE,
+        .pulse_dial = false,
+        .double_escape = false,
+        .adaptive_receive = false,
         .s_regs[0] = 0,
         .s_regs[3] = '\r',
         .s_regs[4] = '\n',
@@ -256,11 +261,11 @@ SPAN_DECLARE(void) at_put_response_code(at_state_t *s, int code)
 static int answer_call(at_state_t *s)
 {
     if (at_modem_control(s, AT_MODEM_CONTROL_ANSWER, NULL) < 0)
-        return FALSE;
+        return false;
     /* Answering should now be in progress. No AT response should be
        issued at this point. */
-    s->do_hangup = FALSE;
-    return TRUE;
+    s->do_hangup = false;
+    return true;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -319,7 +324,7 @@ SPAN_DECLARE(void) at_call_event(at_state_t *s, int event)
                     at_modem_control(s, AT_MODEM_CONTROL_RESTART, (void *) FAX_MODEM_NOCNG_TONE_TX);
                 else
                     at_modem_control(s, AT_MODEM_CONTROL_RESTART, (void *) FAX_MODEM_CNG_TONE_TX);
-                s->dte_is_waiting = TRUE;
+                s->dte_is_waiting = true;
             }
         }
         break;
@@ -343,13 +348,13 @@ SPAN_DECLARE(void) at_call_event(at_state_t *s, int event)
             if (s->ok_is_pending)
             {
                 at_put_response_code(s, AT_RESPONSE_CODE_OK);
-                s->ok_is_pending = FALSE;
+                s->ok_is_pending = false;
             }
             else
             {
                 at_put_response_code(s, AT_RESPONSE_CODE_NO_CARRIER);
             }
-            s->dte_is_waiting = FALSE;
+            s->dte_is_waiting = false;
             at_set_at_rx_mode(s, AT_MODE_ONHOOK_COMMAND);
         }
         else if (s->fclass_mode  &&  s->rx_signal_present)
@@ -361,7 +366,7 @@ SPAN_DECLARE(void) at_call_event(at_state_t *s, int event)
         }
         if (s->at_rx_mode != AT_MODE_OFFHOOK_COMMAND  &&  s->at_rx_mode != AT_MODE_ONHOOK_COMMAND)
             at_put_response_code(s, AT_RESPONSE_CODE_NO_CARRIER);
-        s->rx_signal_present = FALSE;
+        s->rx_signal_present = false;
         at_modem_control(s, AT_MODEM_CONTROL_RNG, (void *) 0);
         at_set_at_rx_mode(s, AT_MODE_ONHOOK_COMMAND);
         break;
@@ -384,7 +389,7 @@ SPAN_DECLARE(void) at_reset_call_info(at_state_t *s)
     }
     s->call_id = NULL;
     s->rings_indicated = 0;
-    s->call_info_displayed = FALSE;
+    s->call_info_displayed = false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -431,7 +436,7 @@ SPAN_DECLARE(void) at_display_call_info(at_state_t *s)
         at_put_response(s, buf);
         call_id = call_id->next;
     }
-    s->call_info_displayed = TRUE;
+    s->call_info_displayed = true;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -526,7 +531,7 @@ static int parse_out(at_state_t *s, const char **t, int *target, int max_value,
         default:
             /* Set value */
             if ((val = parse_num(t, max_value)) < 0)
-                return FALSE;
+                return false;
             if (target)
                 *target = val;
             break;
@@ -539,9 +544,9 @@ static int parse_out(at_state_t *s, const char **t, int *target, int max_value,
         at_put_response(s, buf);
         break;
     default:
-        return FALSE;
+        return false;
     }
-    return TRUE;
+    return true;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -565,14 +570,14 @@ static int parse_2_out(at_state_t *s, const char **t, int *target1, int max_valu
         default:
             /* Set value */
             if ((val1 = parse_num(t, max_value1)) < 0)
-                return FALSE;
+                return false;
             if (target1)
                 *target1 = val1;
             if (**t == ',')
             {
                 (*t)++;
                 if ((val2 = parse_num(t, max_value2)) < 0)
-                    return FALSE;
+                    return false;
                 if (target2)
                     *target2 = val2;
             }
@@ -587,9 +592,9 @@ static int parse_2_out(at_state_t *s, const char **t, int *target1, int max_valu
         at_put_response(s, buf);
         break;
     default:
-        return FALSE;
+        return false;
     }
-    return TRUE;
+    return true;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -622,7 +627,7 @@ static int parse_n_out(at_state_t *s,
             for (i = 0;  i < entries;  i++)
             {
                 if ((val = parse_num(t, max_values[i])) < 0)
-                    return FALSE;
+                    return false;
                 if (targets[i])
                     *targets[i] = val;
                 if (**t != ',')
@@ -645,9 +650,9 @@ static int parse_n_out(at_state_t *s,
         at_put_response(s, buf);
         break;
     default:
-        return FALSE;
+        return false;
     }
-    return TRUE;
+    return true;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -670,7 +675,7 @@ static int parse_hex_out(at_state_t *s, const char **t, int *target, int max_val
         default:
             /* Set value */
             if ((val = parse_hex_num(t, max_value)) < 0)
-                return FALSE;
+                return false;
             if (target)
                 *target = val;
             break;
@@ -683,9 +688,9 @@ static int parse_hex_out(at_state_t *s, const char **t, int *target, int max_val
         at_put_response(s, buf);
         break;
     default:
-        return FALSE;
+        return false;
     }
-    return TRUE;
+    return true;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -710,7 +715,7 @@ static int parse_string_list_out(at_state_t *s, const char **t, int *target, int
         default:
             /* Set value */
             if ((val = match_element(t, def)) < 0)
-                return FALSE;
+                return false;
             if (target)
                 *target = val;
             break;
@@ -729,9 +734,9 @@ static int parse_string_list_out(at_state_t *s, const char **t, int *target, int
         at_put_response(s, buf);
         break;
     default:
-        return FALSE;
+        return false;
     }
-    return TRUE;
+    return true;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -764,11 +769,11 @@ static int parse_string_out(at_state_t *s, const char **t, char **target, const
         at_put_response(s, (*target)  ?  *target  :  "");
         break;
     default:
-        return FALSE;
+        return false;
     }
     while (*t)
         t++;
-    return TRUE;
+    return true;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -863,18 +868,18 @@ static int process_class1_cmd(at_state_t *s, const char **t)
 
     val = -1;
     if (!parse_out(s, t, &val, 255, NULL, allowed))
-        return TRUE;
+        return true;
     if (val < 0)
     {
         /* It was just a query */
-        return TRUE;
+        return true;
     }
     /* All class 1 FAX commands are supposed to give an ERROR response, if the phone
        is on-hook. */
     if (s->at_rx_mode == AT_MODE_ONHOOK_COMMAND)
-        return FALSE;
+        return false;
 
-    result = TRUE;
+    result = true;
     if (s->class1_handler)
         result = s->class1_handler(s, s->class1_user_data, direction, operation, val);
     switch (result)
@@ -882,11 +887,11 @@ static int process_class1_cmd(at_state_t *s, const char **t)
     case 0:
         /* Inhibit an immediate response.  (These commands should not be part of a multi-command entry.) */
         *t = (const char *) -1;
-        return TRUE;
+        return true;
     case -1:
-        return FALSE;
+        return false;
     }
-    return TRUE;
+    return true;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -916,11 +921,11 @@ static const char *at_cmd_D(at_state_t *s, const char *t)
 
     /* V.250 6.3.1 - Dial (abortable) */
     at_reset_call_info(s);
-    s->do_hangup = FALSE;
-    s->silent_dial = FALSE;
-    s->command_dial = FALSE;
+    s->do_hangup = false;
+    s->silent_dial = false;
+    s->command_dial = false;
     t += 1;
-    ok = FALSE;
+    ok = false;
     /* There are a numbers of options in a dial command string.
        Many are completely irrelevant in this application. */
     u = num;
@@ -962,11 +967,11 @@ static const char *at_cmd_D(at_state_t *s, const char *t)
                 break;
             case 'T':
                 /* V.250 6.3.1.3 Tone dial */
-                s->p.pulse_dial = FALSE;
+                s->p.pulse_dial = false;
                 break;
             case 'P':
                 /* V.250 6.3.1.4 Pulse dial */
-                s->p.pulse_dial = TRUE;
+                s->p.pulse_dial = true;
                 break;
             case '!':
                 /* V.250 6.3.1.5 Hook flash, register recall */
@@ -978,7 +983,7 @@ static const char *at_cmd_D(at_state_t *s, const char *t)
                 break;
             case '@':
                 /* V.250 6.3.1.7 Wait for quiet answer */
-                s->silent_dial = TRUE;
+                s->silent_dial = true;
                 break;
             case 'S':
                 /* V.250 6.3.1.8 Invoke stored string */
@@ -999,7 +1004,7 @@ static const char *at_cmd_D(at_state_t *s, const char *t)
                 break;
             case ';':
                 /* V.250 6.3.1 - Dial string terminator - make voice call and remain in command mode */
-                s->command_dial = TRUE;
+                s->command_dial = true;
                 break;
             case '>':
                 /* GSM07.07 6.2 - Direct dialling from phone book supplementary service subscription
@@ -1055,7 +1060,7 @@ static const char *at_cmd_H(at_state_t *s, const char *t)
     {
         /* Push out the last of the audio (probably by sending a short silence). */
         at_modem_control(s, AT_MODEM_CONTROL_RESTART, (void *) FAX_MODEM_FLUSH);
-        s->do_hangup = TRUE;
+        s->do_hangup = true;
         at_set_at_rx_mode(s, AT_MODE_CONNECTED);
         return (const char *) -1;
     }
@@ -1138,7 +1143,7 @@ static const char *at_cmd_P(at_state_t *s, const char *t)
 {
     /* V.250 6.3.3 - Select pulse dialling (command) */
     t += 1;
-    s->p.pulse_dial = TRUE;
+    s->p.pulse_dial = true;
     return t;
 }
 /*- End of function --------------------------------------------------------*/
@@ -1232,7 +1237,7 @@ static const char *at_cmd_T(at_state_t *s, const char *t)
 {
     /* V.250 6.3.2 - Select tone dialling (command) */
     t += 1;
-    s->p.pulse_dial = FALSE;
+    s->p.pulse_dial = false;
     return t;
 }
 /*- End of function --------------------------------------------------------*/
index 493f766f9c971a02ea089ad8d846716e7fa8b0b0..8f74b7a86a16e4d16a895baae7729bb55d2e3a53 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 
 #include "spandsp/telephony.h"
@@ -78,10 +83,10 @@ typedef struct
     uint8_t     off_time;   /* Minimum post tone silence (ms) */
 } mf_digit_tones_t;
 
-int bell_mf_gen_inited = FALSE;
+int bell_mf_gen_inited = false;
 tone_gen_descriptor_t bell_mf_digit_tones[15];
 
-int r2_mf_gen_inited = FALSE;
+int r2_mf_gen_inited = false;
 tone_gen_descriptor_t r2_mf_fwd_digit_tones[15];
 tone_gen_descriptor_t r2_mf_back_digit_tones[15];
 
@@ -271,10 +276,10 @@ static void bell_mf_gen_init(void)
                                  tones->off_time,
                                  0,
                                  0,
-                                 FALSE);
+                                 false);
         tones++;
     }
-    bell_mf_gen_inited = TRUE;
+    bell_mf_gen_inited = true;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -391,7 +396,7 @@ SPAN_DECLARE(int) r2_mf_tx_put(r2_mf_tx_state_t *s, char digit)
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(r2_mf_tx_state_t *) r2_mf_tx_init(r2_mf_tx_state_t *s, int fwd)
+SPAN_DECLARE(r2_mf_tx_state_t *) r2_mf_tx_init(r2_mf_tx_state_t *s, bool fwd)
 {
     int i;
     const mf_digit_tones_t *tones;
@@ -437,7 +442,7 @@ SPAN_DECLARE(r2_mf_tx_state_t *) r2_mf_tx_init(r2_mf_tx_state_t *s, int fwd)
                                      (tones->off_time == 0));
             tones++;
         }
-        r2_mf_gen_inited = TRUE;
+        r2_mf_gen_inited = true;
     }
     s->fwd = fwd;
     return s;
@@ -630,7 +635,7 @@ SPAN_DECLARE(bell_mf_rx_state_t *) bell_mf_rx_init(bell_mf_rx_state_t *s,
                                                    void *user_data)
 {
     int i;
-    static int initialised = FALSE;
+    static int initialised = false;
 
     if (s == NULL)
     {
@@ -643,7 +648,7 @@ SPAN_DECLARE(bell_mf_rx_state_t *) bell_mf_rx_init(bell_mf_rx_state_t *s,
     {
         for (i = 0;  i < 6;  i++)
             make_goertzel_descriptor(&bell_mf_detect_desc[i], (float) bell_mf_frequencies[i], BELL_MF_SAMPLES_PER_BLOCK);
-        initialised = TRUE;
+        initialised = true;
     }
     s->digits_callback = callback;
     s->digits_callback_data = user_data;
@@ -746,7 +751,7 @@ SPAN_DECLARE(int) r2_mf_rx(r2_mf_rx_state_t *s, const int16_t amp[], int samples
             }
         }
         /* Basic signal level and twist tests */
-        hit = FALSE;
+        hit = false;
         if (energy[best] >= R2_MF_THRESHOLD
             &&
             energy[second_best] >= R2_MF_THRESHOLD
@@ -756,7 +761,7 @@ SPAN_DECLARE(int) r2_mf_rx(r2_mf_rx_state_t *s, const int16_t amp[], int samples
             energy[best]*R2_MF_TWIST > energy[second_best])
         {
             /* Relative peak test */
-            hit = TRUE;
+            hit = true;
             for (i = 0;  i < 6;  i++)
             {
                 if (i != best  &&  i != second_best)
@@ -764,7 +769,7 @@ SPAN_DECLARE(int) r2_mf_rx(r2_mf_rx_state_t *s, const int16_t amp[], int samples
                     if (energy[i]*R2_MF_RELATIVE_PEAK >= energy[second_best])
                     {
                         /* The best two are not clearly the best */
-                        hit = FALSE;
+                        hit = false;
                         break;
                     }
                 }
@@ -805,12 +810,12 @@ SPAN_DECLARE(int) r2_mf_rx_get(r2_mf_rx_state_t *s)
 /*- End of function --------------------------------------------------------*/
 
 SPAN_DECLARE(r2_mf_rx_state_t *) r2_mf_rx_init(r2_mf_rx_state_t *s,
-                                               int fwd,
+                                               bool fwd,
                                                tone_report_func_t callback,
                                                void *user_data)
 {
     int i;
-    static int initialised = FALSE;
+    static int initialised = false;
 
     if (s == NULL)
     {
@@ -828,7 +833,7 @@ SPAN_DECLARE(r2_mf_rx_state_t *) r2_mf_rx_init(r2_mf_rx_state_t *s,
             make_goertzel_descriptor(&mf_fwd_detect_desc[i], (float) r2_mf_fwd_frequencies[i], R2_MF_SAMPLES_PER_BLOCK);
             make_goertzel_descriptor(&mf_back_detect_desc[i], (float) r2_mf_back_frequencies[i], R2_MF_SAMPLES_PER_BLOCK);
         }
-        initialised = TRUE;
+        initialised = true;
     }
     if (fwd)
     {
index a4081f66d1981d28301875a4bacef71b2d02ab90..728476d65edf7db25057248e73c5b61cb4a8640c 100644 (file)
 #include <string.h>
 #include <assert.h>
 #include <time.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 
 #include "spandsp/telephony.h"
 #include "spandsp/alloc.h"
@@ -137,14 +142,14 @@ static void assess_error_rate(bert_state_t *s)
     int i;
     int j;
     int sum;
-    int test;
+    bool test;
 
     /* We assess the error rate in decadic steps. For each decade we assess the error over 10 times
        the number of bits, to smooth the result. This means we assess the 1 in 100 rate based on 1000 bits
        (i.e. we look for >=10 errors in 1000 bits). We make an assessment every 100 bits, using a sliding
        window over the last 1000 bits. We assess the 1 in 1000 rate over 10000 bits in a similar way, and
        so on for the lower error rates. */
-    test = TRUE;
+    test = false;
     for (i = 2;  i <= 7;  i++)
     {
         if (++s->decade_ptr[i] < 10)
@@ -157,7 +162,7 @@ static void assess_error_rate(bert_state_t *s)
         if (test  &&  sum > 10)
         {
             /* We overflow into the next decade */
-            test = FALSE;
+            test = false;
             if (s->error_rate != i  &&  s->reporter)
                 s->reporter(s->user_data, BERT_REPORT_GT_10_2 + i - 2, &s->results);
             s->error_rate = i;
index f3da9c4d0b8d72c2e236f2b16e81ae4a0876a6be..6c0b9dde4b51b0d55c521eff3cdbb4a24a060cd0 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 #include <assert.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 
 #include "spandsp/telephony.h"
 #include "spandsp/alloc.h"
index ebb6accba4000217d377d03151c01474b2bc62ea..710cbef4354255cc74c7f6608c45a577fa6a8a59 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include <assert.h>
 
 #include "floating_fudge.h"
index 0bf7eb8a98c9d31fc0d20ee731d3d0d2162d9070..66a0cd62cd3a21b338cee073562d98d468fdbe39 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include <assert.h>
 
 #include "floating_fudge.h"
index f7407eda1f58a93d2809d8306f8822ccba0a4bdb..cf4dd0cd0fae27bed055cb519d53486d7dd70748 100644 (file)
 #include <inttypes.h>
 #include <stdio.h>
 #include <string.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 
 #include "spandsp/telephony.h"
 #include "spandsp/crc.h"
@@ -102,7 +107,7 @@ SPAN_DECLARE(int) crc_itu32_append(uint8_t *buf, int len)
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(int) crc_itu32_check(const uint8_t *buf, int len)
+SPAN_DECLARE(bool) crc_itu32_check(const uint8_t *buf, int len)
 {
     uint32_t crc;
     int i;
@@ -193,7 +198,7 @@ SPAN_DECLARE(int) crc_itu16_append(uint8_t *buf, int len)
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(int) crc_itu16_check(const uint8_t *buf, int len)
+SPAN_DECLARE(bool) crc_itu16_check(const uint8_t *buf, int len)
 {
     uint16_t crc;
     int i;
index e58552de58f03d0f4f9aea477ae5c2fcf7feb3d1..9f6401028ca6c245cde31b213a6bd2f183c4a243 100644 (file)
 
 #include <stdlib.h>
 #include <inttypes.h>
+#include <memory.h>
+#include <string.h>
+#include <limits.h>
 #if defined(HAVE_TGMATH_H)
 #include <tgmath.h>
 #endif
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
-#include <memory.h>
-#include <string.h>
-#include <limits.h>
 
 #include "spandsp/telephony.h"
 #include "spandsp/alloc.h"
@@ -94,11 +99,11 @@ static const float dtmf_col[] =
 
 static const char dtmf_positions[] = "123A" "456B" "789C" "*0#D";
 
-static int dtmf_rx_inited = FALSE;
+static bool dtmf_rx_inited = false;
 static goertzel_descriptor_t dtmf_detect_row[4];
 static goertzel_descriptor_t dtmf_detect_col[4];
 
-static int dtmf_tx_inited = FALSE;
+static bool dtmf_tx_inited = false;
 static tone_gen_descriptor_t dtmf_digit_tones[16];
 
 SPAN_DECLARE(int) dtmf_rx(dtmf_rx_state_t *s, const int16_t amp[], int samples)
@@ -424,7 +429,7 @@ SPAN_DECLARE(dtmf_rx_state_t *) dtmf_rx_init(dtmf_rx_state_t *s,
     s->digits_callback_data = user_data;
     s->realtime_callback = NULL;
     s->realtime_callback_data = NULL;
-    s->filter_dialtone = FALSE;
+    s->filter_dialtone = false;
     s->normal_twist = DTMF_NORMAL_TWIST;
     s->reverse_twist = DTMF_REVERSE_TWIST;
     s->threshold = DTMF_THRESHOLD;
@@ -439,7 +444,7 @@ SPAN_DECLARE(dtmf_rx_state_t *) dtmf_rx_init(dtmf_rx_state_t *s,
             make_goertzel_descriptor(&dtmf_detect_row[i], dtmf_row[i], DTMF_SAMPLES_PER_BLOCK);
             make_goertzel_descriptor(&dtmf_detect_col[i], dtmf_col[i], DTMF_SAMPLES_PER_BLOCK);
         }
-        dtmf_rx_inited = TRUE;
+        dtmf_rx_inited = true;
     }
     for (i = 0;  i < 4;  i++)
     {
@@ -492,10 +497,10 @@ static void dtmf_tx_initialise(void)
                                      DEFAULT_DTMF_TX_OFF_TIME,
                                      0,
                                      0,
-                                     FALSE);
+                                     false);
         }
     }
-    dtmf_tx_inited = TRUE;
+    dtmf_tx_inited = true;
 }
 /*- End of function --------------------------------------------------------*/
 
index 18c4ba4c1ffd021359d2af2d01ce9d13ff1b7bc4..5d6a1cadd285dfc9fc2193c741c396815a04934c 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <string.h>
 #include <stdio.h>
 #if !defined(NULL)
 #define NULL (void *) 0
 #endif
-#if !defined(FALSE)
-#define FALSE 0
-#endif
-#if !defined(TRUE)
-#define TRUE (!FALSE)
-#endif
 
 #define NONUPDATE_DWELL_TIME        600     /* 600 samples, or 75ms */
 
@@ -275,7 +274,7 @@ SPAN_DECLARE(echo_can_state_t *) echo_can_init(int len, int adaption_mode)
     ec->rx_power_threshold = 10000000;
     ec->geigel_max = 0;
     ec->geigel_lag = 0;
-    ec->dtd_onset = FALSE;
+    ec->dtd_onset = false;
     ec->tap_set = 0;
     ec->tap_rotate_counter = 1600;
     ec->cng_level = 1000;
@@ -338,7 +337,7 @@ SPAN_DECLARE(void) echo_can_flush(echo_can_state_t *ec)
 
     ec->geigel_max = 0;
     ec->geigel_lag = 0;
-    ec->dtd_onset = FALSE;
+    ec->dtd_onset = false;
     ec->tap_set = 0;
     ec->tap_rotate_counter = 1600;
 
@@ -486,7 +485,7 @@ printf("Revert to %d at %d\n", (ec->tap_set + 1)%3, sample_no);
                         ec->narrowband_score = 0;
                     }
                 }
-                ec->dtd_onset = FALSE;
+                ec->dtd_onset = false;
                 if (--ec->tap_rotate_counter <= 0)
                 {
 printf("Rotate to %d at %d\n", ec->tap_set, sample_no);
@@ -533,7 +532,7 @@ printf("Revert to %d at %d\n", (ec->tap_set + 1)%3, sample_no);
                 for (i = 0;  i < ec->taps;  i++)
                     ec->fir_taps32[i] = ec->fir_taps16[(ec->tap_set + 1)%3][i] << 15;
                 ec->tap_rotate_counter = 1600;
-                ec->dtd_onset = TRUE;
+                ec->dtd_onset = true;
             }
             ec->nonupdate_dwell = NONUPDATE_DWELL_TIME;
         }
@@ -576,7 +575,7 @@ printf("Revert to %d at %d\n", (ec->tap_set + 1)%3, sample_no);
             if (!ec->cng)
             {
                 ec->cng_level = ec->clean_rx_power;
-                ec->cng = TRUE;
+                ec->cng = true;
             }
             if ((ec->adaption_mode & ECHO_CAN_USE_CNG))
             {
@@ -595,12 +594,12 @@ printf("Revert to %d at %d\n", (ec->tap_set + 1)%3, sample_no);
         }
         else
         {
-            ec->cng = FALSE;
+            ec->cng = false;
         }
     }
     else
     {
-        ec->cng = FALSE;
+        ec->cng = false;
     }
 
 printf("Narrowband score %4d %5d at %d\n", ec->narrowband_score, score, sample_no);
index b07aa002c5d7aae4f4ce4f62d5d720389d34c0a4..a220c4f81800f03140f505164d2812f387291f52 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <assert.h>
 #include <fcntl.h>
 
 #include "spandsp/private/logging.h"
 #include "spandsp/private/silence_gen.h"
+#include "spandsp/private/power_meter.h"
 #include "spandsp/private/fsk.h"
 #include "spandsp/private/modem_connect_tones.h"
 #include "spandsp/private/v8.h"
@@ -210,7 +216,7 @@ static int set_next_tx_type(fax_state_t *s)
     silence_gen_alter(&t->silence_gen, 0);
     fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
     fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
-    t->transmit = FALSE;
+    t->transmit = false;
     return -1;
 }
 /*- End of function --------------------------------------------------------*/
@@ -277,7 +283,7 @@ static void fax_set_rx_type(void *user_data, int type, int bit_rate, int short_t
     t->current_rx_type = type;
     t->rx_bit_rate = bit_rate;
     if (use_hdlc)
-        hdlc_rx_init(&t->hdlc_rx, FALSE, TRUE, HDLC_FRAMING_OK_THRESHOLD, t30_hdlc_accept, &s->t30);
+        hdlc_rx_init(&t->hdlc_rx, false, true, HDLC_FRAMING_OK_THRESHOLD, t30_hdlc_accept, &s->t30);
 
     switch (type)
     {
@@ -320,14 +326,14 @@ static void fax_set_tx_type(void *user_data, int type, int bit_rate, int short_t
         silence_gen_alter(&t->silence_gen, ms_to_samples(short_train));
         fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
         fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
-        t->transmit = TRUE;
+        t->transmit = true;
         break;
     case T30_MODEM_CED:
     case T30_MODEM_CNG:
         tone = (type == T30_MODEM_CED)  ?  FAX_MODEM_CED_TONE_TX  :  FAX_MODEM_CNG_TONE_TX;
         fax_modems_start_slow_modem(t, tone);
         fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
-        t->transmit = TRUE;
+        t->transmit = true;
         break;
     case T30_MODEM_V21:
         fax_modems_start_slow_modem(t, FAX_MODEM_V21_TX);
@@ -340,7 +346,7 @@ static void fax_set_tx_type(void *user_data, int type, int bit_rate, int short_t
         silence_gen_alter(&t->silence_gen, ms_to_samples(75));
         fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
         fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &fsk_tx, &t->v21_tx);
-        t->transmit = TRUE;
+        t->transmit = true;
         break;
     case T30_MODEM_V17:
         silence_gen_alter(&t->silence_gen, ms_to_samples(75));
@@ -349,7 +355,7 @@ static void fax_set_tx_type(void *user_data, int type, int bit_rate, int short_t
         fax_modems_start_fast_modem(t, FAX_MODEM_V17_TX, bit_rate, short_train, use_hdlc);
         fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
         fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &v17_tx, &t->fast_modems.v17_tx);
-        t->transmit = TRUE;
+        t->transmit = true;
         break;
     case T30_MODEM_V27TER:
         silence_gen_alter(&t->silence_gen, ms_to_samples(75));
@@ -358,7 +364,7 @@ static void fax_set_tx_type(void *user_data, int type, int bit_rate, int short_t
         fax_modems_start_fast_modem(t, FAX_MODEM_V27TER_TX, bit_rate, short_train, use_hdlc);
         fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
         fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &v27ter_tx, &t->fast_modems.v27ter_tx);
-        t->transmit = TRUE;
+        t->transmit = true;
         break;
     case T30_MODEM_V29:
         silence_gen_alter(&t->silence_gen, ms_to_samples(75));
@@ -367,7 +373,7 @@ static void fax_set_tx_type(void *user_data, int type, int bit_rate, int short_t
         fax_modems_start_fast_modem(t, FAX_MODEM_V29_TX, bit_rate, short_train, use_hdlc);
         fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
         fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &v29_tx, &t->fast_modems.v29_tx);
-        t->transmit = TRUE;
+        t->transmit = true;
         break;
     case T30_MODEM_DONE:
         span_log(&s->logging, SPAN_LOG_FLOW, "FAX exchange complete\n");
@@ -376,7 +382,7 @@ static void fax_set_tx_type(void *user_data, int type, int bit_rate, int short_t
         silence_gen_alter(&t->silence_gen, 0);
         fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
         fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
-        t->transmit = FALSE;
+        t->transmit = false;
         break;
     }
     t->tx_bit_rate = bit_rate;
@@ -478,7 +484,7 @@ SPAN_DECLARE(fax_state_t *) fax_init(fax_state_t *s, int calling_party)
     span_log_init(&s->logging, SPAN_LOG_NONE, NULL);
     span_log_set_protocol(&s->logging, "FAX");
     fax_modems_init(&s->modems,
-                    FALSE,
+                    false,
                     t30_hdlc_accept,
                     hdlc_underflow_handler,
                     t30_non_ecm_put_bit,
index 69698bcaeb325195e84c2e50c9fbbeb25ad89e31..9f6cc4ba4c7ea62fceab6a06d07bf5155740c0fc 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <assert.h>
 #include <fcntl.h>
@@ -74,6 +79,7 @@
 
 #include "spandsp/private/logging.h"
 #include "spandsp/private/silence_gen.h"
+#include "spandsp/private/power_meter.h"
 #include "spandsp/private/fsk.h"
 #include "spandsp/private/v17tx.h"
 #include "spandsp/private/v17rx.h"
@@ -93,7 +99,7 @@ static void fax_modems_hdlc_accept(void *user_data, const uint8_t *msg, int len,
 
     s = (fax_modems_state_t *) user_data;
     if (ok)
-        s->rx_frame_received = TRUE;
+        s->rx_frame_received = false;
     if (s->hdlc_accept)
         s->hdlc_accept(s->hdlc_accept_user_data, msg, len, ok);
 }
@@ -264,7 +270,7 @@ SPAN_DECLARE(void) fax_modems_start_slow_modem(fax_modems_state_t *s, int which)
         fsk_rx_init(&s->v21_rx, &preset_fsk_specs[FSK_V21CH2], FSK_FRAME_MODE_SYNC, (put_bit_func_t) hdlc_rx_put_bit, &s->hdlc_rx);
         fax_modems_set_rx_handler(s, (span_rx_handler_t) &fsk_rx, &s->v21_rx, (span_rx_fillin_handler_t) &fsk_rx_fillin, &s->v21_rx);
         fsk_rx_signal_cutoff(&s->v21_rx, -39.09f);
-        s->rx_frame_received = FALSE;
+        s->rx_frame_received = false;
         break;
     case FAX_MODEM_CED_TONE_RX:
         modem_connect_tones_rx_init(&s->connect_rx, MODEM_CONNECT_TONES_FAX_CED, s->tone_callback, s->tone_callback_user_data);
@@ -322,10 +328,10 @@ SPAN_DECLARE(void) fax_modems_start_fast_modem(fax_modems_state_t *s, int which,
     if (s->fast_modem != which)
     {
         s->current_rx_type = which;
-        s->short_train = FALSE;
+        s->short_train = false;
         s->fast_modem = which;
         if (hdlc_mode)
-            s->rx_frame_received = FALSE;
+            s->rx_frame_received = false;
         switch (s->fast_modem)
         {
         case FAX_MODEM_V27TER_RX:
@@ -368,13 +374,13 @@ SPAN_DECLARE(void) fax_modems_start_fast_modem(fax_modems_state_t *s, int which,
         switch (s->fast_modem)
         {
         case FAX_MODEM_V27TER_RX:
-            v27ter_rx_restart(&s->fast_modems.v27ter_rx, s->bit_rate, FALSE);
+            v27ter_rx_restart(&s->fast_modems.v27ter_rx, s->bit_rate, false);
             v27ter_rx_set_put_bit(&s->fast_modems.v27ter_rx, put_bit, put_bit_user_data);
             v27ter_rx_set_modem_status_handler(&s->fast_modems.v27ter_rx, v27ter_rx_status_handler, s);
             fax_modems_set_rx_handler(s, (span_rx_handler_t) &fax_modems_v27ter_v21_rx, s, (span_rx_fillin_handler_t) &fax_modems_v27ter_v21_rx_fillin, s);
             break;
         case FAX_MODEM_V29_RX:
-            v29_rx_restart(&s->fast_modems.v29_rx, s->bit_rate, FALSE);
+            v29_rx_restart(&s->fast_modems.v29_rx, s->bit_rate, false);
             v29_rx_set_put_bit(&s->fast_modems.v29_rx, put_bit, put_bit_user_data);
             v29_rx_set_modem_status_handler(&s->fast_modems.v29_rx, v29_rx_status_handler, s);
             fax_modems_set_rx_handler(s, (span_rx_handler_t) &fax_modems_v29_v21_rx, s, (span_rx_fillin_handler_t) &fax_modems_v29_v21_rx_fillin, s);
@@ -535,15 +541,15 @@ SPAN_DECLARE(fax_modems_state_t *) fax_modems_init(fax_modems_state_t *s,
     s->hdlc_accept = hdlc_accept;
     s->hdlc_accept_user_data = user_data;
 
-    hdlc_rx_init(&s->hdlc_rx, FALSE, FALSE, HDLC_FRAMING_OK_THRESHOLD, fax_modems_hdlc_accept, s);
-    hdlc_tx_init(&s->hdlc_tx, FALSE, 2, FALSE, hdlc_tx_underflow, user_data);
+    hdlc_rx_init(&s->hdlc_rx, false, false, HDLC_FRAMING_OK_THRESHOLD, fax_modems_hdlc_accept, s);
+    hdlc_tx_init(&s->hdlc_tx, false, 2, false, hdlc_tx_underflow, user_data);
 
     fax_modems_start_slow_modem(s, FAX_MODEM_V21_RX);
     fsk_tx_init(&s->v21_tx, &preset_fsk_specs[FSK_V21CH2], (get_bit_func_t) hdlc_tx_get_bit, &s->hdlc_tx);
 
     silence_gen_init(&s->silence_gen, 0);
 
-    s->rx_signal_present = FALSE;
+    s->rx_signal_present = false;
     s->rx_handler = (span_rx_handler_t) &span_dummy_rx;
     s->rx_fillin_handler = (span_rx_fillin_handler_t) &span_dummy_rx;
     s->rx_user_data = NULL;
index 88967e93ed71c9674f513b5168bd335ffb77824d..ff625bb13d726fdfe747d895fe6e41cd5fc96074 100644 (file)
 
 #include <inttypes.h>
 #include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <time.h>
+#include <fcntl.h>
 #if defined(HAVE_TGMATH_H)
 #include <tgmath.h>
 #endif
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
-#include <string.h>
-#include <stdio.h>
-#include <time.h>
-#include <fcntl.h>
 
 #include "spandsp/telephony.h"
 #include "spandsp/complex.h"
 #include "filter_tools.h"
 
-#if !defined(FALSE)
-#define FALSE 0
-#endif
-#if !defined(TRUE)
-#define TRUE (!FALSE)
-#endif
-
 #define MAXPZ       8192
 #define SEQ_LEN     8192
 #define MAX_FFT_LEN SEQ_LEN
index 7e6619a58f6c6f611bd7a0d59696b4b657ebc8cf..29b32c65ea49487a02bed81f145f3a9015c13f79 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <assert.h>
 
@@ -49,6 +54,7 @@
 #include "spandsp/async.h"
 #include "spandsp/fsk.h"
 
+#include "spandsp/private/power_meter.h"
 #include "spandsp/private/fsk.h"
 
 const fsk_spec_t preset_fsk_specs[] =
@@ -155,7 +161,7 @@ SPAN_DECLARE(int) fsk_tx_restart(fsk_tx_state_t *s, const fsk_spec_t *spec)
     s->baud_frac = 0;
     s->current_phase_rate = s->phase_rates[1];
 
-    s->shutdown = FALSE;
+    s->shutdown = false;
     return 0;
 }
 /*- End of function --------------------------------------------------------*/
@@ -214,7 +220,7 @@ SPAN_DECLARE_NONSTD(int) fsk_tx(fsk_tx_state_t *s, int16_t amp[], int len)
                     s->status_handler(s->status_user_data, SIG_STATUS_END_OF_DATA);
                 if (s->status_handler)
                     s->status_handler(s->status_user_data, SIG_STATUS_SHUTDOWN_COMPLETE);
-                s->shutdown = TRUE;
+                s->shutdown = true;
                 break;
             }
             s->current_phase_rate = s->phase_rates[bit & 1];
index bbf3bbfc0fedc72ad06d8fdff318d0bcb6745aa4..2f11715c106394a345b63f723be20b253cd5fac6 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 
 #include "spandsp/telephony.h"
@@ -263,11 +268,11 @@ SPAN_DECLARE(g722_decode_state_t *) g722_decode_init(g722_decode_state_t *s, int
     else
         s->bits_per_sample = 8;
     if ((options & G722_SAMPLE_RATE_8000))
-        s->eight_k = TRUE;
+        s->eight_k = true;
     if ((options & G722_PACKED)  &&  s->bits_per_sample != 8)
-        s->packed = TRUE;
+        s->packed = true;
     else
-        s->packed = FALSE;
+        s->packed = false;
     s->band[0].det = 32;
     s->band[1].det = 8;
     return s;
@@ -444,11 +449,11 @@ SPAN_DECLARE(g722_encode_state_t *) g722_encode_init(g722_encode_state_t *s, int
     else
         s->bits_per_sample = 8;
     if ((options & G722_SAMPLE_RATE_8000))
-        s->eight_k = TRUE;
+        s->eight_k = true;
     if ((options & G722_PACKED)  &&  s->bits_per_sample != 8)
-        s->packed = TRUE;
+        s->packed = true;
     else
-        s->packed = FALSE;
+        s->packed = false;
     s->band[0].det = 32;
     s->band[1].det = 8;
     return s;
index ba1c5b913e9936a7aa3c43b2ff698d0d18d51055..4f3bea3b6b4545afc96afac49f42d1ddb061c55e 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 
 #include "spandsp/telephony.h"
@@ -394,7 +399,7 @@ static void update(g726_state_t *s,
     int16_t thr;
     int16_t pk0;
     int i;
-    int tr;
+    bool tr;
 
     a2p = 0;
     /* Needed in updating predictor poles */
@@ -409,11 +414,11 @@ static void update(g726_state_t *s,
     thr = (ylint > 9)  ?  (31 << 10)  :  ((32 + ylfrac) << ylint);
     dqthr = (thr + (thr >> 1)) >> 1;            /* dqthr = 0.75 * thr */
     if (!s->td)                                 /* signal supposed voice */
-        tr = FALSE;
+        tr = false;
     else if (mag <= dqthr)                      /* supposed data, but small mag */
-        tr = FALSE;                             /* treated as voice */
+        tr = false;                             /* treated as voice */
     else                                        /* signal is data (modem) */
-        tr = TRUE;
+        tr = true;
 
     /*
      * Quantizer scale factor adaptation.
@@ -564,11 +569,11 @@ static void update(g726_state_t *s,
 
     /* TONE */
     if (tr)                 /* this sample has been treated as data */
-        s->td = FALSE;      /* next one will be treated as voice */
+        s->td = false;      /* next one will be treated as voice */
     else if (a2p < -11776)  /* small sample-to-sample correlation */
-        s->td = TRUE;       /* signal may be data */
+        s->td = true;       /* signal may be data */
     else                    /* signal is voice */
-        s->td = FALSE;
+        s->td = false;
 
     /* Adaptation speed control. */
     /* FILTA */
@@ -1025,7 +1030,7 @@ SPAN_DECLARE(g726_state_t *) g726_init(g726_state_t *s, int bit_rate, int ext_co
         s->b[i] = 0;
         s->dq[i] = 32;
     }
-    s->td = FALSE;
+    s->td = false;
     switch (bit_rate)
     {
     case 16000:
index 68ddff3e1e1aa3a79e55253a7659d491f91151cb..387ef1493b32db5eef637e5530eeb0633e3b2179 100644 (file)
@@ -59,7 +59,7 @@
 static void weighting_filter(int16_t x[40],
                              const int16_t *e)      // signal [-5..0.39.44] IN)
 {
-#if defined(__GNUC__)  &&  defined(SPANDSP_USE_MMX)  &&  defined(__x86_64__) && !(defined(__APPLE_CC__)  && __APPLE_CC__ >= 5448)
+#if defined(__GNUC__)  &&  defined(SPANDSP_USE_MMX)  &&  defined(__x86_64__)
     /* Table 4.4   Coefficients of the weighting filter */
     /* This must be padded to a multiple of 4 for MMX to work */
     static const union
index 3efaf3810ef13691946690bae38978dde463898a..7a20bf24513312a26a23fdc7971dc89337a4c405 100644 (file)
 #include <inttypes.h>
 #include <string.h>
 #include <stdio.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 
 #include "spandsp/telephony.h"
 #include "spandsp/alloc.h"
@@ -47,7 +52,7 @@ static void report_status_change(hdlc_rx_state_t *s, int status)
     if (s->status_handler)
         s->status_handler(s->status_user_data, status);
     else if (s->frame_handler)
-        s->frame_handler(s->frame_user_data, NULL, status, TRUE);
+        s->frame_handler(s->frame_user_data, NULL, status, true);
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -63,7 +68,7 @@ static void rx_special_condition(hdlc_rx_state_t *s, int status)
         s->len = 0;
         s->num_bits = 0;
         s->flags_seen = 0;
-        s->framing_ok_announced = FALSE;
+        s->framing_ok_announced = false;
         /* Fall through */
     case SIG_STATUS_TRAINING_IN_PROGRESS:
     case SIG_STATUS_TRAINING_FAILED:
@@ -95,7 +100,7 @@ static __inline__ void octet_set_and_count(hdlc_rx_state_t *s)
     }
     else
     {
-        s->octet_counting_mode = TRUE;
+        s->octet_counting_mode = true;
         s->octet_count = s->octet_count_report_interval;
     }
 }
@@ -140,7 +145,7 @@ static void rx_flag_or_abort(hdlc_rx_state_t *s)
     {
         /* Hit HDLC flag */
         /* A flag clears octet counting */
-        s->octet_counting_mode = FALSE;
+        s->octet_counting_mode = false;
         if (s->flags_seen >= s->framing_ok_threshold)
         {
             /* We may have a frame, or we may have back to back flags */
@@ -156,7 +161,7 @@ static void rx_flag_or_abort(hdlc_rx_state_t *s)
                         s->rx_bytes += s->len - s->crc_bytes;
                         s->len -= s->crc_bytes;
                         if (s->frame_handler)
-                            s->frame_handler(s->frame_user_data, s->buffer, s->len, TRUE);
+                            s->frame_handler(s->frame_user_data, s->buffer, s->len, true);
                     }
                     else
                     {
@@ -165,7 +170,7 @@ static void rx_flag_or_abort(hdlc_rx_state_t *s)
                         {
                             s->len -= s->crc_bytes;
                             if (s->frame_handler)
-                                s->frame_handler(s->frame_user_data, s->buffer, s->len, FALSE);
+                                s->frame_handler(s->frame_user_data, s->buffer, s->len, false);
                         }
                     }
                 }
@@ -181,7 +186,7 @@ static void rx_flag_or_abort(hdlc_rx_state_t *s)
                         else
                             s->len = 0;
                         if (s->frame_handler)
-                            s->frame_handler(s->frame_user_data, s->buffer, s->len, FALSE);
+                            s->frame_handler(s->frame_user_data, s->buffer, s->len, false);
                     }
                     s->rx_length_errors++;
                 }
@@ -206,7 +211,7 @@ static void rx_flag_or_abort(hdlc_rx_state_t *s)
             if (++s->flags_seen >= s->framing_ok_threshold  &&  !s->framing_ok_announced)
             {
                 report_status_change(s, SIG_STATUS_FRAMING_OK);
-                s->framing_ok_announced = TRUE;
+                s->framing_ok_announced = true;
             }
         }
     }
@@ -307,8 +312,8 @@ SPAN_DECLARE(void) hdlc_rx_set_octet_counting_report_interval(hdlc_rx_state_t *s
 /*- End of function --------------------------------------------------------*/
 
 SPAN_DECLARE(hdlc_rx_state_t *) hdlc_rx_init(hdlc_rx_state_t *s,
-                                             int crc32,
-                                             int report_bad_frames,
+                                             bool crc32,
+                                             bool report_bad_frames,
                                              int framing_ok_threshold,
                                              hdlc_frame_handler_t handler,
                                              void *user_data)
@@ -372,7 +377,7 @@ SPAN_DECLARE(int) hdlc_tx_frame(hdlc_tx_state_t *s, const uint8_t *frame, size_t
 {
     if (len <= 0)
     {
-        s->tx_end = TRUE;
+        s->tx_end = true;
         return 0;
     }
     if (s->len + len > s->max_frame_len)
@@ -398,7 +403,7 @@ SPAN_DECLARE(int) hdlc_tx_frame(hdlc_tx_state_t *s, const uint8_t *frame, size_t
         s->len += len;
     else
         s->len = len;
-    s->tx_end = FALSE;
+    s->tx_end = false;
     return 0;
 }
 /*- End of function --------------------------------------------------------*/
@@ -413,8 +418,8 @@ SPAN_DECLARE(int) hdlc_tx_flags(hdlc_tx_state_t *s, int len)
         s->flag_octets += -len;
     else
         s->flag_octets = len;
-    s->report_flag_underflow = TRUE;
-    s->tx_end = FALSE;
+    s->report_flag_underflow = true;
+    s->tx_end = false;
     return 0;
 }
 /*- End of function --------------------------------------------------------*/
@@ -453,7 +458,7 @@ SPAN_DECLARE_NONSTD(int) hdlc_tx_get_byte(hdlc_tx_state_t *s)
         /* We are in a timed flag section (preamble, inter frame gap, etc.) */
         if (--s->flag_octets <= 0  &&  s->report_flag_underflow)
         {
-            s->report_flag_underflow = FALSE;
+            s->report_flag_underflow = false;
             if (s->len == 0)
             {
                 /* The timed flags have finished, there is nothing else queued to go,
@@ -509,7 +514,7 @@ SPAN_DECLARE_NONSTD(int) hdlc_tx_get_byte(hdlc_tx_state_t *s)
                     s->crc = 0xFFFFFFFF;
                 /* Report the underflow now. If there are timed flags still in progress, loading the
                    next frame right now will be harmless. */
-                s->report_flag_underflow = FALSE;
+                s->report_flag_underflow = false;
                 if (s->underflow_handler)
                     s->underflow_handler(s->user_data);
                 /* Make sure we finish off with at least one flag octet, if the underflow report did not result
@@ -540,7 +545,7 @@ SPAN_DECLARE_NONSTD(int) hdlc_tx_get_byte(hdlc_tx_state_t *s)
     /* Untimed idling on flags */
     if (s->tx_end)
     {
-        s->tx_end = FALSE;
+        s->tx_end = false;
         return SIG_STATUS_END_OF_DATA;
     }
     return s->idle_octet;
@@ -585,9 +590,9 @@ SPAN_DECLARE(void) hdlc_tx_set_max_frame_len(hdlc_tx_state_t *s, size_t max_len)
 /*- End of function --------------------------------------------------------*/
 
 SPAN_DECLARE(hdlc_tx_state_t *) hdlc_tx_init(hdlc_tx_state_t *s,
-                                             int crc32,
+                                             bool crc32,
                                              int inter_frame_flags,
-                                             int progressive,
+                                             bool progressive,
                                              hdlc_underflow_handler_t handler,
                                              void *user_data)
 {
index ef30f6f4d4467f0cef0fced8a735c7c61fa35342..442d188be5d92801b5b20c5c494dfd0c5c80a46a 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <tiffio.h>
 #include <assert.h>
index 68975b0e042e9a22d3a24f7d8d12d003ac83ad05..09bc29b6c631c14e54b8b0b99b8966c010547350 100644 (file)
 #include <signal.h>
 #include <sys/time.h>
 #include <time.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 
 #include "spandsp/telephony.h"
 #include "spandsp/alloc.h"
@@ -74,11 +79,11 @@ static void default_message_handler(void *user_data, int level, const char *text
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(int) span_log_test(logging_state_t *s, int level)
+SPAN_DECLARE(bool) span_log_test(logging_state_t *s, int level)
 {
     if (s  &&  (s->level & SPAN_LOG_SEVERITY_MASK) >= (level & SPAN_LOG_SEVERITY_MASK))
-        return TRUE;
-    return FALSE;
+        return true;
+    return false;
 }
 /*- End of function --------------------------------------------------------*/
 
index e809d41ec8517d3986cc22836196068702b69884..082dbbb3aca48a6dd7d9045f40b5f53a456f3a6c 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 
 #include "spandsp/telephony.h"
@@ -349,7 +354,7 @@ static void onset(lpc10_encode_state_t *s,
                     osbuf[*osptr - 1] = i - 9;
                     (*osptr)++;
                 }
-                s->hyst = TRUE;
+                s->hyst = true;
             }
             s->lasti = i;
             /* After one onset detection, at least OSHYST sample times must go */
@@ -357,7 +362,7 @@ static void onset(lpc10_encode_state_t *s,
         }
         else if (s->hyst  &&  i - s->lasti >= 10)
         {
-            s->hyst = FALSE;
+            s->hyst = false;
         }
     }
 }
index eb6d9968cb57f65ea7754bf80810d169fbf735ed..224213359136a53187aa4726c24f6140ae8b8d8c 100644 (file)
 #include <stdlib.h>
 #include <stdio.h>
 #include <inttypes.h>
+#include <memory.h>
 #if defined(HAVE_TGMATH_H)
 #include <tgmath.h>
 #endif
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
-#include <memory.h>
 
 #include "spandsp/telephony.h"
 #include "spandsp/alloc.h"
@@ -280,7 +285,7 @@ static int pitsyn(lpc10_decode_state_t *s,
             ipiti[i] = *pitch;
             rmsi[i] = *rms;
         }
-        s->first_pitsyn = FALSE;
+        s->first_pitsyn = false;
     }
     else
     {
@@ -407,7 +412,7 @@ static int pitsyn(lpc10_decode_state_t *s,
         /* NOUT        | --   --     --       --        ??        ?? */
         /* IVOICE      | --   --     --       --        0         0 */
 
-        /* UVPIT is always 0.0 on the first pass through the DO WHILE (TRUE)
+        /* UVPIT is always 0.0 on the first pass through the DO WHILE (true)
            loop below. */
 
         /* The only possible non-0 value of SLOPE (in column 111) is
@@ -858,7 +863,7 @@ static void decode(lpc10_decode_state_t *s,
         /* Skip decoding on first frame because present data not yet available */
         if (s->first)
         {
-            s->first = FALSE;
+            s->first = false;
             /* Assign PITCH a "default" value on the first call, since */
             /* otherwise it would be left uninitialized.  The two lines */
             /* below were copied from above, since it seemed like a */
@@ -1025,7 +1030,7 @@ SPAN_DECLARE(lpc10_decode_state_t *) lpc10_decode_init(lpc10_decode_state_t *s,
 
     /* State used by function decode */
     s->iptold = 60;
-    s->first = TRUE;
+    s->first = true;
     s->ivp2h = 0;
     s->iovoic = 0;
     s->iavgp = 60;
@@ -1045,7 +1050,7 @@ SPAN_DECLARE(lpc10_decode_state_t *) lpc10_decode_init(lpc10_decode_state_t *s,
 
     /* State used by function pitsyn */
     s->rmso = 1.0f;
-    s->first_pitsyn = TRUE;
+    s->first_pitsyn = true;
 
     /* State used by function bsynz */
     s->ipo = 0;
index 976fc602d0ae8759528fac729f10bcf1353648ce..27bf10c9b1a036f81ab6dd2a369fb777b9127c7f 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 
 #include "spandsp/telephony.h"
@@ -322,7 +327,7 @@ SPAN_DECLARE(lpc10_encode_state_t *) lpc10_encode_init(lpc10_encode_state_t *s,
     s->l2sum1 = 0.0f;
     s->l2ptr1 = 1;
     s->l2ptr2 = 9;
-    s->hyst = FALSE;
+    s->hyst = false;
 
     /* State used by function lpc10_voicing */
     s->dither = 20.0f;
index f728d6fa636ca8c20657af8d2430c5dfc52c0b2c..339e2415638b56e51761016ca2640192fb30e5db 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 
 #include "spandsp/telephony.h"
@@ -67,7 +72,7 @@ void lpc10_placea(int32_t *ipitch,
     int32_t k;
     int32_t l;
     int32_t hrange;
-    int ephase;
+    bool ephase;
     int32_t lrange;
 
     lrange = (af - 2)*lframe + 1;
@@ -148,14 +153,14 @@ void lpc10_placea(int32_t *ipitch,
             awin[af - 1][1] += *ipitch;
         }
         /* Make energy window be phase-synchronous. */
-        ephase = TRUE;
+        ephase = true;
     }
     else
     {
         /* Case 3 */
         awin[af - 1][0] = vwin[af - 1][0];
         awin[af - 1][1] = vwin[af - 1][1];
-        ephase = FALSE;
+        ephase = false;
     }
     /* RMS is computed over an integer number of pitch periods in the analysis
        window.  When it is not placed phase-synchronously, it is placed as close
@@ -193,7 +198,7 @@ void lpc10_placev(int32_t *osbuf,
 {
     int32_t i1;
     int32_t i2;
-    int crit;
+    bool crit;
     int32_t q;
     int32_t osptr1;
     int32_t hrange;
@@ -286,12 +291,12 @@ void lpc10_placev(int32_t *osbuf,
         q++;
         /* Check for case 2 (placement before onset): */
         /* Check for critical region exception: */
-        crit = FALSE;
+        crit = false;
         for (i = q + 1;  i < osptr1;  i++)
         {
             if (osbuf[i - 1] - osbuf[q - 1] >= minwin)
             {
-                crit = TRUE;
+                crit = true;
                 break;
             }
         }
index 90891f9ccab256dfad641e66306b022a9b63a0cd..fdb1b3f7c552afd085a9f74dea070ccbd0ff961b 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 
 #include "spandsp/telephony.h"
index 8ceac8aab9031fda9120f0e44aad4cea661de27b..b0faed4a0207524883104d36e344d99a43e07d0e 100644 (file)
 #include <inttypes.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <string.h>
+#include <stdio.h>
+#include <time.h>
+#include <fcntl.h>
 #if defined(HAVE_TGMATH_H)
 #include <tgmath.h>
 #endif
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
-#include <string.h>
-#include <stdio.h>
-#include <time.h>
-#include <fcntl.h>
 #if defined(__sunos)  ||  defined(__solaris)  ||  defined(__sun)
 #include <getopt.h>
 #endif
 #include "spandsp/complex.h"
 #include "filter_tools.h"
 
-#if !defined(FALSE)
-#define FALSE 0
-#endif
-#if !defined(TRUE)
-#define TRUE (!FALSE)
-#endif
-
 //#define SAMPLE_RATE         8000.0
 #define MAX_COEFFS_PER_FILTER   128
 #define MAX_COEFF_SETS          384
@@ -84,7 +82,7 @@ static void make_tx_filter(int coeff_sets,
     alpha = baud_rate/(2.0*(double) (coeff_sets*baud_rate));
     beta = excess_bandwidth;
 
-    compute_raised_cosine_filter(coeffs, total_coeffs, TRUE, FALSE, alpha, beta);
+    compute_raised_cosine_filter(coeffs, total_coeffs, true, false, alpha, beta);
 
     /* Find the DC gain of the filter, and adjust the filter to unity gain. */
     floating_gain = 0.0;
@@ -180,7 +178,7 @@ static void make_rx_filter(int coeff_sets,
     beta = excess_bandwidth;
     carrier *= 2.0*3.1415926535/SAMPLE_RATE;
 
-    compute_raised_cosine_filter(coeffs, total_coeffs, TRUE, FALSE, alpha, beta);
+    compute_raised_cosine_filter(coeffs, total_coeffs, true, false, alpha, beta);
 
     /* Find the DC gain of the filter, and adjust the filter to unity gain. */
     floating_gain = 0.0;
@@ -284,7 +282,7 @@ int main(int argc, char **argv)
     const char *tx_tag;
     const char *modem;
 
-    transmit_modem = FALSE;
+    transmit_modem = false;
     modem = "";
     while ((opt = getopt(argc, argv, "m:rt")) != -1)
     {
@@ -294,10 +292,10 @@ int main(int argc, char **argv)
             modem = optarg;
             break;
         case 'r':
-            transmit_modem = FALSE;
+            transmit_modem = false;
             break;
         case 't':
-            transmit_modem = TRUE;
+            transmit_modem = true;
             break;
         default:
             usage();
index 6a08781f66e8da3a895f6a82f250a833f320e124..9c030ad0edfc67e7828a2d3aa25007ee1e1d30e4 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <stdio.h>
 
@@ -70,6 +75,7 @@
 #include "spandsp/fsk.h"
 #include "spandsp/modem_connect_tones.h"
 
+#include "spandsp/private/power_meter.h"
 #include "spandsp/private/fsk.h"
 #include "spandsp/private/modem_connect_tones.h"
 
@@ -256,12 +262,12 @@ SPAN_DECLARE(modem_connect_tones_tx_state_t *) modem_connect_tones_tx_init(modem
 {
     int alloced;
 
-    alloced = FALSE;
+    alloced = false;
     if (s == NULL)
     {
         if ((s = (modem_connect_tones_tx_state_t *) span_alloc(sizeof(*s))) == NULL)
             return NULL;
-        alloced = TRUE;
+        alloced = true;
     }
     s->tone_type = tone_type;
     switch (s->tone_type)
@@ -399,7 +405,7 @@ static void v21_put_bit(void *user_data, int bit)
             s->raw_bit_stream = 0;
             s->num_bits = 0;
             s->flags_seen = 0;
-            s->framing_ok_announced = FALSE;
+            s->framing_ok_announced = false;
             break;
         }
         return;
@@ -430,7 +436,7 @@ static void v21_put_bit(void *user_data, int bit)
                 if (++s->flags_seen >= HDLC_FRAMING_OK_THRESHOLD  &&  !s->framing_ok_announced)
                 {
                     report_tone_state(s, MODEM_CONNECT_TONES_FAX_PREAMBLE, lfastrintf(fsk_rx_signal_power(&(s->v21rx))));
-                    s->framing_ok_announced = TRUE;
+                    s->framing_ok_announced = true;
                 }
             }
         }
@@ -442,7 +448,7 @@ static void v21_put_bit(void *user_data, int bit)
         {
             if (s->num_bits == 8)
             {
-                s->framing_ok_announced = FALSE;
+                s->framing_ok_announced = false;
                 s->flags_seen = 0;
             }
         }
@@ -548,7 +554,7 @@ SPAN_DECLARE_NONSTD(int) modem_connect_tones_rx(modem_connect_tones_rx_state_t *
                     report_tone_state(s, MODEM_CONNECT_TONES_NONE, -99);
                 s->tone_cycle_duration = 0;
                 s->good_cycles = 0;
-                s->tone_on = FALSE;
+                s->tone_on = false;
                 continue;
             }
             /* There is adequate energy in the channel. Is it mostly at 2100Hz? */
@@ -590,7 +596,7 @@ SPAN_DECLARE_NONSTD(int) modem_connect_tones_rx(modem_connect_tones_rx_state_t *
                         s->tone_cycle_duration = ms_to_samples(450 + 100);
                     }
                 }
-                s->tone_on = TRUE;
+                s->tone_on = true;
             }
             else if (s->notch_level*5 > s->channel_level)
             {
@@ -609,7 +615,7 @@ SPAN_DECLARE_NONSTD(int) modem_connect_tones_rx(modem_connect_tones_rx_state_t *
                         s->good_cycles = 0;
                     }
                 }
-                s->tone_on = FALSE;
+                s->tone_on = false;
             }
         }
         break;
@@ -743,7 +749,7 @@ SPAN_DECLARE(modem_connect_tones_rx_state_t *) modem_connect_tones_rx_init(modem
     s->tone_cycle_duration = 0;
     s->good_cycles = 0;
     s->hit = MODEM_CONNECT_TONES_NONE;
-    s->tone_on = FALSE;
+    s->tone_on = false;
     s->tone_callback = tone_callback;
     s->callback_data = user_data;
     s->znotch_1 = 0.0f;
@@ -752,7 +758,7 @@ SPAN_DECLARE(modem_connect_tones_rx_state_t *) modem_connect_tones_rx_init(modem
     s->z15hz_2 = 0.0f;
     s->num_bits = 0;
     s->flags_seen = 0;
-    s->framing_ok_announced = FALSE;
+    s->framing_ok_announced = false;
     s->raw_bit_stream = 0;
     return s;
 }
index 60a8d9767426be3ba0e7e5e6d0bc7d99e89ca3dc..9ad0d8dcf2e5ebfe7e83ec71fe9d924b05f78ed4 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 #include <limits.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 
 #include "spandsp/telephony.h"
 #include "spandsp/alloc.h"
 #include "spandsp/playout.h"
 
+#include "spandsp/private/playout.h"
+
 static playout_frame_t *queue_get(playout_state_t *s, timestamp_t sender_stamp)
 {
     playout_frame_t *frame;
@@ -121,7 +128,7 @@ SPAN_DECLARE(int) playout_get(playout_state_t *s, playout_frame_t *frameout, tim
         if (!s->not_first)
         {
             /* Prime things the first time through */
-            s->not_first = TRUE;
+            s->not_first = true;
             s->latest_expected = frame->receiver_stamp + s->min_length;
         }
         /* Leaky integrate the rate of occurance of frames received just in time and late */
@@ -297,7 +304,7 @@ SPAN_DECLARE(int) playout_put(playout_state_t *s, void *data, int type, timestam
     {
         s->last_speech_sender_stamp = sender_stamp - sender_len - s->min_length;
         s->last_speech_sender_len = sender_len;
-        s->start = FALSE;
+        s->start = false;
     }
 
     return PLAYOUT_OK;
@@ -321,7 +328,7 @@ SPAN_DECLARE(void) playout_restart(playout_state_t *s, int min_length, int max_l
     s->min_length = min_length;
     s->max_length = (max_length > min_length)  ?  max_length  :  min_length;
     s->dropable_threshold = 1*0x10000000/100;
-    s->start = TRUE;
+    s->start = true;
     s->since_last_step = 0x7FFFFFFF;
     /* Start with the minimum buffer length allowed, and work from there */
     s->actual_buffer_length =
index 840682a8fc7825391f02420c23c4b03995e3f254..7b45dad988f1c79b01a63711e73a9770b24b15b2 100644 (file)
@@ -48,6 +48,8 @@
 #include "spandsp/saturated.h"
 #include "spandsp/plc.h"
 
+#include "spandsp/private/plc.h"
+
 /* We do a straight line fade to zero volume in 50ms when we are filling in for missing data. */
 #define ATTENUATION_INCREMENT       0.0025f     /* Attenuation per sample */
 
index 984393021568a18bb877b883ce7583010a4cdcda..147fb47029046c210c1cb5878c7a5152f69ccd34 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <assert.h>
 
@@ -48,6 +53,8 @@
 #include "spandsp/alloc.h"
 #include "spandsp/power_meter.h"
 
+#include "spandsp/private/power_meter.h"
+
 SPAN_DECLARE(power_meter_t *) power_meter_init(power_meter_t *s, int shift)
 {
     if (s == NULL)
@@ -148,14 +155,14 @@ SPAN_DECLARE(int32_t) power_surge_detector(power_surge_detector_state_t *s, int1
     {
         if (pow_short <= s->surge*(pow_medium >> 10))
             return 0;
-        s->signal_present = TRUE;
+        s->signal_present = true;
         s->medium_term.reading = s->short_term.reading;
     }
     else
     {
         if (pow_short < s->sag*(pow_medium >> 10))
         {
-            s->signal_present = FALSE;
+            s->signal_present = false;
             s->medium_term.reading = s->short_term.reading;
             return 0;
         }
index 3f55e833eace9ce76b91abd0ef9657ea87fbe9d6..d56903996991dc18f37380a5afa4313bc687a214 100644 (file)
 #include <ctype.h>
 #include <stdlib.h>
 #include <inttypes.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
+#if defined(HAVE_STDATOMIC_H)
+#include <stdatomic.h>
+#endif
 #include <sys/types.h>
 
 #define SPANDSP_FULLY_DEFINE_QUEUE_STATE_T
@@ -44,7 +52,7 @@
 
 #include "spandsp/private/queue.h"
 
-SPAN_DECLARE(int) queue_empty(queue_state_t *s)
+SPAN_DECLARE(bool) queue_empty(queue_state_t *s)
 {
     return (s->iptr == s->optr);
 }
index f65b5d7764ef9e4ea62ef28a3bf513a5568af20e..6e38e6bd9485399c9bce34deedd1f377361699cc 100644 (file)
 #include <inttypes.h>
 #include <stdlib.h>
 #include <memory.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 
 #include "spandsp/telephony.h"
 #include "spandsp/alloc.h"
index 698c07180ecd78e1f4e59b308b014cd0c75c4edc..e40d39ac371091bd8f408ee6d4a71fe40af3bd47 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <memory.h>
 #include <string.h>
@@ -54,6 +59,7 @@
 #include "spandsp/super_tone_rx.h"
 #include "spandsp/sig_tone.h"
 
+#include "spandsp/private/power_meter.h"
 #include "spandsp/private/sig_tone.h"
 
 /*! PI */
@@ -226,7 +232,7 @@ SPAN_DECLARE(int) sig_tone_tx(sig_tone_tx_state_t *s, int16_t amp[], int len)
     int k;
     int n;
     int16_t tone;
-    int need_update;
+    bool need_update;
     int high_low;
 
     for (i = 0;  i < len;  i += n)
@@ -236,19 +242,19 @@ SPAN_DECLARE(int) sig_tone_tx(sig_tone_tx_state_t *s, int16_t amp[], int len)
             if (s->current_tx_timeout <= len - i)
             {
                 n = s->current_tx_timeout;
-                need_update = TRUE;
+                need_update = true;
             }
             else
             {
                 n = len - i;
-                need_update = FALSE;
+                need_update = false;
             }
             s->current_tx_timeout -= n;
         }
         else
         {
             n = len - i;
-            need_update = FALSE;
+            need_update = false;
         }
         if (!(s->current_tx_tone & SIG_TONE_TX_PASSTHROUGH))
             vec_zeroi16(&amp[i], n);
@@ -449,13 +455,13 @@ SPAN_DECLARE(int) sig_tone_rx(sig_tone_rx_state_t *s, int16_t amp[], int len)
         if ((s->signalling_state & (SIG_TONE_1_PRESENT | SIG_TONE_2_PRESENT)))
         {
             if (s->flat_mode_timeout  &&  --s->flat_mode_timeout == 0)
-                s->flat_mode = TRUE;
+                s->flat_mode = true;
             /*endif*/
         }
         else
         {
             s->flat_mode_timeout = s->desc->sharp_flat_timeout;
-            s->flat_mode = FALSE;
+            s->flat_mode = false;
         }
         /*endif*/
 
index d89f9c8e42c4de52b8b867db77a5dc093f082fa5..7c24f4334e31a3f9ab070dd75a855f557d6b54e2 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <assert.h>
 #include <limits.h>
index d5a7b4458137855a784903949a146b660689f885..6ed699f3b426d5eaaeac3079a75cb54aefc060a2 100644 (file)
@@ -45,6 +45,7 @@
 #include <limits.h>
 #include <time.h>
 @INSERT_MATH_HEADER@
+@INSERT_STDBOOL_HEADER@
 #include <tiffio.h>
 
 #include <spandsp/telephony.h>
index 8511897604affb40040f9fa94ac993e911845688..6ad81aa9be509f0c36082c52c507526399b16335 100644 (file)
@@ -28,8 +28,8 @@
 #if !defined(_SPANDSP_ALLOC_H_)
 #define _SPANDSP_ALLOC_H_
 
-typedef void *(*span_alloc_t)(size_t size);
 typedef void *(*span_aligned_alloc_t)(size_t alignment, size_t size);
+typedef void *(*span_alloc_t)(size_t size);
 typedef void *(*span_realloc_t)(void *ptr, size_t size);
 typedef void (*span_free_t)(void *ptr);
 
@@ -38,20 +38,20 @@ extern "C"
 {
 #endif
 
-/* Allocate size bytes of memory. */
-SPAN_DECLARE(void *) span_alloc(size_t size);
-
 /* Allocate size bytes allocated to ALIGNMENT bytes.  */
 SPAN_DECLARE(void *) span_aligned_alloc(size_t alignment, size_t size);
 
+/* Allocate size bytes of memory. */
+SPAN_DECLARE(void *) span_alloc(size_t size);
+
 /* Re-allocate the previously allocated block in ptr, making the new block size bytes long. */
 SPAN_DECLARE(void *) span_realloc(void *ptr, size_t size);
 
 /* Free a block allocated by span_alloc, span_aligned_alloc, or span_realloc. */
 SPAN_DECLARE(void) span_free(void *ptr);
 
-SPAN_DECLARE(int) span_mem_allocators(span_alloc_t custom_alloc,
-                                      span_aligned_alloc_t custom_aligned_alloc,
+SPAN_DECLARE(int) span_mem_allocators(span_aligned_alloc_t custom_aligned_alloc,
+                                      span_alloc_t custom_alloc,
                                       span_realloc_t custom_realloc,
                                       span_free_t custom_free);
 
index 1b22cd5caf91d557318047cae7403df17ed2f567..eabb41d3f10d0e0215fced993af5009f58f3db39 100644 (file)
@@ -164,7 +164,7 @@ SPAN_DECLARE_NONSTD(void) async_rx_put_bit(void *user_data, int bit);
     \param data_bits The number of data bits.
     \param parity_bits The type of parity.
     \param stop_bits The number of stop bits.
-    \param use_v14 TRUE if V.14 rate adaption processing should be used.
+    \param use_v14 True if V.14 rate adaption processing should be used.
     \param put_byte The callback routine used to put the received data.
     \param user_data An opaque pointer.
     \return A pointer to the initialised context, or NULL if there was a problem. */
@@ -172,7 +172,7 @@ SPAN_DECLARE(async_rx_state_t *) async_rx_init(async_rx_state_t *s,
                                                int data_bits,
                                                int parity_bits,
                                                int stop_bits,
-                                               int use_v14,
+                                               bool use_v14,
                                                put_byte_func_t put_byte,
                                                void *user_data);
 
@@ -198,7 +198,7 @@ SPAN_DECLARE_NONSTD(int) async_tx_get_bit(void *user_data);
     \param data_bits The number of data bit.
     \param parity_bits The type of parity.
     \param stop_bits The number of stop bits.
-    \param use_v14 TRUE if V.14 rate adaption processing should be used.
+    \param use_v14 True if V.14 rate adaption processing should be used.
     \param get_byte The callback routine used to get the data to be transmitted.
     \param user_data An opaque pointer.
     \return A pointer to the initialised context, or NULL if there was a problem. */
@@ -206,7 +206,7 @@ SPAN_DECLARE(async_tx_state_t *) async_tx_init(async_tx_state_t *s,
                                                int data_bits,
                                                int parity_bits,
                                                int stop_bits,
-                                               int use_v14,
+                                               bool use_v14,
                                                get_byte_func_t get_byte,
                                                void *user_data);
 
index 7f8ebbb16b8f182f7224318df137861d9ccb70a5..aa390d509ba97c60fd9462fd28debe85f88f9a09 100644 (file)
@@ -115,14 +115,14 @@ enum
 */
 typedef struct
 {
-    /*! TRUE if character echo is enabled */
-    int echo;
-    /*! TRUE if verbose reporting is enabled */
-    int verbose;
-    /*! TRUE if result codes are verbose */
+    /*! True if character echo is enabled */
+    bool echo;
+    /*! True if verbose reporting is enabled */
+    bool verbose;
+    /*! Result code format code - numeic or verbose */
     int result_code_format;
-    /*! TRUE if pulse dialling is the default */
-    int pulse_dial;
+    /*! True if pulse dialling is the default */
+    bool pulse_dial;
     /*! ??? */
     int double_escape;
     /*! ??? */
index 98d9f749e8a4d10fbc633785bd45e92b05deab3b..2d40848a34d66a814a74abfb24ebb27a6a9c2ab4 100644 (file)
@@ -175,10 +175,10 @@ SPAN_DECLARE(int) r2_mf_tx_put(r2_mf_tx_state_t *s, char digit);
 
 /*! \brief Initialise an R2 MF tone generator context.
     \param s The R2 MF generator context.
-    \param fwd TRUE if the context is for forward signals. FALSE if the
+    \param fwd True if the context is for forward signals. False if the
            context is for backward signals.
     \return A pointer to the MFC/R2 generator context.*/
-SPAN_DECLARE(r2_mf_tx_state_t *) r2_mf_tx_init(r2_mf_tx_state_t *s, int fwd);
+SPAN_DECLARE(r2_mf_tx_state_t *) r2_mf_tx_init(r2_mf_tx_state_t *s, bool fwd);
 
 /*! \brief Release an R2 MF tone generator context.
     \param s The R2 MF tone generator context.
@@ -242,7 +242,7 @@ SPAN_DECLARE(int) r2_mf_rx_get(r2_mf_rx_state_t *s);
 
 /*! \brief Initialise an R2 MF receiver context.
     \param s The R2 MF receiver context.
-    \param fwd TRUE if the context is for forward signals. FALSE if the
+    \param fwd True if the context is for forward signals. False if the
            context is for backward signals.
     \param callback An optional callback routine, used to report received digits. If
            no callback routine is set, digits may be collected, using the r2_mf_rx_get()
@@ -251,7 +251,7 @@ SPAN_DECLARE(int) r2_mf_rx_get(r2_mf_rx_state_t *s);
            and supplied in callbacks.
     \return A pointer to the R2 MF receiver context. */
 SPAN_DECLARE(r2_mf_rx_state_t *) r2_mf_rx_init(r2_mf_rx_state_t *s,
-                                               int fwd,
+                                               bool fwd,
                                                tone_report_func_t callback,
                                                void *user_data);
 
index b55e4afd16b4fc6fcf8d8c1f0011262c1cda6e5f..edbaedb48f766d3763774168ea35685324110697 100644 (file)
@@ -71,7 +71,7 @@ SPAN_DECLARE(void) bitstream_flush(bitstream_state_t *s, uint8_t **c);
 
 /*! \brief Initialise a bitstream context.
     \param s A pointer to the bitstream context.
-    \param lsb_first TRUE if the bit stream is LSB first, else its MSB first.
+    \param lsb_first True if the bit stream is LSB first, else its MSB first.
     \return A pointer to the bitstream context. */
 SPAN_DECLARE(bitstream_state_t *) bitstream_init(bitstream_state_t *s, int direction);
 
index a4d9b8040a336b77c2c0f2ff4cc742607b70f8c9..9d02355621287dbc8547803db3a780c07a3b1988 100644 (file)
@@ -60,9 +60,9 @@ SPAN_DECLARE(int) crc_itu32_append(uint8_t *buf, int len);
 /*! \brief Check the ITU/CCITT CRC-32 value in a frame.
     \param buf The buffer containing the frame.
     \param len The length of the frame.
-    \return TRUE if the CRC is OK, else FALSE.
+    \return True if the CRC is OK, else false.
 */
-SPAN_DECLARE(int) crc_itu32_check(const uint8_t *buf, int len);
+SPAN_DECLARE(bool) crc_itu32_check(const uint8_t *buf, int len);
 
 /*! \brief Calculate the ITU/CCITT CRC-16 value in buffer by whole bytes.
     \param buf The buffer containing the data.
@@ -93,9 +93,9 @@ SPAN_DECLARE(int) crc_itu16_append(uint8_t *buf, int len);
 /*! \brief Check the ITU/CCITT CRC-16 value in a frame.
     \param buf The buffer containing the frame.
     \param len The length of the frame.
-    \return TRUE if the CRC is OK, else FALSE.
+    \return True if the CRC is OK, else false.
 */
-SPAN_DECLARE(int) crc_itu16_check(const uint8_t *buf, int len);
+SPAN_DECLARE(bool) crc_itu16_check(const uint8_t *buf, int len);
 
 #if defined(__cplusplus)
 }
index df9660feeef580e8686561904b6722cf97960827..15915f75a6efece2265b2c5d4fc6abc890146364 100644 (file)
@@ -156,7 +156,7 @@ SPAN_DECLARE(void) dtmf_rx_set_realtime_callback(dtmf_rx_state_t *s,
 
 /*! \brief Adjust a DTMF receiver context.
     \param s The DTMF receiver context.
-    \param filter_dialtone TRUE to enable filtering of dialtone, FALSE
+    \param filter_dialtone True to enable filtering of dialtone, false
            to disable, < 0 to leave unchanged.
     \param twist Acceptable twist, in dB. < 0.0 to leave unchanged.
     \param reverse_twist Acceptable reverse twist, in dB. < 0.0 to leave unchanged.
index 5424b7c67ea11763426d1cf4c68af837a1947763..b86d247805b71ec0399b95c2792562b545c26349 100644 (file)
@@ -40,6 +40,7 @@
 #include <spandsp/private/awgn.h>
 #include <spandsp/private/noise.h>
 #include <spandsp/private/bert.h>
+#include <spandsp/private/power_meter.h>
 #include <spandsp/private/tone_generate.h>
 #include <spandsp/private/bell_r2_mf.h>
 #include <spandsp/private/sig_tone.h>
@@ -49,6 +50,8 @@
 #include <spandsp/private/g726.h>
 #include <spandsp/private/lpc10.h>
 #include <spandsp/private/gsm0610.h>
+#include <spandsp/private/plc.h>
+#include <spandsp/private/playout.h>
 #include <spandsp/private/oki_adpcm.h>
 #include <spandsp/private/ima_adpcm.h>
 #include <spandsp/private/hdlc.h>
 #include <spandsp/private/v27ter_tx.h>
 #include <spandsp/private/v29rx.h>
 #include <spandsp/private/v29tx.h>
-/*#include <spandsp/private/v32bis.h>*/
-/*#include <spandsp/private/v34.h>*/
 #include <spandsp/private/v42.h>
 #include <spandsp/private/v42bis.h>
 #include <spandsp/private/at_interpreter.h>
+#include <spandsp/private/data_modems.h>
 #include <spandsp/private/fax_modems.h>
 #include <spandsp/private/timezone.h>
 #include <spandsp/private/image_translate.h>
index 9d268770bc272125923a7b0bef36d691bee9c90a..01dbb80d8028c586b61f88ee4cc94ce0fb31895c 100644 (file)
@@ -75,16 +75,16 @@ SPAN_DECLARE_NONSTD(int) fax_tx(fax_state_t *s, int16_t *amp, int max_len);
 /*! Select whether silent audio will be sent when FAX transmit is idle.
     \brief Select whether silent audio will be sent when FAX transmit is idle.
     \param s The FAX context.
-    \param transmit_on_idle TRUE if silent audio should be output when the FAX transmitter is
-           idle. FALSE to transmit zero length audio when the FAX transmitter is idle. The default
-           behaviour is FALSE.
+    \param transmit_on_idle True if silent audio should be output when the FAX transmitter is
+           idle. False to transmit zero length audio when the FAX transmitter is idle. The default
+           behaviour is false.
 */
 SPAN_DECLARE(void) fax_set_transmit_on_idle(fax_state_t *s, int transmit_on_idle);
 
 /*! Select whether talker echo protection tone will be sent for the image modems.
     \brief Select whether TEP will be sent for the image modems.
     \param s The FAX context.
-    \param use_tep TRUE if TEP should be sent.
+    \param use_tep True if TEP should be sent.
 */
 SPAN_DECLARE(void) fax_set_tep_mode(fax_state_t *s, int use_tep);
 
@@ -105,7 +105,7 @@ SPAN_DECLARE(logging_state_t *) fax_get_logging_state(fax_state_t *s);
 /*! Restart a FAX context.
     \brief Restart a FAX context.
     \param s The FAX context.
-    \param calling_party TRUE if the context is for a calling party. FALSE if the
+    \param calling_party True if the context is for a calling party. False if the
            context is for an answering party.
     \return 0 for OK, else -1. */
 SPAN_DECLARE(int) fax_restart(fax_state_t *s, int calling_party);
@@ -113,7 +113,7 @@ SPAN_DECLARE(int) fax_restart(fax_state_t *s, int calling_party);
 /*! Initialise a FAX context.
     \brief Initialise a FAX context.
     \param s The FAX context.
-    \param calling_party TRUE if the context is for a calling party. FALSE if the
+    \param calling_party True if the context is for a calling party. False if the
            context is for an answering party.
     \return A pointer to the FAX context, or NULL if there was a problem.
 */
index cf5efe4330faf8b094847a4a2bad77a1913729ab..a0916d1d5fa3ddf2c091cde0d9ae6ec7f7aa89c2 100644 (file)
@@ -83,8 +83,8 @@ extern "C"
 
 /*! \brief Initialise an HDLC receiver context.
     \param s A pointer to an HDLC receiver context.
-    \param crc32 TRUE to use ITU CRC32. FALSE to use ITU CRC16.
-    \param report_bad_frames TRUE to request the reporting of bad frames.
+    \param crc32 True to use ITU CRC32. False to use ITU CRC16.
+    \param report_bad_frames True to request the reporting of bad frames.
     \param framing_ok_threshold The number of back-to-back flags needed to
            start the framing OK condition. This may be used where a series of
            flag octets is used as a preamble, such as in the T.30 protocol.
@@ -93,8 +93,8 @@ extern "C"
     \return A pointer to the HDLC receiver context.
 */
 SPAN_DECLARE(hdlc_rx_state_t *) hdlc_rx_init(hdlc_rx_state_t *s,
-                                             int crc32,
-                                             int report_bad_frames,
+                                             bool crc32,
+                                             bool report_bad_frames,
                                              int framing_ok_threshold,
                                              hdlc_frame_handler_t handler,
                                              void *user_data);
@@ -169,17 +169,17 @@ SPAN_DECLARE_NONSTD(void) hdlc_rx_put(hdlc_rx_state_t *s, const uint8_t buf[], i
 
 /*! \brief Initialise an HDLC transmitter context.
     \param s A pointer to an HDLC transmitter context.
-    \param crc32 TRUE to use ITU CRC32. FALSE to use ITU CRC16.
+    \param crc32 True to use ITU CRC32. False to use ITU CRC16.
     \param inter_frame_flags The minimum flag octets to insert between frames (usually one).
-    \param progressive TRUE if frame creation works in progressive mode.
+    \param progressive True if frame creation works in progressive mode.
     \param handler The callback function called when the HDLC transmitter underflows.
     \param user_data An opaque parameter for the callback routine.
     \return A pointer to the HDLC transmitter context.
 */
 SPAN_DECLARE(hdlc_tx_state_t *) hdlc_tx_init(hdlc_tx_state_t *s,
-                                             int crc32,
+                                             bool crc32,
                                              int inter_frame_flags,
-                                             int progressive,
+                                             bool progressive,
                                              hdlc_underflow_handler_t handler,
                                              void *user_data);
 
index 2de8eb8767ac1d42b3abc7b83b72d66df669c12b..78db086ef0a41550a8f2361eecac1f7f155a09a7 100644 (file)
@@ -80,9 +80,9 @@ extern "C"
     \brief Test if logging of a specified severity level is enabled.
     \param s The logging context.
     \param level The severity level to be tested.
-    \return TRUE if logging is enable, else FALSE.
+    \return True if logging is enable.
 */
-SPAN_DECLARE(int) span_log_test(logging_state_t *s, int level);
+SPAN_DECLARE(bool) span_log_test(logging_state_t *s, int level);
 
 /*! Generate a log entry.
     \brief Generate a log entry.
index 7c2b980753173acb98bc6f657fc8dc0a390fcc64..713f813bbbd8cfa07199ebca333b2cd057946f91 100644 (file)
@@ -153,7 +153,7 @@ SPAN_DECLARE_NONSTD(int) modem_connect_tones_rx_fillin(modem_connect_tones_rx_st
 
 /*! \brief Test if a modem_connect tone has been detected.
     \param s The context.
-    \return TRUE if tone is detected, else FALSE.
+    \return The code for the detected tone.
 */
 SPAN_DECLARE(int) modem_connect_tones_rx_get(modem_connect_tones_rx_state_t *s);
 
index 582fcb2c51be08cda8af4864e35a1dcd82c0d856..8e038086df393629cd8cfad4eb9ee5174aee3ce1 100644 (file)
@@ -56,80 +56,13 @@ enum
 
 typedef int timestamp_t;
 
-typedef struct playout_frame_s
-{
-    /*! The actual frame data */
-    void *data;
-    /*! The type of frame */
-    int type;
-    /*! The timestamp assigned by the sending end */
-    timestamp_t sender_stamp;
-    /*! The timespan covered by the data in this frame */
-    timestamp_t sender_len;
-    /*! The timestamp assigned by the receiving end */
-    timestamp_t receiver_stamp;
-    /*! Pointer to the next earlier frame */
-    struct playout_frame_s *earlier;
-    /*! Pointer to the next later frame */
-    struct playout_frame_s *later;
-} playout_frame_t;
+typedef struct playout_frame_s playout_frame_t;
 
 /*!
     Playout (jitter buffer) descriptor. This defines the working state
     for a single instance of playout buffering.
 */
-typedef struct
-{
-    /*! TRUE if the buffer is dynamically sized */
-    int dynamic;
-    /*! The minimum length (dynamic) or fixed length (static) of the buffer */
-    int min_length;
-    /*! The maximum length (dynamic) or fixed length (static) of the buffer */
-    int max_length;
-    /*! The target filter threshold for adjusting dynamic buffering. */
-    int dropable_threshold;
-
-    int start;
-
-    /*! The queued frame list */
-    playout_frame_t *first_frame;
-    playout_frame_t *last_frame;
-    /*! The free frame pool */
-    playout_frame_t *free_frames;
-
-    /*! The total frames input to the buffer, to date. */
-    int frames_in;
-    /*! The total frames output from the buffer, to date. */
-    int frames_out;
-    /*! The number of frames received out of sequence. */
-    int frames_oos;
-    /*! The number of frames which were discarded, due to late arrival. */
-    int frames_late;
-    /*! The number of frames which were never received. */
-    int frames_missing;
-    /*! The number of frames trimmed from the stream, due to buffer shrinkage. */
-    int frames_trimmed;
-
-    timestamp_t latest_expected;
-    /*! The present jitter adjustment */
-    timestamp_t current;
-    /*! The sender_stamp of the last speech frame */
-    timestamp_t last_speech_sender_stamp;
-    /*! The duration of the last speech frame */
-    timestamp_t last_speech_sender_len;
-
-    int not_first;
-    /*! The time since the target buffer length was last changed. */
-    timestamp_t since_last_step;
-    /*! Filter state for tracking the packets arriving just in time */
-    int32_t state_just_in_time;
-    /*! Filter state for tracking the packets arriving late */
-    int32_t state_late;
-    /*! The current target length of the buffer */
-    int target_buffer_length;
-    /*! The current actual length of the buffer, which may lag behind the target value */
-    int actual_buffer_length;
-} playout_state_t;
+typedef struct playout_state_s playout_state_t;
 
 #if defined(__cplusplus)
 extern "C"
index 801c6ac65f793e154612ec964bd0483d61edecb8..6d5c301073c079d5b3d594f7eaa7c2f85f7b393d 100644 (file)
@@ -109,21 +109,7 @@ That's it!
 /*!
     The generic packet loss concealer context.
 */
-typedef struct
-{
-    /*! Consecutive erased samples */
-    int missing_samples;
-    /*! Current offset into pitch period */
-    int pitch_offset;
-    /*! Pitch estimate */
-    int pitch;
-    /*! Buffer for a cycle of speech */
-    float pitchbuf[PLC_PITCH_MIN];
-    /*! History buffer */
-    int16_t history[PLC_HISTORY_LEN];
-    /*! Current pointer into the history buffer */
-    int buf_ptr;
-} plc_state_t;
+typedef struct plc_state_s plc_state_t;
 
 
 #if defined(__cplusplus)
index 5eff21fccddff5f3d02168a53eb184e618706f11..e94985860712e90cdba2030431095e1b85a49688 100644 (file)
@@ -23,8 +23,8 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#if !defined(_POWER_METER_H_)
-#define _POWER_METER_H_
+#if !defined(_SPANDSP_POWER_METER_H_)
+#define _SPANDSP_POWER_METER_H_
 
 /*! \page power_meter_page Power metering
 
@@ -45,24 +45,9 @@ values +/-8031, and this square wave represents 0dBov.  This translates into 6.1
     Power meter descriptor. This defines the working state for a
     single instance of a power measurement device.
 */
-typedef struct
-{
-    /*! The shift factor, which controls the damping of the power meter. */
-    int shift;
-
-    /*! The current power reading. */
-    int32_t reading;
-} power_meter_t;
+typedef struct power_meter_s power_meter_t;
 
-typedef struct
-{
-    power_meter_t short_term;
-    power_meter_t medium_term;
-    int signal_present;
-    int32_t surge;
-    int32_t sag;
-    int32_t min;
-} power_surge_detector_state_t;
+typedef struct power_surge_detector_state_s power_surge_detector_state_t;
 
 #if defined(__cplusplus)
 extern "C"
index 39bb1d4a4480954ab48ddf8b8923c2a3fe51e312..1c9c9265954858a4b561dd7feaf0f9e73785b5ce 100644 (file)
@@ -69,8 +69,8 @@ struct async_rx_state_s
     int parity;
     /*! \brief The number of stop bits per character. */
     int stop_bits;
-    /*! \brief TRUE if V.14 rate adaption processing should be performed. */
-    int use_v14;
+    /*! \brief True if V.14 rate adaption processing should be performed. */
+    bool use_v14;
     /*! \brief A pointer to the callback routine used to handle received characters. */
     put_byte_func_t put_byte;
     /*! \brief An opaque pointer passed when calling put_byte. */
index a60a9aa46e10186b34e5e8e13372c5081bf67a80..3ddade99c55cdabd6be2ccc419e93f3541c3e9a5 100644 (file)
@@ -106,10 +106,10 @@ struct at_state_s
     int command_dial;
     int ok_is_pending;
     int dte_is_waiting;
-    /*! \brief TRUE if a carrier is presnt. Otherwise FALSE. */
-    int rx_signal_present;
-    /*! \brief TRUE if a modem has trained, Otherwise FALSE. */
-    int rx_trained;
+    /*! \brief True if a carrier is presnt. Otherwise false. */
+    bool rx_signal_present;
+    /*! \brief True if a modem has trained, Otherwise false. */
+    bool rx_trained;
     int transmit;
 
     char line[256];
index 234e4c9ba0e0af75050324bc7ec462e9137d370a..d0681be23ff193bb7253eb4841e1a993ce842f37 100644 (file)
@@ -73,8 +73,8 @@ struct r2_mf_tx_state_s
 {
     /*! The tone generator. */
     tone_gen_state_t tone;
-    /*! TRUE if generating forward tones, otherwise generating reverse tones. */
-    int fwd;
+    /*! True if generating forward tones, otherwise generating reverse tones. */
+    bool fwd;
     /*! The current digit being generated. */
     int digit;
 };
@@ -88,8 +88,8 @@ struct r2_mf_rx_state_s
     tone_report_func_t callback;
     /*! An opaque pointer passed to the callback function. */
     void *callback_data;
-    /*! TRUE is we are detecting forward tones. FALSE if we are detecting backward tones */
-    int fwd;
+    /*! Tue is we are detecting forward tones. False if we are detecting backward tones */
+    bool fwd;
     /*! Tone detector working states */
     goertzel_state_t out[6];
     /*! The current sample number within a processing block. */
index aec8d5e12489d6d5466bfc7ef1bb931aec8cab27..e957eabd612f28a4de827ff6d76c13c0f80afab6 100644 (file)
@@ -33,8 +33,8 @@ struct bitstream_state_s
     uint32_t bitstream;
     /*! The residual bits in bitstream. */
     int residue;
-    /*! TRUE if the stream is LSB first, else MSB first */
-    int lsb_first;
+    /*! True if the stream is LSB first, else MSB first */
+    bool lsb_first;
 };
 
 
index c773ee61eefd41f8a8049ff5dc02bdceb908e351..37450fdba5e8deabe8ae1887adc2f6c7dd33aaf9 100644 (file)
@@ -61,8 +61,8 @@ struct dtmf_rx_state_s
     tone_report_func_t realtime_callback;
     /*! An opaque pointer passed to the real time callback function. */
     void *realtime_callback_data;
-    /*! TRUE if dialtone should be filtered before processing */
-    int filter_dialtone;
+    /*! True if dialtone should be filtered before processing */
+    bool filter_dialtone;
 #if defined(SPANDSP_USE_FIXED_POINT)
     /*! 350Hz filter state for the optional dialtone filter. */
     float z350[2];
index cb66c2f576309beff4cf971cb9b484121e63f83c..373a692994f9db3a108bd41e9177f10d2549267a 100644 (file)
 */
 struct fax_modems_state_s
 {
-    /*! TRUE is talker echo protection should be sent for the image modems */
-    int use_tep;
+    /*! True is talker echo protection should be sent for the image modems */
+    bool use_tep;
     /*! \brief The callback function used to report detected tones. */
     tone_report_func_t tone_callback;
     /*! \brief A user specified opaque pointer passed to the tone_callback function. */
     void *tone_callback_user_data;
 
-    /*! If TRUE, transmit silence when there is nothing else to transmit. If FALSE return only
+    /*! If true, transmit silence when there is nothing else to transmit. If false return only
         the actual generated audio. Note that this only affects untimed silences. Timed silences
         (e.g. the 75ms silence between V.21 and a high speed modem) will alway be transmitted as
         silent audio. */
@@ -110,12 +110,12 @@ struct fax_modems_state_s
     hdlc_frame_handler_t hdlc_accept;
     void *hdlc_accept_user_data;
 
-    /*! \brief TRUE if a carrier is present. Otherwise FALSE. */
-    int rx_signal_present;
-    /*! \brief TRUE if a modem has trained correctly. */
-    int rx_trained;
-    /*! \brief TRUE if an HDLC frame has been received correctly. */
-    int rx_frame_received;
+    /*! \brief True if a carrier is present. Otherwise false. */
+    bool rx_signal_present;
+    /*! \brief True if a modem has trained correctly. */
+    bool rx_trained;
+    /*! \brief True if an HDLC frame has been received correctly. */
+    bool rx_frame_received;
 
     int deferred_rx_handler_updates;
     /*! \brief The current receive signal handler */
@@ -145,8 +145,8 @@ struct fax_modems_state_s
     /*! \brief The current bit rate of the receiver. */
     int rx_bit_rate;
 
-    /*! \brief If TRUE, transmission is in progress */
-    int transmit;
+    /*! \brief If True, transmission is in progress */
+    bool transmit;
     /*! \brief Audio logging file handle for received audio. */
     int audio_rx_log;
     /*! \brief Audio logging file handle for transmitted audio. */
index 9a8e8aec4b68b2e3e8cf0bf17dacb7def2d922a6..47b2abaa2f88dfd5a341a56887ea1773ac753e80 100644 (file)
@@ -47,13 +47,13 @@ typedef struct
  */
 struct g722_encode_state_s
 {
-    /*! TRUE if the operating in the special ITU test mode, with the band split filters
+    /*! True if the operating in the special ITU test mode, with the band split filters
              disabled. */
-    int itu_test_mode;
-    /*! TRUE if the G.722 data is packed */
-    int packed;
-    /*! TRUE if encode from 8k samples/second */
-    int eight_k;
+    bool itu_test_mode;
+    /*! True if the G.722 data is packed */
+    bool packed;
+    /*! True if encode from 8k samples/second */
+    bool eight_k;
     /*! 6 for 48000kbps, 7 for 56000kbps, or 8 for 64000kbps. */
     int bits_per_sample;
 
@@ -75,13 +75,13 @@ struct g722_encode_state_s
  */
 struct g722_decode_state_s
 {
-    /*! TRUE if the operating in the special ITU test mode, with the band split filters
+    /*! True if the operating in the special ITU test mode, with the band split filters
              disabled. */
-    int itu_test_mode;
-    /*! TRUE if the G.722 data is packed */
-    int packed;
-    /*! TRUE if decode to 8k samples/second */
-    int eight_k;
+    bool itu_test_mode;
+    /*! True if the G.722 data is packed */
+    bool packed;
+    /*! True if decode to 8k samples/second */
+    bool eight_k;
     /*! 6 for 48000kbps, 7 for 56000kbps, or 8 for 64000kbps. */
     int bits_per_sample;
 
index de87394daf65302a296ccd0a116cf0be323df8e1..6390a52f08958ee3c2ec9c72b872a1ab8e54a52d 100644 (file)
@@ -43,24 +43,24 @@ struct hdlc_rx_state_s
     modem_status_func_t status_handler;
     /*! \brief An opaque parameter passed to the status callback routine. */
     void *status_user_data;
-    /*! \brief TRUE if bad frames are to be reported. */
-    int report_bad_frames;
+    /*! \brief True if bad frames are to be reported. */
+    bool report_bad_frames;
     /*! \brief The number of consecutive flags which must be seen before framing is
         declared OK. */
     int framing_ok_threshold;
-    /*! \brief TRUE if framing OK has been announced. */
-    int framing_ok_announced;
+    /*! \brief True if framing OK has been announced. */
+    bool framing_ok_announced;
     /*! \brief Number of consecutive flags seen so far. */
     int flags_seen;
 
     /*! \brief The raw (stuffed) bit stream buffer. */
-    unsigned int raw_bit_stream;
+    uint32_t raw_bit_stream;
     /*! \brief The destuffed bit stream buffer. */
-    unsigned int byte_in_progress;
+    uint32_t byte_in_progress;
     /*! \brief The current number of bits in byte_in_progress. */
     int num_bits;
-    /*! \brief TRUE if in octet counting mode (e.g. for MTP). */
-    int octet_counting_mode;
+    /*! \brief True if in octet counting mode (e.g. for MTP). */
+    bool octet_counting_mode;
     /*! \brief Octet count, to achieve the functionality needed for things
                like MTP. */
     int octet_count;
@@ -98,8 +98,8 @@ struct hdlc_tx_state_s
     void *user_data;
     /*! \brief The minimum flag octets to insert between frames. */
     int inter_frame_flags;
-    /*! \brief TRUE if frame creation works in progressive mode. */
-    int progressive;
+    /*! \brief True if frame creation works in progressive mode. */
+    bool progressive;
     /*! \brief Maximum permitted frame length. */
     size_t max_frame_len;
 
@@ -113,8 +113,8 @@ struct hdlc_tx_state_s
     int flag_octets;
     /*! \brief The number of abort octets to send for a timed burst of aborts. */
     int abort_octets;
-    /*! \brief TRUE if the next underflow of timed flag octets should be reported */
-    int report_flag_underflow;
+    /*! \brief True if the next underflow of timed flag octets should be reported */
+    bool report_flag_underflow;
 
     /*! \brief The current message being transmitted, with its CRC attached. */
     uint8_t buffer[HDLC_MAXFRAME_LEN + 4];
@@ -130,8 +130,8 @@ struct hdlc_tx_state_s
     /*! \brief The number of bits remaining in byte. */
     int bits;
 
-    /*! \brief TRUE if transmission should end on buffer underflow .*/
-    int tx_end;
+    /*! \brief True if transmission should end on buffer underflow .*/
+    bool tx_end;
 };
 
 #endif
index b61893637ccd06839ab5d57b417092dab82bbd70..e02096e6d5754b168331b4968c023836f0c45479 100644 (file)
@@ -92,8 +92,8 @@ struct lpc10_encode_state_s
     int32_t l2ptr2;
     /*! \brief No initial value necessary */
     int32_t lasti;
-    /*! \brief Initial value FALSE */
-    int hyst;
+    /*! \brief Initial value false */
+    bool hyst;
 
     /* State used by function lpc10_voicing */
     /*! \brief Initial value 20.0f */
@@ -148,8 +148,8 @@ struct lpc10_decode_state_s
     /* State used by function decode */
     /*! \brief Initial value 60 */
     int32_t iptold;
-    /*! \brief Initial value TRUE */
-    int first;
+    /*! \brief Initial value true */
+    bool first;
     /*! \brief ??? */
     int32_t ivp2h;
     /*! \brief ??? */
@@ -172,18 +172,18 @@ struct lpc10_decode_state_s
     int32_t buflen;
 
     /* State used by function pitsyn */
-    /*! \brief No initial value necessary as long as first_pitsyn is initially TRUE */
+    /*! \brief No initial value necessary as long as first_pitsyn is initially true */
     int32_t ivoico;
-    /*! \brief  No initial value necessary as long as first_pitsyn is initially TRUE */
+    /*! \brief  No initial value necessary as long as first_pitsyn is initially true */
     int32_t ipito;
     /*! \brief Initial value 1.0f */
     float rmso;
-    /*! \brief No initial value necessary as long as first_pitsyn is initially TRUE */
+    /*! \brief No initial value necessary as long as first_pitsyn is initially true */
     float rco[10];
-    /*! \brief No initial value necessary as long as first_pitsyn is initially TRUE */
+    /*! \brief No initial value necessary as long as first_pitsyn is initially true */
     int32_t jsamp;
-    /*! \brief Initial value TRUE */
-    int first_pitsyn;
+    /*! \brief Initial value true */
+    bool first_pitsyn;
 
     /* State used by function bsynz */
     /*! \brief ??? */
index c1c33d25a4ce68ea3dda6433e8d144fc2f21813d..d76faf1de3dfff1f0b9e9f682eec7832d2831880 100644 (file)
@@ -77,7 +77,7 @@ struct modem_connect_tones_rx_state_s
     int32_t am_level;
     /*! \brief Sample counter for the small chunks of samples, after which a test is conducted. */
     int chunk_remainder;
-    /*! \brief TRUE is the tone is currently confirmed present in the audio. */
+    /*! \brief The code for the tone currently confirmed present in the audio. */
     int tone_present;
     /*! \brief */
     int tone_on;
@@ -85,7 +85,7 @@ struct modem_connect_tones_rx_state_s
     int tone_cycle_duration;
     /*! \brief A count of the number of good cycles of tone reversal seen. */
     int good_cycles;
-    /*! \brief TRUE if the tone has been seen since the last time the user tested for it */
+    /*! \brief The confirmed tone code. */
     int hit;
     /*! \brief A V.21 FSK modem context used when searching for FAX preamble. */
     fsk_rx_state_t v21rx;
@@ -95,8 +95,8 @@ struct modem_connect_tones_rx_state_s
     int num_bits;
     /*! \brief Number of consecutive flags seen so far. */
     int flags_seen;
-    /*! \brief TRUE if framing OK has been announced. */
-    int framing_ok_announced;
+    /*! \brief True if framing OK has been announced. */
+    bool framing_ok_announced;
 };
 
 #endif
diff --git a/libs/spandsp/src/spandsp/private/playout.h b/libs/spandsp/src/spandsp/private/playout.h
new file mode 100644 (file)
index 0000000..dd8c9a5
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * SpanDSP - a series of DSP components for telephony
+ *
+ * private/playout.h
+ *
+ * Written by Steve Underwood <steveu@coppice.org>
+ *
+ * Copyright (C) 2005 Steve Underwood
+ *
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 2.1,
+ * as published by the Free Software Foundation.
+ *
+ * This program 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#if !defined(_SPANDSP_PRIVATE_PLAYOUT_H_)
+#define _SPANDSP_PRIVATE_PLAYOUT_H_
+
+struct playout_frame_s
+{
+    /*! The actual frame data */
+    void *data;
+    /*! The type of frame */
+    int type;
+    /*! The timestamp assigned by the sending end */
+    timestamp_t sender_stamp;
+    /*! The timespan covered by the data in this frame */
+    timestamp_t sender_len;
+    /*! The timestamp assigned by the receiving end */
+    timestamp_t receiver_stamp;
+    /*! Pointer to the next earlier frame */
+    struct playout_frame_s *earlier;
+    /*! Pointer to the next later frame */
+    struct playout_frame_s *later;
+};
+
+/*!
+    Playout (jitter buffer) descriptor. This defines the working state
+    for a single instance of playout buffering.
+*/
+struct playout_state_s
+{
+    /*! True if the buffer is dynamically sized */
+    bool dynamic;
+    /*! The minimum length (dynamic) or fixed length (static) of the buffer */
+    int min_length;
+    /*! The maximum length (dynamic) or fixed length (static) of the buffer */
+    int max_length;
+    /*! The target filter threshold for adjusting dynamic buffering. */
+    int dropable_threshold;
+
+    int start;
+
+    /*! The queued frame list */
+    playout_frame_t *first_frame;
+    playout_frame_t *last_frame;
+    /*! The free frame pool */
+    playout_frame_t *free_frames;
+
+    /*! The total frames input to the buffer, to date. */
+    int frames_in;
+    /*! The total frames output from the buffer, to date. */
+    int frames_out;
+    /*! The number of frames received out of sequence. */
+    int frames_oos;
+    /*! The number of frames which were discarded, due to late arrival. */
+    int frames_late;
+    /*! The number of frames which were never received. */
+    int frames_missing;
+    /*! The number of frames trimmed from the stream, due to buffer shrinkage. */
+    int frames_trimmed;
+
+    timestamp_t latest_expected;
+    /*! The present jitter adjustment */
+    timestamp_t current;
+    /*! The sender_stamp of the last speech frame */
+    timestamp_t last_speech_sender_stamp;
+    /*! The duration of the last speech frame */
+    timestamp_t last_speech_sender_len;
+
+    int not_first;
+    /*! The time since the target buffer length was last changed. */
+    timestamp_t since_last_step;
+    /*! Filter state for tracking the packets arriving just in time */
+    int32_t state_just_in_time;
+    /*! Filter state for tracking the packets arriving late */
+    int32_t state_late;
+    /*! The current target length of the buffer */
+    int target_buffer_length;
+    /*! The current actual length of the buffer, which may lag behind the target value */
+    int actual_buffer_length;
+};
+
+#endif
+/*- End of file ------------------------------------------------------------*/
diff --git a/libs/spandsp/src/spandsp/private/plc.h b/libs/spandsp/src/spandsp/private/plc.h
new file mode 100644 (file)
index 0000000..79975b0
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * SpanDSP - a series of DSP components for telephony
+ *
+ * private/plc.h
+ *
+ * Written by Steve Underwood <steveu@coppice.org>
+ *
+ * Copyright (C) 2004 Steve Underwood
+ *
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 2.1,
+ * as published by the Free Software Foundation.
+ *
+ * This program 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/*! \file */
+
+#if !defined(_SPANDSP_PRIVATE_PLC_H_)
+#define _SPANDSP_PRIVATE_PLC_H_
+
+/*! Minimum allowed pitch (66 Hz) */
+#define PLC_PITCH_MIN           120
+/*! Maximum allowed pitch (200 Hz) */
+#define PLC_PITCH_MAX           40
+/*! Maximum pitch OLA window */
+#define PLC_PITCH_OVERLAP_MAX   (PLC_PITCH_MIN >> 2)
+/*! The length over which the AMDF function looks for similarity (20 ms) */
+#define CORRELATION_SPAN        160
+/*! History buffer length. The buffer much also be at leat 1.25 times
+    PLC_PITCH_MIN, but that is much smaller than the buffer needs to be for
+    the pitch assessment. */
+#define PLC_HISTORY_LEN         (CORRELATION_SPAN + PLC_PITCH_MIN)
+
+/*!
+    The generic packet loss concealer context.
+*/
+struct plc_state_s
+{
+    /*! Consecutive erased samples */
+    int missing_samples;
+    /*! Current offset into pitch period */
+    int pitch_offset;
+    /*! Pitch estimate */
+    int pitch;
+    /*! Buffer for a cycle of speech */
+    float pitchbuf[PLC_PITCH_MIN];
+    /*! History buffer */
+    int16_t history[PLC_HISTORY_LEN];
+    /*! Current pointer into the history buffer */
+    int buf_ptr;
+};
+
+#endif
+/*- End of file ------------------------------------------------------------*/
diff --git a/libs/spandsp/src/spandsp/private/power_meter.h b/libs/spandsp/src/spandsp/private/power_meter.h
new file mode 100644 (file)
index 0000000..64b8ec3
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * SpanDSP - a series of DSP components for telephony
+ *
+ * private/power_meter.h
+ *
+ * Written by Steve Underwood <steveu@coppice.org>
+ *
+ * Copyright (C) 2003 Steve Underwood
+ *
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 2.1,
+ * as published by the Free Software Foundation.
+ *
+ * This program 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#if !defined(_SPANDSP_PRIVATE_POWER_METER_H_)
+#define _SPANDSP_PRIVATE_POWER_METER_H_
+
+/*!
+    Power meter descriptor. This defines the working state for a
+    single instance of a power measurement device.
+*/
+struct power_meter_s
+{
+    /*! The shift factor, which controls the damping of the power meter. */
+    int shift;
+
+    /*! The current power reading. */
+    int32_t reading;
+};
+
+struct power_surge_detector_state_s
+{
+    power_meter_t short_term;
+    power_meter_t medium_term;
+    int signal_present;
+    int32_t surge;
+    int32_t sag;
+    int32_t min;
+};
+
+#endif
+/*- End of file ------------------------------------------------------------*/
index e7c621705192fd00504220308c7b6242dc2f1ee7..3ec02d9bf9328cb49a8d28e22e0aec74937b57ca 100644 (file)
@@ -210,10 +210,10 @@ struct sig_tone_rx_state_s
     /*! \brief The minimum ratio between notched power and total power for detection */
     int32_t detection_ratio;
 
-    /*! \brief TRUE if in flat mode. FALSE if in sharp mode. */
-    int flat_mode;
-    /*! \brief TRUE if the notch filter is enabled in the media path */
-    int notch_enabled;
+    /*! \brief True if in flat mode. False if in sharp mode. */
+    bool flat_mode;
+    /*! \brief True if the notch filter is enabled in the media path */
+    bool notch_enabled;
     /*! \brief ??? */
     int flat_mode_timeout;
     /*! \brief ??? */
index 786fd4f0d259005b37bdd35fbc52dca99ff1d8c1..06b35b67a2a83d742d4a7c899d9bdac66b45e7d0 100644 (file)
@@ -43,8 +43,8 @@ struct t30_state_s
     /*! \brief The type of FAX operation currently in progress */
     int operation_in_progress;
 
-    /*! \brief TRUE if behaving as the calling party */
-    int calling_party;
+    /*! \brief True if behaving as the calling party */
+    bool calling_party;
 
     /*! \brief Internet aware FAX mode bit mask. */
     int iaf;
@@ -64,10 +64,10 @@ struct t30_state_s
     int supported_image_sizes;
     /*! \brief A bit mask of the currently supported T.30 special features. */
     int supported_t30_features;
-    /*! \brief TRUE is ECM mode handling is enabled. */
-    int ecm_allowed;
-    /*! \brief TRUE if we are capable of retransmitting pages */
-    int retransmit_capable;
+    /*! \brief True is ECM mode handling is enabled. */
+    bool ecm_allowed;
+    /*! \brief True if we are capable of retransmitting pages */
+    bool retransmit_capable;
 
     /*! \brief The received DCS, formatted as an ASCII string, for inclusion
                in the TIFF file. */
@@ -75,17 +75,17 @@ struct t30_state_s
     /*! \brief The text which will be used in FAX page header. No text results
                in no header line. */
     char header_info[T30_MAX_PAGE_HEADER_INFO + 1];
-    /*! \brief TRUE for FAX page headers to overlay (i.e. replace) the beginning of the
-               page image. FALSE for FAX page headers to add to the overall length of
+    /*! \brief True for FAX page headers to overlay (i.e. replace) the beginning of the
+               page image. False for FAX page headers to add to the overall length of
                the page. */
-    int header_overlays_image;
-    /*! \brief Use private timezone if TRUE */
-    int use_own_tz;
+    bool header_overlays_image;
+    /*! \brief Use private timezone if true */
+    bool use_own_tz;
     /*! \brief Optional per instance time zone for the FAX page header timestamp. */
     tz_t tz;
 
-    /*! \brief TRUE if remote T.30 procedural interrupts are allowed. */
-    int remote_interrupts_allowed;
+    /*! \brief True if remote T.30 procedural interrupts are allowed. */
+    bool remote_interrupts_allowed;
 
     /*! \brief The information fields received. */
     t30_exchanged_info_t rx_info;
@@ -163,11 +163,11 @@ struct t30_state_s
     int local_dis_dtc_len;
     /*! \brief The last DIS or DTC message received form the far end. */
     uint8_t far_dis_dtc_frame[T30_MAX_DIS_DTC_DCS_LEN];
-    /*! \brief TRUE if a valid DIS has been received from the far end. */
-    int dis_received;
+    /*! \brief True if a valid DIS has been received from the far end. */
+    bool dis_received;
 
-    /*! \brief TRUE if the short training sequence should be used. */
-    int short_train;
+    /*! \brief True if the short training sequence should be used. */
+    bool short_train;
 
     /*! \brief A count of the number of bits in the trainability test. This counts down to zero when
         sending TCF, and counts up when receiving it. */
@@ -181,12 +181,12 @@ struct t30_state_s
     int current_fallback;
     /*! \brief The subset of supported modems allowed at the current time, allowing for negotiation. */
     int current_permitted_modems;
-    /*! \brief TRUE if a carrier is present. Otherwise FALSE. */
-    int rx_signal_present;
-    /*! \brief TRUE if a modem has trained correctly. */
-    int rx_trained;
-    /*! \brief TRUE if a valid HDLC frame has been received in the current reception period. */
-    int rx_frame_received;
+    /*! \brief True if a carrier is present. Otherwise false. */
+    bool rx_signal_present;
+    /*! \brief True if a modem has trained correctly. */
+    bool rx_trained;
+    /*! \brief True if a valid HDLC frame has been received in the current reception period. */
+    bool rx_frame_received;
 
     /*! \brief Current reception mode. */
     int current_rx_type;
@@ -214,14 +214,14 @@ struct t30_state_s
     /*! \brief This is only used in full duplex (e.g. ISDN) modes. */
     int timer_t8;
 
-    /*! \brief TRUE once the far end FAX entity has been detected. */
-    int far_end_detected;
+    /*! \brief True once the far end FAX entity has been detected. */
+    bool far_end_detected;
 
-    /*! \brief TRUE once the end of procedure condition has been detected. */
-    int end_of_procedure_detected;
+    /*! \brief True once the end of procedure condition has been detected. */
+    bool end_of_procedure_detected;
 
-    /*! \brief TRUE if a local T.30 interrupt is pending. */
-    int local_interrupt_pending;
+    /*! \brief True if a local T.30 interrupt is pending. */
+    bool local_interrupt_pending;
     /*! \brief The common ground in compression schemes between the local and far ends. */
     int mutual_compressions;
     /*! \brief The common group of supported bi-level image resolutions. */
@@ -248,8 +248,8 @@ struct t30_state_s
     t4_image_width_t image_width;
     /*! \brief Current number of retries of the action in progress. */
     int retries;
-    /*! \brief TRUE if error correcting mode is used. */
-    int error_correcting_mode;
+    /*! \brief True if error correcting mode is used. */
+    bool error_correcting_mode;
     /*! \brief The number of HDLC frame retries, if error correcting mode is used. */
     int error_correcting_mode_retries;
     /*! \brief The current count of consecutive T30_PPR messages. */
@@ -277,9 +277,9 @@ struct t30_state_s
     int ecm_frames_this_tx_burst;
     /*! \brief The current ECM frame, during ECM transmission. */
     int ecm_current_tx_frame;
-    /*! \brief TRUE if we are at the end of an ECM page to se sent - i.e. there are no more
+    /*! \brief True if we are at the end of an ECM page to se sent - i.e. there are no more
         partial pages still to come. */
-    int ecm_at_page_end;
+    bool ecm_at_page_end;
 
     /*! \brief The transmission step queued to follow the one in progress. */
     int next_tx_step;
@@ -305,8 +305,8 @@ struct t30_state_s
 
     /*! \brief the FCF2 field of the last PPS message we received. */
     uint8_t last_pps_fcf2;
-    /*! \brief TRUE if all frames of the current received ECM block are now OK */
-    int rx_ecm_block_ok;
+    /*! \brief True if all frames of the current received ECM block are now OK */
+    bool rx_ecm_block_ok;
     /*! \brief A count of successfully received ECM frames, to assess progress as a basis for
         deciding whether to continue error correction when PPRs keep repeating. */
     int ecm_progress;
index 2686b5f5035fa5a7b61cc99c9bc6af1675450c52..1f7de41f996b0101f7812f235af858ba55f391a1 100644 (file)
@@ -108,8 +108,8 @@ typedef struct
     /*! \brief The current transmit step being timed */
     int timed_step;
 
-    /*! \brief TRUE is there has been some T.38 data missed */
-    int rx_data_missing;
+    /*! \brief True is there has been some T.38 data missed */
+    bool rx_data_missing;
 
     /*! \brief The number of octets to send in each image packet (non-ECM or ECM) at the current
                rate and the current specified packet interval. */
@@ -138,9 +138,9 @@ typedef struct
 
     t31_hdlc_state_t hdlc_from_t31;
 
-    /*! \brief TRUE if we are using ECM mode. This is used to select HDLC faking, necessary
+    /*! \brief True if we are using ECM mode. This is used to select HDLC faking, necessary
                with clunky class 1 modems. */
-    int ecm_mode;
+    bool ecm_mode;
 
     /*! \brief Counter for trailing non-ECM bytes, used to flush out the far end's modem. */
     int non_ecm_trailer_bytes;
@@ -179,8 +179,8 @@ struct t31_state_s
 
     t31_audio_front_end_state_t audio;
     t31_t38_front_end_state_t t38_fe;
-    /*! TRUE if working in T.38 mode. */
-    int t38_mode;
+    /*! True if working in T.38 mode. */
+    bool t38_mode;
 
     /*! HDLC buffer, for composing an HDLC frame from the computer to the channel. */
     struct
@@ -189,8 +189,8 @@ struct t31_state_s
         uint8_t buf[T31_MAX_HDLC_LEN];
         int len;
         int ptr;
-        /*! \brief TRUE when the end of HDLC data from the computer has been detected. */
-        int final;
+        /*! \brief True when the end of HDLC data from the computer has been detected. */
+        bool final;
     } hdlc_tx;
     /*! Buffer for data from the computer to the channel. */
     struct
@@ -201,24 +201,24 @@ struct t31_state_s
         int in_bytes;
         /*! \brief The number of bytes sent from the transmit buffer. */
         int out_bytes;
-        /*! \brief TRUE if the flow of real data has started. */
-        int data_started;
-        /*! \brief TRUE if holding up further data into the buffer, for flow control. */
-        int holding;
-        /*! \brief TRUE when the end of non-ECM data from the computer has been detected. */
-        int final;
+        /*! \brief True if the flow of real data has started. */
+        bool data_started;
+        /*! \brief True if holding up further data into the buffer, for flow control. */
+        bool holding;
+        /*! \brief True when the end of non-ECM data from the computer has been detected. */
+        bool final;
     } non_ecm_tx;
 
-    /*! TRUE if DLE prefix just used */
-    int dled;
+    /*! True if DLE prefix just used */
+    bool dled;
 
     /*! \brief Samples of silence awaited, as specified in a "wait for silence" command */
     int silence_awaited;
 
     /*! \brief The current bit rate for the FAX fast message transfer modem. */
     int bit_rate;
-    /*! \brief TRUE if a valid HDLC frame has been received in the current reception period. */
-    int rx_frame_received;
+    /*! \brief True if a valid HDLC frame has been received in the current reception period. */
+    bool rx_frame_received;
 
     /*! \brief Samples elapsed in the current call */
     int64_t call_samples;
@@ -226,8 +226,8 @@ struct t31_state_s
 
     /*! \brief The currently queued modem type. */
     int modem;
-    /*! \brief TRUE when short training mode has been selected by the computer. */
-    int short_train;
+    /*! \brief True when short training mode has been selected by the computer. */
+    bool short_train;
     queue_state_t *rx_queue;
 
     /*! \brief Error and flow logging control */
index 40123128af0e9f4150cbb2215eee0ad78eb3cd47..6d2995706781305200014b786f05e3ef9148c2db 100644 (file)
@@ -98,9 +98,9 @@ struct t38_core_state_s
     /*! \brief Pace transmission */
     int pace_transmission;
 
-    /*! \brief TRUE if IFP packet sequence numbers are relevant. For some transports, like TPKT
+    /*! \brief True if IFP packet sequence numbers are relevant. For some transports, like TPKT
                over TCP they are not relevent. */
-    int check_sequence_numbers;
+    bool check_sequence_numbers;
 
     /*! \brief The number of times each packet type will be sent (low byte). The
                depth of redundancy (2nd byte). Higher numbers may increase reliability
index 075a9b221c9925c357c641d317b4e868df935ea2..23c6dd59bf1b4a7f43242a2cece24e064476a2ad 100644 (file)
@@ -43,12 +43,12 @@ typedef struct
     /*! \brief Core T.38 IFP support */
     t38_core_state_t t38;
 
-    /*! \brief TRUE if the NSF, NSC, and NSS are to be suppressed by altering
-               their contents to something the far end will not recognise. */
+    /*! \brief If NSF, NSC, and NSS are to be suppressed by altering their contents to
+               something the far end will not recognise, this is the amount to overwrite. */
     int suppress_nsx_len[2];
-    /*! \brief TRUE if we need to corrupt the HDLC frame in progress, so the receiver cannot
+    /*! \brief True if we need to corrupt the HDLC frame in progress, so the receiver cannot
                interpret it. The two values are for the two directions. */
-    int corrupt_current_frame[2];
+    bool corrupt_current_frame[2];
 
     /*! \brief the current class of field being received - i.e. none, non-ECM or HDLC */
     int current_rx_field_class;
@@ -87,8 +87,8 @@ typedef struct
     int bit_no;
     /*! \brief Progressively calculated CRC for HDLC messages received from a modem. */
     uint16_t crc;
-    /*! \brief TRUE if non-ECM fill bits are to be stripped when sending image data. */
-    int fill_bit_removal;
+    /*! \brief True if non-ECM fill bits are to be stripped when sending image data. */
+    bool fill_bit_removal;
     /*! \brief The number of octets to send in each image packet (non-ECM or ECM) at
                the current rate and the current specified packet interval. */
     int octets_per_data_packet;
@@ -134,27 +134,27 @@ typedef struct
 {
     /*! \brief A bit mask of the currently supported modem types. */
     int supported_modems;
-    /*! \brief TRUE if ECM FAX mode is allowed through the gateway. */
-    int ecm_allowed;
+    /*! \brief True if ECM FAX mode is allowed through the gateway. */
+    bool ecm_allowed;
     /*! \brief Required time between T.38 transmissions, in ms. */
     int ms_per_tx_chunk;
 
-    /*! \brief TRUE if in image data modem is to use short training. This usually
+    /*! \brief True if in image data modem is to use short training. This usually
                follows image_data_mode, but in ECM mode T.30 defines recovery
                conditions in which long training is used for image data. */
-    int short_train;
-    /*! \brief TRUE if in image data mode, as opposed to TCF mode. */
-    int image_data_mode;
+    bool short_train;
+    /*! \brief True if in image data mode, as opposed to TCF mode. */
+    bool image_data_mode;
     /*! \brief The minimum permitted bits per FAX scan line row. */
     int min_row_bits;
 
-    /*! \brief TRUE if we should count the next MCF as a page end, else FALSE */
-    int count_page_on_mcf;
+    /*! \brief True if we should count the next MCF as a page end, else false */
+    bool count_page_on_mcf;
     /*! \brief The number of pages for which a confirm (MCF) message was returned. */
     int pages_confirmed;
 
-    /*! \brief TRUE if we are in error correcting (ECM) mode */
-    int ecm_mode;
+    /*! \brief True if we are in error correcting (ECM) mode */
+    bool ecm_mode;
     /*! \brief The current bit rate for the fast modem. */
     int fast_bit_rate;
     /*! \brief The current fast receive modem type. */
index 78604420a9448141cddcf0038ea6329e898bdc41..9220f78af1c88d8af166466e9bd2c8a660f6989c 100644 (file)
@@ -55,14 +55,14 @@ struct t38_non_ecm_buffer_state_s
     uint8_t flow_control_fill_octet;
     /*! \brief A code for the phase of input buffering, from initial all ones to completion. */
     int input_phase;
-    /*! \brief TRUE is the end of non-ECM data indication has been received. */
-    int data_finished;
+    /*! \brief True is the end of non-ECM data indication has been received. */
+    bool data_finished;
     /*! \brief The current octet being transmitted from the buffer. */
     unsigned int octet;
     /*! \brief The current bit number in the current non-ECM octet. */
     int bit_no;
-    /*! \brief TRUE if in image data mode, as opposed to TCF mode. */
-    int image_data_mode;
+    /*! \brief True if in image data mode, as opposed to TCF mode. */
+    bool image_data_mode;
 
     /*! \brief The number of octets input to the buffer. */
     int in_octets;
index 0bd75a6cfb453b2db6e3a6140c2d47e8fb360856..219b1e3cf703d14b8ca3a9a6802f506a11536b87 100644 (file)
@@ -46,9 +46,9 @@ typedef struct
     /*! \brief The timed step to go to when we reach idle from the current timed step */
     int queued_timed_step;
 
-    /*! \brief TRUE is there has been some T.38 data missed (i.e. lost packets) in the current
+    /*! \brief True is there has been some T.38 data missed (i.e. lost packets) in the current
                reception period. */
-    int rx_data_missing;
+    bool rx_data_missing;
 
     /*! \brief The number of octets to send in each image packet (non-ECM or ECM) at the current
                rate and the current specified packet interval. */
@@ -84,8 +84,8 @@ typedef struct
     /*! \brief The current T.38 data type being transmitted. */
     int current_tx_data_type;
 
-    /*! \brief TRUE if a carrier is present. Otherwise FALSE. */
-    int rx_signal_present;
+    /*! \brief True if a carrier is present. Otherwise false. */
+    bool rx_signal_present;
 
     /*! \brief The current operating mode of the receiver. */
     int current_rx_type;
index 90b4e72d6608d75cfee98bc3bc9c25cf17d846ce..616e1be879ba64dd9f161bff47273729b9f4c052 100644 (file)
@@ -81,8 +81,8 @@ struct t4_t6_decode_state_s
     int run_length;
     /*! \brief 2D horizontal mode control. */
     int black_white;
-    /*! \brief TRUE if the current run is black */
-    int in_black;
+    /*! \brief True if the current run is black */
+    bool in_black;
 
     /*! \brief The current step into the current row run-lengths buffer. */
     int a_cursor;
index ea080109aabda2b6ae112e44acec14aef35fbdd8..4ac35f76a995d20a4b37ffc88287c8218feea641 100644 (file)
@@ -59,7 +59,7 @@ struct t4_t6_encode_state_s
 
     /*! \brief This variable is set if we are treating the current row as a 2D encoded
                one. */
-    int row_is_2d;
+    bool row_is_2d;
 
     /*! \brief Encoded data bits buffer. */
     uint32_t tx_bitstream;
index f1c21b1080d3e7f4213e3aa5b83ec4828218a9cd..5ff0d2ea272cadbd70c6c2d331d84f68cf165359 100644 (file)
@@ -124,10 +124,10 @@ struct t4_tx_state_s
     /*! \brief The last page to transfer. -1 to continue to the end of the file. */
     int stop_page;
 
-    /*! \brief TRUE for FAX page headers to overlay (i.e. replace) the beginning of the
-               page image. FALSE for FAX page headers to add to the overall length of
+    /*! \brief True for FAX page headers to overlay (i.e. replace) the beginning of the
+               page image. False for FAX page headers to add to the overall length of
                the page. */
-    int header_overlays_image;
+    bool header_overlays_image;
     /*! \brief The text which will be used in FAX page header. No text results
                in no header line. */
     const char *header_info;
index 586a5cc22ffc6e7824038df7d6ab52d3df0a31a3..5eb2b50676614028fed426c76fa8b5f5286cdd00 100644 (file)
@@ -89,8 +89,8 @@ struct t85_encode_state_s
     uint32_t c[128];
     /*! New TX value, or <0 for analysis in progress */
     int32_t new_tx;
-    /*! TRUE if previous row was typical */
-    int prev_ltp;
+    /*! True if previous row was typical */
+    bool prev_ltp;
     /*! Pointers to the 3 row buffers */
     uint8_t *prev_row[3];
     /*! Pointer to a block of allocated memory 3 rows long, which
index 9f28cc3d2ba059b5288bf44bec6250f029b5deb6..87c67978a7d8312f26b8daed180f00e787d86b1a 100644 (file)
@@ -54,8 +54,8 @@ struct tz_ttinfo_s
     int32_t gmtoff;             /* UTC offset in seconds */
     int isdst;                  /* Used to set tm_isdst */
     int abbrind;                /* Abbreviation list index */
-    int ttisstd;                /* TRUE if transition is std time */
-    int ttisgmt;                /* TRUE if transition is UTC */
+    bool ttisstd;               /* True if transition is std time */
+    bool ttisgmt;               /* True if transition is UTC */
 };
 
 /* Leap second information */
index 2082722fd6051cf8a1e07949fa87f63b1aaf55a6..f6f847c553dd9dd51bdd36d1b4e8c84707c57dc2 100644 (file)
@@ -156,8 +156,8 @@ struct v17_rx_state_s
     /*! \brief Scrambler tap */
     int scrambler_tap;
 
-    /*! \brief TRUE if the short training sequence is to be used. */
-    int short_train;
+    /*! \brief True if the short training sequence is to be used. */
+    bool short_train;
     /*! \brief The section of the training data we are currently in. */
     int training_stage;
     /*! \brief A count of how far through the current training step we are. */
index 3e2fff6d2c791b8bd024188b1f6f04fba9b70251..acf2819371af3ea84e3358a95ab0b72686b87081 100644 (file)
@@ -81,10 +81,10 @@ struct v17_tx_state_s
     uint32_t scramble_reg;
     /*! \brief Scrambler tap */
     int scrambler_tap;
-    /*! \brief TRUE if transmitting the training sequence. FALSE if transmitting user data. */
-    int in_training;
-    /*! \brief TRUE if the short training sequence is to be used. */
-    int short_train;
+    /*! \brief True if transmitting the training sequence. False if transmitting user data. */
+    bool in_training;
+    /*! \brief True if the short training sequence is to be used. */
+    bool short_train;
     /*! \brief A counter used to track progress through sending the training sequence. */
     int training_step;
 
index b473abf05bfe3181a1ec595127958aa44dceba08..a7575b870b5cdb738614bc843641f60205312d7b 100644 (file)
@@ -28,8 +28,8 @@
 
 struct v18_state_s
 {
-    /*! \brief TRUE if we are the calling modem */
-    int calling_party;
+    /*! \brief True if we are the calling modem */
+    bool calling_party;
     int mode;
     int nation;
     put_msg_func_t put_msg;
index c0da6b0aa6995a591b224686f6779aec008879c6..dac5becb68ad0fb060053d9e30c4b5706ac5d9b2 100644 (file)
@@ -79,8 +79,8 @@ struct v22bis_state_s
 {
     /*! \brief The maximum permitted bit rate of the modem. Valid values are 1200 and 2400. */
     int bit_rate;
-    /*! \brief TRUE is this is the calling side modem. */
-    int calling_party;
+    /*! \brief True is this is the calling side modem. */
+    bool calling_party;
     /*! \brief The callback function used to get the next bit to be transmitted. */
     get_bit_func_t get_bit;
     /*! \brief A user specified opaque pointer passed to the get_bit callback routine. */
index fbec14c5edfb79844c891504f82b6b08e2d80e26..fc7912febce47cba206357911edc8f5af671c751 100644 (file)
@@ -130,8 +130,8 @@ struct v27ter_rx_state_s
     int scrambler_pattern_count;
     /*! \brief The current step in the table of BC constellation positions. */
     int training_bc;
-    /*! \brief TRUE if the previous trained values are to be reused. */
-    int old_train;
+    /*! \brief True if the previous trained values are to be reused. */
+    bool old_train;
     /*! \brief The section of the training data we are currently in. */
     int training_stage;
     /*! \brief A count of how far through the current training step we are. */
index ba9ab8b5aaf059582e356083f107b71b72f25cca..add5b36979d280c3204c864fa573544bbb35c7b4 100644 (file)
@@ -73,9 +73,9 @@ struct v27ter_tx_state_s
     /*! \brief A counter for the number of consecutive bits of repeating pattern through
                the scrambler. */
     int scrambler_pattern_count;
-    /*! \brief TRUE if transmitting the training sequence, or shutting down transmission.
-               FALSE if transmitting user data. */
-    int in_training;
+    /*! \brief True if transmitting the training sequence, or shutting down transmission.
+               False if transmitting user data. */
+    bool in_training;
     /*! \brief A counter used to track progress through sending the training sequence. */
     int training_step;
 
index fd931af0f80c4f874fcf5714a571fd13a5ad292f..8b38b467bf3bb6dd546a4800460b909900f8e440 100644 (file)
@@ -139,8 +139,8 @@ struct v29_rx_state_s
     uint8_t training_scramble_reg;
     /*! \brief The current step in the table of CD constellation positions. */
     int training_cd;
-    /*! \brief TRUE if the previous trained values are to be reused. */
-    int old_train;
+    /*! \brief True if the previous trained values are to be reused. */
+    bool old_train;
     /*! \brief The section of the training data we are currently in. */
     int training_stage;
     /*! \brief A count of how far through the current training step we are. */
index 67c2b7098d6198464a551d48248e4353f0988842..58f86a2af772b81a25b394be238c8a3e0e2cf7ab 100644 (file)
@@ -76,9 +76,9 @@ struct v29_tx_state_s
     uint32_t scramble_reg;
     /*! \brief The register for the training scrambler. */
     uint8_t training_scramble_reg;
-    /*! \brief TRUE if transmitting the training sequence, or shutting down transmission.
-               FALSE if transmitting user data. */
-    int in_training;
+    /*! \brief True if transmitting the training sequence, or shutting down transmission.
+               False if transmitting user data. */
+    bool in_training;
     /*! \brief A counter used to track progress through sending the training sequence. */
     int training_step;
     /*! \brief An offset value into the table of training parameters, used to match the
index b45b7163498c78e1f032234eb533c1ca70a0b624..5eac89f873db2883ba3ae09b42a12e34c1b8aa3b 100644 (file)
@@ -92,9 +92,9 @@ typedef struct
     uint8_t vr;
     int state;
     int configuring;
-    int local_busy;
-    int far_busy;
-    int rejected;
+    bool local_busy;
+    bool far_busy;
+    bool rejected;
     int retry_count;
 
     /* The control frame buffer, and its pointers */
@@ -131,11 +131,11 @@ typedef struct
 */
 struct v42_state_s
 {
-    /*! TRUE if we are the calling party, otherwise FALSE. */
-    int calling_party;
-    /*! TRUE if we should detect whether the far end is V.42 capable. FALSE if we go
+    /*! True if we are the calling party, otherwise false. */
+    bool calling_party;
+    /*! True if we should detect whether the far end is V.42 capable. false if we go
         directly to protocol establishment. */
-    int detect;
+    bool detect;
 
     /*! The bit rate, used to time events */
     int tx_bit_rate;
index 967b1fd9099c4027aa670436381b2814694aeae6..216199d79bad2b90bf7b9b142bba06d329d33dc0 100644 (file)
@@ -60,8 +60,8 @@ typedef struct
     /*! \brief The maximum amount to be passed to the data handler. */
     int max_output_len;
 
-    /*! \brief TRUE if we are in transparent (i.e. uncompressable) mode */
-    int transparent;
+    /*! \brief True if we are in transparent (i.e. uncompressable) mode */
+    bool transparent;
     /*! \brief Next empty dictionary entry */
     uint16_t v42bis_parm_c1;
     /*! \brief Current codeword size */
@@ -104,8 +104,8 @@ typedef struct
 
     /*! \brief The current value of the escape code */
     uint8_t escape_code;
-    /*! \brief TRUE if we just hit an escape code, and are waiting for the following octet */
-    int escaped;
+    /*! \brief True if we just hit an escape code, and are waiting for the following octet */
+    bool escaped;
 } v42bis_comp_state_t;
 
 /*!
index 213d445f52e4265a46c55dedd04a2300f5072e8b..3c07b0e3bca2cd2436c0d240f9b2f667876719f5 100644 (file)
@@ -28,8 +28,8 @@
 
 struct v8_state_s
 {
-    /*! \brief TRUE if we are the calling party */
-    int calling_party;
+    /*! \brief True if we are the calling party */
+    bool calling_party;
 
     /*! \brief A handler to process the V.8 signals */
     v8_result_handler_t result_handler;
@@ -38,7 +38,7 @@ struct v8_state_s
 
     /*! \brief The current state of the V.8 protocol */
     int state;
-    int fsk_tx_on;
+    bool fsk_tx_on;
     int modem_connect_tone_tx_on;
     int negotiation_timer;
     int ci_timer;
@@ -67,8 +67,8 @@ struct v8_state_s
                testing for matches. */
     uint8_t cm_jm_data[64];
     int cm_jm_len;
-    int got_cm_jm;
-    int got_cj;
+    bool got_cm_jm;
+    bool got_cj;
     int zero_byte_count;
     /*! \brief Error and flow logging control */
     logging_state_t logging;
index cbb4357916d941ffa21cd68f1799edc8057e7cba..7e56a59fc728b659bce7962652c9068f8eeda7e4 100644 (file)
@@ -63,8 +63,8 @@ extern "C"
 /*! Check if a queue is empty.
     \brief Check if a queue is empty.
     \param s The queue context.
-    \return TRUE if empty, else FALSE. */
-SPAN_DECLARE(int) queue_empty(queue_state_t *s);
+    \return True if empty, else false. */
+SPAN_DECLARE(bool) queue_empty(queue_state_t *s);
 
 /*! Check the available free space in a queue's buffer.
     \brief Check available free space.
diff --git a/libs/spandsp/src/spandsp/stdbool.h b/libs/spandsp/src/spandsp/stdbool.h
new file mode 100644 (file)
index 0000000..8c722fa
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * SpanDSP - a series of DSP components for telephony
+ *
+ * stdbool.h - A version for systems which lack their own stdbool.h
+ *
+ * Written by Steve Underwood <steveu@coppice.org>
+ *
+ * Copyright (C) 2003 Steve Underwood
+ *
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 2.1,
+ * as published by the Free Software Foundation.
+ *
+ * This program 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/*! \file */
+
+
+/*
+ * ISO C Standard:  7.16  Boolean type and values  <stdbool.h>
+ */
+
+#if !defined(_STDBOOL_H)
+#define _STDBOOL_H
+
+#if !defined(__cplusplus)
+
+#define _Bool   int
+#define bool    int
+#define false   0
+#define true    (!false)
+
+#else
+
+#define _Bool   bool
+#define bool    bool
+#define false   false
+#define true    true
+
+#endif
+
+/* Signal that all the definitions are present.  */
+#define __bool_true_false_are_defined   1
+
+#endif
index 2ba1330538aae966aca817e9a832ab3b9e773446..e4d734a8e408eee3ffa87855157f5f7d7343febd 100644 (file)
@@ -32,7 +32,7 @@
 
 \section t30_page_sec_1 What does it do?
 The T.30 protocol is the core protocol used for FAX transmission. This module
-implements most of its key featrues. It does not interface to the outside work.
+implements most of its key features. It does not interface to the outside work.
 Seperate modules do that for T.38, analogue line, and other forms of FAX
 communication.
 
@@ -184,13 +184,13 @@ typedef void (*t30_phase_e_handler_t)(t30_state_t *s, void *user_data, int compl
     \brief T.30 real time frame handler.
     \param s The T.30 context.
     \param user_data An opaque pointer.
-    \param direction TRUE for incoming, FALSE for outgoing.
+    \param incoming True for incoming, false for outgoing.
     \param msg The HDLC message.
     \param len The length of the message.
 */
 typedef void (*t30_real_time_frame_handler_t)(t30_state_t *s,
                                               void *user_data,
-                                              int direction,
+                                              bool direction,
                                               const uint8_t msg[],
                                               int len);
 
@@ -209,8 +209,8 @@ typedef int (*t30_document_handler_t)(t30_state_t *s, void *user_data, int statu
     \param user_data An opaque pointer.
     \param type The modem, tone or silence to be sent or received.
     \param bit_rate The bit rate of the modem to be sent or received.
-    \param short_train TRUE if the short training sequence should be used (where one exists).
-    \param use_hdlc FALSE for bit stream, TRUE for HDLC framing.
+    \param short_train True if the short training sequence should be used (where one exists).
+    \param use_hdlc False for bit stream, true for HDLC framing.
 */
 typedef void (*t30_set_handler_t)(void *user_data, int type, int bit_rate, int short_train, int use_hdlc);
 
@@ -448,7 +448,7 @@ typedef struct
 {
     /*! \brief The current bit rate for image transfer. */
     int bit_rate;
-    /*! \brief TRUE if error correcting mode is used. */
+    /*! \brief True if error correcting mode is used. */
     int error_correcting_mode;
     /*! \brief The number of pages sent so far. */
     int pages_tx;
@@ -502,7 +502,7 @@ extern "C"
 /*! Initialise a T.30 context.
     \brief Initialise a T.30 context.
     \param s The T.30 context.
-    \param calling_party TRUE if the context is for a calling party. FALSE if the
+    \param calling_party True if the context is for a calling party. False if the
            context is for an answering party.
     \param set_rx_type_handler
     \param set_rx_type_user_data
@@ -542,7 +542,7 @@ SPAN_DECLARE(int) t30_restart(t30_state_t *s);
     if the job has finished.
     \brief Check if a T.30 call is still active.
     \param s The T.30 context.
-    \return TRUE for call still active, or FALSE for call completed. */
+    \return True for call still active, or false for call completed. */
 SPAN_DECLARE(int) t30_call_active(t30_state_t *s);
 
 /*! Cleanup a T.30 context if the call terminates.
@@ -588,7 +588,7 @@ SPAN_DECLARE(void) t30_non_ecm_put(void *user_data, const uint8_t buf[], int len
     \param user_data The T.30 context.
     \param msg The HDLC message.
     \param len The length of the message, in octets.
-    \param ok TRUE if the frame was received without error. */
+    \param ok True if the frame was received without error. */
 SPAN_DECLARE_NONSTD(void) t30_hdlc_accept(void *user_data, const uint8_t msg[], int len, int ok);
 
 /*! Report the passage of time to the T.30 engine.
@@ -606,13 +606,13 @@ SPAN_DECLARE(void) t30_get_transfer_statistics(t30_state_t *s, t30_stats_t *t);
 /*! Request a local interrupt of FAX exchange.
     \brief Request a local interrupt of FAX exchange.
     \param s The T.30 context.
-    \param state TRUE to enable interrupt request, else FALSE. */
+    \param state True to enable interrupt request, else false. */
 SPAN_DECLARE(void) t30_local_interrupt_request(t30_state_t *s, int state);
 
 /*! Allow remote interrupts of FAX exchange.
     \brief Allow remote interrupts of FAX exchange.
     \param s The T.30 context.
-    \param state TRUE to allow interruptd, else FALSE. */
+    \param state True to allow interruptd, else false. */
 SPAN_DECLARE(void) t30_remote_interrupts_allowed(t30_state_t *s, int state);
 
 #if defined(__cplusplus)
index da3ef01a308403cb4dcce7687bc534af1fde6a9c..1c9a6e51de57a170c8367153cfb08441512f30c5 100644 (file)
@@ -363,8 +363,8 @@ SPAN_DECLARE(size_t) t30_get_rx_csa(t30_state_t *s, int *type, const char *addre
 /*! Set page header extends or overlays the image mode.
     \brief Set page header overlay mode.
     \param s The T.30 context.
-    \param header_overlays_image TRUE for overlay, or FALSE for extend the page. */
-SPAN_DECLARE(int) t30_set_tx_page_header_overlays_image(t30_state_t *s, int header_overlays_image);
+    \param header_overlays_image True for overlay, or false for extend the page. */
+SPAN_DECLARE(int) t30_set_tx_page_header_overlays_image(t30_state_t *s, bool header_overlays_image);
 
 /*! Set the transmitted header information associated with a T.30 context.
     \brief Set the transmitted header information associated with a T.30 context.
@@ -426,15 +426,15 @@ SPAN_DECLARE(void) t30_set_tx_file(t30_state_t *s, const char *file, int start_p
 /*! Set Internet aware FAX (IAF) mode.
     \brief Set Internet aware FAX (IAF) mode.
     \param s The T.30 context.
-    \param iaf TRUE for IAF, or FALSE for non-IAF. */
-SPAN_DECLARE(void) t30_set_iaf_mode(t30_state_t *s, int iaf);
+    \param iaf True for IAF, or false for non-IAF. */
+SPAN_DECLARE(void) t30_set_iaf_mode(t30_state_t *s, bool iaf);
 
 /*! Specify if error correction mode (ECM) is allowed by a T.30 context.
     \brief Select ECM capability.
     \param s The T.30 context.
-    \param enabled TRUE for ECM capable, FALSE for not ECM capable.
+    \param enabled True for ECM capable, or false for not ECM capable.
     \return 0 if OK, else -1. */
-SPAN_DECLARE(int) t30_set_ecm_capability(t30_state_t *s, int enabled);
+SPAN_DECLARE(int) t30_set_ecm_capability(t30_state_t *s, bool enabled);
 
 /*! Specify the output encoding for TIFF files created during FAX reception.
     \brief Specify the output encoding for TIFF files created during FAX reception.
index 4e8452e497b003f5ddb32f275c6e4b15997a1640..b61a4142f9a9409f87a5d4844fdffadc820991ab 100644 (file)
@@ -89,33 +89,33 @@ SPAN_DECLARE(int) t31_t38_send_timeout(t31_state_t *s, int samples);
 /*! Select whether silent audio will be sent when transmit is idle.
     \brief Select whether silent audio will be sent when transmit is idle.
     \param s The T.31 modem context.
-    \param transmit_on_idle TRUE if silent audio should be output when the transmitter is
-           idle. FALSE to transmit zero length audio when the transmitter is idle. The default
-           behaviour is FALSE.
+    \param transmit_on_idle True if silent audio should be output when the transmitter is
+           idle. False to transmit zero length audio when the transmitter is idle. The default
+           behaviour is false.
 */
-SPAN_DECLARE(void) t31_set_transmit_on_idle(t31_state_t *s, int transmit_on_idle);
+SPAN_DECLARE(void) t31_set_transmit_on_idle(t31_state_t *s, bool transmit_on_idle);
 
 /*! Select whether TEP mode will be used (or time allowed for it (when transmitting).
     \brief Select whether TEP mode will be used.
     \param s The T.31 modem context.
-    \param use_tep TRUE if TEP is to be ised.
+    \param use_tep True if TEP is to be used.
 */
-SPAN_DECLARE(void) t31_set_tep_mode(t31_state_t *s, int use_tep);
+SPAN_DECLARE(void) t31_set_tep_mode(t31_state_t *s, bool use_tep);
 
 /*! Select whether T.38 data will be paced as it is transmitted.
     \brief Select whether T.38 data will be paced.
     \param s The T.31 modem context.
-    \param without_pacing TRUE if data is to be sent as fast as possible. FALSE if it is
+    \param without_pacing True if data is to be sent as fast as possible. False if it is
            to be paced.
 */
-SPAN_DECLARE(void) t31_set_t38_config(t31_state_t *s, int without_pacing);
+SPAN_DECLARE(void) t31_set_t38_config(t31_state_t *s, bool without_pacing);
 
 /*! Set audio or T.38 mode.
     \brief Set audio or T.38 mode.
     \param s The T.31 modem context.
-    \param t38_mode TRUE for T.38 mode operation. FALSE for audio mode operation.
+    \param t38_mode True for T.38 mode operation. False for audio mode operation.
 */
-SPAN_DECLARE(void) t31_set_mode(t31_state_t *s, int t38_mode);
+SPAN_DECLARE(void) t31_set_mode(t31_state_t *s, bool t38_mode);
 
 /*! Get a pointer to the logging context associated with a T.31 context.
     \brief Get a pointer to the logging context associated with a T.31 context.
index efd644b39085160b278c7679bd814cb6ecdd0e92..fdef41fdf206abbfe976be9227497832f89539be 100644 (file)
@@ -83,9 +83,9 @@ SPAN_DECLARE(const char *) t35_vendor_to_str(const uint8_t *msg, int len);
     \param model A pointer which will be pointed to the identified model.
            If a NULL pointer is given, the model will not be returned.
            If the model is not identified, NULL will be returned.
-    \return TRUE if the machine was identified, otherwise FALSE.
+    \return True if the machine was identified.
 */
-SPAN_DECLARE(int) t35_decode(const uint8_t *msg, int len, const char **country, const char **vendor, const char **model);
+SPAN_DECLARE(bool) t35_decode(const uint8_t *msg, int len, const char **country, const char **vendor, const char **model);
 
 #if defined(__cplusplus)
 }
index 662cf8d37e9b57f49873e64666f66587a6ca9e3a..86e45089ac637ea24c4e857d3f58c4f946f16a2d 100644 (file)
@@ -312,21 +312,21 @@ SPAN_DECLARE(void) t38_set_data_transport_protocol(t38_core_state_t *s, int data
 
 /*! Set the non-ECM fill bit removal mode.
     \param s The T.38 context.
-    \param fill_bit_removal TRUE to remove fill bits across the T.38 link, else FALSE.
+    \param fill_bit_removal True to remove fill bits across the T.38 link.
 */
-SPAN_DECLARE(void) t38_set_fill_bit_removal(t38_core_state_t *s, int fill_bit_removal);
+SPAN_DECLARE(void) t38_set_fill_bit_removal(t38_core_state_t *s, bool fill_bit_removal);
 
 /*! Set the MMR transcoding mode.
     \param s The T.38 context.
-    \param mmr_transcoding TRUE to transcode to MMR across the T.38 link, else FALSE.
+    \param mmr_transcoding True to transcode to MMR across the T.38 link.
 */
-SPAN_DECLARE(void) t38_set_mmr_transcoding(t38_core_state_t *s, int mmr_transcoding);
+SPAN_DECLARE(void) t38_set_mmr_transcoding(t38_core_state_t *s, bool mmr_transcoding);
 
 /*! Set the JBIG transcoding mode.
     \param s The T.38 context.
-    \param jbig_transcoding TRUE to transcode to JBIG across the T.38 link, else FALSE.
+    \param jbig_transcoding True to transcode to JBIG across the T.38 link.
 */
-SPAN_DECLARE(void) t38_set_jbig_transcoding(t38_core_state_t *s, int jbig_transcoding);
+SPAN_DECLARE(void) t38_set_jbig_transcoding(t38_core_state_t *s, bool jbig_transcoding);
 
 /*! Set the maximum buffer size for received data at the far end.
     \param s The T.38 context.
@@ -363,16 +363,16 @@ SPAN_DECLARE(void) t38_set_t38_version(t38_core_state_t *s, int t38_version);
 
 /*! Set the sequence number handling option.
     \param s The T.38 context.
-    \param check TRUE to check sequence numbers, and handle gaps reasonably. FALSE
+    \param check True to check sequence numbers, and handle gaps reasonably. False
            for no sequence number processing (e.g. for TPKT over TCP transport).
 */
-SPAN_DECLARE(void) t38_set_sequence_number_handling(t38_core_state_t *s, int check);
+SPAN_DECLARE(void) t38_set_sequence_number_handling(t38_core_state_t *s, bool check);
 
 /*! Set the TEP handling option.
     \param s The T.38 context.
-    \param allow_for_tep TRUE to allow for TEP playout, else FALSE.
+    \param allow_for_tep True to allow for TEP playout.
 */
-SPAN_DECLARE(void) t38_set_tep_handling(t38_core_state_t *s, int allow_for_tep);
+SPAN_DECLARE(void) t38_set_tep_handling(t38_core_state_t *s, bool allow_for_tep);
 
 /*! Get a pointer to the logging context associated with a T.38 context.
     \brief Get a pointer to the logging context associated with a T.38 context.
index 4971e8d4bfc6ed245e5dc88126cc00f6f26086f9..89bd9b116df5f9f16ab8ea341a48cd1d42489c5e 100644 (file)
@@ -45,13 +45,13 @@ typedef struct t38_gateway_state_s t38_gateway_state_t;
     \brief T.30 real time frame handler.
     \param s The T.30 context.
     \param user_data An opaque pointer.
-    \param direction TRUE for incoming, FALSE for outgoing.
+    \param incoming True for incoming, false for outgoing.
     \param msg The HDLC message.
     \param len The length of the message.
 */
 typedef void (*t38_gateway_real_time_frame_handler_t)(t38_gateway_state_t *s,
                                                       void *user_data,
-                                                      int direction,
+                                                      bool incoming,
                                                       const uint8_t *msg,
                                                       int len);
 
@@ -62,8 +62,8 @@ typedef struct
 {
     /*! \brief The current bit rate for image transfer. */
     int bit_rate;
-    /*! \brief TRUE if error correcting mode is used. */
-    int error_correcting_mode;
+    /*! \brief True if error correcting mode is used. */
+    bool error_correcting_mode;
     /*! \brief The number of pages transferred so far. */
     int pages_transferred;
 } t38_stats_t;
@@ -124,18 +124,18 @@ SPAN_DECLARE_NONSTD(int) t38_gateway_tx(t38_gateway_state_t *s, int16_t amp[], i
 /*! Control whether error correcting mode (ECM) is allowed.
     \brief Control whether error correcting mode (ECM) is allowed.
     \param s The T.38 context.
-    \param ecm_allowed TRUE is ECM is to be allowed.
+    \param ecm_allowed True is ECM is to be allowed.
 */
-SPAN_DECLARE(void) t38_gateway_set_ecm_capability(t38_gateway_state_t *s, int ecm_allowed);
+SPAN_DECLARE(void) t38_gateway_set_ecm_capability(t38_gateway_state_t *s, bool ecm_allowed);
 
 /*! Select whether silent audio will be sent when transmit is idle.
     \brief Select whether silent audio will be sent when transmit is idle.
     \param s The T.38 context.
-    \param transmit_on_idle TRUE if silent audio should be output when the FAX transmitter is
-           idle. FALSE to transmit zero length audio when the FAX transmitter is idle. The default
-           behaviour is FALSE.
+    \param transmit_on_idle True if silent audio should be output when the FAX transmitter is
+           idle. False to transmit zero length audio when the FAX transmitter is idle. The default
+           behaviour is false.
 */
-SPAN_DECLARE(void) t38_gateway_set_transmit_on_idle(t38_gateway_state_t *s, int transmit_on_idle);
+SPAN_DECLARE(void) t38_gateway_set_transmit_on_idle(t38_gateway_state_t *s, bool transmit_on_idle);
 
 /*! Specify which modem types are supported by a T.30 context.
     \brief Specify supported modems.
@@ -165,16 +165,16 @@ SPAN_DECLARE(void) t38_gateway_set_nsx_suppression(t38_gateway_state_t *s,
 /*! Select whether talker echo protection tone will be sent for the image modems.
     \brief Select whether TEP will be sent for the image modems.
     \param s The T.38 context.
-    \param use_tep TRUE if TEP should be sent.
+    \param use_tep True if TEP should be sent.
 */
-SPAN_DECLARE(void) t38_gateway_set_tep_mode(t38_gateway_state_t *s, int use_tep);
+SPAN_DECLARE(void) t38_gateway_set_tep_mode(t38_gateway_state_t *s, bool use_tep);
 
 /*! Select whether non-ECM fill bits are to be removed during transmission.
     \brief Select whether non-ECM fill bits are to be removed during transmission.
     \param s The T.38 context.
-    \param remove TRUE if fill bits are to be removed.
+    \param remove True if fill bits are to be removed.
 */
-SPAN_DECLARE(void) t38_gateway_set_fill_bit_removal(t38_gateway_state_t *s, int remove);
+SPAN_DECLARE(void) t38_gateway_set_fill_bit_removal(t38_gateway_state_t *s, bool remove);
 
 /*! Get the current transfer statistics for the current T.38 session.
     \brief Get the current transfer statistics.
index 0b1bee6af60aec25c0577cf27f01c15f03ba8794..3ca28c3d12a977d621b6b5a35fd2c55d202b91c7 100644 (file)
@@ -83,10 +83,10 @@ extern "C"
 
 /*! \brief Initialise a T.38 rate adapting non-ECM buffer context.
     \param s The buffer context.
-    \param mode TRUE for image data mode, or FALSE for TCF mode.
+    \param image_mode True for image data mode, or false for TCF mode.
     \param bits The minimum number of bits per FAX image row.
     \return A pointer to the buffer context, or NULL if there was a problem. */
-SPAN_DECLARE(t38_non_ecm_buffer_state_t *) t38_non_ecm_buffer_init(t38_non_ecm_buffer_state_t *s, int mode, int min_row_bits);
+SPAN_DECLARE(t38_non_ecm_buffer_state_t *) t38_non_ecm_buffer_init(t38_non_ecm_buffer_state_t *s, bool image_mode, int min_row_bits);
 
 SPAN_DECLARE(int) t38_non_ecm_buffer_release(t38_non_ecm_buffer_state_t *s);
 
@@ -94,9 +94,9 @@ SPAN_DECLARE(int) t38_non_ecm_buffer_free(t38_non_ecm_buffer_state_t *s);
 
 /*! \brief Set the mode of a T.38 rate adapting non-ECM buffer context.
     \param s The buffer context.
-    \param mode TRUE for image data mode, or FALSE for TCF mode.
+    \param mode True for image data mode, or false for TCF mode.
     \param bits The minimum number of bits per FAX image row. */
-SPAN_DECLARE(void) t38_non_ecm_buffer_set_mode(t38_non_ecm_buffer_state_t *s, int mode, int min_row_bits);
+SPAN_DECLARE(void) t38_non_ecm_buffer_set_mode(t38_non_ecm_buffer_state_t *s, bool image_mode, int min_row_bits);
 
 /*! \brief Inject data to T.38 rate adapting non-ECM buffer context.
     \param s The buffer context.
index dbf0dca9cb872da4f4e2b01458b5f1c44503583c..630fbb80bcb5ee5193dbb9568385ed0a7dc7fe51 100644 (file)
@@ -72,16 +72,16 @@ SPAN_DECLARE(void) t38_terminal_set_config(t38_terminal_state_t *s, int config);
 /*! Select whether the time for talker echo protection tone will be allowed for when sending.
     \brief Select whether TEP time will be allowed for.
     \param s The T.38 context.
-    \param use_tep TRUE if TEP should be allowed for.
+    \param use_tep True if TEP should be allowed for.
 */
-SPAN_DECLARE(void) t38_terminal_set_tep_mode(t38_terminal_state_t *s, int use_tep);
+SPAN_DECLARE(void) t38_terminal_set_tep_mode(t38_terminal_state_t *s, bool use_tep);
 
 /*! Select whether non-ECM fill bits are to be removed during transmission.
     \brief Select whether non-ECM fill bits are to be removed during transmission.
     \param s The T.38 context.
-    \param remove TRUE if fill bits are to be removed.
+    \param remove True if fill bits are to be removed.
 */
-SPAN_DECLARE(void) t38_terminal_set_fill_bit_removal(t38_terminal_state_t *s, int remove);
+SPAN_DECLARE(void) t38_terminal_set_fill_bit_removal(t38_terminal_state_t *s, bool remove);
 
 /*! Get a pointer to the T.30 engine associated with a termination mode T.38 context.
     \brief Get a pointer to the T.30 engine associated with a T.38 context.
@@ -108,21 +108,21 @@ SPAN_DECLARE(logging_state_t *) t38_terminal_get_logging_state(t38_terminal_stat
 
 /*! \brief Reinitialise a termination mode T.38 context.
     \param s The T.38 context.
-    \param calling_party TRUE if the context is for a calling party. FALSE if the
+    \param calling_party True if the context is for a calling party. False if the
            context is for an answering party.
     \return 0 for OK, else -1. */
 SPAN_DECLARE(int) t38_terminal_restart(t38_terminal_state_t *s,
-                                       int calling_party);
+                                       bool calling_party);
 
 /*! \brief Initialise a termination mode T.38 context.
     \param s The T.38 context.
-    \param calling_party TRUE if the context is for a calling party. FALSE if the
+    \param calling_party True if the context is for a calling party. False if the
            context is for an answering party.
     \param tx_packet_handler A callback routine to encapsulate and transmit T.38 packets.
     \param tx_packet_user_data An opaque pointer passed to the tx_packet_handler routine.
     \return A pointer to the termination mode T.38 context, or NULL if there was a problem. */
 SPAN_DECLARE(t38_terminal_state_t *) t38_terminal_init(t38_terminal_state_t *s,
-                                                       int calling_party,
+                                                       bool calling_party,
                                                        t38_tx_packet_handler_t tx_packet_handler,
                                                        void *tx_packet_user_data);
 
index bef9b3196a2a5e30b34a48c92f08eea8e656f94d..0401d108235008313de9691fba4c0e28164d49b8 100644 (file)
@@ -402,14 +402,14 @@ SPAN_DECLARE(int) t4_rx_start_page(t4_rx_state_t *s);
 /*! \brief Put a bit of the current document page.
     \param s The T.4 context.
     \param bit The data bit.
-    \return TRUE when the bit ends the document page, otherwise FALSE. */
+    \return Decode status. */
 SPAN_DECLARE(int) t4_rx_put_bit(t4_rx_state_t *s, int bit);
 
 /*! \brief Put a byte of the current document page.
     \param s The T.4 context.
     \param buf The buffer containing the chunk.
     \param len The length of the chunk.
-    \return TRUE when the byte ends the document page, otherwise FALSE. */
+    \return Decode status. */
 SPAN_DECLARE(int) t4_rx_put(t4_rx_state_t *s, const uint8_t buf[], size_t len);
 
 /*! \brief Complete the reception of a page.
index 16e2348fbc0b55d44f328cbbba8f785a60ac3369..aa50e5ee60dc088cbd68ee24e4a8d4c5de12d63f 100644 (file)
@@ -48,7 +48,7 @@ extern "C" {
 /*! \brief Put a bit of the current document page.
     \param s The T.4/T.6 context.
     \param bit The data bit.
-    \return TRUE when the bit ends the document page, otherwise FALSE. */
+    \return Decode status. */
 SPAN_DECLARE(int) t4_t6_decode_put_bit(t4_t6_decode_state_t *s, int bit);
 
 /*! \brief Put a byte of the current document page.
index 41974c9fcfb00a12cb4411558acaf121bdb5bd46..019e2e6cd591e5c369a6198a1bfa1d7194ebdd6e 100644 (file)
@@ -360,8 +360,8 @@ SPAN_DECLARE(void) t4_tx_set_header_tz(t4_tx_state_t *s, tz_t *tz);
 /*! Set page header extends or overlays the image mode.
     \brief Set page header overlay mode.
     \param s The T.4 context.
-    \param header_overlays_image TRUE for overlay, or FALSE for extend the page. */
-SPAN_DECLARE(void) t4_tx_set_header_overlays_image(t4_tx_state_t *s, int header_overlays_image);
+    \param header_overlays_image True for overlay, or false to extend the page. */
+SPAN_DECLARE(void) t4_tx_set_header_overlays_image(t4_tx_state_t *s, bool header_overlays_image);
 
 /*! \brief Set the row read handler for a T.4 transmit context.
     \param s The T.4 transmit context.
index 132cce9bf87c21036ec514a522274488b1cea79d..b32ecfa0f576ec9d8202787818b636c471fd0df1 100644 (file)
@@ -70,13 +70,6 @@ typedef int (*span_tx_handler_t)(void *s, int16_t amp[], int max_len);
 #define ms_to_samples(t)            ((t)*(SAMPLE_RATE/1000))
 #define us_to_samples(t)            ((t)/(1000000/SAMPLE_RATE))
 
-#if !defined(FALSE)
-#define FALSE 0
-#endif
-#if !defined(TRUE)
-#define TRUE (!FALSE)
-#endif
-
 /* Fixed point constant macros */
 #define FP_Q_9_7(x) ((int16_t) (128.0*x + ((x >= 0.0)  ?  0.5  :  -0.5)))
 #define FP_Q_8_8(x) ((int16_t) (256.0*x + ((x >= 0.0)  ?  0.5  :  -0.5)))
index 21c34f5b29a77eeacdc8890910a5f51fb7e76b81..74c4b1dd8ef19fbac89e13a7be99daa1b9d9ac7f 100644 (file)
@@ -239,9 +239,9 @@ SPAN_DECLARE(v17_rx_state_t *) v17_rx_init(v17_rx_state_t *s, int bit_rate, put_
     \brief Reinitialise an existing V.17 modem receive context.
     \param s The modem context.
     \param bit_rate The bit rate of the modem. Valid values are 7200, 9600, 12000 and 14400.
-    \param short_train TRUE if a short training sequence is expected.
+    \param short_train True if a short training sequence is expected.
     \return 0 for OK, -1 for bad parameter */
-SPAN_DECLARE(int) v17_rx_restart(v17_rx_state_t *s, int bit_rate, int short_train);
+SPAN_DECLARE(int) v17_rx_restart(v17_rx_state_t *s, int bit_rate, bool short_train);
 
 /*! Release a V.17 modem receive context.
     \brief Release a V.17 modem receive context.
index 0d98cc7010d7d3180107963843e4c53c8c1d3503..02fb7309ade7f38dff2a0b5223eeb12fbf88faa1 100644 (file)
@@ -101,20 +101,20 @@ SPAN_DECLARE(void) v17_tx_power(v17_tx_state_t *s, float power);
     \brief Initialise a V.17 modem transmit context.
     \param s The modem context.
     \param bit_rate The bit rate of the modem. Valid values are 7200, 9600, 12000 and 14400.
-    \param tep TRUE is the optional TEP tone is to be transmitted.
+    \param tep True is the optional TEP tone is to be transmitted.
     \param get_bit The callback routine used to get the data to be transmitted.
     \param user_data An opaque pointer.
     \return A pointer to the modem context, or NULL if there was a problem. */
-SPAN_DECLARE(v17_tx_state_t *) v17_tx_init(v17_tx_state_t *s, int bit_rate, int tep, get_bit_func_t get_bit, void *user_data);
+SPAN_DECLARE(v17_tx_state_t *) v17_tx_init(v17_tx_state_t *s, int bit_rate, bool tep, get_bit_func_t get_bit, void *user_data);
 
 /*! Reinitialise an existing V.17 modem transmit context, so it may be reused.
     \brief Reinitialise an existing V.17 modem transmit context.
     \param s The modem context.
     \param bit_rate The bit rate of the modem. Valid values are 7200, 9600, 12000 and 14400.
-    \param tep TRUE is the optional TEP tone is to be transmitted.
-    \param short_train TRUE if the short training sequence should be used.
+    \param tep True is the optional TEP tone is to be transmitted.
+    \param short_train True if the short training sequence should be used.
     \return 0 for OK, -1 for parameter error. */
-SPAN_DECLARE(int) v17_tx_restart(v17_tx_state_t *s, int bit_rate, int tep, int short_train);
+SPAN_DECLARE(int) v17_tx_restart(v17_tx_state_t *s, int bit_rate, bool tep, bool short_train);
 
 /*! Release a V.17 modem transmit context.
     \brief Release a V.17 modem transmit context.
index 32814d9c658f285d4707ee1790261a6afe8e29ab..04c0db7c154b4a56cd4222021af1698decdd3181 100644 (file)
@@ -110,7 +110,7 @@ SPAN_DECLARE(logging_state_t *) v18_get_logging_state(v18_state_t *s);
 /*! Initialise a V.18 context.
     \brief Initialise a V.18 context.
     \param s The V.18 context.
-    \param calling_party TRUE if caller mode, else answerer mode.
+    \param calling_party True if caller mode, else answerer mode.
     \param mode Mode of operation.
     \param nation National variant for automoding.
     \param put_msg A callback routine called to deliver the received text
@@ -118,7 +118,7 @@ SPAN_DECLARE(logging_state_t *) v18_get_logging_state(v18_state_t *s);
     \param user_data An opaque pointer for the callback routine.
     \return A pointer to the V.18 context, or NULL if there was a problem. */
 SPAN_DECLARE(v18_state_t *) v18_init(v18_state_t *s,
-                                     int calling_party,
+                                     bool calling_party,
                                      int mode,
                                      int nation,
                                      put_msg_func_t put_msg,
index 6361c058419d1eb81453b35eb63ef1b5e1c292a1..f20656919fa17552d1df4e053f2f4396ca283f9e 100644 (file)
@@ -155,9 +155,9 @@ SPAN_DECLARE(int) v22bis_request_retrain(v22bis_state_t *s, int bit_rate);
 /*! Request a loopback 2 for a V.22bis modem context.
     \brief Request a loopback 2 for a V.22bis modem context.
     \param s The modem context.
-    \param enable TRUE to enable loopback, or FALSE to disable it.
+    \param enable True to enable loopback, or false to disable it.
     \return 0 for OK, -1 for request reject. */
-SPAN_DECLARE(int) v22bis_remote_loopback(v22bis_state_t *s, int enable);
+SPAN_DECLARE(int) v22bis_remote_loopback(v22bis_state_t *s, bool enable);
 
 /*! Report the current operating bit rate of a V.22bis modem context.
     \brief Report the current operating bit rate of a V.22bis modem context
@@ -170,7 +170,7 @@ SPAN_DECLARE(int) v22bis_get_current_bit_rate(v22bis_state_t *s);
     \param s The modem context.
     \param bit_rate The bit rate of the modem. Valid values are 1200 and 2400.
     \param guard The guard tone option. 0 = none, 1 = 550Hz, 2 = 1800Hz.
-    \param calling_party TRUE if this is the calling modem.
+    \param calling_party True if this is the calling modem.
     \param get_bit The callback routine used to get the data to be transmitted.
     \param put_bit The callback routine used to get the data to be transmitted.
     \param user_data An opaque pointer, passed in calls to the get and put routines.
@@ -178,7 +178,7 @@ SPAN_DECLARE(int) v22bis_get_current_bit_rate(v22bis_state_t *s);
 SPAN_DECLARE(v22bis_state_t *) v22bis_init(v22bis_state_t *s,
                                            int bit_rate,
                                            int guard,
-                                           int calling_party,
+                                           bool calling_party,
                                            get_bit_func_t get_bit,
                                            void *get_bit_user_data,
                                            put_bit_func_t put_bit,
index 5881f4cf02163245acc6b93e1e5b3133d961b862..80fdb3655f551ff31b3970cba863a0f46b76e282 100644 (file)
@@ -74,9 +74,9 @@ SPAN_DECLARE(v27ter_rx_state_t *) v27ter_rx_init(v27ter_rx_state_t *s, int bit_r
     \brief Reinitialise an existing V.27ter modem receive context.
     \param s The modem context.
     \param bit_rate The bit rate of the modem. Valid values are 2400 and 4800.
-    \param old_train TRUE if a previous trained values are to be reused.
+    \param old_train True if a previous trained values are to be reused.
     \return 0 for OK, -1 for bad parameter */
-SPAN_DECLARE(int) v27ter_rx_restart(v27ter_rx_state_t *s, int bit_rate, int old_train);
+SPAN_DECLARE(int) v27ter_rx_restart(v27ter_rx_state_t *s, int bit_rate, bool old_train);
 
 /*! Release a V.27ter modem receive context.
     \brief Release a V.27ter modem receive context.
index e785c889ec53dcb28c98a3e5cb34597e48331ebb..fba064fea01341374d232df2f81abb459ae416f3 100644 (file)
@@ -83,19 +83,19 @@ SPAN_DECLARE(void) v27ter_tx_power(v27ter_tx_state_t *s, float power);
     \brief Initialise a V.27ter modem transmit context.
     \param s The modem context.
     \param bit_rate The bit rate of the modem. Valid values are 2400 and 4800.
-    \param tep TRUE is the optional TEP tone is to be transmitted.
+    \param tep True is the optional TEP tone is to be transmitted.
     \param get_bit The callback routine used to get the data to be transmitted.
     \param user_data An opaque pointer.
     \return A pointer to the modem context, or NULL if there was a problem. */
-SPAN_DECLARE(v27ter_tx_state_t *) v27ter_tx_init(v27ter_tx_state_t *s, int bit_rate, int tep, get_bit_func_t get_bit, void *user_data);
+SPAN_DECLARE(v27ter_tx_state_t *) v27ter_tx_init(v27ter_tx_state_t *s, int bit_rate, bool tep, get_bit_func_t get_bit, void *user_data);
 
 /*! Reinitialise an existing V.27ter modem transmit context, so it may be reused.
     \brief Reinitialise an existing V.27ter modem transmit context.
     \param s The modem context.
     \param bit_rate The bit rate of the modem. Valid values are 2400 and 4800.
-    \param tep TRUE is the optional TEP tone is to be transmitted.
+    \param tep True is the optional TEP tone is to be transmitted.
     \return 0 for OK, -1 for bad parameter */
-SPAN_DECLARE(int) v27ter_tx_restart(v27ter_tx_state_t *s, int bit_rate, int tep);
+SPAN_DECLARE(int) v27ter_tx_restart(v27ter_tx_state_t *s, int bit_rate, bool tep);
 
 /*! Release a V.27ter modem transmit context.
     \brief Release a V.27ter modem transmit context.
index ec3a945ad46aa2e1f189a754969251825b0f0bac..378d4fe95539420360c83ab1b8df1f046be29f3c 100644 (file)
@@ -154,9 +154,9 @@ SPAN_DECLARE(v29_rx_state_t *) v29_rx_init(v29_rx_state_t *s, int bit_rate, put_
     \brief Reinitialise an existing V.29 modem receive context.
     \param s The modem context.
     \param bit_rate The bit rate of the modem. Valid values are 4800, 7200 and 9600.
-    \param old_train TRUE if a previous trained values are to be reused.
+    \param old_train True if a previous trained values are to be reused.
     \return 0 for OK, -1 for bad parameter */
-SPAN_DECLARE(int) v29_rx_restart(v29_rx_state_t *s, int bit_rate, int old_train);
+SPAN_DECLARE(int) v29_rx_restart(v29_rx_state_t *s, int bit_rate, bool old_train);
 
 /*! Release a V.29 modem receive context.
     \brief Release a V.29 modem receive context.
index 86737d1ba33d3751d3b052505037071dd08587da..18bcf66b6ac3a19b76d447435e8f6dad4c45f6ec 100644 (file)
@@ -114,19 +114,19 @@ SPAN_DECLARE(void) v29_tx_power(v29_tx_state_t *s, float power);
     \brief Initialise a V.29 modem transmit context.
     \param s The modem context.
     \param bit_rate The bit rate of the modem. Valid values are 4800, 7200 and 9600.
-    \param tep TRUE is the optional TEP tone is to be transmitted.
+    \param tep True is the optional TEP tone is to be transmitted.
     \param get_bit The callback routine used to get the data to be transmitted.
     \param user_data An opaque pointer.
     \return A pointer to the modem context, or NULL if there was a problem. */
-SPAN_DECLARE(v29_tx_state_t *) v29_tx_init(v29_tx_state_t *s, int bit_rate, int tep, get_bit_func_t get_bit, void *user_data);
+SPAN_DECLARE(v29_tx_state_t *) v29_tx_init(v29_tx_state_t *s, int bit_rate, bool tep, get_bit_func_t get_bit, void *user_data);
 
 /*! Reinitialise an existing V.29 modem transmit context, so it may be reused.
     \brief Reinitialise an existing V.29 modem transmit context.
     \param s The modem context.
     \param bit_rate The bit rate of the modem. Valid values are 4800, 7200 and 9600.
-    \param tep TRUE is the optional TEP tone is to be transmitted.
+    \param tep True is the optional TEP tone is to be transmitted.
     \return 0 for OK, -1 for bad parameter */
-SPAN_DECLARE(int) v29_tx_restart(v29_tx_state_t *s, int bit_rate, int tep);
+SPAN_DECLARE(int) v29_tx_restart(v29_tx_state_t *s, int bit_rate, bool tep);
 
 /*! Release a V.29 modem transmit context.
     \brief Release a V.29 modem transmit context.
index 6332e5cd6135797d54a54994e0d6b95edd2669ac..8002d43eed3116463c45bc9f16caeddbe5fa8335 100644 (file)
@@ -78,16 +78,16 @@ SPAN_DECLARE(logging_state_t *) v42_get_logging_state(v42_state_t *s);
 
 /*! Initialise a V.42 context.
     \param s The V.42 context.
-    \param calling_party TRUE if caller mode, else answerer mode.
-    \param detect TRUE to perform the V.42 detection, else go straight into LAP.M
+    \param calling_party True if caller mode, else answerer mode.
+    \param detect True to perform the V.42 detection, else go straight into LAP.M
     \param iframe_get A callback function to handle received frames of data.
     \param iframe_put A callback function to get frames of data for transmission.
     \param user_data An opaque pointer passed to the frame handler routines.
     \return ???
 */
 SPAN_DECLARE(v42_state_t *) v42_init(v42_state_t *s,
-                                     int calling_party,
-                                     int detect,
+                                     bool calling_party,
+                                     bool detect,
                                      get_msg_func_t iframe_get,
                                      put_msg_func_t iframe_put,
                                      void *user_data);
index 0c1924c1e85f50551601c7bb862568b91caa5f0e..9ded271aec15b2aadaa316d162d8bc8466c8a3da 100644 (file)
@@ -135,19 +135,19 @@ extern "C"
 #endif
 
 SPAN_DECLARE(int) v8_restart(v8_state_t *s,
-                             int calling_party,
+                             bool calling_party,
                              v8_parms_t *parms);
 
 /*! Initialise a V.8 context.
     \brief Initialise a V.8 context.
     \param s The V.8 context.
-    \param calling_party TRUE if caller mode, else answerer mode.
+    \param calling_party True if caller mode, else answerer mode.
     \param parms The allowed parameters for the call.
     \param result_handler The callback routine used to handle the results of negotiation.
     \param user_data An opaque pointer passed to the result_handler routine.
     \return A pointer to the V.8 context, or NULL if there was a problem. */
 SPAN_DECLARE(v8_state_t *) v8_init(v8_state_t *s,
-                                   int calling_party,
+                                   bool calling_party,
                                    v8_parms_t *parms,
                                    v8_result_handler_t result_handler,
                                    void *user_data);
index 20eb7d5de958385e4c1b211cb3267fe71e105435..d371bb28287355e7a7aa9e5c5e751980971f77c2 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 
 #include "spandsp/telephony.h"
index 3a4a12acf54f5ea4d7df454944641a2834ab27c8..1d3555a97da3b5c35a88abf12bc90185e70191c8 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <tiffio.h>
 
@@ -748,7 +753,7 @@ static uint8_t check_next_tx_step(t30_state_t *s)
     if (s->document_handler)
         more = s->document_handler(s, s->document_user_data, 0);
     else
-        more = FALSE;
+        more = false;
     if (more)
     {
         span_log(&s->logging, SPAN_LOG_FLOW, "Another document to send\n");
@@ -795,7 +800,7 @@ static int get_partial_ecm_page(t30_state_t *s)
             }
             s->ecm_frames = i;
             span_log(&s->logging, SPAN_LOG_FLOW, "Partial page buffer contains %d frames (%d per frame)\n", i, s->octets_per_ecm_frame);
-            s->ecm_at_page_end = TRUE;
+            s->ecm_at_page_end = true;
             return i;
         }
         s->ecm_len[i] = (int16_t) (4 + len);
@@ -844,7 +849,7 @@ static int send_next_ecm_frame(t30_state_t *s)
         send_frame(s, frame, 3);
         /* In case we are just after a CTC/CTR exchange, which kicked us back
            to long training */
-        s->short_train = TRUE;
+        s->short_train = true;
         return 0;
     }
     return -1;
@@ -892,7 +897,7 @@ static void send_frame(t30_state_t *s, const uint8_t *msg, int len)
     print_frame(s, "Tx: ", msg, len);
 
     if (s->real_time_frame_handler)
-        s->real_time_frame_handler(s, s->real_time_frame_user_data, FALSE, msg, len);
+        s->real_time_frame_handler(s, s->real_time_frame_user_data, false, msg, len);
     if (s->send_hdlc_handler)
         s->send_hdlc_handler(s->send_hdlc_user_data, msg, len);
 }
@@ -939,9 +944,9 @@ static int send_nsf_frame(t30_state_t *s)
         s->tx_info.nsf[1] = CONTROL_FIELD_NON_FINAL_FRAME;
         s->tx_info.nsf[2] = (uint8_t) (T30_NSF | s->dis_received);
         send_frame(s, s->tx_info.nsf, s->tx_info.nsf_len + 3);
-        return TRUE;
+        return true;
     }
-    return FALSE;
+    return false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -955,9 +960,9 @@ static int send_nss_frame(t30_state_t *s)
         s->tx_info.nss[1] = CONTROL_FIELD_NON_FINAL_FRAME;
         s->tx_info.nss[2] = (uint8_t) (T30_NSS | s->dis_received);
         send_frame(s, s->tx_info.nss, s->tx_info.nss_len + 3);
-        return TRUE;
+        return true;
     }
-    return FALSE;
+    return false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -971,9 +976,9 @@ static int send_nsc_frame(t30_state_t *s)
         s->tx_info.nsc[1] = CONTROL_FIELD_NON_FINAL_FRAME;
         s->tx_info.nsc[2] = (uint8_t) (T30_NSC | s->dis_received);
         send_frame(s, s->tx_info.nsc, s->tx_info.nsc_len + 3);
-        return TRUE;
+        return true;
     }
-    return FALSE;
+    return false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -984,9 +989,9 @@ static int send_ident_frame(t30_state_t *s, uint8_t cmd)
         span_log(&s->logging, SPAN_LOG_FLOW, "Sending ident '%s'\n", s->tx_info.ident);
         /* 'cmd' should be T30_TSI, T30_CIG or T30_CSI */
         send_20digit_msg_frame(s, cmd, s->tx_info.ident);
-        return TRUE;
+        return true;
     }
-    return FALSE;
+    return false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -997,10 +1002,10 @@ static int send_psa_frame(t30_state_t *s)
         span_log(&s->logging, SPAN_LOG_FLOW, "Sending polled sub-address '%s'\n", s->tx_info.polled_sub_address);
         send_20digit_msg_frame(s, T30_PSA, s->tx_info.polled_sub_address);
         set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_POLLED_SUBADDRESSING_CAPABLE);
-        return TRUE;
+        return true;
     }
     clr_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_POLLED_SUBADDRESSING_CAPABLE);
-    return FALSE;
+    return false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -1011,10 +1016,10 @@ static int send_sep_frame(t30_state_t *s)
         span_log(&s->logging, SPAN_LOG_FLOW, "Sending selective polling address '%s'\n", s->tx_info.selective_polling_address);
         send_20digit_msg_frame(s, T30_SEP, s->tx_info.selective_polling_address);
         set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_SELECTIVE_POLLING_CAPABLE);
-        return TRUE;
+        return true;
     }
     clr_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_SELECTIVE_POLLING_CAPABLE);
-    return FALSE;
+    return false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -1026,10 +1031,10 @@ static int send_sid_frame(t30_state_t *s)
         span_log(&s->logging, SPAN_LOG_FLOW, "Sending sender identification '%s'\n", s->tx_info.sender_ident);
         send_20digit_msg_frame(s, T30_SID, s->tx_info.sender_ident);
         set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_SENDER_ID_TRANSMISSION);
-        return TRUE;
+        return true;
     }
     clr_ctrl_bit(s->dcs_frame, T30_DCS_BIT_SENDER_ID_TRANSMISSION);
-    return FALSE;
+    return false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -1041,10 +1046,10 @@ static int send_pwd_frame(t30_state_t *s)
         span_log(&s->logging, SPAN_LOG_FLOW, "Sending password '%s'\n", s->tx_info.password);
         send_20digit_msg_frame(s, T30_PWD, s->tx_info.password);
         set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_PASSWORD);
-        return TRUE;
+        return true;
     }
     clr_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_PASSWORD);
-    return FALSE;
+    return false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -1056,10 +1061,10 @@ static int send_sub_frame(t30_state_t *s)
         span_log(&s->logging, SPAN_LOG_FLOW, "Sending sub-address '%s'\n", s->tx_info.sub_address);
         send_20digit_msg_frame(s, T30_SUB, s->tx_info.sub_address);
         set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_SUBADDRESS_TRANSMISSION);
-        return TRUE;
+        return true;
     }
     clr_ctrl_bit(s->dcs_frame, T30_DCS_BIT_SUBADDRESS_TRANSMISSION);
-    return FALSE;
+    return false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -1068,9 +1073,9 @@ static int send_tsa_frame(t30_state_t *s)
     if ((test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_T37)  ||  test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_T38))  &&  0)
     {
         span_log(&s->logging, SPAN_LOG_FLOW, "Sending transmitting subscriber internet address '%s'\n", "");
-        return TRUE;
+        return true;
     }
-    return FALSE;
+    return false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -1080,10 +1085,10 @@ static int send_ira_frame(t30_state_t *s)
     {
         span_log(&s->logging, SPAN_LOG_FLOW, "Sending internet routing address '%s'\n", "");
         set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_INTERNET_ROUTING_ADDRESS_TRANSMISSION);
-        return TRUE;
+        return true;
     }
     clr_ctrl_bit(s->dcs_frame, T30_DCS_BIT_INTERNET_ROUTING_ADDRESS_TRANSMISSION);
-    return FALSE;
+    return false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -1092,9 +1097,9 @@ static int send_cia_frame(t30_state_t *s)
     if ((test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_T37)  ||  test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_T38))  &&  0)
     {
         span_log(&s->logging, SPAN_LOG_FLOW, "Sending calling subscriber internet address '%s'\n", "");
-        return TRUE;
+        return true;
     }
-    return FALSE;
+    return false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -1104,10 +1109,10 @@ static int send_isp_frame(t30_state_t *s)
     {
         span_log(&s->logging, SPAN_LOG_FLOW, "Sending internet selective polling address '%s'\n", "");
         set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_INTERNET_SELECTIVE_POLLING_ADDRESS);
-        return TRUE;
+        return true;
     }
     clr_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_INTERNET_SELECTIVE_POLLING_ADDRESS);
-    return FALSE;
+    return false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -1117,10 +1122,10 @@ static int send_csa_frame(t30_state_t *s)
     if (("in T.37 mode"  ||  "in T.38 mode")  &&  0)
     {
         span_log(&s->logging, SPAN_LOG_FLOW, "Sending called subscriber internet address '%s'\n", "");
-        return TRUE;
+        return true;
     }
 #endif
-    return FALSE;
+    return false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -1457,7 +1462,7 @@ static int build_dcs(t30_state_t *s)
     s->dcs_frame[4] |= fallback_sequence[s->current_fallback].dcs_code;
 
     /* Select the compression to use. */
-    use_bilevel = TRUE;
+    use_bilevel = true;
     set_ctrl_bits(s->dcs_frame, s->min_scan_time_code, T30_DCS_BIT_MIN_SCAN_LINE_TIME_1);
     switch (s->line_compression)
     {
@@ -1491,7 +1496,7 @@ static int build_dcs(t30_state_t *s)
         //if (???????? & T4_COMPRESSION_?????))
         //    set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_PREFERRED_HUFFMAN_TABLES);
         set_ctrl_bits(s->dcs_frame, T30_MIN_SCAN_0MS, T30_DCS_BIT_MIN_SCAN_LINE_TIME_1);
-        use_bilevel = FALSE;
+        use_bilevel = false;
         break;
 #if defined(SPANDSP_SUPPORT_T43)
     case T4_COMPRESSION_T43:
@@ -1503,17 +1508,17 @@ static int build_dcs(t30_state_t *s)
         //if (???????? & T4_COMPRESSION_NO_SUBSAMPLING))
         //    set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_NO_SUBSAMPLING);
         set_ctrl_bits(s->dcs_frame, T30_MIN_SCAN_0MS, T30_DCS_BIT_MIN_SCAN_LINE_TIME_1);
-        use_bilevel = FALSE;
+        use_bilevel = false;
         break;
 #endif
 #if defined(SPANDSP_SUPPORT_T45)
     case T4_COMPRESSION_T45:
-        use_bilevel = FALSE;
+        use_bilevel = false;
         break;
 #endif
 #if defined(SPANDSP_SUPPORT_SYCC_T81)
     case T4_COMPRESSION_SYCC_T81:
-        use_bilevel = FALSE;
+        use_bilevel = false;
         break;
 #endif
     default:
@@ -1674,7 +1679,7 @@ static int analyze_rx_dis_dtc(t30_state_t *s, const uint8_t *msg, int len)
     }
 
     if (msg[2] == T30_DIS)
-        s->dis_received = TRUE;
+        s->dis_received = true;
 
     /* Make a local copy of the message, padded to the maximum possible length with zeros. This allows
        us to simply pick out the bits, without worrying about whether they were set from the remote side. */
@@ -2631,7 +2636,7 @@ static int restart_sending_document(t30_state_t *s)
     t4_tx_restart_page(&s->t4.tx);
     s->retries = 0;
     s->ecm_block = 0;
-    send_dcs_sequence(s, TRUE);
+    send_dcs_sequence(s, true);
     return 0;
 }
 /*- End of function --------------------------------------------------------*/
@@ -2647,7 +2652,7 @@ static int start_receiving_document(t30_state_t *s)
     span_log(&s->logging, SPAN_LOG_FLOW, "Start receiving document\n");
     queue_phase(s, T30_PHASE_B_TX);
     s->ecm_block = 0;
-    send_dis_or_dtc_sequence(s, TRUE);
+    send_dis_or_dtc_sequence(s, true);
     return 0;
 }
 /*- End of function --------------------------------------------------------*/
@@ -2723,7 +2728,7 @@ static int process_rx_dis_dtc(t30_state_t *s, const uint8_t *msg, int len)
             return -1;
         }
         s->retries = 0;
-        send_dcs_sequence(s, TRUE);
+        send_dcs_sequence(s, true);
         return 0;
     }
     span_log(&s->logging, SPAN_LOG_FLOW, "%s nothing to send\n", t30_frametype(msg[2]));
@@ -2750,7 +2755,7 @@ static int process_rx_dis_dtc(t30_state_t *s, const uint8_t *msg, int len)
             return -1;
         }
         s->retries = 0;
-        send_dis_or_dtc_sequence(s, TRUE);
+        send_dis_or_dtc_sequence(s, true);
         return 0;
     }
     span_log(&s->logging, SPAN_LOG_FLOW, "%s nothing to receive\n", t30_frametype(msg[2]));
@@ -2809,7 +2814,7 @@ static int process_rx_dcs(t30_state_t *s, const uint8_t *msg, int len)
     if (!(s->iaf & T30_IAF_MODE_NO_TCF))
     {
         /* TCF is always sent with long training */
-        s->short_train = FALSE;
+        s->short_train = false;
         set_state(s, T30_STATE_F_TCF);
         queue_phase(s, T30_PHASE_C_NON_ECM_RX);
         timer_t2_start(s);
@@ -2825,7 +2830,7 @@ static int send_response_to_pps(t30_state_t *s)
     {
         set_state(s, T30_STATE_F_POST_RCP_MCF);
         send_simple_frame(s, T30_MCF);
-        return TRUE;
+        return true;
     }
     /* We need to send the PPR frame we have created, to try to fill in the missing/bad data. */
     set_state(s, T30_STATE_F_POST_RCP_PPR);
@@ -2833,7 +2838,7 @@ static int send_response_to_pps(t30_state_t *s)
     s->ecm_frame_map[1] = CONTROL_FIELD_FINAL_FRAME;
     s->ecm_frame_map[2] = (uint8_t) (T30_PPR | s->dis_received);
     send_frame(s, s->ecm_frame_map, 3 + 32);
-    return FALSE;
+    return false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -2930,7 +2935,7 @@ static int process_rx_pps(t30_state_t *s, const uint8_t *msg, int len)
 
     /* Build a bit map of which frames we now have stored OK */
     first_bad_frame = 256;
-    first = TRUE;
+    first = true;
     expected_len = 256;
     for (i = 0;  i < 32;  i++)
     {
@@ -2957,7 +2962,7 @@ static int process_rx_pps(t30_state_t *s, const uint8_t *msg, int len)
                         /* Use the length of the first frame as our model for what the length should be */
                         if (s->ecm_len[frame_no] == 64)
                             expected_len = 64;
-                        first = FALSE;
+                        first = false;
                     }
                     /* Check the length is consistent with the first frame */
                     if (s->ecm_len[frame_no] != expected_len)
@@ -3042,7 +3047,7 @@ static int process_rx_pps(t30_state_t *s, const uint8_t *msg, int len)
                 case T30_PRI_EOP:
                 case T30_EOP:
                     span_log(&s->logging, SPAN_LOG_FLOW, "End of procedure detected\n");
-                    s->end_of_procedure_detected = TRUE;
+                    s->end_of_procedure_detected = true;
                     break;
                 }
             }
@@ -3157,7 +3162,7 @@ static void process_rx_fcd(t30_state_t *s, const uint8_t *msg, int len)
             memcpy(&s->ecm_data[frame_no][0], &msg[4], len - 4);
             s->ecm_len[frame_no] = (int16_t) (len - 4);
             /* In case we are just after a CTC/CTR exchange, which kicked us back to long training */
-            s->short_train = TRUE;
+            s->short_train = true;
         }
         /* We have received something, so any missing carrier status is out of date */
         if (s->current_status == T30_ERR_RX_NOCARRIER)
@@ -3422,7 +3427,7 @@ static void process_state_d_post_tcf(t30_state_t *s, const uint8_t *msg, int len
         /* Trainability test succeeded. Send the document. */
         span_log(&s->logging, SPAN_LOG_FLOW, "Trainability test succeeded\n");
         s->retries = 0;
-        s->short_train = TRUE;
+        s->short_train = true;
         if (s->error_correcting_mode)
         {
             set_state(s, T30_STATE_IV);
@@ -3439,7 +3444,7 @@ static void process_state_d_post_tcf(t30_state_t *s, const uint8_t *msg, int len
         /* Trainability test failed. Try again. */
         span_log(&s->logging, SPAN_LOG_FLOW, "Trainability test failed\n");
         s->retries = 0;
-        s->short_train = FALSE;
+        s->short_train = false;
         if (step_fallback_entry(s) < 0)
         {
             /* We have fallen back as far as we can go. Give up. */
@@ -3449,7 +3454,7 @@ static void process_state_d_post_tcf(t30_state_t *s, const uint8_t *msg, int len
             break;
         }
         queue_phase(s, T30_PHASE_B_TX);
-        send_dcs_sequence(s, TRUE);
+        send_dcs_sequence(s, true);
         break;
     case T30_DIS:
         /* It appears they didn't see what we sent - retry the TCF */
@@ -3463,7 +3468,7 @@ static void process_state_d_post_tcf(t30_state_t *s, const uint8_t *msg, int len
         span_log(&s->logging, SPAN_LOG_FLOW, "Retry number %d\n", s->retries);
         queue_phase(s, T30_PHASE_B_TX);
         /* TODO: should we reassess the new DIS message, and possibly adjust the DCS we use? */
-        send_dcs_sequence(s, TRUE);
+        send_dcs_sequence(s, true);
         break;
     case T30_DCN:
         t30_set_status(s, T30_ERR_TX_BADDCS);
@@ -3725,7 +3730,7 @@ static void process_state_f_post_doc_non_ecm(t30_state_t *s, const uint8_t *msg,
         /* Fall through */
     case T30_EOP:
         span_log(&s->logging, SPAN_LOG_FLOW, "End of procedure detected\n");
-        s->end_of_procedure_detected = TRUE;
+        s->end_of_procedure_detected = true;
         s->next_rx_step = fcf;
         queue_phase(s, T30_PHASE_D_TX);
         switch (copy_quality(s))
@@ -3837,7 +3842,7 @@ static void process_state_f_doc_and_post_doc_ecm(t30_state_t *s, const uint8_t *
         break;
     case T30_CTC:
         /* T.30 says we change back to long training here */
-        s->short_train = FALSE;
+        s->short_train = false;
         queue_phase(s, T30_PHASE_D_TX);
         set_state(s, T30_STATE_F_DOC_ECM);
         send_simple_frame(s, T30_CTR);
@@ -3933,7 +3938,7 @@ static void process_state_f_post_rcp_rnr(t30_state_t *s, const uint8_t *msg, int
                 case T30_PRI_EOP:
                 case T30_EOP:
                     span_log(&s->logging, SPAN_LOG_FLOW, "End of procedure detected\n");
-                    s->end_of_procedure_detected = TRUE;
+                    s->end_of_procedure_detected = true;
                     break;
                 }
             }
@@ -4098,8 +4103,8 @@ static void process_state_ii_q(t30_state_t *s, const uint8_t *msg, int len)
             if (s->phase_d_handler)
                 s->phase_d_handler(s, s->phase_d_user_data, fcf);
             terminate_operation_in_progress(s);
-            report_tx_result(s, TRUE);
-            return_to_phase_b(s, FALSE);
+            report_tx_result(s, true);
+            return_to_phase_b(s, false);
             break;
         case T30_PRI_EOP:
         case T30_EOP:
@@ -4108,7 +4113,7 @@ static void process_state_ii_q(t30_state_t *s, const uint8_t *msg, int len)
                 s->phase_d_handler(s, s->phase_d_user_data, fcf);
             terminate_operation_in_progress(s);
             send_dcn(s);
-            report_tx_result(s, TRUE);
+            report_tx_result(s, true);
             break;
         }
         break;
@@ -4146,7 +4151,7 @@ static void process_state_ii_q(t30_state_t *s, const uint8_t *msg, int len)
                 s->phase_d_handler(s, s->phase_d_user_data, fcf);
             t4_tx_release(&s->t4.tx);
             /* TODO: should go back to T, and resend */
-            return_to_phase_b(s, TRUE);
+            return_to_phase_b(s, true);
             break;
         case T30_PRI_EOP:
         case T30_EOP:
@@ -4211,7 +4216,7 @@ static void process_state_ii_q(t30_state_t *s, const uint8_t *msg, int len)
             }
             else
             {
-                return_to_phase_b(s, TRUE);
+                return_to_phase_b(s, true);
             }
             break;
         case T30_PRI_EOP:
@@ -4451,8 +4456,8 @@ static void process_state_iv_pps_null(t30_state_t *s, const uint8_t *msg, int le
                 if (s->phase_d_handler)
                     s->phase_d_handler(s, s->phase_d_user_data, fcf);
                 terminate_operation_in_progress(s);
-                report_tx_result(s, TRUE);
-                return_to_phase_b(s, FALSE);
+                report_tx_result(s, true);
+                return_to_phase_b(s, false);
                 break;
             case T30_PRI_EOP:
             case T30_EOP:
@@ -4461,7 +4466,7 @@ static void process_state_iv_pps_null(t30_state_t *s, const uint8_t *msg, int le
                     s->phase_d_handler(s, s->phase_d_user_data, fcf);
                 terminate_operation_in_progress(s);
                 send_dcn(s);
-                report_tx_result(s, TRUE);
+                report_tx_result(s, true);
                 break;
             }
         }
@@ -4555,8 +4560,8 @@ static void process_state_iv_pps_q(t30_state_t *s, const uint8_t *msg, int len)
                 if (s->phase_d_handler)
                     s->phase_d_handler(s, s->phase_d_user_data, fcf);
                 terminate_operation_in_progress(s);
-                report_tx_result(s, TRUE);
-                return_to_phase_b(s, FALSE);
+                report_tx_result(s, true);
+                return_to_phase_b(s, false);
                 break;
             case T30_PRI_EOP:
             case T30_EOP:
@@ -4565,7 +4570,7 @@ static void process_state_iv_pps_q(t30_state_t *s, const uint8_t *msg, int len)
                     s->phase_d_handler(s, s->phase_d_user_data, fcf);
                 terminate_operation_in_progress(s);
                 send_dcn(s);
-                report_tx_result(s, TRUE);
+                report_tx_result(s, true);
                 break;
             }
         }
@@ -4670,8 +4675,8 @@ static void process_state_iv_pps_rnr(t30_state_t *s, const uint8_t *msg, int len
                 if (s->phase_d_handler)
                     s->phase_d_handler(s, s->phase_d_user_data, fcf);
                 terminate_operation_in_progress(s);
-                report_tx_result(s, TRUE);
-                return_to_phase_b(s, FALSE);
+                report_tx_result(s, true);
+                return_to_phase_b(s, false);
                 break;
             case T30_PRI_EOP:
             case T30_EOP:
@@ -4680,7 +4685,7 @@ static void process_state_iv_pps_rnr(t30_state_t *s, const uint8_t *msg, int len
                     s->phase_d_handler(s, s->phase_d_user_data, fcf);
                 terminate_operation_in_progress(s);
                 send_dcn(s);
-                report_tx_result(s, TRUE);
+                report_tx_result(s, true);
                 break;
             }
         }
@@ -4731,7 +4736,7 @@ static void process_state_iv_ctc(t30_state_t *s, const uint8_t *msg, int len)
     case T30_CTR:
         /* Valid response to a CTC received */
         /* T.30 says we change back to long training here */
-        s->short_train = FALSE;
+        s->short_train = false;
         /* Initiate resending of the remainder of the frames. */
         set_state(s, T30_STATE_IV);
         queue_phase(s, T30_PHASE_C_ECM_TX);
@@ -4857,7 +4862,7 @@ static void process_rx_control_msg(t30_state_t *s, const uint8_t *msg, int len)
     /* We should only get good frames here. */
     print_frame(s, "Rx: ", msg, len);
     if (s->real_time_frame_handler)
-        s->real_time_frame_handler(s, s->real_time_frame_user_data, TRUE, msg, len);
+        s->real_time_frame_handler(s, s->real_time_frame_user_data, true, msg, len);
 
     if ((msg[1] & 0x10) == 0)
     {
@@ -5158,42 +5163,42 @@ static void set_phase(t30_state_t *s, int phase)
        signal. Force the signal present indicator to off, because the
        receiver will never be able to. */
     if (s->phase != T30_PHASE_A_CED  &&  s->phase != T30_PHASE_A_CNG)
-        s->rx_signal_present = FALSE;
-    s->rx_trained = FALSE;
-    s->rx_frame_received = FALSE;
+        s->rx_signal_present = false;
+    s->rx_trained = false;
+    s->rx_frame_received = false;
     s->phase = phase;
     switch (phase)
     {
     case T30_PHASE_A_CED:
         if (s->set_rx_type_handler)
-            s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_V21, 300, FALSE, TRUE);
+            s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_V21, 300, false, true);
         if (s->set_tx_type_handler)
-            s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_CED, 0, FALSE, FALSE);
+            s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_CED, 0, false, false);
         break;
     case T30_PHASE_A_CNG:
         if (s->set_rx_type_handler)
-            s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_V21, 300, FALSE, TRUE);
+            s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_V21, 300, false, true);
         if (s->set_tx_type_handler)
-            s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_CNG, 0, FALSE, FALSE);
+            s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_CNG, 0, false, false);
         break;
     case T30_PHASE_B_RX:
     case T30_PHASE_D_RX:
         if (s->set_rx_type_handler)
-            s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_V21, 300, FALSE, TRUE);
+            s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_V21, 300, false, true);
         if (s->set_tx_type_handler)
-            s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_NONE, 0, FALSE, FALSE);
+            s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_NONE, 0, false, false);
         break;
     case T30_PHASE_B_TX:
     case T30_PHASE_D_TX:
         if (!s->far_end_detected  &&  s->timer_t0_t1 > 0)
         {
             s->timer_t0_t1 = ms_to_samples(DEFAULT_TIMER_T1);
-            s->far_end_detected = TRUE;
+            s->far_end_detected = true;
         }
         if (s->set_rx_type_handler)
-            s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, FALSE, FALSE);
+            s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, false, false);
         if (s->set_tx_type_handler)
-            s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_V21, 300, FALSE, TRUE);
+            s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_V21, 300, false, true);
         break;
     case T30_PHASE_C_NON_ECM_RX:
         if (s->set_rx_type_handler)
@@ -5201,11 +5206,11 @@ static void set_phase(t30_state_t *s, int phase)
             /* Momentarily stop the receive modem, so the next change is forced to happen. If we don't do this
                an HDLC message on the slow modem, which has disabled the fast modem, will prevent the same
                fast modem from restarting. */
-            s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, FALSE, FALSE);
-            s->set_rx_type_handler(s->set_rx_type_user_data, fallback_sequence[s->current_fallback].modem_type, fallback_sequence[s->current_fallback].bit_rate, s->short_train, FALSE);
+            s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, false, false);
+            s->set_rx_type_handler(s->set_rx_type_user_data, fallback_sequence[s->current_fallback].modem_type, fallback_sequence[s->current_fallback].bit_rate, s->short_train, false);
         }
         if (s->set_tx_type_handler)
-            s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_NONE, 0, FALSE, FALSE);
+            s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_NONE, 0, false, false);
         break;
     case T30_PHASE_C_NON_ECM_TX:
         /* Pause before switching from anything to phase C */
@@ -5217,24 +5222,24 @@ static void set_phase(t30_state_t *s, int phase)
             /* Momentarily stop the receive modem, so the next change is forced to happen. If we don't do this
                an HDLC message on the slow modem, which has disabled the fast modem, will prevent the same
                fast modem from restarting. */
-            s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, FALSE, FALSE);
-            s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, FALSE, FALSE);
+            s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, false, false);
+            s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, false, false);
         }
         if (s->set_tx_type_handler)
-            s->set_tx_type_handler(s->set_tx_type_user_data, fallback_sequence[s->current_fallback].modem_type, fallback_sequence[s->current_fallback].bit_rate, s->short_train, FALSE);
+            s->set_tx_type_handler(s->set_tx_type_user_data, fallback_sequence[s->current_fallback].modem_type, fallback_sequence[s->current_fallback].bit_rate, s->short_train, false);
         break;
     case T30_PHASE_C_ECM_RX:
         if (s->set_rx_type_handler)
-            s->set_rx_type_handler(s->set_rx_type_user_data, fallback_sequence[s->current_fallback].modem_type, fallback_sequence[s->current_fallback].bit_rate, s->short_train, TRUE);
+            s->set_rx_type_handler(s->set_rx_type_user_data, fallback_sequence[s->current_fallback].modem_type, fallback_sequence[s->current_fallback].bit_rate, s->short_train, true);
         if (s->set_tx_type_handler)
-            s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_NONE, 0, FALSE, FALSE);
+            s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_NONE, 0, false, false);
         break;
     case T30_PHASE_C_ECM_TX:
         /* Pause before switching from anything to phase C */
         if (s->set_rx_type_handler)
-            s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, FALSE, FALSE);
+            s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, false, false);
         if (s->set_tx_type_handler)
-            s->set_tx_type_handler(s->set_tx_type_user_data, fallback_sequence[s->current_fallback].modem_type, fallback_sequence[s->current_fallback].bit_rate, s->short_train, TRUE);
+            s->set_tx_type_handler(s->set_tx_type_user_data, fallback_sequence[s->current_fallback].modem_type, fallback_sequence[s->current_fallback].bit_rate, s->short_train, true);
         break;
     case T30_PHASE_E:
         /* Send a little silence before ending things, to ensure the
@@ -5244,15 +5249,15 @@ static void set_phase(t30_state_t *s, int phase)
         s->tcf_current_zeros = 0;
         s->tcf_most_zeros = 0;
         if (s->set_rx_type_handler)
-            s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, FALSE, FALSE);
+            s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, false, false);
         if (s->set_tx_type_handler)
-            s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_PAUSE, 0, FINAL_FLUSH_TIME, FALSE);
+            s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_PAUSE, 0, FINAL_FLUSH_TIME, false);
         break;
     case T30_PHASE_CALL_FINISHED:
         if (s->set_rx_type_handler)
-            s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_DONE, 0, FALSE, FALSE);
+            s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_DONE, 0, false, false);
         if (s->set_tx_type_handler)
-            s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_DONE, 0, FALSE, FALSE);
+            s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_DONE, 0, false, false);
         break;
     }
 }
@@ -5299,9 +5304,9 @@ static void repeat_last_command(t30_state_t *s)
     switch (s->state)
     {
     case T30_STATE_R:
-        s->dis_received = FALSE;
+        s->dis_received = false;
         queue_phase(s, T30_PHASE_B_TX);
-        send_dis_or_dtc_sequence(s, TRUE);
+        send_dis_or_dtc_sequence(s, true);
         break;
     case T30_STATE_III_Q_MCF:
         queue_phase(s, T30_PHASE_D_TX);
@@ -5331,7 +5336,7 @@ static void repeat_last_command(t30_state_t *s)
         break;
     case T30_STATE_D:
         queue_phase(s, T30_PHASE_B_TX);
-        send_dcs_sequence(s, TRUE);
+        send_dcs_sequence(s, true);
         break;
     case T30_STATE_F_FTT:
         queue_phase(s, T30_PHASE_B_TX);
@@ -5339,13 +5344,13 @@ static void repeat_last_command(t30_state_t *s)
         break;
     case T30_STATE_F_CFR:
         queue_phase(s, T30_PHASE_B_TX);
-        send_cfr_sequence(s, TRUE);
+        send_cfr_sequence(s, true);
         break;
     case T30_STATE_D_POST_TCF:
         /* Need to send the whole training thing again */
-        s->short_train = FALSE;
+        s->short_train = false;
         queue_phase(s, T30_PHASE_B_TX);
-        send_dcs_sequence(s, TRUE);
+        send_dcs_sequence(s, true);
         break;
     case T30_STATE_F_POST_RCP_RNR:
         /* Just ignore */
@@ -5521,8 +5526,8 @@ static void timer_t2_expired(t30_state_t *s)
             span_log(&s->logging, SPAN_LOG_FLOW, "Returning to phase B after %s\n", t30_frametype(s->next_rx_step));
             set_phase(s, T30_PHASE_B_TX);
             timer_t2_start(s);
-            s->dis_received = FALSE;
-            send_dis_or_dtc_sequence(s, TRUE);
+            s->dis_received = false;
+            send_dis_or_dtc_sequence(s, true);
             return;
         }
         break;
@@ -5728,7 +5733,7 @@ static void t30_non_ecm_rx_status(void *user_data, int status)
     case SIG_STATUS_TRAINING_IN_PROGRESS:
         break;
     case SIG_STATUS_TRAINING_FAILED:
-        s->rx_trained = FALSE;
+        s->rx_trained = false;
         break;
     case SIG_STATUS_TRAINING_SUCCEEDED:
         /* The modem is now trained */
@@ -5736,16 +5741,16 @@ static void t30_non_ecm_rx_status(void *user_data, int status)
         s->tcf_test_bits = 0;
         s->tcf_current_zeros = 0;
         s->tcf_most_zeros = 0;
-        s->rx_signal_present = TRUE;
-        s->rx_trained = TRUE;
+        s->rx_signal_present = true;
+        s->rx_trained = true;
         timer_t2_t4_stop(s);
         break;
     case SIG_STATUS_CARRIER_UP:
         break;
     case SIG_STATUS_CARRIER_DOWN:
         was_trained = s->rx_trained;
-        s->rx_signal_present = FALSE;
-        s->rx_trained = FALSE;
+        s->rx_signal_present = false;
+        s->rx_trained = false;
         switch (s->state)
         {
         case T30_STATE_F_TCF:
@@ -5773,11 +5778,11 @@ static void t30_non_ecm_rx_status(void *user_data, int status)
                 else
                 {
                     /* The training went OK */
-                    s->short_train = TRUE;
+                    s->short_train = true;
                     rx_start_page(s);
                     set_phase(s, T30_PHASE_B_TX);
                     set_state(s, T30_STATE_F_CFR);
-                    send_cfr_sequence(s, TRUE);
+                    send_cfr_sequence(s, true);
                 }
             }
             break;
@@ -5981,15 +5986,15 @@ static void t30_hdlc_rx_status(void *user_data, int status)
     case SIG_STATUS_TRAINING_IN_PROGRESS:
         break;
     case SIG_STATUS_TRAINING_FAILED:
-        s->rx_trained = FALSE;
+        s->rx_trained = false;
         break;
     case SIG_STATUS_TRAINING_SUCCEEDED:
         /* The modem is now trained */
-        s->rx_signal_present = TRUE;
-        s->rx_trained = TRUE;
+        s->rx_signal_present = true;
+        s->rx_trained = true;
         break;
     case SIG_STATUS_CARRIER_UP:
-        s->rx_signal_present = TRUE;
+        s->rx_signal_present = true;
         switch (s->timer_t2_t4_is)
         {
         case TIMER_IS_T2B:
@@ -6004,8 +6009,8 @@ static void t30_hdlc_rx_status(void *user_data, int status)
         break;
     case SIG_STATUS_CARRIER_DOWN:
         was_trained = s->rx_trained;
-        s->rx_signal_present = FALSE;
-        s->rx_trained = FALSE;
+        s->rx_signal_present = false;
+        s->rx_trained = false;
         /* If a phase change has been queued to occur after the receive signal drops,
            its time to change. */
         if (s->state == T30_STATE_F_DOC_ECM)
@@ -6058,7 +6063,7 @@ static void t30_hdlc_rx_status(void *user_data, int status)
         if (!s->far_end_detected  &&  s->timer_t0_t1 > 0)
         {
             s->timer_t0_t1 = ms_to_samples(DEFAULT_TIMER_T1);
-            s->far_end_detected = TRUE;
+            s->far_end_detected = true;
             if (s->phase == T30_PHASE_A_CED  ||  s->phase == T30_PHASE_A_CNG)
                 set_phase(s, T30_PHASE_B_RX);
         }
@@ -6153,7 +6158,7 @@ SPAN_DECLARE_NONSTD(void) t30_hdlc_accept(void *user_data, const uint8_t *msg, i
         timer_t2_t4_stop(s);
         return;
     }
-    s->rx_frame_received = TRUE;
+    s->rx_frame_received = true;
     /* Cancel the command or response timer (if one is running) */
     timer_t2_t4_stop(s);
     process_rx_control_msg(s, msg, len);
@@ -6177,11 +6182,11 @@ SPAN_DECLARE(void) t30_front_end_status(void *user_data, int status)
             span_log(&s->logging, SPAN_LOG_FLOW, "Starting answer mode\n");
             set_phase(s, T30_PHASE_B_TX);
             timer_t2_start(s);
-            s->dis_received = FALSE;
-            send_dis_or_dtc_sequence(s, TRUE);
+            s->dis_received = false;
+            send_dis_or_dtc_sequence(s, true);
             break;
         case T30_STATE_R:
-            if (send_dis_or_dtc_sequence(s, FALSE))
+            if (send_dis_or_dtc_sequence(s, false))
             {
                 /* Wait for an acknowledgement. */
                 set_phase(s, T30_PHASE_B_RX);
@@ -6189,7 +6194,7 @@ SPAN_DECLARE(void) t30_front_end_status(void *user_data, int status)
             }
             break;
         case T30_STATE_F_CFR:
-            if (send_cfr_sequence(s, FALSE))
+            if (send_cfr_sequence(s, false))
             {
                 if (s->error_correcting_mode)
                 {
@@ -6309,13 +6314,13 @@ SPAN_DECLARE(void) t30_front_end_status(void *user_data, int status)
             }
             break;
         case T30_STATE_D:
-            if (send_dcs_sequence(s, FALSE))
+            if (send_dcs_sequence(s, false))
             {
                 if ((s->iaf & T30_IAF_MODE_NO_TCF))
                 {
                     /* Skip the trainability test */
                     s->retries = 0;
-                    s->short_train = TRUE;
+                    s->short_train = true;
                     if (s->error_correcting_mode)
                     {
                         set_state(s, T30_STATE_IV);
@@ -6331,7 +6336,7 @@ SPAN_DECLARE(void) t30_front_end_status(void *user_data, int status)
                 {
                     /* Do the trainability test */
                     /* TCF is always sent with long training */
-                    s->short_train = FALSE;
+                    s->short_train = false;
                     set_state(s, T30_STATE_D_TCF);
                     set_phase(s, T30_PHASE_C_NON_ECM_TX);
                 }
@@ -6435,7 +6440,7 @@ SPAN_DECLARE(void) t30_front_end_status(void *user_data, int status)
         default:
             /* Cancel any receive timeout, and declare that a receive signal is present,
                since the front end is explicitly telling us we have seen something. */
-            s->rx_signal_present = TRUE;
+            s->rx_signal_present = true;
             timer_t2_t4_stop(s);
             break;
         }
@@ -6629,9 +6634,9 @@ SPAN_DECLARE(int) t30_restart(t30_state_t *s)
     s->phase = T30_PHASE_IDLE;
     s->next_phase = T30_PHASE_IDLE;
     s->current_fallback = 0;
-    s->rx_signal_present = FALSE;
-    s->rx_trained = FALSE;
-    s->rx_frame_received = FALSE;
+    s->rx_signal_present = false;
+    s->rx_trained = false;
+    s->rx_frame_received = false;
     s->current_status = T30_ERR_OK;
     s->ppr_count = 0;
     s->ecm_progress = 0;
@@ -6645,9 +6650,9 @@ SPAN_DECLARE(int) t30_restart(t30_state_t *s)
     s->tx_page_number = 0;
     s->rtn_events = 0;
     s->rtp_events = 0;
-    s->local_interrupt_pending = FALSE;
-    s->far_end_detected = FALSE;
-    s->end_of_procedure_detected = FALSE;
+    s->local_interrupt_pending = false;
+    s->far_end_detected = false;
+    s->end_of_procedure_detected = false;
     s->timer_t0_t1 = ms_to_samples(DEFAULT_TIMER_T0);
     if (s->calling_party)
     {
index d00ede33d284d8476c727ae5cb562b28f58f7be5..a0a78b31648aa29d8fd2cdf9babcca67a1762d08 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <tiffio.h>
 
@@ -555,7 +560,7 @@ SPAN_DECLARE(size_t) t30_get_rx_csa(t30_state_t *s, int *type, const char *addre
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(int) t30_set_tx_page_header_overlays_image(t30_state_t *s, int header_overlays_image)
+SPAN_DECLARE(int) t30_set_tx_page_header_overlays_image(t30_state_t *s, bool header_overlays_image)
 {
     s->header_overlays_image = header_overlays_image;
     t4_tx_set_header_overlays_image(&s->t4.tx, s->header_overlays_image);
@@ -590,7 +595,7 @@ SPAN_DECLARE(int) t30_set_tx_page_header_tz(t30_state_t *s, const char *tzstring
 {
     if (tz_init(&s->tz, tzstring))
     {
-        s->use_own_tz = TRUE;
+        s->use_own_tz = true;
         t4_tx_set_header_tz(&s->t4.tx, &s->tz);
         return 0;
     }
@@ -633,13 +638,13 @@ SPAN_DECLARE(void) t30_set_tx_file(t30_state_t *s, const char *file, int start_p
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(void) t30_set_iaf_mode(t30_state_t *s, int iaf)
+SPAN_DECLARE(void) t30_set_iaf_mode(t30_state_t *s, bool iaf)
 {
     s->iaf = iaf;
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(int) t30_set_ecm_capability(t30_state_t *s, int enabled)
+SPAN_DECLARE(int) t30_set_ecm_capability(t30_state_t *s, bool enabled)
 {
     s->ecm_allowed = enabled;
     t30_build_dis_or_dtc(s);
@@ -694,7 +699,7 @@ SPAN_DECLARE(int) t30_set_supported_compressions(t30_state_t *s, int supported_c
 #if defined(SPANDSP_SUPPORT_T88)
                             | T4_COMPRESSION_T88
 #endif
-                            //| T4_COMPRESSION_T42_T81
+                            | T4_COMPRESSION_T42_T81
 #if defined(SPANDSP_SUPPORT_SYCC_T81)
                             | T4_COMPRESSION_SYCC_T81
 #endif
@@ -704,7 +709,6 @@ SPAN_DECLARE(int) t30_set_supported_compressions(t30_state_t *s, int supported_c
 #if defined(SPANDSP_SUPPORT_T45)
                             | T4_COMPRESSION_T45
 #endif
-#if 0
                             | T4_COMPRESSION_GRAYSCALE
                             | T4_COMPRESSION_COLOUR
                             | T4_COMPRESSION_12BIT
@@ -712,8 +716,8 @@ SPAN_DECLARE(int) t30_set_supported_compressions(t30_state_t *s, int supported_c
                             | T4_COMPRESSION_GRAY_TO_BILEVEL
                             | T4_COMPRESSION_COLOUR_TO_BILEVEL
                             | T4_COMPRESSION_RESCALING
-#endif
                             | 0;
+
     s->supported_compressions = supported_compressions;
     t30_build_dis_or_dtc(s);
     return 0;
index 33efcb9c034f7ae381908207dde70402e0479bfd..ce1dc74664e6c67f73b8b72d4dd6874f0682764c 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <tiffio.h>
 
index 9993a7a521b5025e66b5211542a404bb216f9871..79ba8f52860cce05371e6cca4190c9efd015e4c1 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <assert.h>
 #include <tiffio.h>
@@ -94,6 +99,7 @@
 #include "spandsp/private/bitstream.h"
 #include "spandsp/private/t38_core.h"
 #include "spandsp/private/silence_gen.h"
+#include "spandsp/private/power_meter.h"
 #include "spandsp/private/fsk.h"
 #include "spandsp/private/modem_connect_tones.h"
 #include "spandsp/private/v8.h"
@@ -216,7 +222,7 @@ static int front_end_status(t31_state_t *s, int status)
             {
                 at_modem_control(&s->at_state, AT_MODEM_CONTROL_HANGUP, NULL);
                 t31_set_at_rx_mode(s, AT_MODE_ONHOOK_COMMAND);
-                s->at_state.do_hangup = FALSE;
+                s->at_state.do_hangup = false;
             }
             else
             {
@@ -310,7 +316,7 @@ static int process_rx_missing(t38_core_state_t *t, void *user_data, int rx_seq_n
     t31_state_t *s;
 
     s = (t31_state_t *) user_data;
-    s->t38_fe.rx_data_missing = TRUE;
+    s->t38_fe.rx_data_missing = true;
     return 0;
 }
 /*- End of function --------------------------------------------------------*/
@@ -392,7 +398,7 @@ static int process_rx_indicator(t38_core_state_t *t, void *user_data, int indica
     }
     /*endswitch*/
     fe->hdlc_rx.len = 0;
-    fe->rx_data_missing = FALSE;
+    fe->rx_data_missing = false;
     return 0;
 }
 /*- End of function --------------------------------------------------------*/
@@ -406,7 +412,7 @@ static void process_hdlc_data(t31_t38_front_end_state_t *fe, const uint8_t *buf,
     }
     else
     {
-        fe->rx_data_missing = TRUE;
+        fe->rx_data_missing = true;
     }
     /*endif*/
 }
@@ -461,7 +467,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
             /* All real HDLC messages in the FAX world start with 0xFF. If this one is not starting
                with 0xFF it would appear some octets must have been missed before this one. */
             if (len <= 0  ||  buf[0] != 0xFF)
-                fe->rx_data_missing = TRUE;
+                fe->rx_data_missing = true;
             /*endif*/
         }
         /*endif*/
@@ -515,7 +521,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
             fe->hdlc_rx.len = 0;
         }
         /*endif*/
-        fe->rx_data_missing = FALSE;
+        fe->rx_data_missing = false;
         fe->timeout_rx_samples = fe->samples + ms_to_samples(MID_RX_TIMEOUT);
         break;
     case T38_FIELD_HDLC_FCS_BAD:
@@ -534,14 +540,14 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
         {
             span_log(&s->logging, SPAN_LOG_FLOW, "Type %s - CRC bad (%s)\n", (fe->hdlc_rx.len >= 3)  ?  t30_frametype(fe->hdlc_rx.buf[2])  :  "???", (fe->rx_data_missing)  ?  "missing octets"  :  "clean");
             if (data_type == T38_DATA_V21)
-                hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, FALSE);
+                hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, false);
             else
-                hdlc_accept_t38_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, FALSE);
+                hdlc_accept_t38_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, false);
             /*endif*/
             fe->hdlc_rx.len = 0;
         }
         /*endif*/
-        fe->rx_data_missing = FALSE;
+        fe->rx_data_missing = false;
         fe->timeout_rx_samples = fe->samples + ms_to_samples(MID_RX_TIMEOUT);
         break;
     case T38_FIELD_HDLC_FCS_OK_SIG_END:
@@ -587,7 +593,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
             fe->hdlc_rx.len = 0;
         }
         /*endif*/
-        fe->rx_data_missing = FALSE;
+        fe->rx_data_missing = false;
         if (t->current_rx_data_type != data_type  ||  t->current_rx_field_type != field_type)
         {
             if (data_type == T38_DATA_V21)
@@ -615,14 +621,14 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
         {
             span_log(&s->logging, SPAN_LOG_FLOW, "Type %s - CRC bad, sig end (%s)\n", (fe->hdlc_rx.len >= 3)  ?  t30_frametype(fe->hdlc_rx.buf[2])  :  "???", (fe->rx_data_missing)  ?  "missing octets"  :  "clean");
             if (data_type == T38_DATA_V21)
-                hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, FALSE);
+                hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, false);
             else
-                hdlc_accept_t38_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, FALSE);
+                hdlc_accept_t38_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, false);
             /*endif*/
             fe->hdlc_rx.len = 0;
         }
         /*endif*/
-        fe->rx_data_missing = FALSE;
+        fe->rx_data_missing = false;
         if (t->current_rx_data_type != data_type  ||  t->current_rx_field_type != field_type)
         {
             if (data_type == T38_DATA_V21)
@@ -654,7 +660,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
                i.e. they send T38_FIELD_HDLC_FCS_OK, and then T38_FIELD_HDLC_SIG_END when the carrier actually drops.
                The other is because the HDLC signal drops unexpectedly - i.e. not just after a final frame. */
             fe->hdlc_rx.len = 0;
-            fe->rx_data_missing = FALSE;
+            fe->rx_data_missing = false;
             fe->timeout_rx_samples = 0;
             if (data_type == T38_DATA_V21)
                 hdlc_rx_status(s, SIG_STATUS_CARRIER_DOWN);
@@ -670,7 +676,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
             if (!s->at_state.rx_signal_present)
             {
                 non_ecm_rx_status(s, SIG_STATUS_TRAINING_SUCCEEDED);
-                s->at_state.rx_signal_present = TRUE;
+                s->at_state.rx_signal_present = true;
             }
             /*endif*/
             bit_reverse(buf2, buf, len);
@@ -690,7 +696,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
                 if (!s->at_state.rx_signal_present)
                 {
                     non_ecm_rx_status(s, SIG_STATUS_TRAINING_SUCCEEDED);
-                    s->at_state.rx_signal_present = TRUE;
+                    s->at_state.rx_signal_present = true;
                 }
                 /*endif*/
                 bit_reverse(buf2, buf, len);
@@ -704,7 +710,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
             non_ecm_rx_status(s, SIG_STATUS_CARRIER_DOWN);
         }
         /*endif*/
-        s->at_state.rx_signal_present = FALSE;
+        s->at_state.rx_signal_present = false;
         fe->timeout_rx_samples = 0;
         break;
     case T38_FIELD_CM_MESSAGE:
@@ -1178,7 +1184,7 @@ static int stream_hdlc(t31_state_t *s)
             else
             {
                 /* End of transmission */
-                s->hdlc_tx.final = FALSE;
+                s->hdlc_tx.final = false;
                 category = (fe->current_tx_data_type == T38_DATA_V21)  ?  T38_PACKET_CATEGORY_CONTROL_DATA_END  :  T38_PACKET_CATEGORY_IMAGE_DATA_END;
                 if ((res = t38_core_send_data(&fe->t38, previous, T38_FIELD_HDLC_FCS_OK_SIG_END, NULL, 0, category)) < 0)
                     return res;
@@ -1302,7 +1308,7 @@ SPAN_DECLARE(int) t31_t38_send_timeout(t31_state_t *s, int samples)
 
     fe = &s->t38_fe;
     if (fe->current_rx_type == T30_MODEM_DONE  ||  fe->current_tx_type == T30_MODEM_DONE)
-        return TRUE;
+        return true;
     /*endif*/
 
     fe->samples += samples;
@@ -1314,12 +1320,12 @@ SPAN_DECLARE(int) t31_t38_send_timeout(t31_state_t *s, int samples)
     }
     /*endif*/
     if (fe->timed_step == T38_TIMED_STEP_NONE)
-        return FALSE;
+        return false;
     /*endif*/
     /* Wait until the right time comes along, unless we are working in "no delays" mode, while talking to an
        IAF terminal. */
     if (fe->us_per_tx_chunk  &&  fe->samples < fe->next_tx_samples)
-        return FALSE;
+        return false;
     /*endif*/
     /* Its time to send something */
     delay = 0;
@@ -1348,7 +1354,7 @@ SPAN_DECLARE(int) t31_t38_send_timeout(t31_state_t *s, int samples)
     }
     /*endswitch*/
     fe->next_tx_samples += us_to_samples(delay);
-    return FALSE;
+    return false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -1370,7 +1376,7 @@ static int t31_modem_control_handler(at_state_t *s, void *user_data, int op, con
     case AT_MODEM_CONTROL_ONHOOK:
         if (t->non_ecm_tx.holding)
         {
-            t->non_ecm_tx.holding = FALSE;
+            t->non_ecm_tx.holding = false;
             /* Tell the application to release further data */
             at_modem_control(&t->at_state, AT_MODEM_CONTROL_CTS, (void *) 1);
         }
@@ -1414,15 +1420,15 @@ static void non_ecm_rx_status(void *user_data, int status)
     case SIG_STATUS_TRAINING_IN_PROGRESS:
         break;
     case SIG_STATUS_TRAINING_FAILED:
-        s->at_state.rx_trained = FALSE;
-        s->audio.modems.rx_trained = FALSE;
+        s->at_state.rx_trained = false;
+        s->audio.modems.rx_trained = false;
         break;
     case SIG_STATUS_TRAINING_SUCCEEDED:
         /* The modem is now trained */
         at_put_response_code(&s->at_state, AT_RESPONSE_CODE_CONNECT);
-        s->at_state.rx_signal_present = TRUE;
-        s->at_state.rx_trained = TRUE;
-        s->audio.modems.rx_trained = TRUE;
+        s->at_state.rx_signal_present = true;
+        s->at_state.rx_trained = true;
+        s->audio.modems.rx_trained = true;
         break;
     case SIG_STATUS_CARRIER_UP:
         break;
@@ -1440,9 +1446,9 @@ static void non_ecm_rx_status(void *user_data, int status)
             t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND);
         }
         /*endif*/
-        s->at_state.rx_signal_present = FALSE;
-        s->at_state.rx_trained = FALSE;
-        s->audio.modems.rx_trained = FALSE;
+        s->at_state.rx_signal_present = false;
+        s->at_state.rx_trained = false;
+        s->audio.modems.rx_trained = false;
         break;
     default:
         if (s->at_state.p.result_code_format)
@@ -1497,7 +1503,7 @@ static void non_ecm_put(void *user_data, const uint8_t buf[], int len)
     if (!s->at_state.rx_signal_present)
     {
         non_ecm_rx_status(s, SIG_STATUS_TRAINING_SUCCEEDED);
-        s->at_state.rx_signal_present = TRUE;
+        s->at_state.rx_signal_present = true;
     }
     /*endif*/
     /* Ignore any fractional bytes which may have accumulated */
@@ -1547,20 +1553,20 @@ static int non_ecm_get_bit(void *user_data)
                    release flow control. */
                 if (s->non_ecm_tx.out_bytes > T31_TX_BUF_LOW_TIDE)
                 {
-                    s->non_ecm_tx.holding = FALSE;
+                    s->non_ecm_tx.holding = false;
                     /* Tell the application to release further data */
                     at_modem_control(&s->at_state, AT_MODEM_CONTROL_CTS, (void *) 1);
                 }
                 /*endif*/
             }
             /*endif*/
-            s->non_ecm_tx.data_started = TRUE;
+            s->non_ecm_tx.data_started = true;
         }
         else
         {
             if (s->non_ecm_tx.final)
             {
-                s->non_ecm_tx.final = FALSE;
+                s->non_ecm_tx.final = false;
                 /* This will put the modem into its shutdown sequence. When
                    it has finally shut down, an OK response will be sent. */
                 return SIG_STATUS_END_OF_DATA;
@@ -1604,20 +1610,20 @@ static int non_ecm_get(void *user_data, uint8_t buf[], int len)
                 /* See if the buffer is approaching empty. It might be time to release flow control. */
                 if (s->non_ecm_tx.out_bytes > T31_TX_BUF_LOW_TIDE)
                 {
-                    s->non_ecm_tx.holding = FALSE;
+                    s->non_ecm_tx.holding = false;
                     /* Tell the application to release further data */
                     at_modem_control(&s->at_state, AT_MODEM_CONTROL_CTS, (void *) 1);
                 }
                 /*endif*/
             }
             /*endif*/
-            s->non_ecm_tx.data_started = TRUE;
+            s->non_ecm_tx.data_started = true;
         }
         else
         {
             if (s->non_ecm_tx.final)
             {
-                s->non_ecm_tx.final = FALSE;
+                s->non_ecm_tx.final = false;
                 /* This will put the modem into its shutdown sequence. When
                    it has finally shut down, an OK response will be sent. */
                 return i;
@@ -1661,7 +1667,7 @@ static void hdlc_tx_underflow(void *user_data)
     s = (t31_state_t *) user_data;
     if (s->hdlc_tx.final)
     {
-        s->hdlc_tx.final = FALSE;
+        s->hdlc_tx.final = false;
         /* Schedule an orderly shutdown of the modem */
         hdlc_tx_frame(&s->audio.modems.hdlc_tx, NULL, 0);
     }
@@ -1689,21 +1695,21 @@ static void hdlc_rx_status(void *user_data, int status)
     case SIG_STATUS_TRAINING_IN_PROGRESS:
         break;
     case SIG_STATUS_TRAINING_FAILED:
-        s->at_state.rx_trained = FALSE;
-        s->audio.modems.rx_trained = FALSE;
+        s->at_state.rx_trained = false;
+        s->audio.modems.rx_trained = false;
         break;
     case SIG_STATUS_TRAINING_SUCCEEDED:
         /* The modem is now trained */
-        s->at_state.rx_signal_present = TRUE;
-        s->at_state.rx_trained = TRUE;
-        s->audio.modems.rx_trained = TRUE;
+        s->at_state.rx_signal_present = true;
+        s->at_state.rx_trained = true;
+        s->audio.modems.rx_trained = true;
         break;
     case SIG_STATUS_CARRIER_UP:
         if (s->modem == FAX_MODEM_CNG_TONE_TX  ||  s->modem == FAX_MODEM_NOCNG_TONE_TX  ||  s->modem == FAX_MODEM_V21_RX)
         {
-            s->at_state.rx_signal_present = TRUE;
-            s->rx_frame_received = FALSE;
-            s->audio.modems.rx_frame_received = FALSE;
+            s->at_state.rx_signal_present = true;
+            s->rx_frame_received = false;
+            s->audio.modems.rx_frame_received = false;
         }
         /*endif*/
         break;
@@ -1715,14 +1721,14 @@ static void hdlc_rx_status(void *user_data, int status)
                 if (s->at_state.ok_is_pending)
                 {
                     at_put_response_code(&s->at_state, AT_RESPONSE_CODE_OK);
-                    s->at_state.ok_is_pending = FALSE;
+                    s->at_state.ok_is_pending = false;
                 }
                 else
                 {
                     at_put_response_code(&s->at_state, AT_RESPONSE_CODE_NO_CARRIER);
                 }
                 /*endif*/
-                s->at_state.dte_is_waiting = FALSE;
+                s->at_state.dte_is_waiting = false;
                 t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND);
             }
             else
@@ -1733,9 +1739,9 @@ static void hdlc_rx_status(void *user_data, int status)
             /*endif*/
         }
         /*endif*/
-        s->at_state.rx_signal_present = FALSE;
-        s->at_state.rx_trained = FALSE;
-        s->audio.modems.rx_trained = FALSE;
+        s->at_state.rx_signal_present = false;
+        s->at_state.rx_trained = false;
+        s->audio.modems.rx_trained = false;
         break;
     case SIG_STATUS_FRAMING_OK:
         if (s->modem == FAX_MODEM_CNG_TONE_TX  ||  s->modem == FAX_MODEM_NOCNG_TONE_TX)
@@ -1743,7 +1749,7 @@ static void hdlc_rx_status(void *user_data, int status)
             /* Once we get any valid HDLC the CNG tone stops, and we drop
                to the V.21 receive modem on its own. */
             s->modem = FAX_MODEM_V21_RX;
-            s->at_state.transmit = FALSE;
+            s->at_state.transmit = false;
         }
         /*endif*/
         if (s->modem == FAX_MODEM_V17_RX  ||  s->modem == FAX_MODEM_V27TER_RX  ||  s->modem == FAX_MODEM_V29_RX)
@@ -1754,12 +1760,12 @@ static void hdlc_rx_status(void *user_data, int status)
                V.21 receive mode. */
             if (s->at_state.p.adaptive_receive)
             {
-                s->at_state.rx_signal_present = TRUE;
-                s->rx_frame_received = TRUE;
-                s->audio.modems.rx_frame_received = TRUE;
+                s->at_state.rx_signal_present = true;
+                s->rx_frame_received = true;
+                s->audio.modems.rx_frame_received = true;
                 s->modem = FAX_MODEM_V21_RX;
-                s->at_state.transmit = FALSE;
-                s->at_state.dte_is_waiting = TRUE;
+                s->at_state.transmit = false;
+                s->at_state.dte_is_waiting = true;
                 at_put_response_code(&s->at_state, AT_RESPONSE_CODE_FRH3);
                 at_put_response_code(&s->at_state, AT_RESPONSE_CODE_CONNECT);
             }
@@ -1767,8 +1773,8 @@ static void hdlc_rx_status(void *user_data, int status)
             {
                 s->modem = FAX_MODEM_SILENCE_TX;
                 t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND);
-                s->rx_frame_received = FALSE;
-                s->audio.modems.rx_frame_received = FALSE;
+                s->rx_frame_received = false;
+                s->audio.modems.rx_frame_received = false;
                 at_put_response_code(&s->at_state, AT_RESPONSE_CODE_FCERROR);
             }
             /*endif*/
@@ -1781,8 +1787,8 @@ static void hdlc_rx_status(void *user_data, int status)
                 {
                     /* Report CONNECT as soon as possible to avoid a timeout. */
                     at_put_response_code(&s->at_state, AT_RESPONSE_CODE_CONNECT);
-                    s->rx_frame_received = TRUE;
-                    s->audio.modems.rx_frame_received = TRUE;
+                    s->rx_frame_received = true;
+                    s->audio.modems.rx_frame_received = true;
                 }
                 else
                 {
@@ -1825,8 +1831,8 @@ static void hdlc_accept_frame(void *user_data, const uint8_t *msg, int len, int
         {
             /* Report CONNECT as soon as possible to avoid a timeout. */
             at_put_response_code(&s->at_state, AT_RESPONSE_CODE_CONNECT);
-            s->rx_frame_received = TRUE;
-            s->audio.modems.rx_frame_received = TRUE;
+            s->rx_frame_received = true;
+            s->audio.modems.rx_frame_received = true;
         }
         else
         {
@@ -1860,14 +1866,14 @@ static void hdlc_accept_frame(void *user_data, const uint8_t *msg, int len, int
             {
                 /* This is the last frame.  We don't send OK until the carrier drops to avoid
                    redetecting it later. */
-                s->at_state.ok_is_pending = TRUE;
+                s->at_state.ok_is_pending = true;
             }
             else
             {
                 at_put_response_code(&s->at_state, (ok)  ?  AT_RESPONSE_CODE_OK  :  AT_RESPONSE_CODE_ERROR);
-                s->at_state.dte_is_waiting = FALSE;
-                s->rx_frame_received = FALSE;
-                s->audio.modems.rx_frame_received = FALSE;
+                s->at_state.dte_is_waiting = false;
+                s->rx_frame_received = false;
+                s->audio.modems.rx_frame_received = false;
             }
             /*endif*/
         }
@@ -2015,13 +2021,13 @@ static void hdlc_accept_non_ecm_frame(void *user_data, const uint8_t *msg, int l
 
 static void t31_v21_rx(t31_state_t *s)
 {
-    s->at_state.ok_is_pending = FALSE;
+    s->at_state.ok_is_pending = false;
     s->hdlc_tx.len = 0;
-    s->hdlc_tx.final = FALSE;
-    s->dled = FALSE;
-    hdlc_rx_init(&s->audio.modems.hdlc_rx, FALSE, TRUE, HDLC_FRAMING_OK_THRESHOLD, hdlc_accept_frame, s);
+    s->hdlc_tx.final = false;
+    s->dled = false;
+    hdlc_rx_init(&s->audio.modems.hdlc_rx, false, true, HDLC_FRAMING_OK_THRESHOLD, hdlc_accept_frame, s);
     fax_modems_start_slow_modem(&s->audio.modems, FAX_MODEM_V21_RX);
-    s->at_state.transmit = TRUE;
+    s->at_state.transmit = true;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -2038,14 +2044,14 @@ static int restart_modem(t31_state_t *s, int new_modem)
     /*endif*/
     queue_flush(s->rx_queue);
     s->modem = new_modem;
-    s->non_ecm_tx.final = FALSE;
-    s->at_state.rx_signal_present = FALSE;
-    s->at_state.rx_trained = FALSE;
-    s->audio.modems.rx_trained = FALSE;
-    s->rx_frame_received = FALSE;
-    s->audio.modems.rx_frame_received = FALSE;
+    s->non_ecm_tx.final = false;
+    s->at_state.rx_signal_present = false;
+    s->at_state.rx_trained = false;
+    s->audio.modems.rx_trained = false;
+    s->rx_frame_received = false;
+    s->audio.modems.rx_frame_received = false;
     fax_modems_set_rx_handler(t, (span_rx_handler_t) &span_dummy_rx, NULL, (span_rx_fillin_handler_t) &span_dummy_rx_fillin, NULL);
-    use_hdlc = FALSE;
+    use_hdlc = false;
     switch (s->modem)
     {
     case FAX_MODEM_CNG_TONE_TX:
@@ -2068,7 +2074,7 @@ static int restart_modem(t31_state_t *s, int new_modem)
             fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
         }
         /*endif*/
-        s->at_state.transmit = TRUE;
+        s->at_state.transmit = true;
         break;
     case FAX_MODEM_NOCNG_TONE_TX:
         if (s->t38_mode)
@@ -2082,7 +2088,7 @@ static int restart_modem(t31_state_t *s, int new_modem)
             fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
         }
         /*endif*/
-        s->at_state.transmit = FALSE;
+        s->at_state.transmit = false;
         break;
     case FAX_MODEM_CED_TONE_TX:
         if (s->t38_mode)
@@ -2097,7 +2103,7 @@ static int restart_modem(t31_state_t *s, int new_modem)
             fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
         }
         /*endif*/
-        s->at_state.transmit = TRUE;
+        s->at_state.transmit = true;
         break;
     case FAX_MODEM_V21_RX:
         if (s->t38_mode)
@@ -2115,13 +2121,13 @@ static int restart_modem(t31_state_t *s, int new_modem)
         {
             s->t38_fe.next_tx_indicator = T38_IND_V21_PREAMBLE;
             s->t38_fe.current_tx_data_type = T38_DATA_V21;
-            use_hdlc = TRUE;
+            use_hdlc = true;
             s->t38_fe.timed_step = (use_hdlc)  ?  T38_TIMED_STEP_HDLC_MODEM  :  T38_TIMED_STEP_NON_ECM_MODEM;
             set_octets_per_data_packet(s, 300);
         }
         else
         {
-            hdlc_tx_init(&t->hdlc_tx, FALSE, 2, FALSE, hdlc_tx_underflow, s);
+            hdlc_tx_init(&t->hdlc_tx, false, 2, false, hdlc_tx_underflow, s);
             /* The spec says 1s +-15% of preamble. So, the minimum is 32 octets. */
             hdlc_tx_flags(&t->hdlc_tx, 32);
             fax_modems_start_slow_modem(t, FAX_MODEM_V21_TX);
@@ -2130,9 +2136,9 @@ static int restart_modem(t31_state_t *s, int new_modem)
         }
         /*endif*/
         s->hdlc_tx.len = 0;
-        s->hdlc_tx.final = FALSE;
-        s->dled = FALSE;
-        s->at_state.transmit = TRUE;
+        s->hdlc_tx.final = false;
+        s->dled = false;
+        s->at_state.transmit = true;
         break;
     case FAX_MODEM_V17_RX:
     case FAX_MODEM_V27TER_RX:
@@ -2144,7 +2150,7 @@ static int restart_modem(t31_state_t *s, int new_modem)
             fax_modems_start_fast_modem(t, s->modem, s->bit_rate, s->short_train, use_hdlc);
         }
         /*endif*/
-        s->at_state.transmit = FALSE;
+        s->at_state.transmit = false;
         break;
     case FAX_MODEM_V17_TX:
         if (s->t38_mode)
@@ -2178,8 +2184,8 @@ static int restart_modem(t31_state_t *s, int new_modem)
         }
         /*endif*/
         s->non_ecm_tx.out_bytes = 0;
-        s->non_ecm_tx.data_started = FALSE;
-        s->at_state.transmit = TRUE;
+        s->non_ecm_tx.data_started = false;
+        s->at_state.transmit = true;
         break;
     case FAX_MODEM_V27TER_TX:
         if (s->t38_mode)
@@ -2205,8 +2211,8 @@ static int restart_modem(t31_state_t *s, int new_modem)
         }
         /*endif*/
         s->non_ecm_tx.out_bytes = 0;
-        s->non_ecm_tx.data_started = FALSE;
-        s->at_state.transmit = TRUE;
+        s->non_ecm_tx.data_started = false;
+        s->at_state.transmit = true;
         break;
     case FAX_MODEM_V29_TX:
         if (s->t38_mode)
@@ -2232,8 +2238,8 @@ static int restart_modem(t31_state_t *s, int new_modem)
         }
         /*endif*/
         s->non_ecm_tx.out_bytes = 0;
-        s->non_ecm_tx.data_started = FALSE;
-        s->at_state.transmit = TRUE;
+        s->non_ecm_tx.data_started = false;
+        s->at_state.transmit = true;
         break;
     case FAX_MODEM_SILENCE_TX:
         if (s->t38_mode)
@@ -2252,7 +2258,7 @@ static int restart_modem(t31_state_t *s, int new_modem)
             fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
         }
         /*endif*/
-        s->at_state.transmit = FALSE;
+        s->at_state.transmit = false;
         break;
     case FAX_MODEM_SILENCE_RX:
         if (!s->t38_mode)
@@ -2263,7 +2269,7 @@ static int restart_modem(t31_state_t *s, int new_modem)
             fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
         }
         /*endif*/
-        s->at_state.transmit = FALSE;
+        s->at_state.transmit = false;
         break;
     case FAX_MODEM_FLUSH:
         /* Send 200ms of silence to "push" the last audio out */
@@ -2279,7 +2285,7 @@ static int restart_modem(t31_state_t *s, int new_modem)
             silence_gen_alter(&t->silence_gen, ms_to_samples(200));
             fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
             fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
-            s->at_state.transmit = TRUE;
+            s->at_state.transmit = true;
         }
         /*endif*/
         break;
@@ -2301,7 +2307,7 @@ static __inline__ void dle_unstuff_hdlc(t31_state_t *s, const char *stuffed, int
     {
         if (s->dled)
         {
-            s->dled = FALSE;
+            s->dled = false;
             if (stuffed[i] == ETX)
             {
                 s->hdlc_tx.final = (s->hdlc_tx.buf[1] & 0x10);
@@ -2330,7 +2336,7 @@ static __inline__ void dle_unstuff_hdlc(t31_state_t *s, const char *stuffed, int
         else
         {
             if (stuffed[i] == DLE)
-                s->dled = TRUE;
+                s->dled = true;
             else
                 s->hdlc_tx.buf[s->hdlc_tx.len++] = stuffed[i];
             /*endif*/
@@ -2349,10 +2355,10 @@ static __inline__ void dle_unstuff_fake_hdlc(t31_state_t *s, const char *stuffed
     {
         if (s->dled)
         {
-            s->dled = FALSE;
+            s->dled = false;
             if (stuffed[i] == ETX)
             {
-                s->non_ecm_tx.final = TRUE;
+                s->non_ecm_tx.final = true;
                 t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND);
                 return;
             }
@@ -2370,7 +2376,7 @@ static __inline__ void dle_unstuff_fake_hdlc(t31_state_t *s, const char *stuffed
         else
         {
             if (stuffed[i] == DLE)
-                s->dled = TRUE;
+                s->dled = true;
             else
                 hdlc_rx_put_byte(&s->t38_fe.hdlc_rx_non_ecm, bit_reverse8(stuffed[i]));
             /*endif*/
@@ -2389,10 +2395,10 @@ static __inline__ void dle_unstuff(t31_state_t *s, const char *stuffed, int len)
     {
         if (s->dled)
         {
-            s->dled = FALSE;
+            s->dled = false;
             if (stuffed[i] == ETX)
             {
-                s->non_ecm_tx.final = TRUE;
+                s->non_ecm_tx.final = true;
                 t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND);
                 return;
             }
@@ -2411,7 +2417,7 @@ static __inline__ void dle_unstuff(t31_state_t *s, const char *stuffed, int len)
         else
         {
             if (stuffed[i] == DLE)
-                s->dled = TRUE;
+                s->dled = true;
             else
                 s->non_ecm_tx.buf[s->non_ecm_tx.in_bytes++] = stuffed[i];
             /*endif*/
@@ -2431,7 +2437,7 @@ static __inline__ void dle_unstuff(t31_state_t *s, const char *stuffed, int len)
         /* See if the buffer is approaching full. We might need to apply flow control. */
         if (s->non_ecm_tx.in_bytes > T31_TX_BUF_HIGH_TIDE)
         {
-            s->non_ecm_tx.holding = TRUE;
+            s->non_ecm_tx.holding = true;
             /* Tell the application to hold further data */
             at_modem_control(&s->at_state, AT_MODEM_CONTROL_CTS, (void *) 0);
         }
@@ -2453,7 +2459,7 @@ static int process_class1_cmd(at_state_t *t, void *user_data, int direction, int
 
     s = (t31_state_t *) user_data;
     new_transmit = direction;
-    immediate_response = TRUE;
+    immediate_response = true;
     switch (operation)
     {
     case 'S':
@@ -2467,7 +2473,7 @@ static int process_class1_cmd(at_state_t *t, void *user_data, int direction, int
             else
                 silence_gen_alter(&s->audio.modems.silence_gen, ms_to_samples(val*10));
             /*endif*/
-            s->at_state.transmit = TRUE;
+            s->at_state.transmit = true;
         }
         else
         {
@@ -2487,7 +2493,7 @@ static int process_class1_cmd(at_state_t *t, void *user_data, int direction, int
             /*endif*/
         }
         /*endif*/
-        immediate_response = FALSE;
+        immediate_response = false;
         span_log(&s->logging, SPAN_LOG_FLOW, "Silence %dms\n", val*10);
         break;
     case 'H':
@@ -2495,7 +2501,7 @@ static int process_class1_cmd(at_state_t *t, void *user_data, int direction, int
         {
         case 3:
             new_modem = (new_transmit)  ?  FAX_MODEM_V21_TX  :  FAX_MODEM_V21_RX;
-            s->short_train = FALSE;
+            s->short_train = false;
             s->bit_rate = 300;
             break;
         default:
@@ -2506,7 +2512,7 @@ static int process_class1_cmd(at_state_t *t, void *user_data, int direction, int
         if (new_modem != s->modem)
         {
             restart_modem(s, new_modem);
-            immediate_response = FALSE;
+            immediate_response = false;
         }
         /*endif*/
         s->at_state.transmit = new_transmit;
@@ -2521,8 +2527,8 @@ static int process_class1_cmd(at_state_t *t, void *user_data, int direction, int
         {
             /* Send straight away, if there is something queued. */
             t31_set_at_rx_mode(s, AT_MODE_DELIVERY);
-            s->rx_frame_received = FALSE;
-            s->audio.modems.rx_frame_received = FALSE;
+            s->rx_frame_received = false;
+            s->audio.modems.rx_frame_received = false;
             do
             {
                 if (!queue_empty(s->rx_queue))
@@ -2551,7 +2557,7 @@ static int process_class1_cmd(at_state_t *t, void *user_data, int direction, int
                 }
                 else
                 {
-                    s->at_state.dte_is_waiting = TRUE;
+                    s->at_state.dte_is_waiting = true;
                     break;
                 }
                 /*endif*/
@@ -2559,7 +2565,7 @@ static int process_class1_cmd(at_state_t *t, void *user_data, int direction, int
             while (msg[0] == AT_RESPONSE_CODE_CONNECT);
         }
         /*endif*/
-        immediate_response = FALSE;
+        immediate_response = false;
         break;
     default:
         switch (val)
@@ -2568,84 +2574,84 @@ static int process_class1_cmd(at_state_t *t, void *user_data, int direction, int
             s->t38_fe.next_tx_indicator = T38_IND_V27TER_2400_TRAINING;
             s->t38_fe.current_tx_data_type = T38_DATA_V27TER_2400;
             new_modem = (new_transmit)  ?  FAX_MODEM_V27TER_TX  :  FAX_MODEM_V27TER_RX;
-            s->short_train = FALSE;
+            s->short_train = false;
             s->bit_rate = 2400;
             break;
         case 48:
             s->t38_fe.next_tx_indicator = T38_IND_V27TER_4800_TRAINING;
             s->t38_fe.current_tx_data_type = T38_DATA_V27TER_4800;
             new_modem = (new_transmit)  ?  FAX_MODEM_V27TER_TX  :  FAX_MODEM_V27TER_RX;
-            s->short_train = FALSE;
+            s->short_train = false;
             s->bit_rate = 4800;
             break;
         case 72:
             s->t38_fe.next_tx_indicator = T38_IND_V29_7200_TRAINING;
             s->t38_fe.current_tx_data_type = T38_DATA_V29_7200;
             new_modem = (new_transmit)  ?  FAX_MODEM_V29_TX  :  FAX_MODEM_V29_RX;
-            s->short_train = FALSE;
+            s->short_train = false;
             s->bit_rate = 7200;
             break;
         case 96:
             s->t38_fe.next_tx_indicator = T38_IND_V29_9600_TRAINING;
             s->t38_fe.current_tx_data_type = T38_DATA_V29_9600;
             new_modem = (new_transmit)  ?  FAX_MODEM_V29_TX  :  FAX_MODEM_V29_RX;
-            s->short_train = FALSE;
+            s->short_train = false;
             s->bit_rate = 9600;
             break;
         case 73:
             s->t38_fe.next_tx_indicator = T38_IND_V17_7200_LONG_TRAINING;
             s->t38_fe.current_tx_data_type = T38_DATA_V17_7200;
             new_modem = (new_transmit)  ?  FAX_MODEM_V17_TX  :  FAX_MODEM_V17_RX;
-            s->short_train = FALSE;
+            s->short_train = false;
             s->bit_rate = 7200;
             break;
         case 74:
             s->t38_fe.next_tx_indicator = T38_IND_V17_7200_SHORT_TRAINING;
             s->t38_fe.current_tx_data_type = T38_DATA_V17_7200;
             new_modem = (new_transmit)  ?  FAX_MODEM_V17_TX  :  FAX_MODEM_V17_RX;
-            s->short_train = TRUE;
+            s->short_train = true;
             s->bit_rate = 7200;
             break;
         case 97:
             s->t38_fe.next_tx_indicator = T38_IND_V17_9600_LONG_TRAINING;
             s->t38_fe.current_tx_data_type = T38_DATA_V17_9600;
             new_modem = (new_transmit)  ?  FAX_MODEM_V17_TX  :  FAX_MODEM_V17_RX;
-            s->short_train = FALSE;
+            s->short_train = false;
             s->bit_rate = 9600;
             break;
         case 98:
             s->t38_fe.next_tx_indicator = T38_IND_V17_9600_SHORT_TRAINING;
             s->t38_fe.current_tx_data_type = T38_DATA_V17_9600;
             new_modem = (new_transmit)  ?  FAX_MODEM_V17_TX  :  FAX_MODEM_V17_RX;
-            s->short_train = TRUE;
+            s->short_train = true;
             s->bit_rate = 9600;
             break;
         case 121:
             s->t38_fe.next_tx_indicator = T38_IND_V17_12000_LONG_TRAINING;
             s->t38_fe.current_tx_data_type = T38_DATA_V17_12000;
             new_modem = (new_transmit)  ?  FAX_MODEM_V17_TX  :  FAX_MODEM_V17_RX;
-            s->short_train = FALSE;
+            s->short_train = false;
             s->bit_rate = 12000;
             break;
         case 122:
             s->t38_fe.next_tx_indicator = T38_IND_V17_12000_SHORT_TRAINING;
             s->t38_fe.current_tx_data_type = T38_DATA_V17_12000;
             new_modem = (new_transmit)  ?  FAX_MODEM_V17_TX  :  FAX_MODEM_V17_RX;
-            s->short_train = TRUE;
+            s->short_train = true;
             s->bit_rate = 12000;
             break;
         case 145:
             s->t38_fe.next_tx_indicator = T38_IND_V17_14400_LONG_TRAINING;
             s->t38_fe.current_tx_data_type = T38_DATA_V17_14400;
             new_modem = (new_transmit)  ?  FAX_MODEM_V17_TX  :  FAX_MODEM_V17_RX;
-            s->short_train = FALSE;
+            s->short_train = false;
             s->bit_rate = 14400;
             break;
         case 146:
             s->t38_fe.next_tx_indicator = T38_IND_V17_14400_SHORT_TRAINING;
             s->t38_fe.current_tx_data_type = T38_DATA_V17_14400;
             new_modem = (new_transmit)  ?  FAX_MODEM_V17_TX  :  FAX_MODEM_V17_RX;
-            s->short_train = TRUE;
+            s->short_train = true;
             s->bit_rate = 14400;
             break;
         default:
@@ -2664,7 +2670,7 @@ static int process_class1_cmd(at_state_t *t, void *user_data, int direction, int
         }
         /*endif*/
         restart_modem(s, new_modem);
-        immediate_response = FALSE;
+        immediate_response = false;
         break;
     }
     /*endswitch*/
@@ -2708,7 +2714,7 @@ SPAN_DECLARE(int) t31_at_rx(t31_state_t *s, const char *t, int len)
             }
             /*endif*/
             s->at_state.rx_data_bytes = 0;
-            s->at_state.transmit = FALSE;
+            s->at_state.transmit = false;
             s->modem = FAX_MODEM_SILENCE_TX;
             fax_modems_set_rx_handler(&s->audio.modems, (span_rx_handler_t) &span_dummy_rx, NULL, (span_rx_fillin_handler_t) &span_dummy_rx_fillin, NULL);
             t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND);
@@ -2901,19 +2907,19 @@ SPAN_DECLARE_NONSTD(int) t31_tx(t31_state_t *s, int16_t amp[], int max_len)
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(void) t31_set_transmit_on_idle(t31_state_t *s, int transmit_on_idle)
+SPAN_DECLARE(void) t31_set_transmit_on_idle(t31_state_t *s, bool transmit_on_idle)
 {
     s->audio.modems.transmit_on_idle = transmit_on_idle;
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(void) t31_set_tep_mode(t31_state_t *s, int use_tep)
+SPAN_DECLARE(void) t31_set_tep_mode(t31_state_t *s, bool use_tep)
 {
     s->audio.modems.use_tep = use_tep;
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(void) t31_set_t38_config(t31_state_t *s, int without_pacing)
+SPAN_DECLARE(void) t31_set_t38_config(t31_state_t *s, bool without_pacing)
 {
     if (without_pacing)
     {
@@ -2941,7 +2947,7 @@ SPAN_DECLARE(void) t31_set_t38_config(t31_state_t *s, int without_pacing)
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(void) t31_set_mode(t31_state_t *s, int t38_mode)
+SPAN_DECLARE(void) t31_set_mode(t31_state_t *s, bool t38_mode)
 {
     s->t38_mode = t38_mode;
     span_log(&s->logging, SPAN_LOG_FLOW, "Mode set to %d\n", s->t38_mode);
@@ -2993,8 +2999,8 @@ static int t31_t38_fe_init(t31_state_t *t,
 
     t->hdlc_tx.ptr = 0;
 
-    hdlc_tx_init(&s->hdlc_tx_non_ecm, FALSE, 1, FALSE, hdlc_tx_underflow2, s);
-    hdlc_rx_init(&s->hdlc_rx_non_ecm, FALSE, TRUE, 2, hdlc_accept_non_ecm_frame, t);
+    hdlc_tx_init(&s->hdlc_tx_non_ecm, false, 1, false, hdlc_tx_underflow2, s);
+    hdlc_rx_init(&s->hdlc_rx_non_ecm, false, true, 2, hdlc_accept_non_ecm_frame, t);
     return 0;
 }
 /*- End of function --------------------------------------------------------*/
@@ -3014,13 +3020,13 @@ SPAN_DECLARE(t31_state_t *) t31_init(t31_state_t *s,
         return NULL;
     /*endif*/
 
-    alloced = FALSE;
+    alloced = false;
     if (s == NULL)
     {
         if ((s = (t31_state_t *) span_alloc(sizeof (*s))) == NULL)
             return NULL;
         /*endif*/
-        alloced = TRUE;
+        alloced = true;
     }
     /*endif*/
     memset(s, 0, sizeof(*s));
@@ -3030,7 +3036,7 @@ SPAN_DECLARE(t31_state_t *) t31_init(t31_state_t *s,
     s->modem_control_handler = modem_control_handler;
     s->modem_control_user_data = modem_control_user_data;
     fax_modems_init(&s->audio.modems,
-                    FALSE,
+                    false,
                     hdlc_accept_frame,
                     hdlc_tx_underflow,
                     non_ecm_put_bit,
@@ -3052,22 +3058,22 @@ SPAN_DECLARE(t31_state_t *) t31_init(t31_state_t *s,
     v8_parms.pstn_access = 0;
     v8_parms.nsf = -1;
     v8_parms.t66 = -1;
-    v8_init(&s->audio.v8, FALSE, &v8_parms, v8_handler, s);
+    v8_init(&s->audio.v8, false, &v8_parms, v8_handler, s);
 
     power_meter_init(&s->audio.rx_power, 4);
     s->audio.last_sample = 0;
     s->audio.silence_threshold_power = power_meter_level_dbm0(-36);
-    s->at_state.rx_signal_present = FALSE;
-    s->at_state.rx_trained = FALSE;
-    s->audio.modems.rx_trained = FALSE;
+    s->at_state.rx_signal_present = false;
+    s->at_state.rx_trained = false;
+    s->audio.modems.rx_trained = false;
 
-    s->at_state.do_hangup = FALSE;
+    s->at_state.do_hangup = false;
     s->at_state.line_ptr = 0;
     s->audio.silence_heard = 0;
     s->silence_awaited = 0;
     s->call_samples = 0;
     s->modem = FAX_MODEM_NONE;
-    s->at_state.transmit = TRUE;
+    s->at_state.transmit = true;
 
     if ((s->rx_queue = queue_init(NULL, 4096, QUEUE_WRITE_ATOMIC | QUEUE_READ_ATOMIC)) == NULL)
     {
@@ -3083,10 +3089,10 @@ SPAN_DECLARE(t31_state_t *) t31_init(t31_state_t *s,
     if (tx_t38_packet_handler)
     {
         t31_t38_fe_init(s, tx_t38_packet_handler, tx_t38_packet_user_data);
-        t31_set_t38_config(s, FALSE);
+        t31_set_t38_config(s, false);
     }
     /*endif*/
-    s->t38_mode = FALSE;
+    s->t38_mode = false;
     return s;
 }
 /*- End of function --------------------------------------------------------*/
index 3e210854ab69ac6fc9084e09cc6189e9b81f7f0e..ce04a6ce230916e06361fcda38dc8a26d30f7731 100644 (file)
 #include <inttypes.h>
 #include <ctype.h>
 #include <string.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 
 #include "spandsp/telephony.h"
 #include "spandsp/bit_operations.h"
@@ -86,7 +91,7 @@ typedef struct
     int vendor_id_len;
     /*! The vendor's name */
     const char *vendor_name;
-    /*! TRUE if the station ID for this vendor is reversed */
+    /*! True if the station ID for this vendor is reversed */
     int inverse_station_id_order;
     /*! A pointer to a list of known models from this vendor */
     const model_data_t *known_models;
@@ -273,260 +278,260 @@ static const model_data_t Muratec48[] =
 static const nsf_data_t vendor_00[] =
 {
     /* Japan */
-    {"\x00\x00", 2, "Unknown - indeterminate", TRUE, NULL},
-    {"\x00\x01", 2, "Anritsu", FALSE, NULL},
-    {"\x00\x02", 2, "Nippon Telephone", FALSE, NULL},
-    {"\x00\x05", 2, "Mitsuba Electric", FALSE, NULL},
-    {"\x00\x06", 2, "Master Net", FALSE, NULL},
-    {"\x00\x09", 2, "Xerox/Toshiba", TRUE, Xerox},
-    {"\x00\x0A", 2, "Kokusai", FALSE, NULL},
-    {"\x00\x0D", 2, "Logic System International", FALSE, NULL},
-    {"\x00\x0E", 2, "Panasonic", FALSE, Panasonic0E},
-    {"\x00\x11", 2, "Canon", FALSE, Canon},
-    {"\x00\x15", 2, "Toyotsushen Machinery", FALSE, NULL},
-    {"\x00\x16", 2, "System House Mind", FALSE, NULL},
-    {"\x00\x19", 2, "Xerox", TRUE, NULL},
-    {"\x00\x1D", 2, "Hitachi Software", FALSE, NULL},
-    {"\x00\x21", 2, "OKI Electric/Lanier", TRUE, NULL},
-    {"\x00\x25", 2, "Ricoh", TRUE, Ricoh},
-    {"\x00\x26", 2, "Konica", FALSE, NULL},
-    {"\x00\x29", 2, "Japan Wireless", FALSE, NULL},
-    {"\x00\x2D", 2, "Sony", FALSE, NULL},
-    {"\x00\x31", 2, "Sharp/Olivetti", FALSE, Sharp},
-    {"\x00\x35", 2, "Kogyu", FALSE, NULL},
-    {"\x00\x36", 2, "Japan Telecom", FALSE, NULL},
-    {"\x00\x3D", 2, "IBM Japan", FALSE, NULL},
-    {"\x00\x39", 2, "Panasonic", FALSE, NULL},
-    {"\x00\x41", 2, "Swasaki Communication", FALSE, NULL},
-    {"\x00\x45", 2, "Muratec", FALSE, Muratec45},
-    {"\x00\x46", 2, "Pheonix", FALSE, NULL},
-    {"\x00\x48", 2, "Muratec", FALSE, Muratec48},           /* Not registered */
-    {"\x00\x49", 2, "Japan Electric", FALSE, NULL},
-    {"\x00\x4D", 2, "Okura Electric", FALSE, NULL},
-    {"\x00\x51", 2, "Sanyo", FALSE, Sanyo},
-    {"\x00\x55", 2, "Unknown - Japan 55", FALSE, NULL},
-    {"\x00\x56", 2, "Brother", FALSE, Brother},
-    {"\x00\x59", 2, "Fujitsu", FALSE, NULL},
-    {"\x00\x5D", 2, "Kuoni", FALSE, NULL},
-    {"\x00\x61", 2, "Casio", FALSE, NULL},
-    {"\x00\x65", 2, "Tateishi Electric", FALSE, NULL},
-    {"\x00\x66", 2, "Utax/Mita", TRUE, NULL},
-    {"\x00\x69", 2, "Hitachi Production", FALSE, NULL},
-    {"\x00\x6D", 2, "Hitachi Telecom", FALSE, NULL},
-    {"\x00\x71", 2, "Tamura Electric Works", FALSE, NULL},
-    {"\x00\x75", 2, "Tokyo Electric Corp.", FALSE, NULL},
-    {"\x00\x76", 2, "Advance", FALSE, NULL},
-    {"\x00\x79", 2, "Panasonic", FALSE, Panasonic79},
-    {"\x00\x7D", 2, "Seiko", FALSE, NULL},
-    {"\x08\x00", 2, "Daiko", FALSE, NULL},
-    {"\x10\x00", 2, "Funai Electric", FALSE, NULL},
-    {"\x20\x00", 2, "Eagle System", FALSE, NULL},
-    {"\x30\x00", 2, "Nippon Business Systems", FALSE, NULL},
-    {"\x40\x00", 2, "Comtron", FALSE, NULL},
-    {"\x48\x00", 2, "Cosmo Consulting", FALSE, NULL},
-    {"\x50\x00", 2, "Orion Electric", FALSE, NULL},
-    {"\x60\x00", 2, "Nagano Nippon", FALSE, NULL},
-    {"\x70\x00", 2, "Kyocera", FALSE, NULL},
-    {"\x80\x00", 2, "Kanda Networks", FALSE, NULL},
-    {"\x88\x00", 2, "Soft Front", FALSE, NULL},
-    {"\x90\x00", 2, "Arctic", FALSE, NULL},
-    {"\xA0\x00", 2, "Nakushima", FALSE, NULL},
-    {"\xB0\x00", 2, "Minolta", FALSE, NULL},
-    {"\xC0\x00", 2, "Tohoku Pioneer", FALSE, NULL},
-    {"\xD0\x00", 2, "USC", FALSE, NULL},
-    {"\xE0\x00", 2, "Hiboshi", FALSE, NULL},
-    {"\xF0\x00", 2, "Sumitomo Electric", FALSE, NULL},
-    {NULL, 0, NULL, FALSE, NULL}
+    {"\x00\x00", 2, "Unknown - indeterminate", true, NULL},
+    {"\x00\x01", 2, "Anritsu", false, NULL},
+    {"\x00\x02", 2, "Nippon Telephone", false, NULL},
+    {"\x00\x05", 2, "Mitsuba Electric", false, NULL},
+    {"\x00\x06", 2, "Master Net", false, NULL},
+    {"\x00\x09", 2, "Xerox/Toshiba", true, Xerox},
+    {"\x00\x0A", 2, "Kokusai", false, NULL},
+    {"\x00\x0D", 2, "Logic System International", false, NULL},
+    {"\x00\x0E", 2, "Panasonic", false, Panasonic0E},
+    {"\x00\x11", 2, "Canon", false, Canon},
+    {"\x00\x15", 2, "Toyotsushen Machinery", false, NULL},
+    {"\x00\x16", 2, "System House Mind", false, NULL},
+    {"\x00\x19", 2, "Xerox", true, NULL},
+    {"\x00\x1D", 2, "Hitachi Software", false, NULL},
+    {"\x00\x21", 2, "OKI Electric/Lanier", true, NULL},
+    {"\x00\x25", 2, "Ricoh", true, Ricoh},
+    {"\x00\x26", 2, "Konica", false, NULL},
+    {"\x00\x29", 2, "Japan Wireless", false, NULL},
+    {"\x00\x2D", 2, "Sony", false, NULL},
+    {"\x00\x31", 2, "Sharp/Olivetti", false, Sharp},
+    {"\x00\x35", 2, "Kogyu", false, NULL},
+    {"\x00\x36", 2, "Japan Telecom", false, NULL},
+    {"\x00\x3D", 2, "IBM Japan", false, NULL},
+    {"\x00\x39", 2, "Panasonic", false, NULL},
+    {"\x00\x41", 2, "Swasaki Communication", false, NULL},
+    {"\x00\x45", 2, "Muratec", false, Muratec45},
+    {"\x00\x46", 2, "Pheonix", false, NULL},
+    {"\x00\x48", 2, "Muratec", false, Muratec48},           /* Not registered */
+    {"\x00\x49", 2, "Japan Electric", false, NULL},
+    {"\x00\x4D", 2, "Okura Electric", false, NULL},
+    {"\x00\x51", 2, "Sanyo", false, Sanyo},
+    {"\x00\x55", 2, "Unknown - Japan 55", false, NULL},
+    {"\x00\x56", 2, "Brother", false, Brother},
+    {"\x00\x59", 2, "Fujitsu", false, NULL},
+    {"\x00\x5D", 2, "Kuoni", false, NULL},
+    {"\x00\x61", 2, "Casio", false, NULL},
+    {"\x00\x65", 2, "Tateishi Electric", false, NULL},
+    {"\x00\x66", 2, "Utax/Mita", true, NULL},
+    {"\x00\x69", 2, "Hitachi Production", false, NULL},
+    {"\x00\x6D", 2, "Hitachi Telecom", false, NULL},
+    {"\x00\x71", 2, "Tamura Electric Works", false, NULL},
+    {"\x00\x75", 2, "Tokyo Electric Corp.", false, NULL},
+    {"\x00\x76", 2, "Advance", false, NULL},
+    {"\x00\x79", 2, "Panasonic", false, Panasonic79},
+    {"\x00\x7D", 2, "Seiko", false, NULL},
+    {"\x08\x00", 2, "Daiko", false, NULL},
+    {"\x10\x00", 2, "Funai Electric", false, NULL},
+    {"\x20\x00", 2, "Eagle System", false, NULL},
+    {"\x30\x00", 2, "Nippon Business Systems", false, NULL},
+    {"\x40\x00", 2, "Comtron", false, NULL},
+    {"\x48\x00", 2, "Cosmo Consulting", false, NULL},
+    {"\x50\x00", 2, "Orion Electric", false, NULL},
+    {"\x60\x00", 2, "Nagano Nippon", false, NULL},
+    {"\x70\x00", 2, "Kyocera", false, NULL},
+    {"\x80\x00", 2, "Kanda Networks", false, NULL},
+    {"\x88\x00", 2, "Soft Front", false, NULL},
+    {"\x90\x00", 2, "Arctic", false, NULL},
+    {"\xA0\x00", 2, "Nakushima", false, NULL},
+    {"\xB0\x00", 2, "Minolta", false, NULL},
+    {"\xC0\x00", 2, "Tohoku Pioneer", false, NULL},
+    {"\xD0\x00", 2, "USC", false, NULL},
+    {"\xE0\x00", 2, "Hiboshi", false, NULL},
+    {"\xF0\x00", 2, "Sumitomo Electric", false, NULL},
+    {NULL, 0, NULL, false, NULL}
 };
 
 static const nsf_data_t vendor_20[] =
 {
     /* Germany */
-    {"\x09",     1, "ITK Institut für Telekommunikation GmbH & Co KG", FALSE, NULL},
-    {"\x11",     1, "Dr. Neuhaus Mikroelektronik", FALSE, NULL},
-    {"\x21",     1, "ITO Communication", FALSE, NULL},
-    {"\x31",     1, "mbp Kommunikationssysteme GmbH", FALSE, NULL},
-    {"\x41",     1, "Siemens", FALSE, NULL},
-    {"\x42",     1, "Deutsche Telekom AG", FALSE, NULL},
-    {"\x51",     1, "mps Software", FALSE, NULL},
-    {"\x61",     1, "Hauni Elektronik", FALSE, NULL},
-    {"\x71",     1, "Digitronic computersysteme gmbh", FALSE, NULL},
-    {"\x81\x00", 2, "Innovaphone GmbH", FALSE, NULL},
-    {"\x81\x40", 2, "TEDAS Gesellschaft für Telekommunikations-, Daten- und Audiosysteme mbH", FALSE, NULL},
-    {"\x81\x80", 2, "AVM Audiovisuelles Marketing und Computersysteme GmbH", FALSE, NULL},
-    {"\x81\xC0", 2, "EICON Technology Research GmbH", FALSE, NULL},
-    {"\xB1",     1, "Schneider Rundfunkwerke AG", FALSE, NULL},
-    {"\xC2",     1, "Deutsche Telekom AG", FALSE, NULL},
-    {"\xD1",     1, "Ferrari electronik GmbH", FALSE, NULL},
-    {"\xF1",     1, "DeTeWe - Deutsche Telephonwerke AG & Co", FALSE, NULL},
-    {"\xFF",     1, "Germany Regional Code", FALSE, NULL},
-    {NULL, 0, NULL, FALSE, NULL}
+    {"\x09",     1, "ITK Institut für Telekommunikation GmbH & Co KG", false, NULL},
+    {"\x11",     1, "Dr. Neuhaus Mikroelektronik", false, NULL},
+    {"\x21",     1, "ITO Communication", false, NULL},
+    {"\x31",     1, "mbp Kommunikationssysteme GmbH", false, NULL},
+    {"\x41",     1, "Siemens", false, NULL},
+    {"\x42",     1, "Deutsche Telekom AG", false, NULL},
+    {"\x51",     1, "mps Software", false, NULL},
+    {"\x61",     1, "Hauni Elektronik", false, NULL},
+    {"\x71",     1, "Digitronic computersysteme gmbh", false, NULL},
+    {"\x81\x00", 2, "Innovaphone GmbH", false, NULL},
+    {"\x81\x40", 2, "TEDAS Gesellschaft für Telekommunikations-, Daten- und Audiosysteme mbH", false, NULL},
+    {"\x81\x80", 2, "AVM Audiovisuelles Marketing und Computersysteme GmbH", false, NULL},
+    {"\x81\xC0", 2, "EICON Technology Research GmbH", false, NULL},
+    {"\xB1",     1, "Schneider Rundfunkwerke AG", false, NULL},
+    {"\xC2",     1, "Deutsche Telekom AG", false, NULL},
+    {"\xD1",     1, "Ferrari electronik GmbH", false, NULL},
+    {"\xF1",     1, "DeTeWe - Deutsche Telephonwerke AG & Co", false, NULL},
+    {"\xFF",     1, "Germany Regional Code", false, NULL},
+    {NULL, 0, NULL, false, NULL}
 };
 
 static const nsf_data_t vendor_64[] =
 {
     /* China (not Lebanon) */
-    {"\x00\x00", 2, "Unknown - China 00 00", FALSE, NULL},
-    {"\x01\x00", 2, "Unknown - China 01 00", FALSE, NULL},
-    {"\x01\x01", 2, "Unknown - China 01 01", FALSE, NULL},
-    {"\x01\x02", 2, "Unknown - China 01 02", FALSE, NULL},
-    {NULL, 0, NULL, FALSE, NULL}
+    {"\x00\x00", 2, "Unknown - China 00 00", false, NULL},
+    {"\x01\x00", 2, "Unknown - China 01 00", false, NULL},
+    {"\x01\x01", 2, "Unknown - China 01 01", false, NULL},
+    {"\x01\x02", 2, "Unknown - China 01 02", false, NULL},
+    {NULL, 0, NULL, false, NULL}
 };
 
 static const nsf_data_t vendor_61[] =
 {
     /* Korea */
-    {"\x00\x7A", 2, "Xerox", FALSE, NULL},
-    {NULL, 0, NULL, FALSE, NULL}
+    {"\x00\x7A", 2, "Xerox", false, NULL},
+    {NULL, 0, NULL, false, NULL}
 };
 
 static const nsf_data_t vendor_86[] =
 {
     /* Korea (not Papua New Guinea) */
-    {"\x00\x02", 2, "Unknown - Korea 02", FALSE, NULL},
-    {"\x00\x06", 2, "Unknown - Korea 06", FALSE, NULL},
-    {"\x00\x08", 2, "Unknown - Korea 08", FALSE, NULL},
-    {"\x00\x0A", 2, "Unknown - Korea 0A", FALSE, NULL},
-    {"\x00\x0E", 2, "Unknown - Korea 0E", FALSE, NULL},
-    {"\x00\x10", 2, "Samsung", FALSE, NULL},
-    {"\x00\x11", 2, "Unknown - Korea 11", FALSE, NULL},
-    {"\x00\x16", 2, "Samsung", FALSE, Samsung16},
-    {"\x00\x1A", 2, "Unknown - Korea 1A", FALSE, NULL},
-    {"\x00\x40", 2, "Unknown - Korea 40", FALSE, NULL},
-    {"\x00\x48", 2, "Unknown - Korea 48", FALSE, NULL},
-    {"\x00\x52", 2, "Unknown - Korea 52", FALSE, NULL},
-    {"\x00\x5A", 2, "Samsung", FALSE, Samsung5A},
-    {"\x00\x5E", 2, "Unknown - Korea 5E", FALSE, NULL},
-    {"\x00\x66", 2, "Unknown - Korea 66", FALSE, NULL},
-    {"\x00\x6E", 2, "Unknown - Korea 6E", FALSE, NULL},
-    {"\x00\x82", 2, "Unknown - Korea 82", FALSE, NULL},
-    {"\x00\x88", 2, "Unknown - Korea 88", FALSE, NULL},
-    {"\x00\x8A", 2, "Unknown - Korea 8A", FALSE, NULL},
-    {"\x00\x8C", 2, "Samsung", FALSE, Samsung8C},
-    {"\x00\x92", 2, "Unknown - Korea 92", FALSE, NULL},
-    {"\x00\x98", 2, "Samsung", FALSE, NULL},
-    {"\x00\xA2", 2, "Samsung", FALSE, SamsungA2},
-    {"\x00\xA4", 2, "Unknown - Korea A4", FALSE, NULL},
-    {"\x00\xC2", 2, "Samsung", FALSE, NULL},
-    {"\x00\xC9", 2, "Unknown - Korea C9", FALSE, NULL},
-    {"\x00\xCC", 2, "Unknown - Korea CC", FALSE, NULL},
-    {"\x00\xD2", 2, "Unknown - Korea D2", FALSE, NULL},
-    {"\x00\xDA", 2, "Xerox", FALSE, XeroxDA},
-    {"\x00\xE2", 2, "Unknown - Korea E2", FALSE, NULL},
-    {"\x00\xEC", 2, "Unknown - Korea EC", FALSE, NULL},
-    {"\x00\xEE", 2, "Unknown - Korea EE", FALSE, NULL},
-    {NULL, 0, NULL, FALSE, NULL}
+    {"\x00\x02", 2, "Unknown - Korea 02", false, NULL},
+    {"\x00\x06", 2, "Unknown - Korea 06", false, NULL},
+    {"\x00\x08", 2, "Unknown - Korea 08", false, NULL},
+    {"\x00\x0A", 2, "Unknown - Korea 0A", false, NULL},
+    {"\x00\x0E", 2, "Unknown - Korea 0E", false, NULL},
+    {"\x00\x10", 2, "Samsung", false, NULL},
+    {"\x00\x11", 2, "Unknown - Korea 11", false, NULL},
+    {"\x00\x16", 2, "Samsung", false, Samsung16},
+    {"\x00\x1A", 2, "Unknown - Korea 1A", false, NULL},
+    {"\x00\x40", 2, "Unknown - Korea 40", false, NULL},
+    {"\x00\x48", 2, "Unknown - Korea 48", false, NULL},
+    {"\x00\x52", 2, "Unknown - Korea 52", false, NULL},
+    {"\x00\x5A", 2, "Samsung", false, Samsung5A},
+    {"\x00\x5E", 2, "Unknown - Korea 5E", false, NULL},
+    {"\x00\x66", 2, "Unknown - Korea 66", false, NULL},
+    {"\x00\x6E", 2, "Unknown - Korea 6E", false, NULL},
+    {"\x00\x82", 2, "Unknown - Korea 82", false, NULL},
+    {"\x00\x88", 2, "Unknown - Korea 88", false, NULL},
+    {"\x00\x8A", 2, "Unknown - Korea 8A", false, NULL},
+    {"\x00\x8C", 2, "Samsung", false, Samsung8C},
+    {"\x00\x92", 2, "Unknown - Korea 92", false, NULL},
+    {"\x00\x98", 2, "Samsung", false, NULL},
+    {"\x00\xA2", 2, "Samsung", false, SamsungA2},
+    {"\x00\xA4", 2, "Unknown - Korea A4", false, NULL},
+    {"\x00\xC2", 2, "Samsung", false, NULL},
+    {"\x00\xC9", 2, "Unknown - Korea C9", false, NULL},
+    {"\x00\xCC", 2, "Unknown - Korea CC", false, NULL},
+    {"\x00\xD2", 2, "Unknown - Korea D2", false, NULL},
+    {"\x00\xDA", 2, "Xerox", false, XeroxDA},
+    {"\x00\xE2", 2, "Unknown - Korea E2", false, NULL},
+    {"\x00\xEC", 2, "Unknown - Korea EC", false, NULL},
+    {"\x00\xEE", 2, "Unknown - Korea EE", false, NULL},
+    {NULL, 0, NULL, false, NULL}
 };
 
 static const nsf_data_t vendor_bc[] =
 {
     /* France */
-    {"\x53\x01", 2, "Minolta", FALSE, NULL},
-    {NULL, 0, NULL, FALSE, NULL}
+    {"\x53\x01", 2, "Minolta", false, NULL},
+    {NULL, 0, NULL, false, NULL}
 };
 
 static const nsf_data_t vendor_ad[] =
 {
     /* United States (not Tunisia) */
-    {"\x00\x00", 2, "Pitney Bowes", FALSE, PitneyBowes},
-    {"\x00\x0C", 2, "Dialogic", FALSE, NULL},
-    {"\x00\x15", 2, "Lexmark", FALSE, Lexmark},
-    {"\x00\x16", 2, "JetFax", FALSE, JetFax},
-    {"\x00\x24", 2, "Octel", FALSE, NULL},
-    {"\x00\x36", 2, "HP", FALSE, HP},
-    {"\x00\x42", 2, "FaxTalk", FALSE, NULL},
-    {"\x00\x44", 2, NULL, TRUE, NULL},
-    {"\x00\x46", 2, "BrookTrout", FALSE, NULL},
-    {"\x00\x51", 2, "Telogy Networks", FALSE, NULL},
-    {"\x00\x55", 2, "HylaFAX", FALSE, NULL},
-    {"\x00\x5C", 2, "IBM", FALSE, NULL},
-    {"\x00\x98", 2, "Unknown - USA 98", TRUE, NULL},
-    {NULL, 0, NULL, FALSE, NULL}
+    {"\x00\x00", 2, "Pitney Bowes", false, PitneyBowes},
+    {"\x00\x0C", 2, "Dialogic", false, NULL},
+    {"\x00\x15", 2, "Lexmark", false, Lexmark},
+    {"\x00\x16", 2, "JetFax", false, JetFax},
+    {"\x00\x24", 2, "Octel", false, NULL},
+    {"\x00\x36", 2, "HP", false, HP},
+    {"\x00\x42", 2, "FaxTalk", false, NULL},
+    {"\x00\x44", 2, NULL, true, NULL},
+    {"\x00\x46", 2, "BrookTrout", false, NULL},
+    {"\x00\x51", 2, "Telogy Networks", false, NULL},
+    {"\x00\x55", 2, "HylaFAX", false, NULL},
+    {"\x00\x5C", 2, "IBM", false, NULL},
+    {"\x00\x98", 2, "Unknown - USA 98", true, NULL},
+    {NULL, 0, NULL, false, NULL}
 };
 
 static const nsf_data_t vendor_b4[] =
 {
     /* United Kingdom */
-    {"\x00\xB0", 2, "DCE", FALSE, NULL},
-    {"\x00\xB1", 2, "Hasler", FALSE, NULL},
-    {"\x00\xB2", 2, "Interquad", FALSE, NULL},
-    {"\x00\xB3", 2, "Comwave", FALSE, NULL},
-    {"\x00\xB4", 2, "Iconographic", FALSE, NULL},
-    {"\x00\xB5", 2, "Wordcraft", FALSE, NULL},
-    {"\x00\xB6", 2, "Acorn", FALSE, NULL},
-    {NULL, 0, NULL, FALSE, NULL}
+    {"\x00\xB0", 2, "DCE", false, NULL},
+    {"\x00\xB1", 2, "Hasler", false, NULL},
+    {"\x00\xB2", 2, "Interquad", false, NULL},
+    {"\x00\xB3", 2, "Comwave", false, NULL},
+    {"\x00\xB4", 2, "Iconographic", false, NULL},
+    {"\x00\xB5", 2, "Wordcraft", false, NULL},
+    {"\x00\xB6", 2, "Acorn", false, NULL},
+    {NULL, 0, NULL, false, NULL}
 };
 
 static const nsf_data_t vendor_b5[] =
 {
     /* United States */
-    {"\x00\x01", 2, "Picturetel", FALSE, NULL},
-    {"\x00\x20", 2, "Conexant", FALSE, NULL},
-    {"\x00\x22", 2, "Comsat", FALSE, NULL},
-    {"\x00\x24", 2, "Octel", FALSE, NULL},
-    {"\x00\x26", 2, "ROLM", FALSE, NULL},
-    {"\x00\x28", 2, "SOFNET", FALSE, NULL},
-    {"\x00\x29", 2, "TIA TR-29 Committee", FALSE, NULL},
-    {"\x00\x2A", 2, "STF Tech", FALSE, NULL},
-    {"\x00\x2C", 2, "HKB", FALSE, NULL},
-    {"\x00\x2E", 2, "Delrina", FALSE, NULL},
-    {"\x00\x30", 2, "Dialogic", FALSE, NULL},
-    {"\x00\x32", 2, "Applied Synergy", FALSE, NULL},
-    {"\x00\x34", 2, "Syncro Development", FALSE, NULL},
-    {"\x00\x36", 2, "Genoa", FALSE, NULL},
-    {"\x00\x38", 2, "Texas Instruments", FALSE, NULL},
-    {"\x00\x3A", 2, "IBM", FALSE, NULL},
-    {"\x00\x3C", 2, "ViaSat", FALSE, NULL},
-    {"\x00\x3E", 2, "Ericsson", FALSE, NULL},
-    {"\x00\x42", 2, "Bogosian", FALSE, NULL},
-    {"\x00\x44", 2, "Adobe", FALSE, NULL},
-    {"\x00\x46", 2, "Fremont Communications", FALSE, NULL},
-    {"\x00\x48", 2, "Hayes", FALSE, NULL},
-    {"\x00\x4A", 2, "Lucent", FALSE, NULL},
-    {"\x00\x4C", 2, "Data Race", FALSE, NULL},
-    {"\x00\x4E", 2, "TRW", FALSE, NULL},
-    {"\x00\x52", 2, "Audiofax", FALSE, NULL},
-    {"\x00\x54", 2, "Computer Automation", FALSE, NULL},
-    {"\x00\x56", 2, "Serca", FALSE, NULL},
-    {"\x00\x58", 2, "Octocom", FALSE, NULL},
-    {"\x00\x5C", 2, "Power Solutions", FALSE, NULL},
-    {"\x00\x5A", 2, "Digital Sound", FALSE, NULL},
-    {"\x00\x5E", 2, "Pacific Data", FALSE, NULL},
-    {"\x00\x60", 2, "Commetrex", FALSE, NULL},
-    {"\x00\x62", 2, "BrookTrout", FALSE, NULL},
-    {"\x00\x64", 2, "Gammalink", FALSE, NULL},
-    {"\x00\x66", 2, "Castelle", FALSE, NULL},
-    {"\x00\x68", 2, "Hybrid Fax", FALSE, NULL},
-    {"\x00\x6A", 2, "Omnifax", FALSE, NULL},
-    {"\x00\x6C", 2, "HP", FALSE, NULL},
-    {"\x00\x6E", 2, "Microsoft", FALSE, NULL},
-    {"\x00\x72", 2, "Speaking Devices", FALSE, NULL},
-    {"\x00\x74", 2, "Compaq", FALSE, NULL},
-    {"\x00\x76", 2, "Microsoft", FALSE, NULL},      /* uses LSB for country but MSB for manufacturer */
-    {"\x00\x78", 2, "Cylink", FALSE, NULL},
-    {"\x00\x7A", 2, "Pitney Bowes", FALSE, NULL},
-    {"\x00\x7C", 2, "Digiboard", FALSE, NULL},
-    {"\x00\x7E", 2, "Codex", FALSE, NULL},
-    {"\x00\x82", 2, "Wang Labs", FALSE, NULL},
-    {"\x00\x84", 2, "Netexpress Communications", FALSE, NULL},
-    {"\x00\x86", 2, "Cable-Sat", FALSE, NULL},
-    {"\x00\x88", 2, "MFPA", FALSE, NULL},
-    {"\x00\x8A", 2, "Telogy Networks", FALSE, NULL},
-    {"\x00\x8E", 2, "Telecom Multimedia Systems", FALSE, NULL},
-    {"\x00\x8C", 2, "AT&T", FALSE, NULL},
-    {"\x00\x92", 2, "Nuera", FALSE, NULL},
-    {"\x00\x94", 2, "K56flex", FALSE, NULL},
-    {"\x00\x96", 2, "MiBridge", FALSE, NULL},
-    {"\x00\x98", 2, "Xerox", FALSE, NULL},
-    {"\x00\x9A", 2, "Fujitsu", FALSE, NULL},
-    {"\x00\x9B", 2, "Fujitsu", FALSE, NULL},
-    {"\x00\x9C", 2, "Natural Microsystems", FALSE, NULL},
-    {"\x00\x9E", 2, "CopyTele", FALSE, NULL},
-    {"\x00\xA2", 2, "Murata", FALSE, NULL},
-    {"\x00\xA4", 2, "Lanier", FALSE, NULL},
-    {"\x00\xA6", 2, "Qualcomm", FALSE, NULL},
-    {"\x00\xAA", 2, "HylaFAX", FALSE, NULL},
-    {NULL, 0, NULL, FALSE, NULL}
+    {"\x00\x01", 2, "Picturetel", false, NULL},
+    {"\x00\x20", 2, "Conexant", false, NULL},
+    {"\x00\x22", 2, "Comsat", false, NULL},
+    {"\x00\x24", 2, "Octel", false, NULL},
+    {"\x00\x26", 2, "ROLM", false, NULL},
+    {"\x00\x28", 2, "SOFNET", false, NULL},
+    {"\x00\x29", 2, "TIA TR-29 Committee", false, NULL},
+    {"\x00\x2A", 2, "STF Tech", false, NULL},
+    {"\x00\x2C", 2, "HKB", false, NULL},
+    {"\x00\x2E", 2, "Delrina", false, NULL},
+    {"\x00\x30", 2, "Dialogic", false, NULL},
+    {"\x00\x32", 2, "Applied Synergy", false, NULL},
+    {"\x00\x34", 2, "Syncro Development", false, NULL},
+    {"\x00\x36", 2, "Genoa", false, NULL},
+    {"\x00\x38", 2, "Texas Instruments", false, NULL},
+    {"\x00\x3A", 2, "IBM", false, NULL},
+    {"\x00\x3C", 2, "ViaSat", false, NULL},
+    {"\x00\x3E", 2, "Ericsson", false, NULL},
+    {"\x00\x42", 2, "Bogosian", false, NULL},
+    {"\x00\x44", 2, "Adobe", false, NULL},
+    {"\x00\x46", 2, "Fremont Communications", false, NULL},
+    {"\x00\x48", 2, "Hayes", false, NULL},
+    {"\x00\x4A", 2, "Lucent", false, NULL},
+    {"\x00\x4C", 2, "Data Race", false, NULL},
+    {"\x00\x4E", 2, "TRW", false, NULL},
+    {"\x00\x52", 2, "Audiofax", false, NULL},
+    {"\x00\x54", 2, "Computer Automation", false, NULL},
+    {"\x00\x56", 2, "Serca", false, NULL},
+    {"\x00\x58", 2, "Octocom", false, NULL},
+    {"\x00\x5C", 2, "Power Solutions", false, NULL},
+    {"\x00\x5A", 2, "Digital Sound", false, NULL},
+    {"\x00\x5E", 2, "Pacific Data", false, NULL},
+    {"\x00\x60", 2, "Commetrex", false, NULL},
+    {"\x00\x62", 2, "BrookTrout", false, NULL},
+    {"\x00\x64", 2, "Gammalink", false, NULL},
+    {"\x00\x66", 2, "Castelle", false, NULL},
+    {"\x00\x68", 2, "Hybrid Fax", false, NULL},
+    {"\x00\x6A", 2, "Omnifax", false, NULL},
+    {"\x00\x6C", 2, "HP", false, NULL},
+    {"\x00\x6E", 2, "Microsoft", false, NULL},
+    {"\x00\x72", 2, "Speaking Devices", false, NULL},
+    {"\x00\x74", 2, "Compaq", false, NULL},
+    {"\x00\x76", 2, "Microsoft", false, NULL},      /* uses LSB for country but MSB for manufacturer */
+    {"\x00\x78", 2, "Cylink", false, NULL},
+    {"\x00\x7A", 2, "Pitney Bowes", false, NULL},
+    {"\x00\x7C", 2, "Digiboard", false, NULL},
+    {"\x00\x7E", 2, "Codex", false, NULL},
+    {"\x00\x82", 2, "Wang Labs", false, NULL},
+    {"\x00\x84", 2, "Netexpress Communications", false, NULL},
+    {"\x00\x86", 2, "Cable-Sat", false, NULL},
+    {"\x00\x88", 2, "MFPA", false, NULL},
+    {"\x00\x8A", 2, "Telogy Networks", false, NULL},
+    {"\x00\x8E", 2, "Telecom Multimedia Systems", false, NULL},
+    {"\x00\x8C", 2, "AT&T", false, NULL},
+    {"\x00\x92", 2, "Nuera", false, NULL},
+    {"\x00\x94", 2, "K56flex", false, NULL},
+    {"\x00\x96", 2, "MiBridge", false, NULL},
+    {"\x00\x98", 2, "Xerox", false, NULL},
+    {"\x00\x9A", 2, "Fujitsu", false, NULL},
+    {"\x00\x9B", 2, "Fujitsu", false, NULL},
+    {"\x00\x9C", 2, "Natural Microsystems", false, NULL},
+    {"\x00\x9E", 2, "CopyTele", false, NULL},
+    {"\x00\xA2", 2, "Murata", false, NULL},
+    {"\x00\xA4", 2, "Lanier", false, NULL},
+    {"\x00\xA6", 2, "Qualcomm", false, NULL},
+    {"\x00\xAA", 2, "HylaFAX", false, NULL},
+    {NULL, 0, NULL, false, NULL}
 };
 
 static const country_code_t t35_country_codes[255] =
@@ -904,7 +909,7 @@ SPAN_DECLARE(const char *) t35_vendor_to_str(const uint8_t *msg, int len)
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(int) t35_decode(const uint8_t *msg, int len, const char **country, const char **vendor, const char **model)
+SPAN_DECLARE(bool) t35_decode(const uint8_t *msg, int len, const char **country, const char **vendor, const char **model)
 {
     const nsf_data_t *p;
     const model_data_t *pp;
@@ -917,7 +922,7 @@ SPAN_DECLARE(int) t35_decode(const uint8_t *msg, int len, const char **country,
         *model = NULL;
 
     if ((p = find_vendor(msg, len)) == NULL)
-        return FALSE;
+        return false;
     if (vendor)
         *vendor = p->vendor_name;
     if (model  &&  p->known_models)
@@ -933,7 +938,7 @@ SPAN_DECLARE(int) t35_decode(const uint8_t *msg, int len, const char **country,
             }
         }
     }
-    return TRUE;
+    return true;
 }
 /*- End of function --------------------------------------------------------*/
 /*- End of file ------------------------------------------------------------*/
index 922e8a372a29e9688957a5b91fa27e46ab7a02b1..0bbbd18fb62cd02cc91c3a945a4486b520e66d82 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <assert.h>
 #include <memory.h>
@@ -456,7 +461,7 @@ SPAN_DECLARE_NONSTD(int) t38_core_rx_ifp_stream(t38_core_state_t *s, const uint8
         //printf("Count is %d\n", count);
         /* Do a dummy run through the fields to check we have a complete and uncorrupted packet. */
         prev_ptr = ptr;
-        other_half = FALSE;
+        other_half = false;
         t30_field_type = 0;
         for (i = 0;  i < (int) count;  i++)
         {
@@ -473,7 +478,7 @@ SPAN_DECLARE_NONSTD(int) t38_core_rx_ifp_stream(t38_core_state_t *s, const uint8
                     /* Decode field_type */
                     t30_field_type = buf[ptr] & 0x7;
                     ptr++;
-                    other_half = FALSE;
+                    other_half = false;
                 }
                 else
                 {
@@ -483,7 +488,7 @@ SPAN_DECLARE_NONSTD(int) t38_core_rx_ifp_stream(t38_core_state_t *s, const uint8
                     if (field_data_present)
                         ptr++;
                     else
-                        other_half = TRUE;
+                        other_half = true;
                 }
                 if (t30_field_type > T38_FIELD_T4_NON_ECM_SIG_END)
                 {
@@ -538,7 +543,7 @@ SPAN_DECLARE_NONSTD(int) t38_core_rx_ifp_stream(t38_core_state_t *s, const uint8
         /* Things look alright in the data, so lets run through the fields again, actually processing them.
            There is no need to do all the error checking along the way on this pass. */
         ptr = prev_ptr;
-        other_half = FALSE;
+        other_half = false;
         for (i = 0;  i < (int) count;  i++)
         {
             if (s->t38_version == 0)
@@ -552,7 +557,7 @@ SPAN_DECLARE_NONSTD(int) t38_core_rx_ifp_stream(t38_core_state_t *s, const uint8
                     /* Decode field_type */
                     t30_field_type = buf[ptr] & 0x7;
                     ptr++;
-                    other_half = FALSE;
+                    other_half = false;
                 }
                 else
                 {
@@ -562,7 +567,7 @@ SPAN_DECLARE_NONSTD(int) t38_core_rx_ifp_stream(t38_core_state_t *s, const uint8
                     if (field_data_present)
                         ptr++;
                     else
-                        other_half = TRUE;
+                        other_half = true;
                 }
             }
             else
@@ -1002,19 +1007,19 @@ SPAN_DECLARE(void) t38_set_data_transport_protocol(t38_core_state_t *s, int data
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(void) t38_set_fill_bit_removal(t38_core_state_t *s, int fill_bit_removal)
+SPAN_DECLARE(void) t38_set_fill_bit_removal(t38_core_state_t *s, bool fill_bit_removal)
 {
     s->fill_bit_removal = fill_bit_removal;
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(void) t38_set_mmr_transcoding(t38_core_state_t *s, int mmr_transcoding)
+SPAN_DECLARE(void) t38_set_mmr_transcoding(t38_core_state_t *s, bool mmr_transcoding)
 {
     s->mmr_transcoding = mmr_transcoding;
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(void) t38_set_jbig_transcoding(t38_core_state_t *s, int jbig_transcoding)
+SPAN_DECLARE(void) t38_set_jbig_transcoding(t38_core_state_t *s, bool jbig_transcoding)
 {
     s->jbig_transcoding = jbig_transcoding;
 }
@@ -1038,7 +1043,7 @@ SPAN_DECLARE(void) t38_set_t38_version(t38_core_state_t *s, int t38_version)
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(void) t38_set_sequence_number_handling(t38_core_state_t *s, int check)
+SPAN_DECLARE(void) t38_set_sequence_number_handling(t38_core_state_t *s, bool check)
 {
     s->check_sequence_numbers = check;
 }
@@ -1050,7 +1055,7 @@ SPAN_DECLARE(void) t38_set_pace_transmission(t38_core_state_t *s, int pace_trans
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(void) t38_set_tep_handling(t38_core_state_t *s, int allow_for_tep)
+SPAN_DECLARE(void) t38_set_tep_handling(t38_core_state_t *s, bool allow_for_tep)
 {
     s->allow_for_tep = allow_for_tep;
 }
@@ -1121,14 +1126,14 @@ SPAN_DECLARE(t38_core_state_t *) t38_core_init(t38_core_state_t *s,
        T.38 domain - e.g. from SDP data. */
     s->data_rate_management_method = T38_DATA_RATE_MANAGEMENT_TRANSFERRED_TCF;
     s->data_transport_protocol = T38_TRANSPORT_UDPTL;
-    s->fill_bit_removal = FALSE;
-    s->mmr_transcoding = FALSE;
-    s->jbig_transcoding = FALSE;
+    s->fill_bit_removal = false;
+    s->mmr_transcoding = false;
+    s->jbig_transcoding = false;
     s->max_buffer_size = 400;
     s->max_datagram_size = 100;
     s->t38_version = 0;
-    s->check_sequence_numbers = TRUE;
-    s->pace_transmission = TRUE;
+    s->check_sequence_numbers = true;
+    s->pace_transmission = true;
 
     /* Set some defaults */
     s->category_control[T38_PACKET_CATEGORY_INDICATOR] = 1;
index 7078a37908a5e113c9cdc5618b6dc4d193e3a7aa..78346e3ecfe1191b1f6e9490be0f416b1f10256a 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <assert.h>
 #if defined(LOG_FAX_AUDIO)
 
 #include "spandsp/private/logging.h"
 #include "spandsp/private/silence_gen.h"
+#include "spandsp/private/power_meter.h"
 #include "spandsp/private/fsk.h"
 #include "spandsp/private/v17tx.h"
 #include "spandsp/private/v17rx.h"
@@ -271,22 +277,22 @@ static int set_next_tx_type(t38_gateway_state_t *s)
             ||
             t->tx_handler == (span_tx_handler_t) &tone_gen)
         {
-            fax_modems_set_rx_active(t, TRUE);
+            fax_modems_set_rx_active(t, true);
         }
         else
         {
-            fax_modems_set_rx_active(t, FALSE);
+            fax_modems_set_rx_active(t, false);
         }
         /*endif*/
-        return TRUE;
+        return true;
     }
     /*endif*/
     u = &s->core.hdlc_to_modem;
     if (u->in == u->out)
-        return FALSE;
+        return false;
     /*endif*/
     if ((u->buf[u->out].contents & FLAG_INDICATOR) == 0)
-        return FALSE;
+        return false;
     /*endif*/
     indicator = (u->buf[u->out].contents & 0xFF);
     u->buf[u->out].len = 0;
@@ -299,15 +305,15 @@ static int set_next_tx_type(t38_gateway_state_t *s)
     if (s->core.image_data_mode  &&  s->core.ecm_mode)
     {
         span_log(&s->logging, SPAN_LOG_FLOW, "HDLC mode\n");
-        hdlc_tx_init(&t->hdlc_tx, FALSE, 2, TRUE, hdlc_underflow_handler, s);
+        hdlc_tx_init(&t->hdlc_tx, false, 2, true, hdlc_underflow_handler, s);
         fax_modems_set_get_bit(t, (get_bit_func_t) hdlc_tx_get_bit, &t->hdlc_tx);
-        use_hdlc = TRUE;
+        use_hdlc = true;
     }
     else
     {
         span_log(&s->logging, SPAN_LOG_FLOW, "Non-ECM mode\n");
         fax_modems_set_get_bit(t, (get_bit_func_t) t38_non_ecm_buffer_get_bit, &s->core.non_ecm_to_modem);
-        use_hdlc = FALSE;
+        use_hdlc = false;
     }
     /*endif*/
     switch (indicator)
@@ -318,31 +324,31 @@ static int set_next_tx_type(t38_gateway_state_t *s)
         //silence_gen_set(&t->silence_gen, ms_to_samples(75));
         fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
         fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
-        fax_modems_set_rx_active(t, TRUE);
+        fax_modems_set_rx_active(t, true);
         break;
     case T38_IND_CNG:
         t->tx_bit_rate = 0;
         fax_modems_start_slow_modem(t, FAX_MODEM_CNG_TONE_TX);
         silence_gen_set(&t->silence_gen, 0);
         fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
-        fax_modems_set_rx_active(t, TRUE);
+        fax_modems_set_rx_active(t, true);
         break;
     case T38_IND_CED:
         t->tx_bit_rate = 0;
         fax_modems_start_slow_modem(t, FAX_MODEM_CED_TONE_TX);
         fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
-        fax_modems_set_rx_active(t, TRUE);
+        fax_modems_set_rx_active(t, true);
         break;
     case T38_IND_V21_PREAMBLE:
         t->tx_bit_rate = 300;
-        hdlc_tx_init(&t->hdlc_tx, FALSE, 2, TRUE, hdlc_underflow_handler, s);
+        hdlc_tx_init(&t->hdlc_tx, false, 2, true, hdlc_underflow_handler, s);
         hdlc_tx_flags(&t->hdlc_tx, 32);
         silence_gen_alter(&t->silence_gen, ms_to_samples(75));
         u->buf[u->in].len = 0;
         fax_modems_start_slow_modem(t, FAX_MODEM_V21_TX);
         fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
         fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &fsk_tx, &t->v21_tx);
-        fax_modems_set_rx_active(t, TRUE);
+        fax_modems_set_rx_active(t, true);
         break;
     case T38_IND_V27TER_2400_TRAINING:
     case T38_IND_V27TER_4800_TRAINING:
@@ -352,7 +358,7 @@ static int set_next_tx_type(t38_gateway_state_t *s)
         fax_modems_start_fast_modem(t, FAX_MODEM_V27TER_TX, bit_rate, s->core.short_train, use_hdlc);
         fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
         fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &v27ter_tx, &t->fast_modems.v27ter_tx);
-        fax_modems_set_rx_active(t, TRUE);
+        fax_modems_set_rx_active(t, true);
         break;
     case T38_IND_V29_7200_TRAINING:
     case T38_IND_V29_9600_TRAINING:
@@ -362,7 +368,7 @@ static int set_next_tx_type(t38_gateway_state_t *s)
         fax_modems_start_fast_modem(t, FAX_MODEM_V29_TX, bit_rate, s->core.short_train, use_hdlc);
         fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
         fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &v29_tx, &t->fast_modems.v29_tx);
-        fax_modems_set_rx_active(t, TRUE);
+        fax_modems_set_rx_active(t, true);
         break;
     case T38_IND_V17_7200_SHORT_TRAINING:
     case T38_IND_V17_7200_LONG_TRAINING:
@@ -372,32 +378,32 @@ static int set_next_tx_type(t38_gateway_state_t *s)
     case T38_IND_V17_12000_LONG_TRAINING:
     case T38_IND_V17_14400_SHORT_TRAINING:
     case T38_IND_V17_14400_LONG_TRAINING:
-        short_train = FALSE;
+        short_train = false;
         switch (indicator)
         {
         case T38_IND_V17_7200_SHORT_TRAINING:
-            short_train = TRUE;
+            short_train = true;
             bit_rate = 7200;
             break;
         case T38_IND_V17_7200_LONG_TRAINING:
             bit_rate = 7200;
             break;
         case T38_IND_V17_9600_SHORT_TRAINING:
-            short_train = TRUE;
+            short_train = true;
             bit_rate = 9600;
             break;
         case T38_IND_V17_9600_LONG_TRAINING:
             bit_rate = 9600;
             break;
         case T38_IND_V17_12000_SHORT_TRAINING:
-            short_train = TRUE;
+            short_train = true;
             bit_rate = 12000;
             break;
         case T38_IND_V17_12000_LONG_TRAINING:
             bit_rate = 12000;
             break;
         case T38_IND_V17_14400_SHORT_TRAINING:
-            short_train = TRUE;
+            short_train = true;
             bit_rate = 14400;
             break;
         case T38_IND_V17_14400_LONG_TRAINING:
@@ -410,7 +416,7 @@ static int set_next_tx_type(t38_gateway_state_t *s)
         fax_modems_start_fast_modem(t, FAX_MODEM_V17_TX, bit_rate, short_train, use_hdlc);
         fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
         fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &v17_tx, &t->fast_modems.v17_tx);
-        fax_modems_set_rx_active(t, TRUE);
+        fax_modems_set_rx_active(t, true);
         break;
     case T38_IND_V8_ANSAM:
         t->tx_bit_rate = 300;
@@ -442,7 +448,7 @@ static int set_next_tx_type(t38_gateway_state_t *s)
         hdlc_tx_flags(&t->hdlc_tx, t->tx_bit_rate/(8*5));
     /*endif*/
     s->t38x.in_progress_rx_indicator = indicator;
-    return TRUE;
+    return true;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -510,7 +516,7 @@ static void edit_control_messages(t38_gateway_state_t *s, int from_modem, uint8_
                    processed, 2 machines which recognise each other might do special things
                    we cannot handle as a middle man. */
                 span_log(&s->logging, SPAN_LOG_FLOW, "Corrupting %s message to prevent recognition\n", t30_frametype(buf[2]));
-                s->t38x.corrupt_current_frame[from_modem] = TRUE;
+                s->t38x.corrupt_current_frame[from_modem] = true;
             }
             /*endif*/
             break;
@@ -645,8 +651,8 @@ static void monitor_control_messages(t38_gateway_state_t *s,
     case T30_CFR:
         /* We are changing from TCF exchange to image exchange */
         /* Successful training means we should change to short training */
-        s->core.image_data_mode = TRUE;
-        s->core.short_train = TRUE;
+        s->core.image_data_mode = true;
+        s->core.short_train = true;
         span_log(&s->logging, SPAN_LOG_FLOW, "CFR - short train = %d, ECM = %d\n", s->core.short_train, s->core.ecm_mode);
         if (!from_modem)
             restart_rx_modem(s);
@@ -655,14 +661,14 @@ static void monitor_control_messages(t38_gateway_state_t *s,
     case T30_RTN:
     case T30_RTP:
         /* We are going back to the exchange of fresh TCF */
-        s->core.image_data_mode = FALSE;
-        s->core.short_train = FALSE;
+        s->core.image_data_mode = false;
+        s->core.short_train = false;
         break;
     case T30_CTR:
         /* T.30 says the first image data after this does full training, yet does not
            return to TCF. This seems to be the sole case of long training for image
            data. */
-        s->core.short_train = FALSE;
+        s->core.short_train = false;
         break;
     case T30_DTC:
     case T30_DCS:
@@ -671,8 +677,8 @@ static void monitor_control_messages(t38_gateway_state_t *s,
            correct modem. */
         s->core.fast_bit_rate = 0;
         s->core.fast_rx_modem = FAX_MODEM_NONE;
-        s->core.image_data_mode = FALSE;
-        s->core.short_train = FALSE;
+        s->core.image_data_mode = false;
+        s->core.short_train = false;
         if (from_modem)
             s->core.timed_mode = TIMED_MODE_TCF_PREDICTABLE_MODEM_START_BEGIN;
         /*endif*/
@@ -722,13 +728,13 @@ static void monitor_control_messages(t38_gateway_state_t *s,
                the fast modem again, so abandon our idea of it. */
             s->core.fast_bit_rate = 0;
             s->core.fast_rx_modem = FAX_MODEM_NONE;
-            s->core.image_data_mode = FALSE;
-            s->core.short_train = FALSE;
+            s->core.image_data_mode = false;
+            s->core.short_train = false;
 #endif
             /* Fall through */
         case T30_MPS:
         case T30_PRI_MPS:
-            s->core.count_page_on_mcf = TRUE;
+            s->core.count_page_on_mcf = true;
             break;
         }
         /*endswitch*/
@@ -748,15 +754,15 @@ static void monitor_control_messages(t38_gateway_state_t *s,
            the fast modem again, so abandon our idea of it. */
         s->core.fast_bit_rate = 0;
         s->core.fast_rx_modem = FAX_MODEM_NONE;
-        s->core.image_data_mode = FALSE;
-        s->core.short_train = FALSE;
+        s->core.image_data_mode = false;
+        s->core.short_train = false;
 #endif
         /* Fall through */
     case T30_MPS:
     case T30_MPS | 1:
     case T30_PRI_MPS:
     case T30_PRI_MPS | 1:
-        s->core.count_page_on_mcf = TRUE;
+        s->core.count_page_on_mcf = true;
         break;
     case T30_MCF:
     case T30_MCF | 1:
@@ -764,7 +770,7 @@ static void monitor_control_messages(t38_gateway_state_t *s,
         {
             s->core.pages_confirmed++;
             span_log(&s->logging, SPAN_LOG_FLOW, "Pages confirmed = %d\n", s->core.pages_confirmed);
-            s->core.count_page_on_mcf = FALSE;
+            s->core.count_page_on_mcf = false;
         }
         /*endif*/
         break;
@@ -1094,9 +1100,9 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
             {
                 if ((hdlc_buf->flags & HDLC_FLAG_MISSING_DATA) == 0)
                 {
-                    monitor_control_messages(s, FALSE, hdlc_buf->buf, hdlc_buf->len);
+                    monitor_control_messages(s, false, hdlc_buf->buf, hdlc_buf->len);
                     if (s->core.real_time_frame_handler)
-                        s->core.real_time_frame_handler(s, s->core.real_time_frame_user_data, FALSE, hdlc_buf->buf, hdlc_buf->len);
+                        s->core.real_time_frame_handler(s, s->core.real_time_frame_user_data, false, hdlc_buf->buf, hdlc_buf->len);
                     /*endif*/
                 }
                 /*endif*/
@@ -1107,11 +1113,11 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
                    long training. There has to be more than one value HDLC frame in a
                    chunk of image data, so just setting short training mode here should
                    be enough. */
-                s->core.short_train = TRUE;
+                s->core.short_train = true;
             }
             /*endif*/
             hdlc_buf->contents = (data_type | FLAG_DATA);
-            finalise_hdlc_frame(s, TRUE);
+            finalise_hdlc_frame(s, true);
         }
         else
         {
@@ -1119,7 +1125,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
             hdlc_buf->contents = 0;
         }
         /*endif*/
-        xx->corrupt_current_frame[0] = FALSE;
+        xx->corrupt_current_frame[0] = false;
         break;
     case T38_FIELD_HDLC_FCS_BAD:
         xx->current_rx_field_class = T38_FIELD_CLASS_HDLC;
@@ -1145,7 +1151,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
             }
             /*endif*/
             hdlc_buf->contents = (data_type | FLAG_DATA);
-            finalise_hdlc_frame(s, FALSE);
+            finalise_hdlc_frame(s, false);
         }
         else
         {
@@ -1153,7 +1159,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
             hdlc_buf->contents = 0;
         }
         /*endif*/
-        xx->corrupt_current_frame[0] = FALSE;
+        xx->corrupt_current_frame[0] = false;
         break;
     case T38_FIELD_HDLC_FCS_OK_SIG_END:
         xx->current_rx_field_class = T38_FIELD_CLASS_HDLC;
@@ -1182,9 +1188,9 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
             {
                 if ((hdlc_buf->flags & HDLC_FLAG_MISSING_DATA) == 0)
                 {
-                    monitor_control_messages(s, FALSE, hdlc_buf->buf, hdlc_buf->len);
+                    monitor_control_messages(s, false, hdlc_buf->buf, hdlc_buf->len);
                     if (s->core.real_time_frame_handler)
-                        s->core.real_time_frame_handler(s, s->core.real_time_frame_user_data, FALSE, hdlc_buf->buf, hdlc_buf->len);
+                        s->core.real_time_frame_handler(s, s->core.real_time_frame_user_data, false, hdlc_buf->buf, hdlc_buf->len);
                     /*endif*/
                 }
                 /*endif*/
@@ -1195,11 +1201,11 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
                    long training. There has to be more than one value HDLC frame in a
                    chunk of image data, so just setting short training mode here should
                    be enough. */
-                s->core.short_train = TRUE;
+                s->core.short_train = true;
             }
             /*endif*/
             hdlc_buf->contents = (data_type | FLAG_DATA);
-            finalise_hdlc_frame(s, TRUE);
+            finalise_hdlc_frame(s, true);
         }
         else
         {
@@ -1213,7 +1219,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
             xx->current_rx_field_class = T38_FIELD_CLASS_NONE;
         }
         /*endif*/
-        xx->corrupt_current_frame[0] = FALSE;
+        xx->corrupt_current_frame[0] = false;
         break;
     case T38_FIELD_HDLC_FCS_BAD_SIG_END:
         xx->current_rx_field_class = T38_FIELD_CLASS_HDLC;
@@ -1239,7 +1245,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
             }
             /*endif*/
             hdlc_buf->contents = (data_type | FLAG_DATA);
-            finalise_hdlc_frame(s, FALSE);
+            finalise_hdlc_frame(s, false);
         }
         else
         {
@@ -1253,7 +1259,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
             xx->current_rx_field_class = T38_FIELD_CLASS_NONE;
         }
         /*endif*/
-        xx->corrupt_current_frame[0] = FALSE;
+        xx->corrupt_current_frame[0] = false;
         break;
     case T38_FIELD_HDLC_SIG_END:
         hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in];
@@ -1299,7 +1305,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
             xx->current_rx_field_class = T38_FIELD_CLASS_NONE;
         }
         /*endif*/
-        xx->corrupt_current_frame[0] = FALSE;
+        xx->corrupt_current_frame[0] = false;
         break;
     case T38_FIELD_T4_NON_ECM_DATA:
         if (xx->current_rx_field_class == T38_FIELD_CLASS_NONE)
@@ -1315,7 +1321,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
         if (len > 0)
             t38_non_ecm_buffer_inject(&s->core.non_ecm_to_modem, buf, len);
         /*endif*/
-        xx->corrupt_current_frame[0] = FALSE;
+        xx->corrupt_current_frame[0] = false;
         break;
     case T38_FIELD_T4_NON_ECM_SIG_END:
         if (xx->current_rx_field_class == T38_FIELD_CLASS_NONE)
@@ -1370,7 +1376,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
             xx->current_rx_field_class = T38_FIELD_CLASS_NONE;
         }
         /*endif*/
-        xx->corrupt_current_frame[0] = FALSE;
+        xx->corrupt_current_frame[0] = false;
         break;
     default:
         break;
@@ -1521,11 +1527,11 @@ static void non_ecm_rx_status(void *user_data, int status)
         break;
     case SIG_STATUS_TRAINING_SUCCEEDED:
         /* The modem is now trained */
-        s->audio.modems.rx_signal_present = TRUE;
-        s->audio.modems.rx_trained = TRUE;
+        s->audio.modems.rx_signal_present = true;
+        s->audio.modems.rx_trained = true;
         s->core.timed_mode = TIMED_MODE_IDLE;
         s->core.samples_to_timeout = 0;
-        s->core.short_train = TRUE;
+        s->core.short_train = true;
         to_t38_buffer_init(&s->core.to_t38);
         break;
     case SIG_STATUS_CARRIER_UP:
@@ -1701,11 +1707,11 @@ static void hdlc_rx_status(hdlc_rx_state_t *t, int status)
         break;
     case SIG_STATUS_TRAINING_SUCCEEDED:
         /* The modem is now trained. */
-        s->audio.modems.rx_signal_present = TRUE;
-        s->audio.modems.rx_trained = TRUE;
-        s->core.short_train = TRUE;
+        s->audio.modems.rx_signal_present = true;
+        s->audio.modems.rx_trained = true;
+        s->core.short_train = true;
         /* Behave like HDLC preamble has been announced. */
-        t->framing_ok_announced = TRUE;
+        t->framing_ok_announced = true;
         to_t38_buffer_init(&s->core.to_t38);
         break;
     case SIG_STATUS_CARRIER_UP:
@@ -1714,7 +1720,7 @@ static void hdlc_rx_status(hdlc_rx_state_t *t, int status)
         t->len = 0;
         t->num_bits = 0;
         t->flags_seen = 0;
-        t->framing_ok_announced = FALSE;
+        t->framing_ok_announced = false;
         to_t38_buffer_init(&s->core.to_t38);
         break;
     case SIG_STATUS_CARRIER_DOWN:
@@ -1723,7 +1729,7 @@ static void hdlc_rx_status(hdlc_rx_state_t *t, int status)
             category = (s->t38x.current_tx_data_type == T38_DATA_V21)  ?  T38_PACKET_CATEGORY_CONTROL_DATA_END  :  T38_PACKET_CATEGORY_IMAGE_DATA_END;
             t38_core_send_data(&s->t38x.t38, s->t38x.current_tx_data_type, T38_FIELD_HDLC_SIG_END, NULL, 0, category);
             t38_core_send_indicator(&s->t38x.t38, T38_IND_NO_SIGNAL);
-            t->framing_ok_announced = FALSE;
+            t->framing_ok_announced = false;
         }
         /*endif*/
         restart_rx_modem(s);
@@ -1809,9 +1815,9 @@ static void rx_flag_or_abort(hdlc_rx_state_t *t)
                         span_log(&s->logging, SPAN_LOG_FLOW, "HDLC frame type %s, CRC OK\n", t30_frametype(t->buffer[2]));
                         if (s->t38x.current_tx_data_type == T38_DATA_V21)
                         {
-                            monitor_control_messages(s, TRUE, t->buffer, t->len - 2);
+                            monitor_control_messages(s, true, t->buffer, t->len - 2);
                             if (s->core.real_time_frame_handler)
-                                s->core.real_time_frame_handler(s, s->core.real_time_frame_user_data, TRUE, t->buffer, t->len - 2);
+                                s->core.real_time_frame_handler(s, s->core.real_time_frame_user_data, true, t->buffer, t->len - 2);
                             /*endif*/
                         }
                         else
@@ -1819,7 +1825,7 @@ static void rx_flag_or_abort(hdlc_rx_state_t *t)
                             /* Make sure we go back to short training if CTC/CTR has kicked us into
                                long training. Any successful HDLC frame received at a rate other than
                                V.21 is an adequate indication we should change. */
-                            s->core.short_train = TRUE;
+                            s->core.short_train = true;
                         }
                         /*endif*/
                         /* It seems some boxes may not like us sending a _SIG_END here, and then another
@@ -1850,13 +1856,13 @@ static void rx_flag_or_abort(hdlc_rx_state_t *t)
                 if (s->t38x.current_tx_data_type == T38_DATA_V21)
                 {
                     t38_core_send_indicator(&s->t38x.t38, set_slow_packetisation(s));
-                    s->audio.modems.rx_signal_present = TRUE;
+                    s->audio.modems.rx_signal_present = true;
                 }
                 /*endif*/
                 if (s->t38x.in_progress_rx_indicator == T38_IND_CNG)
                     set_next_tx_type(s);
                 /*endif*/
-                t->framing_ok_announced = TRUE;
+                t->framing_ok_announced = true;
             }
             /*endif*/
         }
@@ -1867,7 +1873,7 @@ static void rx_flag_or_abort(hdlc_rx_state_t *t)
     t->num_bits = 0;
     u->crc = 0xFFFF;
     u->data_ptr = 0;
-    s->t38x.corrupt_current_frame[1] = FALSE;
+    s->t38x.corrupt_current_frame[1] = false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -1962,9 +1968,9 @@ static int restart_rx_modem(t38_gateway_state_t *s)
              s->core.ecm_mode);
 
     t = &s->audio.modems;
-    hdlc_rx_init(&t->hdlc_rx, FALSE, TRUE, HDLC_FRAMING_OK_THRESHOLD, NULL, s);
-    t->rx_signal_present = FALSE;
-    t->rx_trained = FALSE;
+    hdlc_rx_init(&t->hdlc_rx, false, true, HDLC_FRAMING_OK_THRESHOLD, NULL, s);
+    t->rx_signal_present = false;
+    t->rx_trained = false;
     /* Default to the transmit data being V.21, unless a faster modem pops up trained. */
     s->t38x.current_tx_data_type = T38_DATA_V21;
     //fax_modems_start_slow_modem(t, FAX_MODEM_V21_RX);
@@ -1987,13 +1993,13 @@ static int restart_rx_modem(t38_gateway_state_t *s)
     /*endif*/
     to_t38_buffer_init(&s->core.to_t38);
     s->core.to_t38.octets_per_data_packet = 1;
-    t->deferred_rx_handler_updates = TRUE;
+    t->deferred_rx_handler_updates = true;
     switch (s->core.fast_rx_modem)
     {
     case FAX_MODEM_V27TER_RX:
     case FAX_MODEM_V29_RX:
     case FAX_MODEM_V17_RX:
-        fax_modems_start_fast_modem(t, s->core.fast_rx_modem, s->core.fast_bit_rate, s->core.short_train, FALSE);
+        fax_modems_start_fast_modem(t, s->core.fast_rx_modem, s->core.fast_bit_rate, s->core.short_train, false);
         s->core.fast_rx_active = s->core.fast_rx_modem;
         break;
     case FAX_MODEM_V21_RX:
@@ -2158,13 +2164,13 @@ SPAN_DECLARE(logging_state_t *) t38_gateway_get_logging_state(t38_gateway_state_
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(void) t38_gateway_set_ecm_capability(t38_gateway_state_t *s, int ecm_allowed)
+SPAN_DECLARE(void) t38_gateway_set_ecm_capability(t38_gateway_state_t *s, bool ecm_allowed)
 {
     s->core.ecm_allowed = ecm_allowed;
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(void) t38_gateway_set_transmit_on_idle(t38_gateway_state_t *s, int transmit_on_idle)
+SPAN_DECLARE(void) t38_gateway_set_transmit_on_idle(t38_gateway_state_t *s, bool transmit_on_idle)
 {
     s->audio.modems.transmit_on_idle = transmit_on_idle;
 }
@@ -2194,13 +2200,13 @@ SPAN_DECLARE(void) t38_gateway_set_nsx_suppression(t38_gateway_state_t *s,
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(void) t38_gateway_set_tep_mode(t38_gateway_state_t *s, int use_tep)
+SPAN_DECLARE(void) t38_gateway_set_tep_mode(t38_gateway_state_t *s, bool use_tep)
 {
     fax_modems_set_tep_mode(&s->audio.modems, use_tep);
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(void) t38_gateway_set_fill_bit_removal(t38_gateway_state_t *s, int remove)
+SPAN_DECLARE(void) t38_gateway_set_fill_bit_removal(t38_gateway_state_t *s, bool remove)
 {
     s->core.to_t38.fill_bit_removal = remove;
 }
@@ -2218,7 +2224,7 @@ SPAN_DECLARE(void) t38_gateway_set_real_time_frame_handler(t38_gateway_state_t *
 static int t38_gateway_audio_init(t38_gateway_state_t *s)
 {
     fax_modems_init(&s->audio.modems,
-                    FALSE,
+                    false,
                     NULL,
                     hdlc_underflow_handler,
                     non_ecm_put_bit,
@@ -2227,7 +2233,7 @@ static int t38_gateway_audio_init(t38_gateway_state_t *s)
                     s);
     /* We need to use progressive HDLC transmit, and a special HDLC receiver, which is different
        from the other uses of FAX modems. */
-    hdlc_tx_init(&s->audio.modems.hdlc_tx, FALSE, 2, TRUE, hdlc_underflow_handler, s);
+    hdlc_tx_init(&s->audio.modems.hdlc_tx, false, 2, true, hdlc_underflow_handler, s);
     fsk_rx_set_put_bit(&s->audio.modems.v21_rx, (put_bit_func_t) t38_hdlc_rx_put_bit, &s->audio.modems.hdlc_rx);
     /* TODO: Don't use the very low cutoff levels we would like to. We get some quirks if we do.
        We need to sort this out. */
@@ -2280,14 +2286,14 @@ SPAN_DECLARE(t38_gateway_state_t *) t38_gateway_init(t38_gateway_state_t *s,
     t38_gateway_audio_init(s);
     t38_gateway_t38_init(s, tx_packet_handler, tx_packet_user_data);
 
-    fax_modems_set_rx_active(&s->audio.modems, TRUE);
+    fax_modems_set_rx_active(&s->audio.modems, true);
     t38_gateway_set_supported_modems(s, T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17);
     t38_gateway_set_nsx_suppression(s, (const uint8_t *) "\x00\x00\x00", 3, (const uint8_t *) "\x00\x00\x00", 3);
 
     s->core.to_t38.octets_per_data_packet = 1;
-    s->core.ecm_allowed = TRUE;
+    s->core.ecm_allowed = true;
     s->core.ms_per_tx_chunk = DEFAULT_MS_PER_TX_CHUNK;
-    t38_non_ecm_buffer_init(&s->core.non_ecm_to_modem, FALSE, 0);
+    t38_non_ecm_buffer_init(&s->core.non_ecm_to_modem, false, 0);
     restart_rx_modem(s);
     s->core.timed_mode = TIMED_MODE_STARTUP;
     s->core.samples_to_timeout = 1;
index bd63c419f25368da0981d999d65fb6e9f22560a3..b5b2c8244b5248fb99a12927814e8d820a97bbaf 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <assert.h>
 
@@ -76,7 +81,7 @@ static void restart_buffer(t38_non_ecm_buffer_state_t *s)
     s->out_ptr = 0;
     s->in_ptr = 0;
     s->latest_eol_ptr = 0;
-    s->data_finished = FALSE;
+    s->data_finished = false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -124,7 +129,7 @@ SPAN_DECLARE(void) t38_non_ecm_buffer_push(t38_non_ecm_buffer_state_t *s)
     /* Don't flow control the data any more. Just push out the remainder of the data
        in the buffer as fast as we can, and shut down. */
     s->latest_eol_ptr = s->in_ptr;
-    s->data_finished = TRUE;
+    s->data_finished = true;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -341,14 +346,14 @@ SPAN_DECLARE(void) t38_non_ecm_buffer_report_output_status(t38_non_ecm_buffer_st
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(void) t38_non_ecm_buffer_set_mode(t38_non_ecm_buffer_state_t *s, int mode, int min_bits_per_row)
+SPAN_DECLARE(void) t38_non_ecm_buffer_set_mode(t38_non_ecm_buffer_state_t *s, bool image_mode, int min_bits_per_row)
 {
-    s->image_data_mode = mode;
+    s->image_data_mode = image_mode;
     s->min_bits_per_row = min_bits_per_row;
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(t38_non_ecm_buffer_state_t *) t38_non_ecm_buffer_init(t38_non_ecm_buffer_state_t *s, int mode, int min_bits_per_row)
+SPAN_DECLARE(t38_non_ecm_buffer_state_t *) t38_non_ecm_buffer_init(t38_non_ecm_buffer_state_t *s, bool image_mode, int min_bits_per_row)
 {
     if (s == NULL)
     {
@@ -356,7 +361,7 @@ SPAN_DECLARE(t38_non_ecm_buffer_state_t *) t38_non_ecm_buffer_init(t38_non_ecm_b
             return NULL;
     }
     memset(s, 0, sizeof(*s));
-    s->image_data_mode = mode;
+    s->image_data_mode = image_mode;
     s->min_bits_per_row = min_bits_per_row;
     restart_buffer(s);
     return s;
index 02a9369f35ede462671b0c32f6099ec7db733d32..bf6a2a9de70377139dd58b822fa6caf423125734 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <assert.h>
 #include <tiffio.h>
@@ -215,7 +220,7 @@ static int process_rx_missing(t38_core_state_t *t, void *user_data, int rx_seq_n
     t38_terminal_state_t *s;
 
     s = (t38_terminal_state_t *) user_data;
-    s->t38_fe.rx_data_missing = TRUE;
+    s->t38_fe.rx_data_missing = true;
     return 0;
 }
 /*- End of function --------------------------------------------------------*/
@@ -251,7 +256,7 @@ static int process_rx_indicator(t38_core_state_t *t, void *user_data, int indica
             &&
             (fe->current_rx_type == T30_MODEM_V21  ||  fe->current_rx_type == T30_MODEM_CNG))
         {
-            hdlc_accept_frame(s, NULL, SIG_STATUS_CARRIER_DOWN, TRUE);
+            hdlc_accept_frame(s, NULL, SIG_STATUS_CARRIER_DOWN, true);
         }
         /*endif*/
         fe->timeout_rx_samples = 0;
@@ -304,7 +309,7 @@ static int process_rx_indicator(t38_core_state_t *t, void *user_data, int indica
     }
     /*endswitch*/
     fe->hdlc_rx.len = 0;
-    fe->rx_data_missing = FALSE;
+    fe->rx_data_missing = false;
     return 0;
 }
 /*- End of function --------------------------------------------------------*/
@@ -328,7 +333,7 @@ static void process_hdlc_data(t38_terminal_front_end_state_t *fe, const uint8_t
     }
     else
     {
-        fe->rx_data_missing = TRUE;
+        fe->rx_data_missing = true;
     }
 }
 /*- End of function --------------------------------------------------------*/
@@ -425,7 +430,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
             /* All real HDLC messages in the FAX world start with 0xFF. If this one is not starting
                with 0xFF it would appear some octets must have been missed before this one. */
             if (len <= 0  ||  buf[0] != 0xFF)
-                fe->rx_data_missing = TRUE;
+                fe->rx_data_missing = true;
             /*endif*/
         }
         /*endif*/
@@ -455,7 +460,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
             fe->hdlc_rx.len = 0;
         }
         /*endif*/
-        fe->rx_data_missing = FALSE;
+        fe->rx_data_missing = false;
         fe->timeout_rx_samples = fe->samples + ms_to_samples(MID_RX_TIMEOUT);
         break;
     case T38_FIELD_HDLC_FCS_BAD:
@@ -473,11 +478,11 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
         if (fe->hdlc_rx.len > 0)
         {
             span_log(&s->logging, SPAN_LOG_FLOW, "Type %s - CRC bad (%s)\n", (fe->hdlc_rx.len >= 3)  ?  t30_frametype(fe->hdlc_rx.buf[2])  :  "???", (fe->rx_data_missing)  ?  "missing octets"  :  "clean");
-            hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, FALSE);
+            hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, false);
             fe->hdlc_rx.len = 0;
         }
         /*endif*/
-        fe->rx_data_missing = FALSE;
+        fe->rx_data_missing = false;
         fe->timeout_rx_samples = fe->samples + ms_to_samples(MID_RX_TIMEOUT);
         break;
     case T38_FIELD_HDLC_FCS_OK_SIG_END:
@@ -499,9 +504,9 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
             fe->hdlc_rx.len = 0;
         }
         /*endif*/
-        fe->rx_data_missing = FALSE;
+        fe->rx_data_missing = false;
         if (t->current_rx_data_type != data_type  ||  t->current_rx_field_type != field_type)
-            hdlc_accept_frame(s, NULL, SIG_STATUS_CARRIER_DOWN, TRUE);
+            hdlc_accept_frame(s, NULL, SIG_STATUS_CARRIER_DOWN, true);
         /*endif*/
         /* Treat this like a no signal indicator has occurred, so if the no signal indicator is missing, we are still OK */
         fake_rx_indicator(t, s, T38_IND_NO_SIGNAL);
@@ -521,13 +526,13 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
         if (fe->hdlc_rx.len > 0)
         {
             span_log(&s->logging, SPAN_LOG_FLOW, "Type %s - CRC bad, sig end (%s)\n", (fe->hdlc_rx.len >= 3)  ?  t30_frametype(fe->hdlc_rx.buf[2])  :  "???", (fe->rx_data_missing)  ?  "missing octets"  :  "clean");
-            hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, FALSE);
+            hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, false);
             fe->hdlc_rx.len = 0;
         }
         /*endif*/
-        fe->rx_data_missing = FALSE;
+        fe->rx_data_missing = false;
         if (t->current_rx_data_type != data_type  ||  t->current_rx_field_type != field_type)
-            hdlc_accept_frame(s, NULL, SIG_STATUS_CARRIER_DOWN, TRUE);
+            hdlc_accept_frame(s, NULL, SIG_STATUS_CARRIER_DOWN, true);
         /*endif*/
         /* Treat this like a no signal indicator has occurred, so if the no signal indicator is missing, we are still OK */
         fake_rx_indicator(t, s, T38_IND_NO_SIGNAL);
@@ -552,7 +557,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
                i.e. they send T38_FIELD_HDLC_FCS_OK, and then T38_FIELD_HDLC_SIG_END when the carrier actually drops.
                The other is because the HDLC signal drops unexpectedly - i.e. not just after a final frame. */
             fe->hdlc_rx.len = 0;
-            fe->rx_data_missing = FALSE;
+            fe->rx_data_missing = false;
             front_end_status(s, T30_FRONT_END_RECEIVE_COMPLETE);
         }
         /*endif*/
@@ -563,7 +568,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
         if (!fe->rx_signal_present)
         {
             t30_non_ecm_put_bit(&s->t30, SIG_STATUS_TRAINING_SUCCEEDED);
-            fe->rx_signal_present = TRUE;
+            fe->rx_signal_present = true;
         }
         /*endif*/
         if (len > 0)
@@ -585,7 +590,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
                 if (!fe->rx_signal_present)
                 {
                     t30_non_ecm_put_bit(&s->t30, SIG_STATUS_TRAINING_SUCCEEDED);
-                    fe->rx_signal_present = TRUE;
+                    fe->rx_signal_present = true;
                 }
                 /*endif*/
                 bit_reverse(buf2, buf, len);
@@ -599,7 +604,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
             front_end_status(s, T30_FRONT_END_RECEIVE_COMPLETE);
         }
         /*endif*/
-        fe->rx_signal_present = FALSE;
+        fe->rx_signal_present = false;
         /* Treat this like a no signal indicator has occurred, so if the no signal indicator is missing, we are still OK */
         fake_rx_indicator(t, s, T38_IND_NO_SIGNAL);
         break;
@@ -1149,7 +1154,7 @@ SPAN_DECLARE(int) t38_terminal_send_timeout(t38_terminal_state_t *s, int samples
 
     fe = &s->t38_fe;
     if (fe->current_rx_type == T30_MODEM_DONE  ||  fe->current_tx_type == T30_MODEM_DONE)
-        return TRUE;
+        return true;
     /*endif*/
 
     fe->samples += samples;
@@ -1162,12 +1167,12 @@ SPAN_DECLARE(int) t38_terminal_send_timeout(t38_terminal_state_t *s, int samples
     }
     /*endif*/
     if (fe->timed_step == T38_TIMED_STEP_NONE)
-        return FALSE;
+        return false;
     /*endif*/
     /* Wait until the right time comes along, unless we are working in "no delays" mode, while talking to an
        IAF terminal. */
     if (fe->us_per_tx_chunk  &&  fe->samples < fe->next_tx_samples)
-        return FALSE;
+        return false;
     /*endif*/
     /* Its time to send something */
     delay = 0;
@@ -1198,11 +1203,11 @@ SPAN_DECLARE(int) t38_terminal_send_timeout(t38_terminal_state_t *s, int samples
     if (delay < 0)
     {
         t30_terminate(&s->t30);
-        return TRUE;
+        return true;
     }
     /*endif*/
     fe->next_tx_samples += us_to_samples(delay);
-    return FALSE;
+    return false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -1365,7 +1370,7 @@ SPAN_DECLARE(void) t38_terminal_set_config(t38_terminal_state_t *s, int config)
     if ((config & T38_TERMINAL_OPTION_NO_PACING))
     {
         /* Continuous streaming mode, as used for TPKT over TCP transport */
-        t38_set_pace_transmission(&s->t38_fe.t38, FALSE);
+        t38_set_pace_transmission(&s->t38_fe.t38, false);
         s->t38_fe.hdlc_tx.extra_bits = 0;
         if ((config & T38_TERMINAL_OPTION_NO_INDICATORS))
             t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_INDICATOR, 0);
@@ -1383,7 +1388,7 @@ SPAN_DECLARE(void) t38_terminal_set_config(t38_terminal_state_t *s, int config)
     else
     {
         /* Paced streaming mode, as used for UDP transports */
-        t38_set_pace_transmission(&s->t38_fe.t38, TRUE);
+        t38_set_pace_transmission(&s->t38_fe.t38, true);
         s->t38_fe.hdlc_tx.extra_bits = 0;
         if ((config & T38_TERMINAL_OPTION_NO_INDICATORS))
             t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_INDICATOR, 0);
@@ -1411,7 +1416,7 @@ SPAN_DECLARE(void) t38_terminal_set_config(t38_terminal_state_t *s, int config)
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(void) t38_terminal_set_tep_mode(t38_terminal_state_t *s, int use_tep)
+SPAN_DECLARE(void) t38_terminal_set_tep_mode(t38_terminal_state_t *s, bool use_tep)
 {
     if (use_tep)
         s->t38_fe.chunking_modes |= T38_CHUNKING_ALLOW_TEP_TIME;
@@ -1422,7 +1427,7 @@ SPAN_DECLARE(void) t38_terminal_set_tep_mode(t38_terminal_state_t *s, int use_te
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(void) t38_terminal_set_fill_bit_removal(t38_terminal_state_t *s, int remove)
+SPAN_DECLARE(void) t38_terminal_set_fill_bit_removal(t38_terminal_state_t *s, bool remove)
 {
     if (remove)
         s->t38_fe.iaf |= T30_IAF_MODE_NO_FILL_BITS;
@@ -1452,7 +1457,7 @@ static int t38_terminal_t38_fe_restart(t38_terminal_state_t *t)
     s = &t->t38_fe;
     t38_core_restart(&s->t38);
 
-    s->rx_signal_present = FALSE;
+    s->rx_signal_present = false;
     s->timed_step = T38_TIMED_STEP_NONE;
     //s->iaf = T30_IAF_MODE_T37 | T30_IAF_MODE_T38;
     s->iaf = T30_IAF_MODE_T38;
@@ -1483,7 +1488,7 @@ static int t38_terminal_t38_fe_init(t38_terminal_state_t *t,
                   tx_packet_user_data);
     t38_set_fastest_image_data_rate(&s->t38, 14400);
 
-    s->rx_signal_present = FALSE;
+    s->rx_signal_present = false;
     s->timed_step = T38_TIMED_STEP_NONE;
     s->queued_timed_step = T38_TIMED_STEP_NONE;
     //s->iaf = T30_IAF_MODE_T37 | T30_IAF_MODE_T38;
@@ -1507,7 +1512,7 @@ SPAN_DECLARE(logging_state_t *) t38_terminal_get_logging_state(t38_terminal_stat
 /*- End of function --------------------------------------------------------*/
 
 SPAN_DECLARE(int) t38_terminal_restart(t38_terminal_state_t *s,
-                                       int calling_party)
+                                       bool calling_party)
 {
     t38_terminal_t38_fe_restart(s);
     t30_restart(&s->t30);
@@ -1516,7 +1521,7 @@ SPAN_DECLARE(int) t38_terminal_restart(t38_terminal_state_t *s,
 /*- End of function --------------------------------------------------------*/
 
 SPAN_DECLARE(t38_terminal_state_t *) t38_terminal_init(t38_terminal_state_t *s,
-                                                       int calling_party,
+                                                       bool calling_party,
                                                        t38_tx_packet_handler_t tx_packet_handler,
                                                        void *tx_packet_user_data)
 {
index 5a00a4121e4d13f30d0be2580f13dab53db7ac66..3e7ea3070bf4780caa718512d5a4e116a3e78a7c 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <tiffio.h>
 #include <assert.h>
@@ -330,7 +335,7 @@ SPAN_DECLARE(void) set_lab_gamut2(lab_params_t *lab, int L_P, int L_Q, int a_P,
     lab->offset_a = a_P;
     lab->offset_b = b_P;
 
-    lab->ab_are_signed = FALSE;
+    lab->ab_are_signed = false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -548,13 +553,13 @@ static int is_itu_fax(t42_decode_state_t *s, jpeg_saved_marker_ptr ptr)
     int ok;
     int val[6];
 
-    ok = FALSE;
+    ok = false;
     for (  ;  ptr;  ptr = ptr->next)
     {
         if (ptr->marker != (JPEG_APP0 + 1))
             continue;
         if (ptr->data_length < 6)
-            return FALSE;
+            return false;
         /* Markers are:
             JPEG_RST0
             JPEG_EOI
@@ -562,26 +567,26 @@ static int is_itu_fax(t42_decode_state_t *s, jpeg_saved_marker_ptr ptr)
             JPEG_COM */
         data = (const uint8_t *) ptr->data;
         if (strncmp((const char *) data, "G3FAX", 5))
-            return FALSE;
+            return false;
         switch (data[5])
         {
         case 0:
             if (ptr->data_length < 6 + 4)
             {
                 span_log(&s->logging, SPAN_LOG_FLOW, "Got bad G3FAX0 length - %d\n", ptr->data_length);
-                return FALSE;
+                return false;
             }
             val[0] = pack_16(&data[6]);
             s->spatial_resolution = pack_16(&data[6 + 2]);
             span_log(&s->logging, SPAN_LOG_FLOW, "Version %d, resolution %ddpi\n", val[0], s->spatial_resolution);
-            ok = TRUE;
+            ok = true;
             break;
         case 1:
             span_log(&s->logging, SPAN_LOG_FLOW, "Set gamut\n");
             if (ptr->data_length < 6 + 12)
             {
                 span_log(&s->logging, SPAN_LOG_FLOW, "Got bad G3FAX1 length - %d\n", ptr->data_length);
-                return FALSE;
+                return false;
             }
             set_gamut_from_code(&s->logging, &s->lab, &data[6]);
             break;
@@ -590,13 +595,13 @@ static int is_itu_fax(t42_decode_state_t *s, jpeg_saved_marker_ptr ptr)
             if (ptr->data_length < 6 + 4)
             {
                 span_log(&s->logging, SPAN_LOG_FLOW, "Got bad G3FAX2 length - %d\n", ptr->data_length);
-                return FALSE;
+                return false;
             }
             s->illuminant_colour_temperature = set_illuminant_from_code(&s->logging, &s->lab, &data[6]);
             break;
         default:
             span_log(&s->logging, SPAN_LOG_FLOW, "Got unexpected G3FAX%d length - %d\n", data[5], ptr->data_length);
-            return FALSE;
+            return false;
         }
     }
 
@@ -776,7 +781,7 @@ static int t42_srgb_to_itulab_jpeg(t42_encode_state_t *s)
 
     jpeg_set_defaults(&s->compressor);
     /* Limit to baseline-JPEG values */
-    //jpeg_set_quality(&s->compressor, s->quality, TRUE);
+    //jpeg_set_quality(&s->compressor, s->quality, true);
 
     if (s->no_subsampling)
     {
@@ -799,7 +804,7 @@ static int t42_srgb_to_itulab_jpeg(t42_encode_state_t *s)
     s->compressor.image_width = s->image_width;
     s->compressor.image_height = s->image_length;
 
-    jpeg_start_compress(&s->compressor, TRUE);
+    jpeg_start_compress(&s->compressor, true);
 
     set_itu_fax(s);
 
@@ -937,14 +942,14 @@ SPAN_DECLARE(int) t42_encode_restart(t42_encode_state_t *s, uint32_t image_width
         /* ITU-YCC */
         /* Illuminant D65 */
         set_lab_illuminant(&s->lab, 95.047f, 100.000f, 108.883f);
-        set_lab_gamut(&s->lab, 0, 100, -127, 127, -127, 127, FALSE);
+        set_lab_gamut(&s->lab, 0, 100, -127, 127, -127, 127, false);
     }
     else
     {
         /* ITULAB */
         /* Illuminant D50 */
         set_lab_illuminant(&s->lab, 96.422f, 100.000f,  82.521f);
-        set_lab_gamut(&s->lab, 0, 100, -85, 85, -75, 125, FALSE);
+        set_lab_gamut(&s->lab, 0, 100, -85, 85, -75, 125, false);
     }
     s->compressed_image_size = 0;
     s->compressed_image_ptr = 0;
@@ -1118,7 +1123,7 @@ static int t42_itulab_jpeg_to_srgb(t42_decode_state_t *s)
     }
 
     /* Take the header */
-    jpeg_read_header(&s->decompressor, FALSE);
+    jpeg_read_header(&s->decompressor, false);
     /* Sanity check and parameter check */
     if (!is_itu_fax(s, s->decompressor.marker_list))
     {
@@ -1316,14 +1321,14 @@ SPAN_DECLARE(int) t42_decode_restart(t42_decode_state_t *s)
         /* ITU-YCC */
         /* Illuminant D65 */
         set_lab_illuminant(&s->lab, 95.047f, 100.000f, 108.883f);
-        set_lab_gamut(&s->lab, 0, 100, -127, 127, -127, 127, FALSE);
+        set_lab_gamut(&s->lab, 0, 100, -127, 127, -127, 127, false);
     }
     else
     {
         /* ITULAB */
         /* Illuminant D50 */
         set_lab_illuminant(&s->lab, 96.422f, 100.000f,  82.521f);
-        set_lab_gamut(&s->lab, 0, 100, -85, 85, -75, 125, FALSE);
+        set_lab_gamut(&s->lab, 0, 100, -85, 85, -75, 125, false);
     }
 
     s->end_of_data = 0;
index 9e2ee76be2012267b7d20910f423c8614ad90734..181226e75790a3de6b9538ad6ccf27f3f16c5d25 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include <time.h>
 #include "floating_fudge.h"
 #include <setjmp.h>
 #include "t43_gray_code_tables.h"
 #include "t42_t43_local.h"
 
-#if !defined(FALSE)
-#define FALSE 0
-#endif
-#if !defined(TRUE)
-#define TRUE (!FALSE)
-#endif
-
 SPAN_DECLARE(const char *) t43_image_type_to_str(int type)
 {
     switch (type)
@@ -868,7 +866,7 @@ SPAN_DECLARE(int) t43_decode_restart(t43_decode_state_t *s)
     /* ITULAB */
     /* Illuminant D50 */
     set_lab_illuminant(&s->lab, 96.422f, 100.000f,  82.521f);
-    set_lab_gamut(&s->lab, 0, 100, -85, 85, -75, 125, FALSE);
+    set_lab_gamut(&s->lab, 0, 100, -85, 85, -75, 125, false);
 
     s->t85.min_bit_planes = 1;
     s->t85.max_bit_planes = 8;
@@ -901,7 +899,7 @@ SPAN_DECLARE(t43_decode_state_t *) t43_decode_init(t43_decode_state_t *s,
     /* ITULAB */
     /* Illuminant D50 */
     set_lab_illuminant(&s->lab, 96.422f, 100.000f,  82.521f);
-    set_lab_gamut(&s->lab, 0, 100, -85, 85, -75, 125, FALSE);
+    set_lab_gamut(&s->lab, 0, 100, -85, 85, -75, 125, false);
 
     s->t85.min_bit_planes = 1;
     s->t85.max_bit_planes = 8;
index b7bed5dd185620ffcf7b82b95175df4dd0d26a48..256e8fcdfc62fbb8c771d820216068dac19e13c1 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <tiffio.h>
 
@@ -1185,14 +1190,14 @@ SPAN_DECLARE(logging_state_t *) t4_rx_get_logging_state(t4_rx_state_t *s)
 
 SPAN_DECLARE(t4_rx_state_t *) t4_rx_init(t4_rx_state_t *s, const char *file, int supported_output_compressions)
 {
-    int allocated;
+    bool alloced;
 
-    allocated = FALSE;
+    alloced = false;
     if (s == NULL)
     {
         if ((s = (t4_rx_state_t *) span_alloc(sizeof(*s))) == NULL)
             return NULL;
-        allocated = TRUE;
+        alloced = true;
     }
 #if defined(SPANDSP_SUPPORT_TIFF_FX)
     TIFF_FX_init();
@@ -1221,7 +1226,7 @@ SPAN_DECLARE(t4_rx_state_t *) t4_rx_init(t4_rx_state_t *s, const char *file, int
         s->tiff.pages_in_file = 0;
         if (open_tiff_output_file(s, file) < 0)
         {
-            if (allocated)
+            if (alloced)
                 span_free(s);
             return NULL;
         }
index 219a0bafb83cc760dc1bb95c4956782870a15890..4daf7e65c73f3901a91a573979395510e28c12b3 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <tiffio.h>
 
@@ -381,12 +386,12 @@ static int put_bits(t4_t6_decode_state_t *s, uint32_t bit_string, int quantity)
        need a minimum of 13 bits in the buffer to proceed with any bit stream
        analysis. */
     if ((s->rx_bits += quantity) < 13)
-        return FALSE;
+        return false;
     if (s->consecutive_eols)
     {
         /* Check if the image has already terminated. */
         if (s->consecutive_eols >= EOLS_TO_END_ANY_RX_PAGE)
-            return TRUE;
+            return true;
         /* Check if the image hasn't even started. */
         if (s->consecutive_eols < 0)
         {
@@ -397,14 +402,14 @@ static int put_bits(t4_t6_decode_state_t *s, uint32_t bit_string, int quantity)
             {
                 s->rx_bitstream >>= 1;
                 if (--s->rx_bits < 13)
-                    return FALSE;
+                    return false;
             }
             /* We have an EOL, so now the page begins and we can proceed to
                process the bit stream as image data. */
             s->consecutive_eols = 0;
             if (s->encoding == T4_COMPRESSION_T4_1D)
             {
-                s->row_is_2d = FALSE;
+                s->row_is_2d = false;
                 force_drop_rx_bits(s, 12);
             }
             else
@@ -445,7 +450,7 @@ static int put_bits(t4_t6_decode_state_t *s, uint32_t bit_string, int quantity)
                     if (s->consecutive_eols >= EOLS_TO_END_T6_RX_PAGE)
                     {
                         s->consecutive_eols = EOLS_TO_END_ANY_RX_PAGE;
-                        return TRUE;
+                        return true;
                     }
                 }
                 else
@@ -453,7 +458,7 @@ static int put_bits(t4_t6_decode_state_t *s, uint32_t bit_string, int quantity)
                     if (s->consecutive_eols >= EOLS_TO_END_T4_RX_PAGE)
                     {
                         s->consecutive_eols = EOLS_TO_END_ANY_RX_PAGE;
-                        return TRUE;
+                        return true;
                     }
                 }
             }
@@ -465,7 +470,7 @@ static int put_bits(t4_t6_decode_state_t *s, uint32_t bit_string, int quantity)
                     add_run_to_row(s);
                 s->consecutive_eols = 0;
                 if (put_decoded_row(s))
-                    return TRUE;
+                    return true;
             }
             if (s->encoding == T4_COMPRESSION_T4_2D)
             {
@@ -476,7 +481,7 @@ static int put_bits(t4_t6_decode_state_t *s, uint32_t bit_string, int quantity)
             {
                 force_drop_rx_bits(s, 12);
             }
-            s->in_black = FALSE;
+            s->in_black = false;
             s->black_white = 0;
             s->run_length = 0;
             s->row_len = 0;
@@ -609,7 +614,7 @@ static int put_bits(t4_t6_decode_state_t *s, uint32_t bit_string, int quantity)
                     s->a0 += t4_1d_black_table[bits].param;
                     break;
                 case S_TermB:
-                    s->in_black = FALSE;
+                    s->in_black = false;
                     if (s->row_len < s->image_width)
                     {
                         s->run_length += t4_1d_black_table[bits].param;
@@ -643,7 +648,7 @@ static int put_bits(t4_t6_decode_state_t *s, uint32_t bit_string, int quantity)
                     s->a0 += t4_1d_white_table[bits].param;
                     break;
                 case S_TermW:
-                    s->in_black = TRUE;
+                    s->in_black = true;
                     if (s->row_len < s->image_width)
                     {
                         s->run_length += t4_1d_white_table[bits].param;
@@ -676,15 +681,15 @@ static int put_bits(t4_t6_decode_state_t *s, uint32_t bit_string, int quantity)
                 if (s->run_length > 0)
                     add_run_to_row(s);
                 if (put_decoded_row(s))
-                    return TRUE;
-                s->in_black = FALSE;
+                    return true;
+                s->in_black = false;
                 s->black_white = 0;
                 s->run_length = 0;
                 s->row_len = 0;
             }
         }
     }
-    return FALSE;
+    return false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -715,7 +720,7 @@ SPAN_DECLARE(int) t4_t6_decode_put_bit(t4_t6_decode_state_t *s, int bit)
     if (bit < 0)
     {
         t4_t6_decode_rx_status(s, bit);
-        return TRUE;
+        return true;
     }
     s->compressed_image_size++;
     if (put_bits(s, bit & 1, 1))
@@ -858,7 +863,7 @@ SPAN_DECLARE(int) t4_t6_decode_restart(t4_t6_decode_state_t *s, int image_width)
     s->pixels = 8;
 
     s->row_len = 0;
-    s->in_black = FALSE;
+    s->in_black = false;
     s->black_white = 0;
     s->b_cursor = 1;
     s->a_cursor = 0;
index fde78f48273065da1299964d5c566b68b10831cf..85838a0ea9f024a692342f425901425a3af9c47e 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <tiffio.h>
 
@@ -841,12 +846,12 @@ static int encode_row(t4_t6_encode_state_t *s, const uint8_t *row_buf, size_t le
         else
         {
             encode_1d_row(s, row_buf);
-            s->row_is_2d = TRUE;
+            s->row_is_2d = true;
         }
         if (s->rows_to_next_1d_row <= 0)
         {
             /* Insert a row of 1D encoding */
-            s->row_is_2d = FALSE;
+            s->row_is_2d = false;
             s->rows_to_next_1d_row = s->max_rows_to_next_1d_row - 1;
         }
         break;
@@ -874,7 +879,7 @@ static int finalise_page(t4_t6_encode_state_t *s)
     else
     {
         /* Attach an RTC (return to control == 6 x EOLs) to the end of the page */
-        s->row_is_2d = FALSE;
+        s->row_is_2d = false;
         for (i = 0;  i < EOLS_TO_END_T4_TX_PAGE;  i++)
             encode_eol(s);
     }
@@ -1105,7 +1110,7 @@ SPAN_DECLARE(void) t4_t6_encode_set_max_2d_rows_per_1d_row(t4_t6_encode_state_t
     }
     s->max_rows_to_next_1d_row = max;
     s->rows_to_next_1d_row = max - 1;
-    s->row_is_2d = FALSE;
+    s->row_is_2d = false;
 }
 /*- End of function --------------------------------------------------------*/
 
index 35d3632f60b56c68aea444cc739cff1752b8adea..5c35fdb0b48391a7c93b90f78be0a320f1114041 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 #include <tiffio.h>
 
@@ -149,18 +154,18 @@ static const int resolution_map[10][9] =
 
 static const TIFFFieldInfo tiff_fx_tiff_field_info[] =
 {
-    {TIFFTAG_INDEXED, 1, 1, TIFF_SHORT, FIELD_CUSTOM, FALSE, FALSE, (char *) "Indexed"},
-    {TIFFTAG_GLOBALPARAMETERSIFD, 1, 1, TIFF_IFD8, FIELD_CUSTOM, FALSE, FALSE, (char *) "GlobalParametersIFD"},
-    {TIFFTAG_PROFILETYPE, 1, 1, TIFF_LONG, FIELD_CUSTOM, FALSE, FALSE, (char *) "ProfileType"},
-    {TIFFTAG_FAXPROFILE, 1, 1, TIFF_BYTE, FIELD_CUSTOM, FALSE, FALSE, (char *) "FaxProfile"},
-    {TIFFTAG_CODINGMETHODS, 1, 1, TIFF_LONG, FIELD_CUSTOM, FALSE, FALSE, (char *) "CodingMethods"},
-    {TIFFTAG_VERSIONYEAR, 4, 4, TIFF_BYTE, FIELD_CUSTOM, FALSE, FALSE, (char *) "VersionYear"},
-    {TIFFTAG_MODENUMBER, 1, 1, TIFF_BYTE, FIELD_CUSTOM, FALSE, FALSE, (char *) "ModeNumber"},
-    {TIFFTAG_DECODE, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_SRATIONAL, FIELD_CUSTOM, FALSE, TRUE, (char *) "Decode"},
-    {TIFFTAG_IMAGEBASECOLOR, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_SHORT, FIELD_CUSTOM, FALSE, TRUE, (char *) "ImageBaseColor"},
-    {TIFFTAG_T82OPTIONS, 1, 1, TIFF_LONG, FIELD_CUSTOM, FALSE, FALSE, (char *) "T82Options"},
-    {TIFFTAG_STRIPROWCOUNTS, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_LONG, FIELD_CUSTOM, FALSE, TRUE, (char *) "StripRowCounts"},
-    {TIFFTAG_IMAGELAYER, 2, 2, TIFF_LONG, FIELD_CUSTOM, FALSE, FALSE, (char *) "ImageLayer"},
+    {TIFFTAG_INDEXED, 1, 1, TIFF_SHORT, FIELD_CUSTOM, false, false, (char *) "Indexed"},
+    {TIFFTAG_GLOBALPARAMETERSIFD, 1, 1, TIFF_IFD8, FIELD_CUSTOM, false, false, (char *) "GlobalParametersIFD"},
+    {TIFFTAG_PROFILETYPE, 1, 1, TIFF_LONG, FIELD_CUSTOM, false, false, (char *) "ProfileType"},
+    {TIFFTAG_FAXPROFILE, 1, 1, TIFF_BYTE, FIELD_CUSTOM, false, false, (char *) "FaxProfile"},
+    {TIFFTAG_CODINGMETHODS, 1, 1, TIFF_LONG, FIELD_CUSTOM, false, false, (char *) "CodingMethods"},
+    {TIFFTAG_VERSIONYEAR, 4, 4, TIFF_BYTE, FIELD_CUSTOM, false, false, (char *) "VersionYear"},
+    {TIFFTAG_MODENUMBER, 1, 1, TIFF_BYTE, FIELD_CUSTOM, false, false, (char *) "ModeNumber"},
+    {TIFFTAG_DECODE, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_SRATIONAL, FIELD_CUSTOM, false, true, (char *) "Decode"},
+    {TIFFTAG_IMAGEBASECOLOR, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_SHORT, FIELD_CUSTOM, false, true, (char *) "ImageBaseColor"},
+    {TIFFTAG_T82OPTIONS, 1, 1, TIFF_LONG, FIELD_CUSTOM, false, false, (char *) "T82Options"},
+    {TIFFTAG_STRIPROWCOUNTS, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_LONG, FIELD_CUSTOM, false, true, (char *) "StripRowCounts"},
+    {TIFFTAG_IMAGELAYER, 2, 2, TIFF_LONG, FIELD_CUSTOM, false, false, (char *) "ImageLayer"},
 };
 
 #if 1
@@ -199,11 +204,11 @@ static void TIFFFXDefaultDirectory(TIFF *tif)
 
 SPAN_DECLARE(void) TIFF_FX_init(void)
 {
-    static int first_time = TRUE;
+    static int first_time = true;
 
     if (!first_time)
         return;
-    first_time = FALSE;
+    first_time = false;
 
     /* Grab the inherited method and install */
     _ParentExtender = TIFFSetTagExtender(TIFFFXDefaultDirectory);
@@ -506,7 +511,7 @@ static int get_tiff_directory_info(t4_tx_state_t *s)
 
     /* The default luminant is D50 */
     set_lab_illuminant(&s->lab_params, 96.422f, 100.000f,  82.521f);
-    set_lab_gamut(&s->lab_params, 0, 100, -85, 85, -75, 125, FALSE);
+    set_lab_gamut(&s->lab_params, 0, 100, -85, 85, -75, 125, false);
 
     t->compression = -1;
     TIFFGetField(t->tiff_file, TIFFTAG_COMPRESSION, &t->compression);
@@ -1278,17 +1283,17 @@ static int read_tiff_image(t4_tx_state_t *s)
             case PHOTOMETRIC_CIELAB:
                 /* The default luminant is D50 */
                 set_lab_illuminant(&s->lab_params, 96.422f, 100.000f,  82.521f);
-                set_lab_gamut(&s->lab_params, 0, 100, -128, 127, -128, 127, TRUE);
-                s->apply_lab = TRUE;
+                set_lab_gamut(&s->lab_params, 0, 100, -128, 127, -128, 127, true);
+                s->apply_lab = true;
                 break;
             case PHOTOMETRIC_ITULAB:
                 /* The default luminant is D50 */
                 set_lab_illuminant(&s->lab_params, 96.422f, 100.000f,  82.521f);
-                set_lab_gamut(&s->lab_params, 0, 100, -85, 85, -75, 125, FALSE);
-                s->apply_lab = TRUE;
+                set_lab_gamut(&s->lab_params, 0, 100, -85, 85, -75, 125, false);
+                s->apply_lab = true;
                 break;
             default:
-                s->apply_lab = FALSE;
+                s->apply_lab = false;
                 break;
             }
             total_len = 0;
@@ -2303,7 +2308,7 @@ SPAN_DECLARE(void) t4_tx_set_max_2d_rows_per_1d_row(t4_tx_state_t *s, int max)
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(void) t4_tx_set_header_overlays_image(t4_tx_state_t *s, int header_overlays_image)
+SPAN_DECLARE(void) t4_tx_set_header_overlays_image(t4_tx_state_t *s, bool header_overlays_image)
 {
     s->header_overlays_image = header_overlays_image;
 }
@@ -2587,12 +2592,12 @@ SPAN_DECLARE(t4_tx_state_t *) t4_tx_init(t4_tx_state_t *s, const char *file, int
 {
     int allocated;
 
-    allocated = FALSE;
+    allocated = false;
     if (s == NULL)
     {
         if ((s = (t4_tx_state_t *) span_alloc(sizeof(*s))) == NULL)
             return NULL;
-        allocated = TRUE;
+        allocated = true;
     }
     memset(s, 0, sizeof(*s));
 #if defined(SPANDSP_SUPPORT_TIFF_FX)
index 5d51bbc25d4edb2446246a7e9a132ccf4fc58dbe..f9c1408c667cc4122822e76eccb4ec28624bf1c2 100644 (file)
 #include <inttypes.h>
 #include <stdlib.h>
 #include <string.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 
 #include "spandsp/telephony.h"
 #include "spandsp/alloc.h"
@@ -46,9 +51,6 @@
    compression schemes, such as T.81. However, this code has not been checked
    to see if it follows the letter of any spec other than T.82. */
 
-#define FALSE 0
-#define TRUE (!FALSE)
-
 /* Code bytes which must trigger stuffing */
 enum
 {
@@ -349,7 +351,7 @@ SPAN_DECLARE(t81_t82_arith_encode_state_t *) t81_t82_arith_encode_init(t81_t82_a
     s->output_byte_handler = output_byte_handler;
     s->user_data = user_data;
 
-    t81_t82_arith_encode_restart(s, FALSE);
+    t81_t82_arith_encode_restart(s, false);
     return s;
 }
 /*- End of function --------------------------------------------------------*/
@@ -400,7 +402,7 @@ SPAN_DECLARE(int) t81_t82_arith_decode(t81_t82_arith_decode_state_t *s, int cx)
                     if (s->nopadding)
                     {
                         /* Subsequent symbols might depend on zero padding */
-                        s->nopadding = FALSE;
+                        s->nopadding = false;
                         return -2;
                     }
                 }
@@ -416,7 +418,7 @@ SPAN_DECLARE(int) t81_t82_arith_decode(t81_t82_arith_decode_state_t *s, int cx)
         if (s->ct >= 0)
             s->ct--;
         if (s->a == 0x10000)
-            s->startup = FALSE;
+            s->startup = false;
     }
 
     /* T.82 figure 32 - DECODE */
@@ -472,8 +474,8 @@ SPAN_DECLARE(int) t81_t82_arith_decode_restart(t81_t82_arith_decode_state_t *s,
     s->c = 0;
     s->a = 1;
     s->ct = 0;
-    s->startup = TRUE;
-    s->nopadding = FALSE;
+    s->startup = true;
+    s->nopadding = false;
     return 0;
 }
 /*- End of function --------------------------------------------------------*/
@@ -487,7 +489,7 @@ SPAN_DECLARE(t81_t82_arith_decode_state_t *) t81_t82_arith_decode_init(t81_t82_a
     }
     memset(s, 0, sizeof(*s));
 
-    t81_t82_arith_decode_restart(s, FALSE);
+    t81_t82_arith_decode_restart(s, false);
     return s;
 }
 /*- End of function --------------------------------------------------------*/
index f48502c9d9a1e3c4b880ba6436761f7358ca5dc0..8af029d3a0374a28075669d99237c3215c5c4676 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 
 #include "spandsp/telephony.h"
 #include "spandsp/alloc.h"
@@ -48,9 +53,6 @@
 #include "spandsp/private/t81_t82_arith_coding.h"
 #include "spandsp/private/t85.h"
 
-#define FALSE 0
-#define TRUE (!FALSE)
-
 static __inline__ int32_t pack_32(uint8_t *s)
 {
     int32_t value;
@@ -79,7 +81,7 @@ static size_t decode_pscd(t85_decode_state_t *s, const uint8_t data[], size_t le
     s->s.pscd_ptr = data;
     s->s.pscd_end = data + len;
 
-    for (s->interrupt = FALSE;  s->i < s->l0  &&  s->y < s->yd  &&  !s->interrupt;  s->i++, s->y++)
+    for (s->interrupt = false;  s->i < s->l0  &&  s->y < s->yd  &&  !s->interrupt;  s->i++, s->y++)
     {
         /* Point to the current image bytes */
         for (i = 0;  i < 3;  i++)
@@ -127,7 +129,7 @@ static size_t decode_pscd(t85_decode_state_t *s, const uint8_t data[], size_t le
             }
             /* This row is 'not typical' and has to be coded completely */
         }
-        s->pseudo = FALSE;
+        s->pseudo = false;
 
         if (s->x == 0)
         {
@@ -224,7 +226,7 @@ static size_t decode_pscd(t85_decode_state_t *s, const uint8_t data[], size_t le
         *(hp[0] - 1) <<= (s->bytes_per_row*8 - s->xd);
         s->interrupt = s->row_write_handler(s->row_write_user_data, &s->row_buf[s->p[0]*s->bytes_per_row], s->bytes_per_row);
         s->x = 0;
-        s->pseudo = TRUE;
+        s->pseudo = true;
         /* Shuffle the row buffers */
         s->p[2] = s->p[1];
         s->p[1] = s->p[0];
@@ -238,7 +240,7 @@ static size_t decode_pscd(t85_decode_state_t *s, const uint8_t data[], size_t le
 static int finish_sde(t85_decode_state_t *s)
 {
     /* Decode final pixels based on trailing zero bytes */
-    s->s.nopadding = FALSE;
+    s->s.nopadding = false;
     if (decode_pscd(s, s->buffer, 2) != 2  &&  s->interrupt)
         return 1;
 
@@ -248,12 +250,12 @@ static int finish_sde(t85_decode_state_t *s)
 
     s->x = 0;
     s->i = 0;
-    s->pseudo = TRUE;
+    s->pseudo = true;
     s->at_moves = 0;
     if (s->buffer[1] == T82_SDRST)
     {
         s->tx = 0;
-        s->lntp = TRUE;
+        s->lntp = true;
         s->p[0] = 0;
         s->p[1] = -1;
         s->p[2] = -1;
@@ -420,10 +422,10 @@ SPAN_DECLARE(int) t85_decode_put(t85_decode_state_t *s, const uint8_t data[], si
         s->x = 0;
         s->y = 0;
         s->i = 0;
-        s->pseudo = TRUE;
+        s->pseudo = true;
         s->at_moves = 0;
         s->tx = 0;
-        s->lntp = TRUE;
+        s->lntp = true;
         s->bytes_per_row = bytes_per_row;
         s->p[0] = 0;
         s->p[1] = -1;
@@ -733,9 +735,9 @@ SPAN_DECLARE(int) t85_decode_new_plane(t85_decode_state_t *s)
     memset(s->at_row, 0, sizeof(s->at_row));
     memset(s->at_tx, 0, sizeof(s->at_tx));
     memset(s->row_h, 0, sizeof(s->row_h));
-    s->pseudo = FALSE;
-    s->lntp = FALSE;
-    s->interrupt = FALSE;
+    s->pseudo = false;
+    s->lntp = false;
+    s->interrupt = false;
     s->end_of_data = 0;
     if (s->comment)
     {
@@ -746,7 +748,7 @@ SPAN_DECLARE(int) t85_decode_new_plane(t85_decode_state_t *s)
     s->comment_progress = 0;
     s->compressed_image_size = 0;
 
-    t81_t82_arith_decode_restart(&s->s, FALSE);
+    t81_t82_arith_decode_restart(&s->s, false);
     s->s.nopadding = s->options & T85_VLENGTH;
 
     s->buf_len = 0;
@@ -754,10 +756,10 @@ SPAN_DECLARE(int) t85_decode_new_plane(t85_decode_state_t *s)
     s->x = 0;
     s->y = 0;
     s->i = 0;
-    s->pseudo = TRUE;
+    s->pseudo = true;
     s->at_moves = 0;
     s->tx = 0;
-    s->lntp = TRUE;
+    s->lntp = true;
     s->p[0] = 0;
     s->p[1] = -1;
     s->p[2] = -1;
@@ -781,9 +783,9 @@ SPAN_DECLARE(int) t85_decode_restart(t85_decode_state_t *s)
     memset(s->at_row, 0, sizeof(s->at_row));
     memset(s->at_tx, 0, sizeof(s->at_tx));
     memset(s->row_h, 0, sizeof(s->row_h));
-    s->pseudo = FALSE;
-    s->lntp = FALSE;
-    s->interrupt = FALSE;
+    s->pseudo = false;
+    s->lntp = false;
+    s->interrupt = false;
     s->end_of_data = 0;
     if (s->comment)
     {
@@ -794,7 +796,7 @@ SPAN_DECLARE(int) t85_decode_restart(t85_decode_state_t *s)
     s->comment_progress = 0;
     s->compressed_image_size = 0;
 
-    t81_t82_arith_decode_restart(&s->s, FALSE);
+    t81_t82_arith_decode_restart(&s->s, false);
 
     return 0;
 }
index 9b417a39fd9d4dd13a3a5bb4d7985be2cc10590a..ed4d1adaffda83397d0d62bcb3c34f6d7109903e 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 
 #include "spandsp/telephony.h"
 #include "spandsp/alloc.h"
@@ -279,7 +284,7 @@ static int get_next_row(t85_encode_state_t *s)
                 return 0;
             /* We can't clip the image to the current length. We will have to
                continue up to the original length with blank (all white) rows. */
-            s->fill_with_white = TRUE;
+            s->fill_with_white = true;
             memset(s->prev_row[0], 0, bytes_per_row);
         }
     }
@@ -312,11 +317,11 @@ static int get_next_row(t85_encode_state_t *s)
             for (i = 0;  i <= s->mx;  i++)
                 s->c[i] = 0;
         }
-        t81_t82_arith_encode_restart(&s->s, TRUE);
+        t81_t82_arith_encode_restart(&s->s, true);
     }
 
     /* Typical prediction */
-    ltp = FALSE;
+    ltp = false;
     if ((s->options & T85_TPBON))
     {
         /* Look for a match between the rows */
@@ -659,7 +664,7 @@ SPAN_DECLARE(int) t85_encode_restart(t85_encode_state_t *s, uint32_t image_width
     s->newlen = NEWLEN_NONE;
     s->new_tx = -1;
     s->tx = 0;
-    s->prev_ltp = FALSE;
+    s->prev_ltp = false;
     s->bitstream_iptr = 0;
     s->bitstream_optr = 0;
     if (s->bitstream)
@@ -668,7 +673,7 @@ SPAN_DECLARE(int) t85_encode_restart(t85_encode_state_t *s, uint32_t image_width
         s->bitstream = NULL;
     }
     s->bitstream_len = 0;
-    s->fill_with_white = FALSE;
+    s->fill_with_white = false;
     s->compressed_image_size = 0;
 
     t81_t82_arith_encode_init(&s->s, output_byte, s);
index a817834d22aafaa1208f07de35b8a333c2d0d11c..1096ca3e328bdc359166a2ef103ee0e79ccd67ea 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 
 #include "spandsp/telephony.h"
@@ -126,17 +131,17 @@ SPAN_DECLARE(int) time_scale_rate(time_scale_state_t *s, float playout_rate)
 
 SPAN_DECLARE(time_scale_state_t *) time_scale_init(time_scale_state_t *s, int sample_rate, float playout_rate)
 {
-    int alloced;
+    bool alloced;
 
     if (sample_rate > TIME_SCALE_MAX_SAMPLE_RATE)
         return NULL;
-    alloced = FALSE;
+    alloced = false;
     if (s == NULL)
     {
         if ((s = (time_scale_state_t *) span_alloc(sizeof (*s))) == NULL)
             return NULL;
         /*endif*/
-        alloced = TRUE;
+        alloced = true;
     }
     /*endif*/
     s->sample_rate = sample_rate;
index 158b0100dac7fca1430bd7be693dd10f3b95e8f9..cd84dc42e2f6e5cf7053f4758ab7741180da647e 100644 (file)
 #include <string.h>
 #include <time.h>
 #include <stdlib.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include <assert.h>
 
 #include "spandsp/telephony.h"
 
 #include "spandsp/private/timezone.h"
 
-#if !defined(FALSE)
-#define FALSE    0
-#endif
-
-#if !defined(TRUE)
-#define TRUE    (!FALSE)
-#endif
-
 #define SECS_PER_MIN            60
 #define MINS_PER_HOUR           60
 #define HOURS_PER_DAY           24
@@ -645,7 +642,7 @@ static int tzparse(const char *name, struct tz_state_s * const sp, const int las
                 }
             }
             /* Initially we're assumed to be in standard time. */
-            isdst = FALSE;
+            isdst = false;
             theiroffset = theirstdoffset;
             /* Now juggle transition times and types tracking offsets as you do. */
             for (i = 0;  i < sp->timecnt;  i++)
@@ -681,10 +678,10 @@ static int tzparse(const char *name, struct tz_state_s * const sp, const int las
             }
             /* Finally, fill in ttis. ttisstd and ttisgmt need not be handled. */
             sp->ttis[0].gmtoff = -stdoffset;
-            sp->ttis[0].isdst = FALSE;
+            sp->ttis[0].isdst = false;
             sp->ttis[0].abbrind = 0;
             sp->ttis[1].gmtoff = -dstoffset;
-            sp->ttis[1].isdst = TRUE;
+            sp->ttis[1].isdst = true;
             sp->ttis[1].abbrind = stdlen + 1;
             sp->typecnt = 2;
         }
@@ -742,9 +739,9 @@ static void tz_set(tz_t *tz, const char *tzstring)
         lclptr->ttis[0].abbrind = 0;
         strcpy(lclptr->chars, gmt);
     }
-    else if (name[0] == ':'  ||  tzparse(name, lclptr, FALSE) != 0)
+    else if (name[0] == ':'  ||  tzparse(name, lclptr, false) != 0)
     {
-        tzparse(gmt, lclptr, TRUE);
+        tzparse(gmt, lclptr, true);
     }
     set_tzname(tz);
 }
index a1d9585983845c9a3a0693c5e70af612b32ddf96..bfc701a597afdc963db4fd20bd8998026e0c1231 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 
 #include "spandsp/telephony.h"
@@ -64,6 +69,7 @@
 #include "spandsp/v17rx.h"
 
 #include "spandsp/private/logging.h"
+#include "spandsp/private/power_meter.h"
 #include "spandsp/private/v17rx.h"
 
 #if defined(SPANDSP_USE_FIXED_POINTx)
@@ -1118,7 +1124,7 @@ static void process_half_baud(v17_rx_state_t *s, const complexf_t *sample)
                 s->signal_present = 60;
                 equalizer_save(s);
                 s->carrier_phase_rate_save = s->carrier_phase_rate;
-                s->short_train = TRUE;
+                s->short_train = true;
                 s->training_stage = TRAINING_STAGE_NORMAL_OPERATION;
             }
             else
@@ -1213,7 +1219,7 @@ static __inline__ int signal_detect(v17_rx_state_t *s, int16_t amp)
             }
 #if defined(IAXMODEM_STUFF)
             /* Carrier has dropped, but the put_bit is pending the signal_present delay. */
-            s->carrier_drop_pending = TRUE;
+            s->carrier_drop_pending = true;
 #endif
         }
     }
@@ -1224,7 +1230,7 @@ static __inline__ int signal_detect(v17_rx_state_t *s, int16_t amp)
             return 0;
         s->signal_present = 1;
 #if defined(IAXMODEM_STUFF)
-        s->carrier_drop_pending = FALSE;
+        s->carrier_drop_pending = false;
 #endif
         report_status_change(s, SIG_STATUS_CARRIER_UP);
     }
@@ -1387,7 +1393,7 @@ SPAN_DECLARE(logging_state_t *) v17_rx_get_logging_state(v17_rx_state_t *s)
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(int) v17_rx_restart(v17_rx_state_t *s, int bit_rate, int short_train)
+SPAN_DECLARE(int) v17_rx_restart(v17_rx_state_t *s, int bit_rate, bool short_train)
 {
     int i;
 
@@ -1441,7 +1447,7 @@ SPAN_DECLARE(int) v17_rx_restart(v17_rx_state_t *s, int bit_rate, int short_trai
 #if defined(IAXMODEM_STUFF)
     s->high_sample = 0;
     s->low_samples = 0;
-    s->carrier_drop_pending = FALSE;
+    s->carrier_drop_pending = false;
 #endif
     if (short_train != 2)
         s->short_train = short_train;
@@ -1535,7 +1541,7 @@ SPAN_DECLARE(v17_rx_state_t *) v17_rx_init(v17_rx_state_t *s, int bit_rate, put_
     span_log_set_protocol(&s->logging, "V.17 RX");
     s->put_bit = put_bit;
     s->put_bit_user_data = user_data;
-    s->short_train = FALSE;
+    s->short_train = false;
     s->scrambler_tap = 18 - 1;
     v17_rx_signal_cutoff(s, -45.5f);
     s->carrier_phase_rate_save = DDS_PHASE_RATE(CARRIER_NOMINAL_FREQ);
index b4f9f3e80a06654006f6d8ff3d14550b11d7cfa7..cbe261a6cfba5c4187c0c1f961912e748a672b7a 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 
 #include "spandsp/telephony.h"
@@ -252,7 +257,7 @@ static __inline__ complexf_t getbaud(v17_tx_state_t *s)
             {
                 /* Training finished - commence normal operation. */
                 s->current_get_bit = s->get_bit;
-                s->in_training = FALSE;
+                s->in_training = false;
             }
         }
         else
@@ -280,7 +285,7 @@ static __inline__ complexf_t getbaud(v17_tx_state_t *s)
             if (s->status_handler)
                 s->status_handler(s->status_user_data, SIG_STATUS_END_OF_DATA);
             s->current_get_bit = fake_get_bit;
-            s->in_training = TRUE;
+            s->in_training = true;
             bit = 1;
         }
         bits |= (scramble(s, bit) << i);
@@ -381,7 +386,7 @@ SPAN_DECLARE(logging_state_t *) v17_tx_get_logging_state(v17_tx_state_t *s)
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(int) v17_tx_restart(v17_tx_state_t *s, int bit_rate, int tep, int short_train)
+SPAN_DECLARE(int) v17_tx_restart(v17_tx_state_t *s, int bit_rate, bool tep, bool short_train)
 {
     switch (bit_rate)
     {
@@ -423,7 +428,7 @@ SPAN_DECLARE(int) v17_tx_restart(v17_tx_state_t *s, int bit_rate, int tep, int s
     s->rrc_filter_step = 0;
     s->convolution = 0;
     s->scramble_reg = 0x2ECDD5;
-    s->in_training = TRUE;
+    s->in_training = true;
     s->short_train = short_train;
     s->training_step = (tep)  ?  V17_TRAINING_SEG_TEP_A  :  V17_TRAINING_SEG_1;
     s->carrier_phase = 0;
@@ -434,7 +439,7 @@ SPAN_DECLARE(int) v17_tx_restart(v17_tx_state_t *s, int bit_rate, int tep, int s
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(v17_tx_state_t *) v17_tx_init(v17_tx_state_t *s, int bit_rate, int tep, get_bit_func_t get_bit, void *user_data)
+SPAN_DECLARE(v17_tx_state_t *) v17_tx_init(v17_tx_state_t *s, int bit_rate, bool tep, get_bit_func_t get_bit, void *user_data)
 {
     switch (bit_rate)
     {
@@ -461,7 +466,7 @@ SPAN_DECLARE(v17_tx_state_t *) v17_tx_init(v17_tx_state_t *s, int bit_rate, int
     s->scrambler_tap = 18 - 1;
     s->carrier_phase_rate = dds_phase_ratef(CARRIER_NOMINAL_FREQ);
     v17_tx_power(s, -14.0f);
-    v17_tx_restart(s, bit_rate, tep, FALSE);
+    v17_tx_restart(s, bit_rate, tep, false);
     return s;
 }
 /*- End of function --------------------------------------------------------*/
index 177ca88229c9d9085b26ff76e9278f63e4d9dfc5..c1a0e89c4fc3d6823bf795523bd9fe394b57d804 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 
 #include "spandsp/telephony.h"
@@ -63,6 +68,7 @@
 #include "spandsp/private/queue.h"
 #include "spandsp/private/tone_generate.h"
 #include "spandsp/private/async.h"
+#include "spandsp/private/power_meter.h"
 #include "spandsp/private/fsk.h"
 #include "spandsp/private/dtmf.h"
 #include "spandsp/private/modem_connect_tones.h"
@@ -741,14 +747,34 @@ static int v18_tdd_get_async_byte(void *user_data)
         s->next_byte = (uint8_t) 0xFF;
         return x;
     }
-    if ((ch = queue_read_byte(&s->queue.queue)) >= 0)
-        return ch;
-    if (s->tx_signal_on)
+    for (;;)
     {
-        /* The FSK should now be switched off. */
-        s->tx_signal_on = 0;
+        if ((ch = queue_read_byte(&s->queue.queue)) < 0)
+        {
+            if (s->tx_signal_on)
+            {
+                /* The FSK should now be switched off. */
+                s->tx_signal_on = 0;
+            }
+            async_tx_presend_bits(&s->async_tx, 42);
+            return SIG_STATUS_LINK_IDLE;
+        }
+        if ((x = encode_baudot(s, ch)) != 0)
+            break;
+    }
+    s->rx_suppression = (300*SAMPLE_RATE)/1000;
+    if (s->tx_signal_on == 1)
+    {
+        async_tx_presend_bits(&s->async_tx, 7);
+        s->tx_signal_on = 2;
     }
-    return 0x1F;
+    if ((x & 0x3E0))
+    {
+        s->next_byte = (uint8_t) (x & 0x1F);
+        return (uint8_t) ((x >> 5) & 0x1F);
+    }
+    s->next_byte = (uint8_t) 0xFF;
+    return (uint8_t) (x & 0x1F);
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -824,10 +850,15 @@ static void v18_tdd_put_async_byte(void *user_data, int byte)
         }
         return;
     }
+    if (s->rx_suppression > 0)
+        return;
     span_log(&s->logging, SPAN_LOG_FLOW, "Rx byte %x\n", byte);
     if ((octet = decode_baudot(s, byte)) != 0xFF)
+    {
         s->rx_msg[s->rx_msg_len++] = octet;
-    if (s->rx_msg_len >= 256)
+        span_log(&s->logging, SPAN_LOG_FLOW, "Rx byte 0x%x '%c'\n", octet, octet);
+    }
+    if (s->rx_msg_len > 0) //= 256)
     {
         s->rx_msg[s->rx_msg_len] = '\0';
         if (s->put_msg)
@@ -983,18 +1014,23 @@ SPAN_DECLARE_NONSTD(int) v18_rx(v18_state_t *s, const int16_t amp[], int len)
         else
             s->rx_suppression = 0;
     }
-    switch (s->mode)
+    if ((s->mode & V18_MODE_DTMF))
     {
-    case V18_MODE_DTMF:
         /* Apply a message timeout. */
-        s->in_progress -= len;
-        if (s->in_progress <= 0)
-            s->rx_msg_len = 0;
+        if (s->in_progress)
+        {
+            s->in_progress -= len;
+            if (s->in_progress <= 0)
+            {
+                s->in_progress = 0;
+                s->rx_msg_len = 0;
+            }
+        }
         dtmf_rx(&s->dtmf_rx, amp, len);
-        break;
-    default:
+    }
+    if ((s->mode & (V18_MODE_5BIT_4545 | V18_MODE_5BIT_476 | V18_MODE_5BIT_50)))
+    {
         fsk_rx(&s->fsk_rx, amp, len);
-        break;
     }
     return 0;
 }
@@ -1009,18 +1045,23 @@ SPAN_DECLARE_NONSTD(int) v18_rx_fillin(v18_state_t *s, int len)
         else
             s->rx_suppression = 0;
     }
-    switch (s->mode)
+    if ((s->mode & V18_MODE_DTMF))
     {
-    case V18_MODE_DTMF:
         /* Apply a message timeout. */
-        //s->in_progress -= len;
-        //if (s->in_progress <= 0)
-        //    s->rx_msg_len = 0;
+        if (s->in_progress)
+        {
+            s->in_progress -= len;
+            if (s->in_progress <= 0)
+            {
+                s->in_progress = 0;
+                s->rx_msg_len = 0;
+            }
+        }
         dtmf_rx_fillin(&s->dtmf_rx, len);
-        break;
-    default:
+    }
+    if ((s->mode & (V18_MODE_5BIT_4545 | V18_MODE_5BIT_476 | V18_MODE_5BIT_50)))
+    {
         fsk_rx_fillin(&s->fsk_rx, len);
-        break;
     }
     return 0;
 }
@@ -1028,9 +1069,6 @@ SPAN_DECLARE_NONSTD(int) v18_rx_fillin(v18_state_t *s, int len)
 
 SPAN_DECLARE(int) v18_put(v18_state_t *s, const char msg[], int len)
 {
-    char buf[256 + 1];
-    int x;
-    int n;
     int i;
 
     /* This returns the number of characters that would not fit in the buffer.
@@ -1041,29 +1079,11 @@ SPAN_DECLARE(int) v18_put(v18_state_t *s, const char msg[], int len)
         if ((len = strlen(msg)) == 0)
             return 0;
     }
-    switch (s->mode)
-    {
-    case V18_MODE_5BIT_4545:
-    case V18_MODE_5BIT_50:
-        for (i = 0;  i < len;  i++)
-        {
-            n = 0;
-            if ((x = encode_baudot(s, msg[i])))
-            {
-                if ((x & 0x3E0))
-                    buf[n++] = (uint8_t) ((x >> 5) & 0x1F);
-                buf[n++] = (uint8_t) (x & 0x1F);
-                /* TODO: Deal with out of space condition */
-                if (queue_write(&s->queue.queue, (const uint8_t *) buf, n) < 0)
-                    return i;
-                s->tx_signal_on = 1;
-            }
-        }
-        return len;
-    case V18_MODE_DTMF:
-        break;
-    }
-    return -1;
+    /* TODO: Deal with out of space condition */
+    if ((i = queue_write(&s->queue.queue, (const uint8_t *) msg, len)) < 0)
+        return i;
+    s->tx_signal_on = 1;
+    return i;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -1103,7 +1123,7 @@ SPAN_DECLARE(logging_state_t *) v18_get_logging_state(v18_state_t *s)
 /*- End of function --------------------------------------------------------*/
 
 SPAN_DECLARE(v18_state_t *) v18_init(v18_state_t *s,
-                                     int calling_party,
+                                     bool calling_party,
                                      int mode,
                                      int nation,
                                      put_msg_func_t put_msg,
@@ -1128,7 +1148,7 @@ SPAN_DECLARE(v18_state_t *) v18_init(v18_state_t *s,
     case V18_MODE_5BIT_4545:
         s->repeat_shifts = mode & V18_MODE_REPETITIVE_SHIFTS_OPTION;
         fsk_tx_init(&s->fsk_tx, &preset_fsk_specs[FSK_WEITBRECHT_4545], async_tx_get_bit, &s->async_tx);
-        async_tx_init(&s->async_tx, 5, ASYNC_PARITY_NONE, 2, FALSE, v18_tdd_get_async_byte, s);
+        async_tx_init(&s->async_tx, 5, ASYNC_PARITY_NONE, 2, false, v18_tdd_get_async_byte, s);
         /* Schedule an explicit shift at the start of baudot transmission */
         s->baudot_tx_shift = 2;
         /* TDD uses 5 bit data, no parity and 1.5 stop bits. We scan for the first stop bit, and
@@ -1140,7 +1160,7 @@ SPAN_DECLARE(v18_state_t *) v18_init(v18_state_t *s,
     case V18_MODE_5BIT_476:
         s->repeat_shifts = mode & V18_MODE_REPETITIVE_SHIFTS_OPTION;
         fsk_tx_init(&s->fsk_tx, &preset_fsk_specs[FSK_WEITBRECHT_476], async_tx_get_bit, &s->async_tx);
-        async_tx_init(&s->async_tx, 5, ASYNC_PARITY_NONE, 2, FALSE, v18_tdd_get_async_byte, s);
+        async_tx_init(&s->async_tx, 5, ASYNC_PARITY_NONE, 2, false, v18_tdd_get_async_byte, s);
         /* Schedule an explicit shift at the start of baudot transmission */
         s->baudot_tx_shift = 2;
         /* TDD uses 5 bit data, no parity and 1.5 stop bits. We scan for the first stop bit, and
@@ -1152,7 +1172,7 @@ SPAN_DECLARE(v18_state_t *) v18_init(v18_state_t *s,
     case V18_MODE_5BIT_50:
         s->repeat_shifts = mode & V18_MODE_REPETITIVE_SHIFTS_OPTION;
         fsk_tx_init(&s->fsk_tx, &preset_fsk_specs[FSK_WEITBRECHT_50], async_tx_get_bit, &s->async_tx);
-        async_tx_init(&s->async_tx, 5, ASYNC_PARITY_NONE, 2, FALSE, v18_tdd_get_async_byte, s);
+        async_tx_init(&s->async_tx, 5, ASYNC_PARITY_NONE, 2, false, v18_tdd_get_async_byte, s);
         /* Schedule an explicit shift at the start of baudot transmission */
         s->baudot_tx_shift = 2;
         /* TDD uses 5 bit data, no parity and 1.5 stop bits. We scan for the first stop bit, and
@@ -1167,27 +1187,27 @@ SPAN_DECLARE(v18_state_t *) v18_init(v18_state_t *s,
         break;
     case V18_MODE_EDT:
         fsk_tx_init(&s->fsk_tx, &preset_fsk_specs[FSK_V21CH1_110], async_tx_get_bit, &s->async_tx);
-        async_tx_init(&s->async_tx, 7, ASYNC_PARITY_EVEN, 2, FALSE, v18_edt_get_async_byte, s);
+        async_tx_init(&s->async_tx, 7, ASYNC_PARITY_EVEN, 2, false, v18_edt_get_async_byte, s);
         fsk_rx_init(&s->fsk_rx, &preset_fsk_specs[FSK_V21CH1_110], FSK_FRAME_MODE_7E2_FRAMES, v18_edt_put_async_byte, s);
         break;
     case V18_MODE_BELL103:
         fsk_tx_init(&s->fsk_tx, &preset_fsk_specs[FSK_BELL103CH1], async_tx_get_bit, &s->async_tx);
-        async_tx_init(&s->async_tx, 7, ASYNC_PARITY_EVEN, 1, FALSE, v18_edt_get_async_byte, s);
+        async_tx_init(&s->async_tx, 7, ASYNC_PARITY_EVEN, 1, false, v18_edt_get_async_byte, s);
         fsk_rx_init(&s->fsk_rx, &preset_fsk_specs[FSK_BELL103CH2], FSK_FRAME_MODE_7E1_FRAMES, v18_bell103_put_async_byte, s);
         break;
     case V18_MODE_V23VIDEOTEX:
         fsk_tx_init(&s->fsk_tx, &preset_fsk_specs[FSK_V23CH1], async_tx_get_bit, &s->async_tx);
-        async_tx_init(&s->async_tx, 7, ASYNC_PARITY_EVEN, 1, FALSE, v18_edt_get_async_byte, s);
+        async_tx_init(&s->async_tx, 7, ASYNC_PARITY_EVEN, 1, false, v18_edt_get_async_byte, s);
         fsk_rx_init(&s->fsk_rx, &preset_fsk_specs[FSK_V23CH2], FSK_FRAME_MODE_7E1_FRAMES, v18_videotex_put_async_byte, s);
         break;
     case V18_MODE_V21TEXTPHONE:
         fsk_tx_init(&s->fsk_tx, &preset_fsk_specs[FSK_V21CH1], async_tx_get_bit, &s->async_tx);
-        async_tx_init(&s->async_tx, 7, ASYNC_PARITY_EVEN, 1, FALSE, v18_edt_get_async_byte, s);
+        async_tx_init(&s->async_tx, 7, ASYNC_PARITY_EVEN, 1, false, v18_edt_get_async_byte, s);
         fsk_rx_init(&s->fsk_rx, &preset_fsk_specs[FSK_V21CH1], FSK_FRAME_MODE_7E1_FRAMES, v18_textphone_put_async_byte, s);
         break;
     case V18_MODE_V18TEXTPHONE:
         fsk_tx_init(&s->fsk_tx, &preset_fsk_specs[FSK_V21CH1], async_tx_get_bit, &s->async_tx);
-        async_tx_init(&s->async_tx, 7, ASYNC_PARITY_EVEN, 1, FALSE, v18_edt_get_async_byte, s);
+        async_tx_init(&s->async_tx, 7, ASYNC_PARITY_EVEN, 1, false, v18_edt_get_async_byte, s);
         fsk_rx_init(&s->fsk_rx, &preset_fsk_specs[FSK_V21CH1], FSK_FRAME_MODE_7E1_FRAMES, v18_textphone_put_async_byte, s);
         break;
     }
index 099eb8bff02fc4ccb72c84375eeb2f77340e4b81..aba3dd2980da84eacb35a0f998cd3ff79566712a 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 
 #include "spandsp/telephony.h"
@@ -70,6 +75,7 @@
 #include "spandsp/v22bis.h"
 
 #include "spandsp/private/logging.h"
+#include "spandsp/private/power_meter.h"
 #include "spandsp/private/v22bis.h"
 
 #if defined(SPANDSP_USE_FIXED_POINT)
@@ -711,7 +717,7 @@ static __inline__ void process_half_baud(v22bis_state_t *s, const complexf_t *sa
                 if (s->rx.training_count >= ms_to_symbols(100 + 450))
                 {
                     span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting 16 way decisions (caller)\n");
-                    s->rx.sixteen_way_decisions = TRUE;
+                    s->rx.sixteen_way_decisions = true;
                     s->rx.training = V22BIS_RX_TRAINING_STAGE_WAIT_FOR_SCRAMBLED_ONES_AT_2400;
                     s->rx.pattern_repeats = 0;
 #if defined(SPANDSP_USE_FIXED_POINT)
@@ -726,7 +732,7 @@ static __inline__ void process_half_baud(v22bis_state_t *s, const complexf_t *sa
                 if (s->rx.training_count >= ms_to_symbols(450))
                 {
                     span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting 16 way decisions (answerer)\n");
-                    s->rx.sixteen_way_decisions = TRUE;
+                    s->rx.sixteen_way_decisions = true;
                     s->rx.training = V22BIS_RX_TRAINING_STAGE_WAIT_FOR_SCRAMBLED_ONES_AT_2400;
                     s->rx.pattern_repeats = 0;
                 }
@@ -839,7 +845,7 @@ SPAN_DECLARE_NONSTD(int) v22bis_rx(v22bis_state_t *s, const int16_t amp[], int l
             /* Look for power exceeding the carrier on point */
             if (power < s->rx.carrier_on_power)
                 continue;
-            s->rx.signal_present = TRUE;
+            s->rx.signal_present = true;
             v22bis_report_status_change(s, SIG_STATUS_CARRIER_UP);
         }
         /* Only spend effort processing this data if the modem is not parked, after
@@ -952,7 +958,7 @@ int v22bis_rx_restart(v22bis_state_t *s)
     s->rx.scrambler_pattern_count = 0;
     s->rx.training = V22BIS_RX_TRAINING_STAGE_SYMBOL_ACQUISITION;
     s->rx.training_count = 0;
-    s->rx.signal_present = FALSE;
+    s->rx.signal_present = false;
 
     s->rx.carrier_phase_rate = (s->calling_party)  ?  DDS_PHASE_RATE(2400.0f)  :  DDS_PHASE_RATE(1200.0f);
     s->rx.carrier_phase = 0;
@@ -965,7 +971,7 @@ int v22bis_rx_restart(v22bis_state_t *s)
 #endif
 
     s->rx.constellation_state = 0;
-    s->rx.sixteen_way_decisions = FALSE;
+    s->rx.sixteen_way_decisions = false;
 
     equalizer_reset(s);
 
index d7ecbe269aa61d2fa8ca5ee8d8755197fc8b4b19..15d31cb9d76c1965ab552becf0e0a5533314e410 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 
 #include "spandsp/telephony.h"
@@ -61,6 +66,7 @@
 #include "spandsp/v22bis.h"
 
 #include "spandsp/private/logging.h"
+#include "spandsp/private/power_meter.h"
 #include "spandsp/private/v22bis.h"
 
 #if defined(SPANDSP_USE_FIXED_POINT)
@@ -669,7 +675,7 @@ SPAN_DECLARE(int) v22bis_request_retrain(v22bis_state_t *s, int bit_rate)
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(int) v22bis_remote_loopback(v22bis_state_t *s, int enable)
+SPAN_DECLARE(int) v22bis_remote_loopback(v22bis_state_t *s, bool enable)
 {
     /* TODO: */
     return -1;
@@ -685,7 +691,7 @@ SPAN_DECLARE(int) v22bis_get_current_bit_rate(v22bis_state_t *s)
 SPAN_DECLARE(v22bis_state_t *) v22bis_init(v22bis_state_t *s,
                                            int bit_rate,
                                            int guard,
-                                           int calling_party,
+                                           bool calling_party,
                                            get_bit_func_t get_bit,
                                            void *get_bit_user_data,
                                            put_bit_func_t put_bit,
index 0e49cf901b83d4bcead02bf23590492a0127fab2..228c5e4d773a0629a943941c39e110d4e0d9d9b0 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 
 #include "spandsp/telephony.h"
@@ -63,6 +68,7 @@
 #include "spandsp/v27ter_rx.h"
 
 #include "spandsp/private/logging.h"
+#include "spandsp/private/power_meter.h"
 #include "spandsp/private/v27ter_rx.h"
 
 #if defined(SPANDSP_USE_FIXED_POINT)
@@ -783,13 +789,13 @@ static __inline__ int signal_detect(v27ter_rx_state_t *s, int16_t amp)
             {
                 /* Count down a short delay, to ensure we push the last
                    few bits through the filters before stopping. */
-                v27ter_rx_restart(s, s->bit_rate, FALSE);
+                v27ter_rx_restart(s, s->bit_rate, false);
                 report_status_change(s, SIG_STATUS_CARRIER_DOWN);
                 return 0;
             }
 #if defined(IAXMODEM_STUFF)
             /* Carrier has dropped, but the put_bit is pending the signal_present delay. */
-            s->carrier_drop_pending = TRUE;
+            s->carrier_drop_pending = true;
 #endif
         }
     }
@@ -800,7 +806,7 @@ static __inline__ int signal_detect(v27ter_rx_state_t *s, int16_t amp)
             return 0;
         s->signal_present = 1;
 #if defined(IAXMODEM_STUFF)
-        s->carrier_drop_pending = FALSE;
+        s->carrier_drop_pending = false;
 #endif
         report_status_change(s, SIG_STATUS_CARRIER_UP);
     }
@@ -1008,7 +1014,7 @@ SPAN_DECLARE(logging_state_t *) v27ter_rx_get_logging_state(v27ter_rx_state_t *s
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(int) v27ter_rx_restart(v27ter_rx_state_t *s, int bit_rate, int old_train)
+SPAN_DECLARE(int) v27ter_rx_restart(v27ter_rx_state_t *s, int bit_rate, bool old_train)
 {
     span_log(&s->logging, SPAN_LOG_FLOW, "Restarting V.27ter\n");
     if (bit_rate != 4800  &&  bit_rate != 2400)
@@ -1032,7 +1038,7 @@ SPAN_DECLARE(int) v27ter_rx_restart(v27ter_rx_state_t *s, int bit_rate, int old_
 #if defined(IAXMODEM_STUFF)
     s->high_sample = 0;
     s->low_samples = 0;
-    s->carrier_drop_pending = FALSE;
+    s->carrier_drop_pending = false;
 #endif
     vec_zeroi32(s->diff_angles, 16);
 
@@ -1098,7 +1104,7 @@ SPAN_DECLARE(v27ter_rx_state_t *) v27ter_rx_init(v27ter_rx_state_t *s, int bit_r
     s->put_bit = put_bit;
     s->put_bit_user_data = user_data;
 
-    v27ter_rx_restart(s, bit_rate, FALSE);
+    v27ter_rx_restart(s, bit_rate, false);
     return s;
 }
 /*- End of function --------------------------------------------------------*/
index 1195b96d8f8a346e45e0f07c23edeae9a8d25166..1cb724b42e21fb3a90c9cd8b7201502c3f5c4ab2 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 
 #include "spandsp/telephony.h"
@@ -129,7 +134,7 @@ static __inline__ int get_scrambled_bit(v27ter_tx_state_t *s)
         if (s->status_handler)
             s->status_handler(s->status_user_data, SIG_STATUS_END_OF_DATA);
         s->current_get_bit = fake_get_bit;
-        s->in_training = TRUE;
+        s->in_training = true;
         bit = 1;
     }
     return scramble(s, bit);
@@ -209,7 +214,7 @@ static complexf_t getbaud(v27ter_tx_state_t *s)
             /* Switch from the fake get_bit routine, to the user supplied real
                one, and we are up and running. */
             s->current_get_bit = s->get_bit;
-            s->in_training = FALSE;
+            s->in_training = false;
         }
         if (s->training_step == V27TER_TRAINING_SHUTDOWN_END)
         {
@@ -368,7 +373,7 @@ SPAN_DECLARE(logging_state_t *) v27ter_tx_get_logging_state(v27ter_tx_state_t *s
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(int) v27ter_tx_restart(v27ter_tx_state_t *s, int bit_rate, int tep)
+SPAN_DECLARE(int) v27ter_tx_restart(v27ter_tx_state_t *s, int bit_rate, bool tep)
 {
     if (bit_rate != 4800  &&  bit_rate != 2400)
         return -1;
@@ -383,7 +388,7 @@ SPAN_DECLARE(int) v27ter_tx_restart(v27ter_tx_state_t *s, int bit_rate, int tep)
     s->rrc_filter_step = 0;
     s->scramble_reg = 0x3C;
     s->scrambler_pattern_count = 0;
-    s->in_training = TRUE;
+    s->in_training = true;
     s->training_step = (tep)  ?  V27TER_TRAINING_SEG_1  :  V27TER_TRAINING_SEG_2;
     s->carrier_phase = 0;
     s->baud_phase = 0;
@@ -393,7 +398,7 @@ SPAN_DECLARE(int) v27ter_tx_restart(v27ter_tx_state_t *s, int bit_rate, int tep)
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(v27ter_tx_state_t *) v27ter_tx_init(v27ter_tx_state_t *s, int bit_rate, int tep, get_bit_func_t get_bit, void *user_data)
+SPAN_DECLARE(v27ter_tx_state_t *) v27ter_tx_init(v27ter_tx_state_t *s, int bit_rate, bool tep, get_bit_func_t get_bit, void *user_data)
 {
     switch (bit_rate)
     {
index a5520e92cdbdc9ac900f779193ae380751e61fe6..8431ffbfd7017bad191b2595b1e772ca60c151e9 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 
 #include "spandsp/telephony.h"
@@ -62,6 +67,7 @@
 #include "spandsp/v29rx.h"
 
 #include "spandsp/private/logging.h"
+#include "spandsp/private/power_meter.h"
 #include "spandsp/private/v29rx.h"
 
 #if defined(SPANDSP_USE_FIXED_POINT)
@@ -861,14 +867,14 @@ static __inline__ int signal_detect(v29_rx_state_t *s, int16_t amp)
             {
                 /* Count down a short delay, to ensure we push the last
                    few bits through the filters before stopping. */
-                v29_rx_restart(s, s->bit_rate, FALSE);
+                v29_rx_restart(s, s->bit_rate, false);
                 report_status_change(s, SIG_STATUS_CARRIER_DOWN);
                 return 0;
             }
 #if defined(IAXMODEM_STUFF)
             /* Carrier has dropped, but the put_bit is pending the
                signal_present delay. */
-            s->carrier_drop_pending = TRUE;
+            s->carrier_drop_pending = true;
 #endif
         }
     }
@@ -879,7 +885,7 @@ static __inline__ int signal_detect(v29_rx_state_t *s, int16_t amp)
             return 0;
         s->signal_present = 1;
 #if defined(IAXMODEM_STUFF)
-        s->carrier_drop_pending = FALSE;
+        s->carrier_drop_pending = false;
 #endif
         report_status_change(s, SIG_STATUS_CARRIER_UP);
     }
@@ -1048,7 +1054,7 @@ SPAN_DECLARE(logging_state_t *) v29_rx_get_logging_state(v29_rx_state_t *s)
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(int) v29_rx_restart(v29_rx_state_t *s, int bit_rate, int old_train)
+SPAN_DECLARE(int) v29_rx_restart(v29_rx_state_t *s, int bit_rate, bool old_train)
 {
     int i;
 
@@ -1083,7 +1089,7 @@ SPAN_DECLARE(int) v29_rx_restart(v29_rx_state_t *s, int bit_rate, int old_train)
 #if defined(IAXMODEM_STUFF)
     s->high_sample = 0;
     s->low_samples = 0;
-    s->carrier_drop_pending = FALSE;
+    s->carrier_drop_pending = false;
 #endif
     s->old_train = old_train;
     vec_zeroi32(s->diff_angles, 16);
@@ -1164,7 +1170,7 @@ SPAN_DECLARE(v29_rx_state_t *) v29_rx_init(v29_rx_state_t *s, int bit_rate, put_
     /* The thresholds should be on at -26dBm0 and off at -31dBm0 */
     v29_rx_signal_cutoff(s, -28.5f);
 
-    v29_rx_restart(s, bit_rate, FALSE);
+    v29_rx_restart(s, bit_rate, false);
     return s;
 }
 /*- End of function --------------------------------------------------------*/
index d6dbedf9ce0571cb1179e300e38e7015a838c759..749047f0998c983e5846a75f0f233111b4821480 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 
 #include "spandsp/telephony.h"
@@ -107,7 +112,7 @@ static __inline__ int get_scrambled_bit(v29_tx_state_t *s)
         if (s->status_handler)
             s->status_handler(s->status_user_data, SIG_STATUS_END_OF_DATA);
         s->current_get_bit = fake_get_bit;
-        s->in_training = TRUE;
+        s->in_training = true;
         bit = 1;
     }
     out_bit = (bit ^ (s->scramble_reg >> (18 - 1)) ^ (s->scramble_reg >> (23 - 1))) & 1;
@@ -175,7 +180,7 @@ static __inline__ complexf_t getbaud(v29_tx_state_t *s)
             /* Switch from the fake get_bit routine, to the user supplied real
                one, and we are up and running. */
             s->current_get_bit = s->get_bit;
-            s->in_training = FALSE;
+            s->in_training = false;
         }
         if (s->training_step == V29_TRAINING_SHUTDOWN_END)
         {
@@ -337,7 +342,7 @@ SPAN_DECLARE(logging_state_t *) v29_tx_get_logging_state(v29_tx_state_t *s)
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(int) v29_tx_restart(v29_tx_state_t *s, int bit_rate, int tep)
+SPAN_DECLARE(int) v29_tx_restart(v29_tx_state_t *s, int bit_rate, bool tep)
 {
     span_log(&s->logging, SPAN_LOG_FLOW, "Restarting V.29\n");
     s->bit_rate = bit_rate;
@@ -366,7 +371,7 @@ SPAN_DECLARE(int) v29_tx_restart(v29_tx_state_t *s, int bit_rate, int tep)
     s->rrc_filter_step = 0;
     s->scramble_reg = 0;
     s->training_scramble_reg = 0x2A;
-    s->in_training = TRUE;
+    s->in_training = true;
     s->training_step = (tep)  ?  V29_TRAINING_SEG_TEP  :  V29_TRAINING_SEG_1;
     s->carrier_phase = 0;
     s->baud_phase = 0;
@@ -376,7 +381,7 @@ SPAN_DECLARE(int) v29_tx_restart(v29_tx_state_t *s, int bit_rate, int tep)
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(v29_tx_state_t *) v29_tx_init(v29_tx_state_t *s, int bit_rate, int tep, get_bit_func_t get_bit, void *user_data)
+SPAN_DECLARE(v29_tx_state_t *) v29_tx_init(v29_tx_state_t *s, int bit_rate, bool tep, get_bit_func_t get_bit, void *user_data)
 {
     switch (bit_rate)
     {
index 33a4573052e5114e7b8dbb824ca9df635e0b868b..c52a9676a228aaec0a487fc26e5f557d34b6ed0d 100644 (file)
 #include <errno.h>
 #include <fcntl.h>
 #include <ctype.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include <assert.h>
 
 #include "spandsp/telephony.h"
@@ -52,9 +57,6 @@
 #include "spandsp/private/hdlc.h"
 #include "spandsp/private/v42.h"
 
-#define FALSE 0
-#define TRUE (!FALSE)
-
 /* Detection phase timer */
 #define T_400                           750
 /* Acknowledgement timer - 1 second between SABME's */
@@ -626,30 +628,30 @@ static int tx_information_frame(v42_state_t *ss)
 
     s = &ss->lapm;
     if (s->far_busy  ||  ((s->vs - s->va) & 0x7F) >= s->tx_window_size_k)
-        return FALSE;
+        return false;
     if (s->info_get != s->info_put)
-        return TRUE;
+        return true;
     if ((info_put_next = s->info_put + 1) >= V42_INFO_FRAMES)
         info_put_next = 0;
     if (info_put_next == s->info_get  ||  info_put_next == s->info_acked)
-        return FALSE;
+        return false;
     f = &s->info_buf[s->info_put];
     buf = f->buf;
     if (s->iframe_get == NULL)
-        return FALSE;
+        return false;
     n = s->iframe_get(s->iframe_get_user_data, buf + 3, s->tx_n401);
     if (n < 0)
     {
         /* Error */
         report_rx_status_change(ss, SIG_STATUS_LINK_ERROR);
-        return FALSE;
+        return false;
     }
     if (n == 0)
-        return FALSE;
+        return false;
 
     f->len = n + 3;
     s->info_put = info_put_next;
-    return TRUE;
+    return true;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -768,11 +770,11 @@ static void receive_information_frame(v42_state_t *ss, const uint8_t *frame, int
         if (!s->rejected)
         {
             tx_supervisory_frame(s, s->rsp_addr, LAPM_S_REJ, (frame[2] & 0x1));
-            s->rejected = TRUE;
+            s->rejected = true;
         }
         return;
     }
-    s->rejected = FALSE;
+    s->rejected = false;
 
     s->iframe_put(s->iframe_put_user_data, frame + 3, len - 3);
     /* Increment vr */
@@ -790,20 +792,20 @@ static void rx_supervisory_cmd_frame(v42_state_t *ss, const uint8_t *frame, int
     switch (frame[1] & 0x0C)
     {
     case LAPM_S_RR:
-        s->far_busy = FALSE;
+        s->far_busy = false;
         ack_info(ss, frame[2] >> 1);
         /* If p = 1 may be used for status checking? */
         tx_information_rr_rnr_response(ss, frame, len);
         break;
     case LAPM_S_RNR:
-        s->far_busy = TRUE;
+        s->far_busy = true;
         ack_info(ss, frame[2] >> 1);
         /* If p = 1 may be used for status checking? */
         if ((frame[2] & 0x1))
             tx_supervisory_frame(s, s->rsp_addr, (s->local_busy)  ?  LAPM_S_RNR  :  LAPM_S_RR, 1);
         break;
     case LAPM_S_REJ:
-        s->far_busy = FALSE;
+        s->far_busy = false;
         ack_info(ss, frame[2] >> 1);
         if (s->retry_count == 0)
         {
@@ -832,7 +834,7 @@ static void rx_supervisory_rsp_frame(v42_state_t *ss, const uint8_t *frame, int
     switch (frame[1] & 0x0C)
     {
     case LAPM_S_RR:
-        s->far_busy = FALSE;
+        s->far_busy = false;
         ack_info(ss, frame[2] >> 1);
         if (s->retry_count  &&  (frame[2] & 0x1))
         {
@@ -841,7 +843,7 @@ static void rx_supervisory_rsp_frame(v42_state_t *ss, const uint8_t *frame, int
         }
         break;
     case LAPM_S_RNR:
-        s->far_busy = TRUE;
+        s->far_busy = true;
         ack_info(ss, frame[2] >> 1);
         if (s->retry_count  &&  (frame[2] & 0x1))
         {
@@ -852,7 +854,7 @@ static void rx_supervisory_rsp_frame(v42_state_t *ss, const uint8_t *frame, int
             t401_start(ss);
         break;
     case LAPM_S_REJ:
-        s->far_busy = FALSE;
+        s->far_busy = false;
         ack_info(ss, frame[2] >> 1);
         if (s->retry_count == 0  ||  (frame[2] & 0x1))
         {
@@ -998,7 +1000,7 @@ static int rx_unnumbered_rsp_frame(v42_state_t *ss, const uint8_t *frame, int le
         if (s->configuring)
         {
             receive_xid(ss, frame, len);
-            s->configuring = FALSE;
+            s->configuring = false;
             t401_stop(ss);
             switch (s->state)
             {
@@ -1006,7 +1008,7 @@ static int rx_unnumbered_rsp_frame(v42_state_t *ss, const uint8_t *frame, int le
                 lapm_connect(ss);
                 break;
             case LAPM_DATA:
-                s->local_busy = FALSE;
+                s->local_busy = false;
                 tx_supervisory_frame(s, s->cmd_addr, LAPM_S_RR, 0);
                 break;
             }
@@ -1141,10 +1143,10 @@ static int lapm_config(v42_state_t *ss)
     lapm_state_t *s;
 
     s = &ss->lapm;
-    s->configuring = TRUE;
+    s->configuring = true;
     if (s->state == LAPM_DATA)
     {
-        s->local_busy = TRUE;
+        s->local_busy = true;
         tx_supervisory_frame(s, s->cmd_addr, LAPM_S_RNR, 1);
     }
     transmit_xid(ss, s->cmd_addr);
@@ -1159,8 +1161,8 @@ static void reset_lapm(v42_state_t *ss)
 
     s = &ss->lapm;
     /* Reset the LAP.M state */
-    s->local_busy = FALSE;
-    s->far_busy = FALSE;
+    s->local_busy = false;
+    s->far_busy = false;
     s->vs = 0;
     s->va = 0;
     s->vr = 0;
@@ -1321,7 +1323,7 @@ static void negotiation_rx_bit(v42_state_t *s, int new_bit)
                 }
                 else
                 {
-                    s->neg.odp_seen = TRUE;
+                    s->neg.odp_seen = true;
                 }
                 /*endif*/
                 break;
@@ -1472,8 +1474,8 @@ SPAN_DECLARE(void) v42_set_status_callback(v42_state_t *s, modem_status_func_t s
 
 SPAN_DECLARE(void) v42_restart(v42_state_t *s)
 {
-    hdlc_tx_init(&s->lapm.hdlc_tx, FALSE, 1, TRUE, lapm_hdlc_underflow, s);
-    hdlc_rx_init(&s->lapm.hdlc_rx, FALSE, FALSE, 1, lapm_receive, s);
+    hdlc_tx_init(&s->lapm.hdlc_tx, false, 1, true, lapm_hdlc_underflow, s);
+    hdlc_rx_init(&s->lapm.hdlc_rx, false, false, 1, lapm_receive, s);
 
     if (s->detect)
     {
@@ -1485,7 +1487,7 @@ SPAN_DECLARE(void) v42_restart(v42_state_t *s)
         s->neg.rxoks = 0;
         s->neg.txadps = 0;
         s->neg.rx_negotiation_step = 0;
-        s->neg.odp_seen = FALSE;
+        s->neg.odp_seen = false;
         t400_start(s);
         s->lapm.state = LAPM_DETECT;
     }
@@ -1500,8 +1502,8 @@ SPAN_DECLARE(void) v42_restart(v42_state_t *s)
 /*- End of function --------------------------------------------------------*/
 
 SPAN_DECLARE(v42_state_t *) v42_init(v42_state_t *ss,
-                                     int calling_party,
-                                     int detect,
+                                     bool calling_party,
+                                     bool detect,
                                      get_msg_func_t iframe_get,
                                      put_msg_func_t iframe_put,
                                      void *user_data)
@@ -1524,8 +1526,8 @@ SPAN_DECLARE(v42_state_t *) v42_init(v42_state_t *ss,
     s->iframe_put_user_data = user_data;
 
     s->state = (ss->detect)  ?  LAPM_DETECT  :  LAPM_IDLE;
-    s->local_busy = FALSE;
-    s->far_busy = FALSE;
+    s->local_busy = false;
+    s->far_busy = false;
 
     /* The address octet is:
         Data link connection identifier (0)
index cc34c54be94f25b8da5792f13e88e05c0ca30dd8..3ca07fc493feb7e7cad537bd7ac4876af305cc6f 100644 (file)
 #include <fcntl.h>
 #include <ctype.h>
 #include <assert.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 
 #include "spandsp/telephony.h"
 #include "spandsp/alloc.h"
@@ -171,8 +176,8 @@ static void dictionary_init(v42bis_comp_state_t *s)
     s->flushed_length = 0;
     s->string_length = 0;
     s->escape_code = 0;
-    s->transparent = TRUE;
-    s->escaped = FALSE;
+    s->transparent = true;
+    s->escaped = false;
     s->compression_performance = COMPRESSIBILITY_MONITOR;
 }
 /*- End of function --------------------------------------------------------*/
@@ -330,7 +335,7 @@ static void go_compressed(v42bis_state_t *ss)
     push_octet(s, s->escape_code);
     push_octet(s, V42BIS_ECM);
     s->bit_buffer = 0;
-    s->transparent = FALSE;
+    s->transparent = false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -353,7 +358,7 @@ static void go_transparent(v42bis_state_t *ss)
     s->last_added = 0;
     push_compressed_code(s, V42BIS_ETM);
     push_octet_alignment(s);
-    s->transparent = TRUE;
+    s->transparent = true;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -535,14 +540,14 @@ SPAN_DECLARE(int) v42bis_decompress(v42bis_state_t *ss, const uint8_t buf[], int
             if (s->escaped)
             {
                 /* Command */
-                s->escaped = FALSE;
+                s->escaped = false;
                 switch (in)
                 {
                 case V42BIS_ECM:
                     /* Enter compressed mode */
                     span_log(&ss->logging, SPAN_LOG_FLOW, "Hit V42BIS_ECM\n");
                     send_string(s);
-                    s->transparent = FALSE;
+                    s->transparent = false;
                     s->update_at = s->last_matched;
                     s->last_matched = 0;
                     i++;
@@ -568,12 +573,12 @@ SPAN_DECLARE(int) v42bis_decompress(v42bis_state_t *ss, const uint8_t buf[], int
             }
             else if (in == s->escape_code)
             {
-                s->escaped = TRUE;
+                s->escaped = true;
                 i++;
                 continue;
             }
 
-            yyy = TRUE;
+            yyy = true;
             for (j = 0;  j < 2  &&  yyy;  j++)
             {
                 if (s->update_at)
@@ -606,7 +611,7 @@ SPAN_DECLARE(int) v42bis_decompress(v42bis_state_t *ss, const uint8_t buf[], int
                         s->last_matched = 0;
                     }
                     i++;
-                    yyy = FALSE;
+                    yyy = false;
                 }
             }
         }
@@ -633,7 +638,7 @@ SPAN_DECLARE(int) v42bis_decompress(v42bis_state_t *ss, const uint8_t buf[], int
                     /* Enter transparent mode */
                     span_log(&ss->logging, SPAN_LOG_FLOW, "Hit V42BIS_ETM\n");
                     s->bit_count = 0;
-                    s->transparent = TRUE;
+                    s->transparent = true;
                     s->last_matched = 0;
                     s->last_added = 0;
                     break;
index fb8436651c0282f53b58e48db96e23ed98084fd5..464d90b0fefc065c3733ec27e78db67a62b5e254 100644 (file)
 #if defined(HAVE_MATH_H)
 #include <math.h>
 #endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
 #include "floating_fudge.h"
 
 #include "spandsp/telephony.h"
@@ -58,6 +63,7 @@
 #include "spandsp/v8.h"
 
 #include "spandsp/private/logging.h"
+#include "spandsp/private/power_meter.h"
 #include "spandsp/private/fsk.h"
 #include "spandsp/private/modem_connect_tones.h"
 #include "spandsp/private/v8.h"
@@ -427,7 +433,7 @@ static void cm_jm_decode(v8_state_t *s)
         return;
     }
     /* We have a matching pair of CMs or JMs, so we are happy this is correct. */
-    s->got_cm_jm = TRUE;
+    s->got_cm_jm = true;
 
     span_log(&s->logging, SPAN_LOG_FLOW, "Decoding\n");
 
@@ -577,7 +583,7 @@ static void put_bit(void *user_data, int bit)
             if (data == 0)
             {
                 if (++s->zero_byte_count == 3)
-                    s->got_cj = TRUE;
+                    s->got_cj = true;
             }
             else
             {
@@ -603,8 +609,8 @@ static void v8_decode_init(v8_state_t *s)
     s->preamble_type = V8_SYNC_UNKNOWN;
     s->bit_stream = 0;
     s->cm_jm_len = 0;
-    s->got_cm_jm = FALSE;
-    s->got_cj = FALSE;
+    s->got_cm_jm = false;
+    s->got_cj = false;
     s->zero_byte_count = 0;
     s->rx_data_ptr = 0;
 }
@@ -751,7 +757,7 @@ SPAN_DECLARE_NONSTD(int) v8_tx(v8_state_t *s, int16_t *amp, int max_len)
         if (len < max_len)
         {
             span_log(&s->logging, SPAN_LOG_FLOW, "FSK ends\n");
-            s->fsk_tx_on = FALSE;
+            s->fsk_tx_on = false;
         }
     }
     return len;
@@ -832,7 +838,7 @@ SPAN_DECLARE_NONSTD(int) v8_rx(v8_state_t *s, const int16_t *amp, int len)
         fsk_tx_restart(&s->v21tx, &preset_fsk_specs[FSK_V21CH1]);
         send_ci(s);
         s->state = V8_CI_ON;
-        s->fsk_tx_on = TRUE;
+        s->fsk_tx_on = true;
         break;
     case V8_CI_ON:
         residual_samples = modem_connect_tones_rx(&s->ansam_rx, amp, len);
@@ -873,7 +879,7 @@ SPAN_DECLARE_NONSTD(int) v8_rx(v8_state_t *s, const int16_t *amp, int len)
                 fsk_tx_restart(&s->v21tx, &preset_fsk_specs[FSK_V21CH1]);
                 send_ci(s);
                 s->state = V8_CI_ON;
-                s->fsk_tx_on = TRUE;
+                s->fsk_tx_on = true;
             }
         }
         break;
@@ -894,7 +900,7 @@ SPAN_DECLARE_NONSTD(int) v8_rx(v8_state_t *s, const int16_t *amp, int len)
             send_v92(s);
             send_cm_jm(s);
             s->state = V8_CM_ON;
-            s->fsk_tx_on = TRUE;
+            s->fsk_tx_on = true;
         }
         break;
     case V8_CM_ON:
@@ -908,7 +914,7 @@ SPAN_DECLARE_NONSTD(int) v8_rx(v8_state_t *s, const int16_t *amp, int len)
             for (i = 0;  i < 3;  i++)
                 v8_put_byte(s, 0);
             s->state = V8_CJ_ON;
-            s->fsk_tx_on = TRUE;
+            s->fsk_tx_on = true;
             break;
         }
         if ((s->negotiation_timer -= len) <= 0)
@@ -961,7 +967,7 @@ SPAN_DECLARE_NONSTD(int) v8_rx(v8_state_t *s, const int16_t *amp, int len)
             s->state = V8_JM_ON;
             send_cm_jm(s);
             s->modem_connect_tone_tx_on = ms_to_samples(75);
-            s->fsk_tx_on = TRUE;
+            s->fsk_tx_on = true;
             break;
         }
         if ((s->negotiation_timer -= len) <= 0)
@@ -1024,7 +1030,7 @@ SPAN_DECLARE(logging_state_t *) v8_get_logging_state(v8_state_t *s)
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(int) v8_restart(v8_state_t *s, int calling_party, v8_parms_t *parms)
+SPAN_DECLARE(int) v8_restart(v8_state_t *s, bool calling_party, v8_parms_t *parms)
 {
     memcpy(&s->parms, parms, sizeof(s->parms));
     memset(&s->result, 0, sizeof(s->result));
@@ -1072,7 +1078,7 @@ SPAN_DECLARE(int) v8_restart(v8_state_t *s, int calling_party, v8_parms_t *parms
 /*- End of function --------------------------------------------------------*/
 
 SPAN_DECLARE(v8_state_t *) v8_init(v8_state_t *s,
-                                   int calling_party,
+                                   bool calling_party,
                                    v8_parms_t *parms,
                                    v8_result_handler_t result_handler,
                                    void *user_data)
index a54b22c6e9a995c6aaa3eaa99fbf6402471cf5ab..936fd557de3a6e631b72a608b92ac0256894376b 100644 (file)
@@ -75,17 +75,17 @@ static int reports_entry = 0;
 
 static int16_t amp[1000000];
 
-int tx_callback_reported = FALSE;
-int rx_callback_reported = FALSE;
+bool tx_callback_reported = false;
+bool rx_callback_reported = false;
 
-int sending_complete = FALSE;
+bool sending_complete = false;
 
 SNDFILE *outhandle;
 
 static void talkoff_tx_callback(void *user_data, int tone, int level, int duration)
 {
     printf("Ademco sender report %d\n", tone);
-    tx_callback_reported = TRUE;
+    tx_callback_reported = true;
 }
 
 static int mitel_cm7291_side_2_and_bellcore_tests(void)
@@ -102,7 +102,7 @@ static int mitel_cm7291_side_2_and_bellcore_tests(void)
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Ademco-tx");
 
-    tx_callback_reported = FALSE;
+    tx_callback_reported = false;
 
     /* The remainder of the Mitel tape is the talk-off test */
     /* Here we use the Bellcore test tapes (much tougher), in six
@@ -153,7 +153,7 @@ static void rx_callback(void *user_data, const ademco_contactid_report_t *report
         printf("Report mismatch\n");
         exit(2);
     }
-    rx_callback_reported = TRUE;
+    rx_callback_reported = true;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -174,11 +174,11 @@ static void tx_callback(void *user_data, int tone, int level, int duration)
         if (++reports_entry < 5)
             ademco_contactid_sender_put(sender, &reports[reports_entry]);
         else
-            sending_complete = TRUE;
+            sending_complete = true;
         break;
     case 0:
         /* Sending failed after retries */
-        sending_complete = TRUE;
+        sending_complete = true;
         break;
     }
 }
@@ -223,8 +223,8 @@ static int end_to_end_tests(void)
     awgn_init_dbm0(&noise_source, 1234567, -50);
     munge = codec_munge_init(MUNGE_CODEC_ALAW, 0);
 
-    sending_complete = FALSE;
-    rx_callback_reported = FALSE;
+    sending_complete = false;
+    rx_callback_reported = false;
 
     for (i = 0;  i < 1000;  i++)
     {
index 17be38bcc471b8db3d34086e7587efb08605fe87..500bbf0858c71b63717d8e2ee4fbdd2065881a4f 100644 (file)
@@ -70,16 +70,16 @@ const char *bellcore_files[] =
 char *decode_test_file = NULL;
 
 int errors = 0;
-int basic_testing = FALSE;
+bool basic_testing = false;
 
 adsi_rx_state_t *rx_adsi;
 adsi_tx_state_t *tx_adsi;
 
 int current_standard = 0;
 int good_message_received;
-int log_audio = FALSE;
+bool log_audio = false;
 SNDFILE *outhandle = NULL;
-int short_preamble = FALSE;
+bool short_preamble = false;
 
 static int adsi_create_message(adsi_tx_state_t *s, uint8_t *msg)
 {
@@ -235,7 +235,7 @@ static void put_adsi_msg(void *user_data, const uint8_t *msg, int len)
     uint8_t body[256];
 
     printf("Good message received (%d bytes)\n", len);
-    good_message_received = TRUE;
+    good_message_received = true;
     for (i = 0;  i < len;  i++)
     {
         printf("%02x ", msg[i]);
@@ -625,7 +625,7 @@ static void basic_tests(int standard)
     int push;
     int i;
 
-    basic_testing = TRUE;
+    basic_testing = true;
     printf("Testing %s\n", adsi_standard_to_str(standard));
     tx_adsi = adsi_tx_init(NULL, standard);
     if (short_preamble)
@@ -633,7 +633,7 @@ static void basic_tests(int standard)
     rx_adsi = adsi_rx_init(NULL, standard, put_adsi_msg, NULL);
 
     /* Fake an OK condition for the first message test */
-    good_message_received = TRUE;
+    good_message_received = true;
     push = 0;
     for (i = 0;  i < 100000;  i++)
     {
@@ -653,7 +653,7 @@ static void basic_tests(int standard)
                     printf("No message received %s (%d)\n", adsi_standard_to_str(standard), i);
                     exit(2);
                 }
-                good_message_received = FALSE;
+                good_message_received = false;
                 adsi_msg_len = adsi_create_message(tx_adsi, adsi_msg);
                 adsi_msg_len = adsi_tx_put_message(tx_adsi, adsi_msg, adsi_msg_len);
             }
@@ -678,7 +678,7 @@ static void basic_tests(int standard)
     }
     adsi_rx_free(rx_adsi);
     adsi_tx_free(tx_adsi);
-    basic_testing = FALSE;
+    basic_testing = false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -734,28 +734,28 @@ int main(int argc, char *argv[])
     int enable_basic_tests;
     int enable_talkoff_tests;
 
-    log_audio = FALSE;
+    log_audio = false;
     decode_test_file = NULL;
     test_standard = -1;
-    short_preamble = FALSE;
-    enable_basic_tests = TRUE;
-    enable_talkoff_tests = FALSE;
+    short_preamble = false;
+    enable_basic_tests = true;
+    enable_talkoff_tests = false;
     while ((opt = getopt(argc, argv, "bd:lps:t")) != -1)
     {
         switch (opt)
         {
         case 'b':
-            enable_basic_tests = TRUE;
-            enable_talkoff_tests = FALSE;
+            enable_basic_tests = true;
+            enable_talkoff_tests = false;
             break;
         case 'd':
             decode_test_file = optarg;
             break;
         case 'l':
-            log_audio = TRUE;
+            log_audio = true;
             break;
         case 'p':
-            short_preamble = TRUE;
+            short_preamble = true;
             break;
         case 's':
             if (strcasecmp("CLASS", optarg) == 0)
@@ -774,8 +774,8 @@ int main(int argc, char *argv[])
                 test_standard = atoi(optarg);
             break;
         case 't':
-            enable_basic_tests = FALSE;
-            enable_talkoff_tests = TRUE;
+            enable_basic_tests = false;
+            enable_talkoff_tests = true;
             break;
         default:
             //usage();
index 54dfb1e96d737d426c0905883078a00083766a91..0e8177ae29706a7d309adca3fefb259aff7e1120 100644 (file)
@@ -58,16 +58,16 @@ int main(int argc, char *argv[])
     void *b;
     void *c;
     
-    if (span_mem_allocators(malloc,
-                            memalign,
+    if (span_mem_allocators(memalign,
+                            malloc,
                             realloc,
                             free))
     {
         printf("Failed\n");
         exit(2);
     }
-    a = span_alloc(42);
-    b = span_aligned_alloc(8, 42);
+    a = span_aligned_alloc(8, 42);
+    b = span_alloc(42);
     c = span_realloc(NULL, 42);
     printf("%p %p %p\n", a, b, c);
     span_free(a);
index 49010c3a73d45c55053505f662a7579c888c50f5..48c96e4d363b9a1c76d8363d15f047d6ebbc4a54 100644 (file)
@@ -128,8 +128,8 @@ int main(int argc, char *argv[])
     int bit;
 
     printf("Test with async 8N1\n");
-    async_tx_init(&tx_async, 8, ASYNC_PARITY_NONE, 1, FALSE, test_get_async_byte, NULL);
-    async_rx_init(&rx_async, 8, ASYNC_PARITY_NONE, 1, FALSE, test_put_async_byte, NULL);
+    async_tx_init(&tx_async, 8, ASYNC_PARITY_NONE, 1, false, test_get_async_byte, NULL);
+    async_rx_init(&rx_async, 8, ASYNC_PARITY_NONE, 1, false, test_put_async_byte, NULL);
     tx_async_chars = 0;
     rx_async_chars = 0;
     rx_async_char_mask = 0xFF;
@@ -150,8 +150,8 @@ int main(int argc, char *argv[])
     }
 
     printf("Test with async 7E1\n");
-    async_tx_init(&tx_async, 7, ASYNC_PARITY_EVEN, 1, FALSE, test_get_async_byte, NULL);
-    async_rx_init(&rx_async, 7, ASYNC_PARITY_EVEN, 1, FALSE, test_put_async_byte, NULL);
+    async_tx_init(&tx_async, 7, ASYNC_PARITY_EVEN, 1, false, test_get_async_byte, NULL);
+    async_rx_init(&rx_async, 7, ASYNC_PARITY_EVEN, 1, false, test_put_async_byte, NULL);
     tx_async_chars = 0;
     rx_async_chars = 0;
     rx_async_char_mask = 0x7F;
@@ -172,8 +172,8 @@ int main(int argc, char *argv[])
     }
 
     printf("Test with async 8O1\n");
-    async_tx_init(&tx_async, 8, ASYNC_PARITY_ODD, 1, FALSE, test_get_async_byte, NULL);
-    async_rx_init(&rx_async, 8, ASYNC_PARITY_ODD, 1, FALSE, test_put_async_byte, NULL);
+    async_tx_init(&tx_async, 8, ASYNC_PARITY_ODD, 1, false, test_get_async_byte, NULL);
+    async_rx_init(&rx_async, 8, ASYNC_PARITY_ODD, 1, false, test_put_async_byte, NULL);
     tx_async_chars = 0;
     rx_async_chars = 0;
     rx_async_char_mask = 0xFF;
@@ -194,8 +194,8 @@ int main(int argc, char *argv[])
     }
 
     printf("Test with async 8O1 and V.14\n");
-    async_tx_init(&tx_async, 8, ASYNC_PARITY_ODD, 1, TRUE, test_get_async_byte, NULL);
-    async_rx_init(&rx_async, 8, ASYNC_PARITY_ODD, 1, TRUE, test_put_async_byte, NULL);
+    async_tx_init(&tx_async, 8, ASYNC_PARITY_ODD, 1, true, test_get_async_byte, NULL);
+    async_rx_init(&rx_async, 8, ASYNC_PARITY_ODD, 1, true, test_put_async_byte, NULL);
     tx_async_chars = 0;
     rx_async_chars = 0;
     rx_async_char_mask = 0xFF;
@@ -216,8 +216,8 @@ int main(int argc, char *argv[])
     }
 
     printf("Test with async 5N2\n");
-    async_tx_init(&tx_async, 5, ASYNC_PARITY_NONE, 2, FALSE, test_get_async_byte, NULL);
-    async_rx_init(&rx_async, 5, ASYNC_PARITY_NONE, 2, FALSE, test_put_async_byte, NULL);
+    async_tx_init(&tx_async, 5, ASYNC_PARITY_NONE, 2, false, test_get_async_byte, NULL);
+    async_rx_init(&rx_async, 5, ASYNC_PARITY_NONE, 2, false, test_put_async_byte, NULL);
     tx_async_chars = 0;
     rx_async_chars = 0;
     rx_async_char_mask = 0x1F;
index ed33c95d35276e64c3fba79ab42abb37032392a5..0c938caa01b3f1d899f5832513d1b1ddc3b7a55f 100644 (file)
@@ -112,7 +112,7 @@ static tone_gen_descriptor_t my_mf_digit_tones[16];
 
 static char bell_mf_tone_codes[] = "1234567890CA*B#";
 
-int callback_ok;
+bool callback_ok;
 int callback_roll;
 
 static void my_mf_gen_init(float low_fudge,
@@ -139,7 +139,7 @@ static void my_mf_gen_init(float low_fudge,
                                  gap,
                                  0,
                                  0,
-                                 FALSE);
+                                 false);
     }
 }
 /*- End of function --------------------------------------------------------*/
@@ -188,10 +188,10 @@ static void digit_delivery(void *data, const char *digits, int len)
 
     if (data != (void *) 0x12345678)
     {
-        callback_ok = FALSE;
+        callback_ok = false;
         return;
     }
-    callback_ok = TRUE;
+    callback_ok = true;
     t = s + callback_roll;
     seg = 15 - callback_roll;
     for (i = 0;  i < len;  i += seg, seg = 15)
@@ -200,7 +200,7 @@ static void digit_delivery(void *data, const char *digits, int len)
             seg = len - i;
         if (memcmp(digits + i, t, seg))
         {
-            callback_ok = FALSE;
+            callback_ok = false;
             printf("Fail at %d %d\n", i, seg);
             break;
         }
@@ -522,7 +522,7 @@ int main(int argc, char *argv[])
     /* Test the callback mode for delivering detected digits */
 
     printf("Test: Callback digit delivery mode.\n");
-    callback_ok = FALSE;
+    callback_ok = false;
     callback_roll = 0;
     mf_state = bell_mf_rx_init(NULL, digit_delivery, (void *) 0x12345678);
     my_mf_gen_init(0.0, -10, 0.0, -10, 68, 68);
index 6818f61889533b3995a51c079e8003d43018b60a..5b6bb6151f62e892be221198ad1bb127daea3401 100644 (file)
@@ -210,18 +210,18 @@ int main(int argc, char *argv[])
         bert_put_bit(rx_bert, bit);
         test[tx_bert->tx.reg]++;
     }
-    failed = FALSE;
+    failed = false;
     if (test[0] != 0)
     {
         printf("XXX %d %d\n", 0, test[0]);
-        failed = TRUE;
+        failed = true;
     }
     for (i = 1;  i < 0x200;  i++)
     {
         if (test[i] != 2)
         {
             printf("XXX %d %d\n", i, test[i]);
-            failed = TRUE;
+            failed = true;
         }
     }
     bert_result(rx_bert, &bert_results);
@@ -254,18 +254,18 @@ int main(int argc, char *argv[])
         bert_put_bit(rx_bert, bit);
         test[tx_bert->tx.reg]++;
     }
-    failed = FALSE;
+    failed = false;
     if (test[0] != 0)
     {
         printf("XXX %d %d\n", 0, test[0]);
-        failed = TRUE;
+        failed = true;
     }
     for (i = 1;  i < 0x800;  i++)
     {
         if (test[i] != 2)
         {
             printf("XXX %d %d\n", i, test[i]);
-            failed = TRUE;
+            failed = true;
         }
     }
     bert_result(rx_bert, &bert_results);
@@ -298,18 +298,18 @@ int main(int argc, char *argv[])
         bert_put_bit(rx_bert, bit);
         test[tx_bert->tx.reg]++;
     }
-    failed = FALSE;
+    failed = false;
     if (test[0] != 0)
     {
         printf("XXX %d %d\n", 0, test[0]);
-        failed = TRUE;
+        failed = true;
     }
     for (i = 1;  i < 0x8000;  i++)
     {
         if (test[i] != 2)
         {
             printf("XXX %d %d\n", i, test[i]);
-            failed = TRUE;
+            failed = true;
         }
     }
     bert_result(rx_bert, &bert_results);
@@ -342,11 +342,11 @@ int main(int argc, char *argv[])
         bert_put_bit(rx_bert, bit);
         test[tx_bert->tx.reg]++;
     }
-    failed = FALSE;
+    failed = false;
     if (test[0] != 0)
     {
         printf("XXX %d %d\n", 0, test[0]);
-        failed = TRUE;
+        failed = true;
     }
     for (i = 1;  i < 0x100000;  i++)
     {
@@ -383,11 +383,11 @@ int main(int argc, char *argv[])
         bert_put_bit(rx_bert, bit);
         test[tx_bert->tx.reg]++;
     }
-    failed = FALSE;
+    failed = false;
     if (test[0] != 0)
     {
         printf("XXX %d %d\n", 0, test[0]);
-        failed = TRUE;
+        failed = true;
     }
     for (i = 1;  i < 0x800000;  i++)
     {
index c641872f652befc97dd8d9e7be413dfc64a4ea5e..3e7b441a556b736ee0e498b25b3cd046b654316c 100644 (file)
@@ -106,7 +106,7 @@ int main(int argc, char *argv[])
     unsigned int x;
     int total_bits;
 
-    s = bitstream_init(&state, TRUE);
+    s = bitstream_init(&state, true);
     w = buffer;
     total_bits = 0;
     for (i = 0;  i < SEQUENCE_LENGTH;  i++)
@@ -130,7 +130,7 @@ int main(int argc, char *argv[])
         exit(2);
     }
 
-    s = bitstream_init(&state, TRUE);
+    s = bitstream_init(&state, true);
     r = buffer;
     for (i = 0;  i < SEQUENCE_LENGTH;  i++)
     {
@@ -143,7 +143,7 @@ int main(int argc, char *argv[])
         }
     }
 
-    s = bitstream_init(&state, FALSE);
+    s = bitstream_init(&state, false);
     w = buffer;
     total_bits = 0;
     for (i = 0;  i < SEQUENCE_LENGTH;  i++)
@@ -167,7 +167,7 @@ int main(int argc, char *argv[])
         exit(2);
     }
 
-    s = bitstream_init(&state, FALSE);
+    s = bitstream_init(&state, false);
     r = buffer;
     for (i = 0;  i < SEQUENCE_LENGTH;  i++)
     {
index 89a456bd82af1fdc90a33330eb2409a835fbe249..ef44e0d5b6198e37f08bde251dd736502d10ac41 100644 (file)
@@ -145,15 +145,15 @@ float dtmf_col[] =
 
 char dtmf_positions[] = "123A" "456B" "789C" "*0#D";
 
-int callback_hit;
-int callback_ok;
+bool callback_hit;
+bool callback_ok;
 int callback_roll;
 int step;
 
 float max_forward_twist;
 float max_reverse_twist;
 
-int use_dialtone_filter = FALSE;
+bool use_dialtone_filter = false;
 
 char *decode_test_file = NULL;
 
@@ -185,7 +185,7 @@ static void my_dtmf_gen_init(float low_fudge,
                                      gap,
                                      0,
                                      0,
-                                     FALSE);
+                                     false);
         }
     }
 }
@@ -219,7 +219,7 @@ static void digit_delivery(void *data, const char *digits, int len)
     const char *s = ALL_POSSIBLE_DIGITS;
     const char *t;
 
-    callback_hit = TRUE;
+    callback_hit = true;
     if (data == (void *) 0x12345678)
     {
         t = s + callback_roll;
@@ -230,7 +230,7 @@ static void digit_delivery(void *data, const char *digits, int len)
                 seg = len - i;
             if (memcmp(digits + i, t, seg))
             {
-                callback_ok = FALSE;
+                callback_ok = false;
                 printf("Fail at %d %d\n", i, seg);
                 break;
             }
@@ -240,7 +240,7 @@ static void digit_delivery(void *data, const char *digits, int len)
     }
     else
     {
-        callback_ok = FALSE;
+        callback_ok = false;
     }
 }
 /*- End of function --------------------------------------------------------*/
@@ -250,10 +250,10 @@ static void digit_status(void *data, int signal, int level, int delay)
     const char *s = ALL_POSSIBLE_DIGITS;
     int len;
     static int last_step = 0;
-    static int first = TRUE;
+    static int first = true;
 
     //printf("Digit status %d %d %d\n", signal, level, delay);
-    callback_hit = TRUE;
+    callback_hit = true;
     len = step - last_step;
     if (data == (void *) 0x12345678)
     {
@@ -262,12 +262,12 @@ static void digit_status(void *data, int signal, int level, int delay)
             if (first)
             {
                 /* At the beginning the apparent duration is expected to be wrong */
-                first = FALSE;
+                first = false;
             }
             else
             {
                 printf("Failed for signal %s length %d at %d\n", (callback_roll & 1)  ?  "on"  :  "off", len, step);
-                callback_ok = FALSE;
+                callback_ok = false;
             }
         }
         if (callback_roll & 1)
@@ -275,7 +275,7 @@ static void digit_status(void *data, int signal, int level, int delay)
             if (signal != 0)
             {
                 printf("Failed for signal 0x%X instead of 0\n", signal);
-                callback_ok = FALSE;
+                callback_ok = false;
             }
         }
         else
@@ -283,12 +283,12 @@ static void digit_status(void *data, int signal, int level, int delay)
             if (signal != s[callback_roll >> 1])
             {
                 printf("Failed for signal 0x%X instead of 0x%X\n", signal, s[callback_roll >> 1]);
-                callback_ok = FALSE;
+                callback_ok = false;
             }
             if (level < DEFAULT_DTMF_TX_LEVEL + 3 - 1  ||  level > DEFAULT_DTMF_TX_LEVEL + 3 + 1)
             {
                 printf("Failed for level %d instead of %d\n", level, DEFAULT_DTMF_TX_LEVEL + 3);
-                callback_ok = FALSE;
+                callback_ok = false;
             }
         }
         if (++callback_roll >= 32)
@@ -296,7 +296,7 @@ static void digit_status(void *data, int signal, int level, int delay)
     }
     else
     {
-        callback_ok = FALSE;
+        callback_ok = false;
     }
     last_step = step;
 }
@@ -714,7 +714,7 @@ static void dial_tone_tolerance_tests(void)
 
     for (j = -30;  j < -3;  j++)
     {
-        tone_gen_descriptor_init(&dial_tone_desc, 350, j, 440, j, 1, 0, 0, 0, TRUE);
+        tone_gen_descriptor_init(&dial_tone_desc, 350, j, 440, j, 1, 0, 0, 0, true);
         tone_gen_init(&dial_tone, &dial_tone_desc);
         for (i = 0;  i < 10;  i++)
         {
@@ -755,8 +755,8 @@ static void callback_function_tests(void)
 
     /* Test the callback mode for delivering detected digits */
     printf("Test: Callback digit delivery mode.\n");
-    callback_hit = FALSE;
-    callback_ok = TRUE;
+    callback_hit = false;
+    callback_ok = true;
     callback_roll = 0;
     dtmf_state = dtmf_rx_init(NULL, digit_delivery, (void *) 0x12345678);
     if (use_dialtone_filter  ||  max_forward_twist >= 0.0f  ||  max_reverse_twist >= 0.0f)
@@ -784,8 +784,8 @@ static void callback_function_tests(void)
 
     /* Test the realtime callback mode for reporting detected digits */
     printf("Test: Realtime callback digit delivery mode.\n");
-    callback_hit = FALSE;
-    callback_ok = TRUE;
+    callback_hit = false;
+    callback_ok = true;
     callback_roll = 0;
     dtmf_rx_init(dtmf_state, NULL, NULL);
     dtmf_rx_set_realtime_callback(dtmf_state, digit_status, (void *) 0x12345678);
@@ -867,7 +867,7 @@ int main(int argc, char *argv[])
     int channel_codec;
     int opt;
 
-    use_dialtone_filter = FALSE;
+    use_dialtone_filter = false;
     channel_codec = MUNGE_CODEC_NONE;
     decode_test_file = NULL;
     max_forward_twist = -1.0f;
@@ -886,7 +886,7 @@ int main(int argc, char *argv[])
             max_forward_twist = atof(optarg);
             break;
         case 'f':
-            use_dialtone_filter = TRUE;
+            use_dialtone_filter = true;
             break;
         case 'R':
             max_reverse_twist = atof(optarg);
index 176cf1783bc2783464ffd2742fd3281979492277..3f6f234ce76413cedd3bc4f05358f786cd31fb50 100644 (file)
@@ -188,7 +188,7 @@ int main(int argc, char *argv[])
         exit(2);
     }
 
-    add_digits = TRUE;
+    add_digits = true;
     do
     {
         len = dtmf_tx(gen, amp, 160);
@@ -200,7 +200,7 @@ int main(int argc, char *argv[])
             if (dtmf_tx_put(gen, "1234567890", -1))
             {
                 printf("Digit buffer full\n");
-                add_digits = FALSE;
+                add_digits = false;
             }
         }
     }
index aba34d92b9cfe93ecc2629b1074628ee28159d42..93d496e302589e4e93280a6424fb96d9aeae3d43 100644 (file)
@@ -616,7 +616,7 @@ static void run_test(echo_can_state_t *ctx, int16_t (*tx_source)(void), int16_t
 
 static void print_test_title(const char *title)
 {
-    if (quiet == FALSE)
+    if (quiet == false)
         printf(title);
 }
 /*- End of function --------------------------------------------------------*/
@@ -1567,23 +1567,23 @@ int main(int argc, char *argv[])
     int i;
     time_t now;
     int simulate;
-    int cng;
-    int hpf;
-    int two_channel_file;
     int opt;
     int mode;
+    bool cng;
+    bool hpf;
+    bool two_channel_file;
 
     /* Check which tests we should run */
     if (argc < 2)
         fprintf(stderr, "Usage: echo tests [-g] [-m <model number>] [-s] <list of test numbers>\n");
     line_model_no = 0;
     supp_line_model_no = 0;
-    cng = FALSE;
-    hpf = FALSE;
-    use_gui = FALSE;
-    simulate = FALSE;
+    cng = false;
+    hpf = false;
+    use_gui = false;
+    simulate = false;
     munger = -1;
-    two_channel_file = FALSE;
+    two_channel_file = false;
     erl = -12.0f;
 
     while ((opt = getopt(argc, argv, "2ace:ghm:M:su")) != -1)
@@ -1591,13 +1591,13 @@ int main(int argc, char *argv[])
         switch (opt)
         {
         case '2':
-            two_channel_file = TRUE;
+            two_channel_file = true;
             break;
         case 'a':
             munger = G711_ALAW;
             break;
         case 'c':
-            cng = TRUE;
+            cng = true;
             break;
         case 'e':
             /* Allow for ERL being entered as x or -x */
@@ -1605,14 +1605,14 @@ int main(int argc, char *argv[])
             break;
         case 'g':
 #if defined(ENABLE_GUI)
-            use_gui = TRUE;
+            use_gui = true;
 #else
             fprintf(stderr, "Graphical monitoring not available\n");
             exit(2);
 #endif
             break;
         case 'h':
-            hpf = TRUE;
+            hpf = true;
             break;
         case 'm':
             line_model_no = atoi(optarg);
@@ -1621,7 +1621,7 @@ int main(int argc, char *argv[])
             supp_line_model_no = atoi(optarg);
             break;
         case 's':
-            simulate = TRUE;
+            simulate = true;
             break;
         case 'u':
             munger = G711_ULAW;
index 6bfc14d37ae08fa0a0498a0e0b4ba2ed72aefea3..9fedc23c668e6a59152e94def95af55ba9323414 100644 (file)
@@ -83,12 +83,12 @@ static const struct
     {    0, 0, 0, 0}
 };
 
-int decode_test = FALSE;
+bool decode_test = false;
 int rx_bits = 0;
 
 t30_state_t t30_dummy;
 t4_rx_state_t t4_rx_state;
-int t4_up = FALSE;
+bool t4_up = false;
 
 hdlc_rx_state_t hdlcrx;
 
@@ -102,9 +102,9 @@ int x_resolution = T4_X_RESOLUTION_R8;
 int y_resolution = T4_Y_RESOLUTION_STANDARD;
 int image_width = 1728;
 int octets_per_ecm_frame = 256;
-int error_correcting_mode = FALSE;
+bool error_correcting_mode = false;
 int current_fallback = 0;
-int end_of_page_detected = FALSE;
+bool end_of_page_detected = false;
 
 static void decode_20digit_msg(const uint8_t *pkt, int len)
 {
@@ -294,8 +294,8 @@ static void t4_begin(void)
     t4_rx_set_image_width(&t4_rx_state, image_width);
 
     t4_rx_start_page(&t4_rx_state);
-    t4_up = TRUE;
-    end_of_page_detected = FALSE;
+    t4_up = true;
+    end_of_page_detected = false;
 
     for (i = 0;  i < 256;  i++)
         ecm_len[i] = -1;
@@ -326,7 +326,7 @@ static void t4_end(void)
     fprintf(stderr, "Image resolution = %dx%d\n", stats.x_resolution, stats.y_resolution);
     fprintf(stderr, "Bad rows = %d\n", stats.bad_rows);
     fprintf(stderr, "Longest bad row run = %d\n", stats.longest_bad_row_run);
-    t4_up = FALSE;
+    t4_up = false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -381,7 +381,7 @@ static void v17_put_bit(void *user_data, int bit)
             t4_end();
             if (!end_of_page_detected)
                 fprintf(stderr, "End of page detected\n");
-            end_of_page_detected = TRUE;
+            end_of_page_detected = true;
         }
     }
     //printf("V.17 Rx bit %d - %d\n", rx_bits++, bit);
@@ -419,7 +419,7 @@ static void v29_put_bit(void *user_data, int bit)
             t4_end();
             if (!end_of_page_detected)
                 fprintf(stderr, "End of page detected\n");
-            end_of_page_detected = TRUE;
+            end_of_page_detected = true;
         }
     }
     //printf("V.29 Rx bit %d - %d\n", rx_bits++, bit);
@@ -457,7 +457,7 @@ static void v27ter_put_bit(void *user_data, int bit)
             t4_end();
             if (!end_of_page_detected)
                 fprintf(stderr, "End of page detected\n");
-            end_of_page_detected = TRUE;
+            end_of_page_detected = true;
         }
     }
     //printf("V.27ter Rx bit %d - %d\n", rx_bits++, bit);
@@ -504,7 +504,7 @@ int main(int argc, char *argv[])
     span_log_init(&t30_dummy.logging, SPAN_LOG_FLOW, NULL);
     span_log_set_protocol(&t30_dummy.logging, "T.30");
 
-    hdlc_rx_init(&hdlcrx, FALSE, TRUE, 5, hdlc_accept, NULL);
+    hdlc_rx_init(&hdlcrx, false, true, 5, hdlc_accept, NULL);
     fsk = fsk_rx_init(NULL, &preset_fsk_specs[FSK_V21CH2], FSK_FRAME_MODE_SYNC, v21_put_bit, NULL);
     v17 = v17_rx_init(NULL, 14400, v17_put_bit, NULL);
     v29 = v29_rx_init(NULL, 9600, v29_put_bit, NULL);
index d42ea3a07495529e3a946007751e824a1748ad70..77016202a51889dde0392e608f1882d6ed87958e 100644 (file)
@@ -239,23 +239,23 @@ static void non_ecm_rx_status(void *user_data, int status)
     switch (status)
     {
     case SIG_STATUS_TRAINING_FAILED:
-        s->modems.rx_trained = FALSE;
+        s->modems.rx_trained = false;
         break;
     case SIG_STATUS_TRAINING_SUCCEEDED:
         /* The modem is now trained */
-        s->modems.rx_trained = TRUE;
+        s->modems.rx_trained = true;
         break;
     case SIG_STATUS_CARRIER_UP:
-        s->modems.rx_signal_present = TRUE;
+        s->modems.rx_signal_present = true;
         break;
     case SIG_STATUS_CARRIER_DOWN:
         if (s->modems.rx_trained)
         {
             if (s->real_time_frame_handler)
-                s->real_time_frame_handler(s, s->real_time_frame_user_data, TRUE, NULL, 0);
+                s->real_time_frame_handler(s, s->real_time_frame_user_data, true, NULL, 0);
         }
-        s->modems.rx_signal_present = FALSE;
-        s->modems.rx_trained = FALSE;
+        s->modems.rx_signal_present = false;
+        s->modems.rx_trained = false;
         break;
     }
 }
@@ -280,18 +280,18 @@ static void hdlc_rx_status(void *user_data, int status)
     switch (status)
     {
     case SIG_STATUS_TRAINING_FAILED:
-        s->modems.rx_trained = FALSE;
+        s->modems.rx_trained = false;
         break;
     case SIG_STATUS_TRAINING_SUCCEEDED:
         /* The modem is now trained */
-        s->modems.rx_trained = TRUE;
+        s->modems.rx_trained = true;
         break;
     case SIG_STATUS_CARRIER_UP:
-        s->modems.rx_signal_present = TRUE;
+        s->modems.rx_signal_present = true;
         break;
     case SIG_STATUS_CARRIER_DOWN:
-        s->modems.rx_signal_present = FALSE;
-        s->modems.rx_trained = FALSE;
+        s->modems.rx_signal_present = false;
+        s->modems.rx_trained = false;
         break;
     }
 }
@@ -308,7 +308,7 @@ static void hdlc_accept(void *user_data, const uint8_t *msg, int len, int ok)
     }
     s = (faxtester_state_t *) user_data;
     if (s->real_time_frame_handler)
-        s->real_time_frame_handler(s, s->real_time_frame_user_data, TRUE, msg, len);
+        s->real_time_frame_handler(s, s->real_time_frame_user_data, true, msg, len);
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -325,7 +325,7 @@ int faxtester_rx(faxtester_state_t *s, int16_t *amp, int len)
     {
         if (!s->modems.rx_signal_present)
         {
-            s->wait_for_silence = FALSE;
+            s->wait_for_silence = false;
             front_end_step_complete(s);
         }
     }
@@ -371,7 +371,7 @@ int faxtester_tx(faxtester_state_t *s, int16_t *amp, int max_len)
 
 void faxtest_set_rx_silence(faxtester_state_t *s)
 {
-    s->wait_for_silence = TRUE;
+    s->wait_for_silence = true;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -387,7 +387,7 @@ void faxtester_set_rx_type(void *user_data, int type, int bit_rate, int short_tr
         return;
     s->current_rx_type = type;
     if (use_hdlc)
-        hdlc_rx_init(&t->hdlc_rx, FALSE, FALSE, HDLC_FRAMING_OK_THRESHOLD, hdlc_accept, s);
+        hdlc_rx_init(&t->hdlc_rx, false, false, HDLC_FRAMING_OK_THRESHOLD, hdlc_accept, s);
     switch (type)
     {
     case T30_MODEM_CED:
@@ -449,18 +449,18 @@ void faxtester_set_tx_type(void *user_data, int type, int bit_rate, int short_tr
     case T30_MODEM_PAUSE:
         silence_gen_alter(&t->silence_gen, ms_to_samples(short_train));
         fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
-        s->transmit = TRUE;
+        s->transmit = true;
         break;
     case T30_MODEM_CED:
     case T30_MODEM_CNG:
         tone = (type == T30_MODEM_CED)  ?  MODEM_CONNECT_TONES_FAX_CED  :  MODEM_CONNECT_TONES_FAX_CNG;
         fax_modems_start_slow_modem(t, tone);
-        s->transmit = TRUE;
+        s->transmit = true;
         break;
     case T30_MODEM_V21:
         fax_modems_start_slow_modem(t, FAX_MODEM_V21_TX);
         fsk_tx_set_modem_status_handler(&t->v21_tx, modem_tx_status, (void *) s);
-        s->transmit = TRUE;
+        s->transmit = true;
         break;
     case T30_MODEM_V27TER:
         fax_modems_set_get_bit(t, get_bit_func, get_bit_user_data);
@@ -468,7 +468,7 @@ void faxtester_set_tx_type(void *user_data, int type, int bit_rate, int short_tr
         v27ter_tx_set_modem_status_handler(&t->fast_modems.v27ter_tx, modem_tx_status, (void *) s);
         /* For any fast modem, set 200ms of preamble flags */
         hdlc_tx_flags(&t->hdlc_tx, bit_rate/(8*5));
-        s->transmit = TRUE;
+        s->transmit = true;
         break;
     case T30_MODEM_V29:
         fax_modems_set_get_bit(t, get_bit_func, get_bit_user_data);
@@ -476,7 +476,7 @@ void faxtester_set_tx_type(void *user_data, int type, int bit_rate, int short_tr
         v29_tx_set_modem_status_handler(&t->fast_modems.v29_tx, modem_tx_status, (void *) s);
         /* For any fast modem, set 200ms of preamble flags */
         hdlc_tx_flags(&t->hdlc_tx, bit_rate/(8*5));
-        s->transmit = TRUE;
+        s->transmit = true;
         break;
     case T30_MODEM_V17:
         fax_modems_set_get_bit(t, get_bit_func, get_bit_user_data);
@@ -484,7 +484,7 @@ void faxtester_set_tx_type(void *user_data, int type, int bit_rate, int short_tr
         v17_tx_set_modem_status_handler(&t->fast_modems.v17_tx, modem_tx_status, (void *) s);
         /* For any fast modem, set 200ms of preamble flags */
         hdlc_tx_flags(&t->hdlc_tx, bit_rate/(8*5));
-        s->transmit = TRUE;
+        s->transmit = true;
         break;
     case T30_MODEM_DONE:
         span_log(&s->logging, SPAN_LOG_FLOW, "FAX exchange complete\n");
@@ -492,7 +492,7 @@ void faxtester_set_tx_type(void *user_data, int type, int bit_rate, int short_tr
     default:
         silence_gen_alter(&t->silence_gen, 0);
         fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
-        s->transmit = FALSE;
+        s->transmit = false;
         break;
     }
     s->current_tx_type = type;
@@ -553,17 +553,17 @@ faxtester_state_t *faxtester_init(faxtester_state_t *s, int calling_party)
     span_log_init(&s->logging, SPAN_LOG_NONE, NULL);
     span_log_set_protocol(&s->logging, "TST");
     fax_modems_init(&s->modems,
-                    FALSE,
+                    false,
                     NULL,
                     hdlc_underflow_handler,
                     non_ecm_put_bit,
                     t38_non_ecm_buffer_get_bit,
                     tone_detected,
                     s);
-    fax_modems_set_tep_mode(&s->modems, FALSE);
-    fax_modems_set_rx_active(&s->modems, TRUE);
+    fax_modems_set_tep_mode(&s->modems, false);
+    fax_modems_set_rx_active(&s->modems, true);
     faxtester_set_timeout(s, -1);
-    faxtester_set_tx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE);
+    faxtester_set_tx_type(s, T30_MODEM_NONE, 0, false, false);
 
     return s;
 }
index 45054ec7ece040012a88f98bda1d6f95932d3c1b..bcfcb1d0850eb3206c27e925e07eaef30b36061a 100644 (file)
@@ -44,7 +44,7 @@ typedef void (*faxtester_flush_handler_t)(faxtester_state_t *s, void *user_data,
     \brief FAX tester real time frame handler.
     \param s The FAX tester context.
     \param user_data An opaque pointer.
-    \param direction TRUE for incoming, FALSE for outgoing.
+    \param direction True for incoming, false for outgoing.
     \param msg The HDLC message.
     \param len The length of the message.
 */
@@ -94,11 +94,11 @@ struct faxtester_state_s
     /*! \brief CED or CNG detector */
     modem_connect_tones_rx_state_t connect_rx;
 
-    /*! If TRUE, transmission is in progress */
-    int transmit;
+    /*! If true, transmission is in progress */
+    bool transmit;
 
-    /*! \brief TRUE is the short training sequence should be used. */
-    int short_train;
+    /*! \brief true if the short training sequence should be used. */
+    bool short_train;
 
     /*! \brief The currently select receiver type */
     int current_rx_type;
@@ -157,7 +157,7 @@ void faxtester_set_flush_handler(faxtester_state_t *s, faxtester_flush_handler_t
 /*! Select whether silent audio will be sent when FAX transmit is idle.
     \brief Select whether silent audio will be sent when FAX transmit is idle.
     \param s The FAX tester context.
-    \param transmit_on_idle TRUE if silent audio should be output when the FAX transmitter is
+    \param transmit_on_idle true if silent audio should be output when the FAX transmitter is
            idle. FALSE to transmit zero length audio when the FAX transmitter is idle. The default
            behaviour is FALSE.
 */
@@ -166,7 +166,7 @@ void faxtester_set_transmit_on_idle(faxtester_state_t *s, int transmit_on_idle);
 /*! Select whether talker echo protection tone will be sent for the image modems.
     \brief Select whether TEP will be sent for the image modems.
     \param s The FAX tester context.
-    \param use_tep TRUE if TEP should be sent.
+    \param use_tep true if TEP should be sent.
 */
 void faxtester_set_tep_mode(faxtester_state_t *s, int use_tep);
 
@@ -185,7 +185,7 @@ void faxtester_set_ecm_image_buffer(faxtester_state_t *s, const uint8_t *buf, in
 /*! Initialise a FAX context.
     \brief Initialise a FAX context.
     \param s The FAX tester context.
-    \param calling_party TRUE if the context is for a calling party. FALSE if the
+    \param calling_party true if the context is for a calling party. FALSE if the
            context is for an answering party.
     \return A pointer to the FAX context, or NULL if there was a problem.
 */
index 502da1bbbd02c0bb04ba74764a93aa917054656f..8e417adf9b9608ee9c53a5e8230c415bc415cf69 100644 (file)
@@ -116,16 +116,16 @@ int t38_subst_seq[2] = {0, 0};
 
 t30_exchanged_info_t expected_rx_info[2];
 
-int use_receiver_not_ready = FALSE;
-int test_local_interrupt = FALSE;
+bool use_receiver_not_ready = false;
+bool test_local_interrupt = false;
 
 double when = 0.0;
 
-int phase_e_reached[2] = {FALSE, FALSE};
-int completed[2] = {FALSE, FALSE};
-int succeeded[2] = {FALSE, FALSE};
+bool phase_e_reached[2] = {false, false};
+bool completed[2] = {false, false};
+bool succeeded[2] = {false, false};
 
-int t38_simulate_incrementing_repeats = FALSE;
+bool t38_simulate_incrementing_repeats = false;
 
 static int phase_b_handler(t30_state_t *s, void *user_data, int result)
 {
@@ -316,7 +316,7 @@ static int phase_d_handler(t30_state_t *s, void *user_data, int result)
         if (i == 'A')
         {
             printf("%c: Initiating interrupt request\n", i);
-            t30_local_interrupt_request(s, TRUE);
+            t30_local_interrupt_request(s, true);
         }
         else
         {
@@ -327,7 +327,7 @@ static int phase_d_handler(t30_state_t *s, void *user_data, int result)
             case T30_PRI_EOM:
             case T30_PRI_EOP:
                 printf("%c: Accepting interrupt request\n", i);
-                t30_local_interrupt_request(s, TRUE);
+                t30_local_interrupt_request(s, true);
                 break;
             case T30_PIN:
                 break;
@@ -352,13 +352,13 @@ static void phase_e_handler(t30_state_t *s, void *user_data, int result)
     fax_log_rx_parameters(s, tag);
     t30_get_transfer_statistics(s, &t);
     succeeded[i] = (result == T30_ERR_OK);
-    phase_e_reached[i] = TRUE;
+    phase_e_reached[i] = true;
 }
 /*- End of function --------------------------------------------------------*/
 
 static void real_time_frame_handler(t30_state_t *s,
                                     void *user_data,
-                                    int direction,
+                                    bool incoming,
                                     const uint8_t *msg,
                                     int len)
 {
@@ -367,7 +367,7 @@ static void real_time_frame_handler(t30_state_t *s,
     i = (intptr_t) user_data;
     printf("%c: Real time frame handler - %s, %s, length = %d\n",
            i + 'A',
-           (direction)  ?  "line->T.30"  : "T.30->line",
+           (incoming)  ?  "line->T.30"  : "T.30->line",
            t30_frametype(msg[2]),
            len);
 }
@@ -379,7 +379,7 @@ static int document_handler(t30_state_t *s, void *user_data, int event)
 
     i = (intptr_t) user_data;
     printf("%c: Document handler - event %d\n", i + 'A', event);
-    return FALSE;
+    return false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -395,7 +395,7 @@ static void set_t30_callbacks(t30_state_t *t30, int chan)
 
 static void real_time_gateway_frame_handler(t38_gateway_state_t *s,
                                             void *user_data,
-                                            int direction,
+                                            bool incoming,
                                             const uint8_t *msg,
                                             int len)
 {
@@ -404,7 +404,7 @@ static void real_time_gateway_frame_handler(t38_gateway_state_t *s,
     i = (intptr_t) user_data;
     printf("%c: Real time gateway frame handler - %s, %s, length = %d\n",
            i + 'A',
-           (direction)  ?  "PSTN->T.38"  : "T.38->PSTN",
+           (incoming)  ?  "PSTN->T.38"  : "T.38->PSTN",
            t30_frametype(msg[2]),
            len);
 }
@@ -505,19 +505,19 @@ int main(int argc, char *argv[])
 #endif
 
 #if defined(ENABLE_GUI)
-    use_gui = FALSE;
+    use_gui = false;
 #endif
-    log_audio = FALSE;
-    use_ecm = FALSE;
+    log_audio = false;
+    use_ecm = false;
     t38_version = 1;
     input_tiff_file_name = INPUT_TIFF_FILE_NAME;
-    t38_simulate_incrementing_repeats = FALSE;
+    t38_simulate_incrementing_repeats = false;
     g1050_model_no = 0;
     g1050_speed_pattern_no = 1;
-    remove_fill_bits = FALSE;
-    use_tep = FALSE;
-    feedback_audio = FALSE;
-    use_transmit_on_idle = TRUE;
+    remove_fill_bits = false;
+    use_tep = false;
+    feedback_audio = false;
+    use_transmit_on_idle = true;
     supported_modems = T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17;
     page_header_info = NULL;
     page_header_tz = NULL;
@@ -531,7 +531,7 @@ int main(int argc, char *argv[])
     decode_file_name = NULL;
     code_to_look_up = -1;
     allowed_bilevel_resolutions = 0;
-    colour_enabled = FALSE;
+    colour_enabled = false;
     t38_transport = T38_TRANSPORT_UDPTL;
     while ((opt = getopt(argc, argv, "b:c:Cd:D:efFgH:i:Ilm:M:n:p:s:S:tT:u:v:z:")) != -1)
     {
@@ -544,7 +544,7 @@ int main(int argc, char *argv[])
             code_to_look_up = atoi(optarg);
             break;
         case 'C':
-            colour_enabled = TRUE;
+            colour_enabled = true;
             break;
         case 'd':
             decode_file_name = optarg;
@@ -554,17 +554,17 @@ int main(int argc, char *argv[])
             drop_frame = atoi(optarg);
             break;
         case 'e':
-            use_ecm = TRUE;
+            use_ecm = true;
             break;
         case 'f':
-            feedback_audio = TRUE;
+            feedback_audio = true;
             break;
         case 'F':
-            remove_fill_bits = TRUE;
+            remove_fill_bits = true;
             break;
         case 'g':
 #if defined(ENABLE_GUI)
-            use_gui = TRUE;
+            use_gui = true;
 #else
             fprintf(stderr, "Graphical monitoring not available\n");
             exit(2);
@@ -577,10 +577,10 @@ int main(int argc, char *argv[])
             input_tiff_file_name = optarg;
             break;
         case 'I':
-            t38_simulate_incrementing_repeats = TRUE;
+            t38_simulate_incrementing_repeats = true;
             break;
         case 'l':
-            log_audio = TRUE;
+            log_audio = true;
             break;
         case 'm':
             supported_modems = atoi(optarg);
@@ -630,7 +630,7 @@ int main(int argc, char *argv[])
             scan_line_time = atoi(optarg);
             break;
         case 't':
-            use_tep = TRUE;
+            use_tep = true;
             break;
         case 'T':
             start_page = 0;
@@ -926,7 +926,7 @@ int main(int argc, char *argv[])
         {
             t30_set_supported_colour_resolutions(t30_state[i], 0);
         }
-        t30_set_supported_output_compressions(t30_state[i], T4_COMPRESSION_T4_2D);
+        //t30_set_supported_output_compressions(t30_state[i], T4_COMPRESSION_T85);
         t30_set_ecm_capability(t30_state[i], use_ecm);
         t30_set_supported_compressions(t30_state[i],
                                        T4_COMPRESSION_T4_1D
@@ -934,7 +934,6 @@ int main(int argc, char *argv[])
                                      | T4_COMPRESSION_T6
                                      | T4_COMPRESSION_T85
                                      | T4_COMPRESSION_T85_L0
-#if 0
                                      //| T4_COMPRESSION_T88
                                      | T4_COMPRESSION_T43
                                      | T4_COMPRESSION_T45
@@ -947,7 +946,6 @@ int main(int argc, char *argv[])
                                      | T4_COMPRESSION_GRAY_TO_BILEVEL
                                      | T4_COMPRESSION_COLOUR_TO_BILEVEL
                                      | T4_COMPRESSION_RESCALING
-#endif
                                      | 0);
         t30_set_minimum_scan_line_time(t30_state[i], scan_line_time);
 
@@ -977,9 +975,9 @@ int main(int argc, char *argv[])
                 break;
             case T38_TRANSPORT_TCP:
             case T38_TRANSPORT_TCP_TPKT:
-                t38_terminal_set_fill_bit_removal(t38_state[i], TRUE);
+                t38_terminal_set_fill_bit_removal(t38_state[i], true);
                 t38_terminal_set_config(t38_state[i], T38_TERMINAL_OPTION_NO_PACING | T38_TERMINAL_OPTION_NO_INDICATORS);
-                t38_terminal_set_tep_mode(t38_state[i], FALSE);
+                t38_terminal_set_tep_mode(t38_state[i], false);
                 break;
             }
         }
@@ -1031,7 +1029,7 @@ int main(int argc, char *argv[])
                 fax_rx(fax_state[i], fax_rx_buf[i], SAMPLES_PER_CHUNK);
                 if (!t30_call_active(t30_state[i]))
                 {
-                    completed[i] = TRUE;
+                    completed[i] = true;
                     continue;
                 }
 
index 9cd69f586588be7866c888f554f1d9e7467e905b..db8a1335a7293a98a4de8e3ae16f12f89d39ebc7 100644 (file)
@@ -61,7 +61,7 @@ These tests allow either:
 char *decode_test_file = NULL;
 both_ways_line_model_state_t *model;
 int rx_bits = 0;
-int cutoff_test_carrier = FALSE;
+bool cutoff_test_carrier = false;
 
 static void rx_status(void *user_data, int status)
 {
@@ -93,10 +93,10 @@ static void cutoff_test_rx_status(void *user_data, int status)
     switch (status)
     {
     case SIG_STATUS_CARRIER_UP:
-        cutoff_test_carrier = TRUE;
+        cutoff_test_carrier = true;
         break;
     case SIG_STATUS_CARRIER_DOWN:
-        cutoff_test_carrier = FALSE;
+        cutoff_test_carrier = false;
         break;
     }
 }
@@ -186,23 +186,23 @@ int main(int argc, char *argv[])
     int modem_under_test_1;
     int modem_under_test_2;
     int modems_set;
-    int log_audio;
     int channel_codec;
     int rbs_pattern;
     int on_at;
     int off_at;
+    int opt;
+    bool log_audio;
     tone_gen_descriptor_t tone_desc;
     tone_gen_state_t tone_tx;
-    int opt;
 
     channel_codec = MUNGE_CODEC_NONE;
     rbs_pattern = 0;
     line_model_no = 0;
     decode_test_file = NULL;
-    noise_sweep = FALSE;
+    noise_sweep = false;
     modem_under_test_1 = FSK_V21CH1;
     modem_under_test_2 = FSK_V21CH2;
-    log_audio = FALSE;
+    log_audio = false;
     modems_set = 0;
     while ((opt = getopt(argc, argv, "c:d:lm:nr:s:")) != -1)
     {
@@ -215,13 +215,13 @@ int main(int argc, char *argv[])
             decode_test_file = optarg;
             break;
         case 'l':
-            log_audio = TRUE;
+            log_audio = true;
             break;
         case 'm':
             line_model_no = atoi(optarg);
             break;
         case 'n':
-            noise_sweep = TRUE;
+            noise_sweep = true;
             break;
         case 'r':
             rbs_pattern = atoi(optarg);
@@ -315,7 +315,7 @@ int main(int argc, char *argv[])
                                      0,
                                      0,
                                      0,
-                                     TRUE);
+                                     true);
             tone_gen_init(&tone_tx, &tone_desc);
             for (j = 0;  j < 10;  j++)
             {
@@ -338,7 +338,7 @@ int main(int argc, char *argv[])
                                      0,
                                      0,
                                      0,
-                                     TRUE);
+                                     true);
             tone_gen_init(&tone_tx, &tone_desc);
             for (j = 0;  j < 10;  j++)
             {
index b9d87f5dd37cf7927ddd912d0e98863452d78e49..a7919e95753e46b3c03bd48bdb2378b06de95b1f 100644 (file)
@@ -87,7 +87,7 @@ int main(int argc, char *argv[])
 #endif
 
 #if defined(ENABLE_GUI)
-    use_gui = FALSE;
+    use_gui = false;
 #endif
     model_no = MODEL_NO;
     speed_pattern_no = SPEED_PATTERN_NO;
@@ -98,7 +98,7 @@ int main(int argc, char *argv[])
         {
         case 'g':
 #if defined(ENABLE_GUI)
-            use_gui = TRUE;
+            use_gui = true;
 #else
             fprintf(stderr, "Graphical monitoring not available\n");
             exit(2);
index 8a1fbabbc04a2d95f6592da9688ec9bcea0fcaba..41351496c6921f6ba90e7a6df53ff81239f1b36d 100644 (file)
@@ -38,9 +38,6 @@
 #include "spandsp/g168models.h"
 #include "spandsp-sim.h"
 
-#define FALSE 0
-#define TRUE (!FALSE)
-
 typedef struct
 {
     const char *name;
@@ -158,7 +155,7 @@ int main(int argc, char *argv[])
                                   0,
                                   0,
                                   0,
-                                  TRUE);
+                                  true);
         tone_gen_init(&tone_state, &tone_desc);
         tone_gen(&tone_state, amp, 8000);
         for (i = 0;  i < 10;  i++)
index bb0956d677bf793fcbde3141157c9b3766064c9d..c6ef2b1f78b04ea0e69c72f96d619142ed1f4497 100644 (file)
@@ -353,10 +353,10 @@ int main(int argc, char *argv[])
     int16_t outdata[BLOCK_LEN];
     uint8_t g711data[BLOCK_LEN];
 
-    basic_tests = TRUE;
+    basic_tests = true;
     law = G711_ALAW;
-    encode = FALSE;
-    decode = FALSE;
+    encode = false;
+    decode = false;
     in_file = NULL;
     out_file = NULL;
     while ((opt = getopt(argc, argv, "ad:e:l:u")) != -1)
@@ -365,24 +365,24 @@ int main(int argc, char *argv[])
         {
         case 'a':
             law = G711_ALAW;
-            basic_tests = FALSE;
+            basic_tests = false;
             break;
         case 'd':
             in_file = optarg;
-            basic_tests = FALSE;
-            decode = TRUE;
+            basic_tests = false;
+            decode = true;
             break;
         case 'e':
             in_file = optarg;
-            basic_tests = FALSE;
-            encode = TRUE;
+            basic_tests = false;
+            encode = true;
             break;
         case 'l':
             out_file = optarg;
             break;
         case 'u':
             law = G711_ULAW;
-            basic_tests = FALSE;
+            basic_tests = false;
             break;
         default:
             //usage();
@@ -392,14 +392,14 @@ int main(int argc, char *argv[])
 
     if (basic_tests)
     {
-        compliance_tests(TRUE);
+        compliance_tests(true);
     }
     else
     {
         if (!decode  &&  !encode)
         {
             decode =
-            encode = TRUE;
+            encode = true;
         }
         if (in_file == NULL)
         {
index dff1b959d240436abbcb06f9010b782f3e7517cd..daafaef6d6a3f9e1b0798959eb6ca714b0d37261 100644 (file)
@@ -258,7 +258,7 @@ static void itu_compliance_tests(void)
         }
         len = j - i;
         enc_state = g722_encode_init(NULL, 64000, 0);
-        enc_state->itu_test_mode = TRUE;
+        enc_state->itu_test_mode = true;
         len2 = g722_encode(enc_state, compressed, itu_data + i, len);
 
         /* Check the result against the ITU's reference output data */
@@ -324,7 +324,7 @@ static void itu_compliance_tests(void)
                 compressed[k] = itu_data[k + i] >> ((mode == 3)  ?  10  :  (mode == 2)  ?  9  :  8);
 
             dec_state = g722_decode_init(NULL, (mode == 3)  ?  48000  :  (mode == 2)  ?  56000  :  64000, 0);
-            dec_state->itu_test_mode = TRUE;
+            dec_state->itu_test_mode = true;
             len2 = g722_decode(dec_state, decompressed, compressed, len);
 
             /* Check the result against the ITU's reference output data */
@@ -358,8 +358,8 @@ static void signal_to_distortion_tests(void)
     g722_encode_state_t *enc_state;
     g722_decode_state_t *dec_state;
     swept_tone_state_t *swept;
-    power_meter_t in_meter;
-    power_meter_t out_meter;
+    power_meter_t *in_meter;
+    power_meter_t *out_meter;
     int16_t original[1024];
     uint8_t compressed[1024];
     int16_t decompressed[1024];
@@ -374,32 +374,32 @@ static void signal_to_distortion_tests(void)
        Figure 16/G.722, Figure A.1/G.722, and Figure A.2/G.722 */
     enc_state = g722_encode_init(NULL, 64000, 0);
     dec_state = g722_decode_init(NULL, 64000, 0);
-    power_meter_init(&in_meter, 7);
-    power_meter_init(&out_meter, 7);
+    in_meter = power_meter_init(NULL, 7);
+    out_meter = power_meter_init(NULL, 7);
 
     /* First some silence */
     len = 1024;
     memset(original, 0, len*sizeof(original[0]));
     for (i = 0;  i < len;  i++)
-        in_level = power_meter_update(&in_meter, original[i]);
+        in_level = power_meter_update(in_meter, original[i]);
     len2 = g722_encode(enc_state, compressed, original, len);
     len3 = g722_decode(dec_state, decompressed, compressed, len2);
     out_level = 0;
     for (i = 0;  i < len3;  i++)
-        out_level = power_meter_update(&out_meter, decompressed[i]);
+        out_level = power_meter_update(out_meter, decompressed[i]);
     printf("Silence produces %d at the output\n", out_level);
 
     /* Now a swept tone test */
-    swept = swept_tone_init(NULL, 25.0f, 3500.0f, -10.0f, 60*16000, FALSE);
+    swept = swept_tone_init(NULL, 25.0f, 3500.0f, -10.0f, 60*16000, false);
     do
     {
         len = swept_tone(swept, original, 1024);
         for (i = 0;  i < len;  i++)
-            in_level = power_meter_update(&in_meter, original[i]);
+            in_level = power_meter_update(in_meter, original[i]);
         len2 = g722_encode(enc_state, compressed, original, len);
         len3 = g722_decode(dec_state, decompressed, compressed, len2);
         for (i = 0;  i < len3;  i++)
-            out_level = power_meter_update(&out_meter, decompressed[i]);
+            out_level = power_meter_update(out_meter, decompressed[i]);
         printf("%10d, %10d, %f\n", in_level, out_level, (float) out_level/in_level);
     }
     while (len > 0);
@@ -437,12 +437,12 @@ int main(int argc, char *argv[])
     int32_t tone_phase_rate;
 
     bit_rate = 64000;
-    eight_k_in = FALSE;
-    eight_k_out = FALSE;
-    itutests = TRUE;
-    encode = FALSE;
-    decode = FALSE;
-    tone_test = FALSE;
+    eight_k_in = false;
+    eight_k_out = false;
+    itutests = true;
+    encode = false;
+    decode = false;
+    tone_test = false;
     in_file = NULL;
     out_file = NULL;
     while ((opt = getopt(argc, argv, "b:d:e:i:l:o:t")) != -1)
@@ -456,17 +456,17 @@ int main(int argc, char *argv[])
                 fprintf(stderr, "Invalid bit rate selected. Only 48000, 56000 and 64000 are valid.\n");
                 exit(2);
             }
-            itutests = FALSE;
+            itutests = false;
             break;
         case 'd':
             in_file = optarg;
-            decode = TRUE;
-            itutests = FALSE;
+            decode = true;
+            itutests = false;
             break;
         case 'e':
             in_file = optarg;
-            encode = TRUE;
-            itutests = FALSE;
+            encode = true;
+            itutests = false;
             break;
         case 'i':
             i = atoi(optarg);
@@ -492,8 +492,8 @@ int main(int argc, char *argv[])
             eight_k_out = (i == 8000);
             break;
         case 't':
-            tone_test = TRUE;
-            itutests = FALSE;
+            tone_test = true;
+            itutests = false;
             break;
         default:
             //usage();
@@ -514,7 +514,7 @@ int main(int argc, char *argv[])
         if (!decode  &&  !encode)
         {
             decode =
-            encode = TRUE;
+            encode = true;
         }
         if (in_file == NULL)
         {
index 4fba66021e06e3ad73e78c7925e0ec6b38636e16..0bba6e2fcc595d520771d43781e0a2a22f56d570 100644 (file)
@@ -1196,7 +1196,7 @@ int main(int argc, char *argv[])
     g726_state_t enc_state;
     g726_state_t dec_state;
     int opt;
-    int itutests;
+    bool itutests;
     int bit_rate;
     SNDFILE *inhandle;
     SNDFILE *outhandle;
@@ -1206,7 +1206,7 @@ int main(int argc, char *argv[])
     int packing;
 
     bit_rate = 32000;
-    itutests = TRUE;
+    itutests = true;
     packing = G726_PACKING_NONE;
     while ((opt = getopt(argc, argv, "b:LR")) != -1)
     {
@@ -1219,7 +1219,7 @@ int main(int argc, char *argv[])
                 fprintf(stderr, "Invalid bit rate selected. Only 16000, 24000, 32000 and 40000 are valid.\n");
                 exit(2);
             }
-            itutests = FALSE;
+            itutests = false;
             break;
         case 'L':
             packing = G726_PACKING_LEFT;
index 9993a39260dcfe3789f1448e3a8c85d0bbeb54aa..346f574e995d30826cda29a5f57aebccdb488e9d 100644 (file)
@@ -512,21 +512,21 @@ static int perform_pack_unpack_test(void)
 
 static void etsi_compliance_tests(void)
 {
-    perform_linear_test(TRUE, 1, "Seq01");
-    perform_linear_test(TRUE, 1, "Seq02");
-    perform_linear_test(TRUE, 1, "Seq03");
-    perform_linear_test(TRUE, 1, "Seq04");
-    perform_linear_test(FALSE, 1, "Seq05");
-    perform_law_test(TRUE, 'a', "Seq01");
-    perform_law_test(TRUE, 'a', "Seq02");
-    perform_law_test(TRUE, 'a', "Seq03");
-    perform_law_test(TRUE, 'a', "Seq04");
-    perform_law_test(FALSE, 'a', "Seq05");
-    perform_law_test(TRUE, 'u', "Seq01");
-    perform_law_test(TRUE, 'u', "Seq02");
-    perform_law_test(TRUE, 'u', "Seq03");
-    perform_law_test(TRUE, 'u', "Seq04");
-    perform_law_test(FALSE, 'u', "Seq05");
+    perform_linear_test(true, 1, "Seq01");
+    perform_linear_test(true, 1, "Seq02");
+    perform_linear_test(true, 1, "Seq03");
+    perform_linear_test(true, 1, "Seq04");
+    perform_linear_test(false, 1, "Seq05");
+    perform_law_test(true, 'a', "Seq01");
+    perform_law_test(true, 'a', "Seq02");
+    perform_law_test(true, 'a', "Seq03");
+    perform_law_test(true, 'a', "Seq04");
+    perform_law_test(false, 'a', "Seq05");
+    perform_law_test(true, 'u', "Seq01");
+    perform_law_test(true, 'u', "Seq02");
+    perform_law_test(true, 'u', "Seq03");
+    perform_law_test(true, 'u', "Seq04");
+    perform_law_test(false, 'u', "Seq05");
     /* This is not actually an ETSI test */
     perform_pack_unpack_test();
 
@@ -549,14 +549,14 @@ int main(int argc, char *argv[])
     int etsitests;
     int packing;
 
-    etsitests = TRUE;
+    etsitests = true;
     packing = GSM0610_PACKING_NONE;
     while ((opt = getopt(argc, argv, "lp:")) != -1)
     {
         switch (opt)
         {
         case 'l':
-            etsitests = FALSE;
+            etsitests = false;
             break;
         case 'p':
             packing = atoi(optarg);
index 70df13425ce700866753deadfb257d0c8da60c03..93a364f4f53b5c18efd107e7d258a05898e6dfde 100644 (file)
@@ -46,13 +46,13 @@ using both 16 and 32 bit CRCs.
 int ref_len;
 uint8_t buf[1000];
 
-int abort_reported;
-int frame_handled;
-int frame_failed;
+bool abort_reported;
+bool frame_handled;
+bool frame_failed;
 int frame_len_errors;
 int frame_data_errors;
-int underflow_reported;
-int framing_ok_reported;
+bool underflow_reported;
+bool framing_ok_reported;
 int framing_ok_reports;
 
 hdlc_rx_state_t rx;
@@ -96,11 +96,11 @@ static void frame_handler(void *user_data, const uint8_t *pkt, int len, int ok)
         switch (len)
         {
         case SIG_STATUS_FRAMING_OK:
-            framing_ok_reported = TRUE;
+            framing_ok_reported = true;
             framing_ok_reports++;
             break;
         case SIG_STATUS_ABORT:
-            abort_reported = TRUE;
+            abort_reported = true;
             break;
         }
         return;
@@ -119,11 +119,11 @@ static void frame_handler(void *user_data, const uint8_t *pkt, int len, int ok)
             frame_data_errors++;
             return;
         }
-        frame_handled = TRUE;
+        frame_handled = true;
     }
     else
     {
-        frame_failed = TRUE;
+        frame_failed = true;
     }
 }
 /*- End of function --------------------------------------------------------*/
@@ -131,7 +131,7 @@ static void frame_handler(void *user_data, const uint8_t *pkt, int len, int ok)
 static void underflow_handler(void *user_data)
 {
     //printf("Underflow reported\n");
-    underflow_reported = TRUE;
+    underflow_reported = true;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -183,17 +183,17 @@ static int test_hdlc_modes(void)
     printf("Testing with CRC-16 (byte by byte)\n");
     frame_len_errors = 0;
     frame_data_errors = 0;
-    hdlc_tx_init(&tx, FALSE, 1, FALSE, underflow_handler, NULL);
-    hdlc_rx_init(&rx, FALSE, FALSE, 5, frame_handler, NULL);
-    underflow_reported = FALSE;
+    hdlc_tx_init(&tx, false, 1, false, underflow_handler, NULL);
+    hdlc_rx_init(&rx, false, false, 5, frame_handler, NULL);
+    underflow_reported = false;
 
     start = rdtscll();
     hdlc_tx_flags(&tx, 40);
     /* Push an initial message so we should NOT get an underflow after the preamble. */
     ref_len = cook_up_msg(buf);
     hdlc_tx_frame(&tx, buf, ref_len);
-    frame_handled = FALSE;
-    frame_failed = FALSE;
+    frame_handled = false;
+    frame_failed = false;
     frames_sent = 0;
     bytes_sent = 0;
     for (i = 0;  i < 1000000;  i++)
@@ -202,7 +202,7 @@ static int test_hdlc_modes(void)
         hdlc_rx_put_byte(&rx, nextbyte);
         if (underflow_reported)
         {
-            underflow_reported = FALSE;
+            underflow_reported = false;
             nextbyte = hdlc_tx_get_byte(&tx);
             hdlc_rx_put_byte(&rx, nextbyte);
             frames_sent++;
@@ -214,7 +214,7 @@ static int test_hdlc_modes(void)
             }
             ref_len = cook_up_msg(buf);
             hdlc_tx_frame(&tx, buf, ref_len);
-            frame_handled = FALSE;
+            frame_handled = false;
         }
     }
     end = rdtscll();
@@ -224,17 +224,17 @@ static int test_hdlc_modes(void)
     printf("Testing with CRC-16 (chunk by chunk)\n");
     frame_len_errors = 0;
     frame_data_errors = 0;
-    hdlc_tx_init(&tx, FALSE, 1, FALSE, underflow_handler, NULL);
-    hdlc_rx_init(&rx, FALSE, FALSE, 5, frame_handler, NULL);
-    underflow_reported = FALSE;
+    hdlc_tx_init(&tx, false, 1, false, underflow_handler, NULL);
+    hdlc_rx_init(&rx, false, false, 5, frame_handler, NULL);
+    underflow_reported = false;
 
     start = rdtscll();
     hdlc_tx_flags(&tx, 40);
     /* Push an initial message so we should NOT get an underflow after the preamble. */
     ref_len = cook_up_msg(buf);
     hdlc_tx_frame(&tx, buf, ref_len);
-    frame_handled = FALSE;
-    frame_failed = FALSE;
+    frame_handled = false;
+    frame_failed = false;
     frames_sent = 0;
     bytes_sent = 0;
     for (i = 0;  i < 10000;  i++)
@@ -243,7 +243,7 @@ static int test_hdlc_modes(void)
         hdlc_rx_put(&rx, bufx, len);
         if (underflow_reported)
         {
-            underflow_reported = FALSE;
+            underflow_reported = false;
             len = hdlc_tx_get(&tx, bufx, 100);
             hdlc_rx_put(&rx, bufx, len);
             frames_sent++;
@@ -255,7 +255,7 @@ static int test_hdlc_modes(void)
             }
             ref_len = cook_up_msg(buf);
             hdlc_tx_frame(&tx, buf, ref_len);
-            frame_handled = FALSE;
+            frame_handled = false;
         }
     }
     end = rdtscll();
@@ -265,16 +265,16 @@ static int test_hdlc_modes(void)
     printf("Testing with CRC-16 (bit by bit)\n");
     frame_len_errors = 0;
     frame_data_errors = 0;
-    hdlc_tx_init(&tx, FALSE, 2, FALSE, underflow_handler, NULL);
-    hdlc_rx_init(&rx, FALSE, FALSE, 5, frame_handler, NULL);
-    underflow_reported = FALSE;
+    hdlc_tx_init(&tx, false, 2, false, underflow_handler, NULL);
+    hdlc_rx_init(&rx, false, false, 5, frame_handler, NULL);
+    underflow_reported = false;
 
     start = rdtscll();
     hdlc_tx_flags(&tx, 40);
     /* Don't push an initial message so we should get an underflow after the preamble. */
     /* Lie for the first message, as there isn't really one */
-    frame_handled = TRUE;
-    frame_failed = FALSE;
+    frame_handled = true;
+    frame_failed = false;
     frames_sent = 0;
     bytes_sent = 0;
     ref_len = 0;
@@ -284,7 +284,7 @@ static int test_hdlc_modes(void)
         hdlc_rx_put_bit(&rx, nextbyte);
         if (underflow_reported)
         {
-            underflow_reported = FALSE;
+            underflow_reported = false;
             for (j = 0;  j < 20;  j++)
             {
                 nextbyte = hdlc_tx_get_bit(&tx);
@@ -302,7 +302,7 @@ static int test_hdlc_modes(void)
             }
             ref_len = cook_up_msg(buf);
             hdlc_tx_frame(&tx, buf, ref_len);
-            frame_handled = FALSE;
+            frame_handled = false;
         }
     }
     end = rdtscll();
@@ -312,16 +312,16 @@ static int test_hdlc_modes(void)
     printf("Testing with CRC-32 (byte by byte)\n");
     frame_len_errors = 0;
     frame_data_errors = 0;
-    hdlc_tx_init(&tx, TRUE, 1, FALSE, underflow_handler, NULL);
-    hdlc_rx_init(&rx, TRUE, FALSE, 1, frame_handler, NULL);
-    underflow_reported = FALSE;
+    hdlc_tx_init(&tx, true, 1, false, underflow_handler, NULL);
+    hdlc_rx_init(&rx, true, false, 1, frame_handler, NULL);
+    underflow_reported = false;
 
     start = rdtscll();
     hdlc_tx_flags(&tx, 40);
     /* Don't push an initial message so we should get an underflow after the preamble. */
     /* Lie for the first message, as there isn't really one */
-    frame_handled = TRUE;
-    frame_failed = FALSE;
+    frame_handled = true;
+    frame_failed = false;
     frames_sent = 0;
     bytes_sent = 0;
     ref_len = 0;
@@ -331,7 +331,7 @@ static int test_hdlc_modes(void)
         hdlc_rx_put_byte(&rx, nextbyte);
         if (underflow_reported)
         {
-            underflow_reported = FALSE;
+            underflow_reported = false;
             nextbyte = hdlc_tx_get_byte(&tx);
             hdlc_rx_put_byte(&rx, nextbyte);
             if (ref_len)
@@ -346,7 +346,7 @@ static int test_hdlc_modes(void)
             }
             ref_len = cook_up_msg(buf);
             hdlc_tx_frame(&tx, buf, ref_len);
-            frame_handled = FALSE;
+            frame_handled = false;
         }
     }
     end = rdtscll();
@@ -356,16 +356,16 @@ static int test_hdlc_modes(void)
     printf("Testing progressive mode with CRC-16 (byte by byte)\n");
     frame_len_errors = 0;
     frame_data_errors = 0;
-    hdlc_tx_init(&tx, TRUE, 1, TRUE, underflow_handler, NULL);
-    hdlc_rx_init(&rx, TRUE, FALSE, 1, frame_handler, NULL);
-    underflow_reported = FALSE;
+    hdlc_tx_init(&tx, true, 1, true, underflow_handler, NULL);
+    hdlc_rx_init(&rx, true, false, 1, frame_handler, NULL);
+    underflow_reported = false;
 
     start = rdtscll();
     hdlc_tx_flags(&tx, 40);
     /* Don't push an initial message so we should get an underflow after the preamble. */
     /* Lie for the first message, as there isn't really one */
-    frame_handled = TRUE;
-    frame_failed = FALSE;
+    frame_handled = true;
+    frame_failed = false;
     progress = 9999;
     progress_delay = 9999;
     frames_sent = 0;
@@ -377,7 +377,7 @@ static int test_hdlc_modes(void)
         hdlc_rx_put_byte(&rx, nextbyte);
         if (underflow_reported)
         {
-            underflow_reported = FALSE;
+            underflow_reported = false;
             nextbyte = hdlc_tx_get_byte(&tx);
             hdlc_rx_put_byte(&rx, nextbyte);
             if (ref_len)
@@ -394,7 +394,7 @@ static int test_hdlc_modes(void)
             hdlc_tx_frame(&tx, buf, 10);
             progress = 10;
             progress_delay = 8;
-            frame_handled = FALSE;
+            frame_handled = false;
         }
         if (progress < ref_len  &&  progress_delay-- <= 0)
         {
@@ -424,18 +424,18 @@ static int test_hdlc_frame_length_error_handling(void)
     printf("Testing frame length error handling using CRC-16 (bit by bit)\n");
     frame_len_errors = 0;
     frame_data_errors = 0;
-    hdlc_tx_init(&tx, FALSE, 2, FALSE, underflow_handler, NULL);
-    hdlc_rx_init(&rx, FALSE, TRUE, 5, frame_handler, NULL);
+    hdlc_tx_init(&tx, false, 2, false, underflow_handler, NULL);
+    hdlc_rx_init(&rx, false, true, 5, frame_handler, NULL);
     hdlc_rx_set_max_frame_len(&rx, 100);
-    underflow_reported = FALSE;
-    framing_ok_reported = FALSE;
+    underflow_reported = false;
+    framing_ok_reported = false;
     framing_ok_reports = 0;
 
     hdlc_tx_flags(&tx, 10);
     /* Don't push an initial message so we should get an underflow after the preamble. */
     /* Lie for the first message, as there isn't really one */
-    frame_handled = TRUE;
-    frame_failed = FALSE;
+    frame_handled = true;
+    frame_failed = false;
     frames_sent = 0;
     bytes_sent = 0;
     ref_len = 0;
@@ -446,11 +446,11 @@ static int test_hdlc_frame_length_error_handling(void)
         if (framing_ok_reported)
         {
             printf("Framing OK reported at bit %d (%d)\n", i, framing_ok_reports);
-            framing_ok_reported = FALSE;
+            framing_ok_reported = false;
         }
         if (underflow_reported)
         {
-            underflow_reported = FALSE;
+            underflow_reported = false;
             for (j = 0;  j < 20;  j++)
             {
                 nextbyte = hdlc_tx_get_bit(&tx);
@@ -458,7 +458,7 @@ static int test_hdlc_frame_length_error_handling(void)
                 if (framing_ok_reported)
                 {
                     printf("Framing OK reported at bit %d (%d) - %d\n", i, framing_ok_reports, frame_handled);
-                    framing_ok_reported = FALSE;
+                    framing_ok_reported = false;
                 }
             }
             if (ref_len)
@@ -490,7 +490,7 @@ static int test_hdlc_frame_length_error_handling(void)
             }
             ref_len++;
             hdlc_tx_frame(&tx, buf, ref_len);
-            frame_handled = FALSE;
+            frame_handled = false;
         }
     }
     /* We shouldn't reach here */
@@ -509,21 +509,21 @@ static int test_hdlc_crc_error_handling(void)
     printf("Testing CRC error handling using CRC-16 (bit by bit)\n");
     frame_len_errors = 0;
     frame_data_errors = 0;
-    hdlc_tx_init(&tx, FALSE, 2, FALSE, underflow_handler, NULL);
-    hdlc_rx_init(&rx, FALSE, TRUE, 5, frame_handler, NULL);
-    underflow_reported = FALSE;
-    framing_ok_reported = FALSE;
+    hdlc_tx_init(&tx, false, 2, false, underflow_handler, NULL);
+    hdlc_rx_init(&rx, false, true, 5, frame_handler, NULL);
+    underflow_reported = false;
+    framing_ok_reported = false;
     framing_ok_reports = 0;
 
     hdlc_tx_flags(&tx, 10);
     /* Don't push an initial message so we should get an underflow after the preamble. */
     /* Lie for the first message, as there isn't really one */
-    frame_handled = TRUE;
-    frame_failed = FALSE;
+    frame_handled = true;
+    frame_failed = false;
     frames_sent = 0;
     bytes_sent = 0;
     ref_len = 100;
-    corrupt = FALSE;
+    corrupt = false;
     for (i = 0;  i < 8*1000000;  i++)
     {
         nextbyte = hdlc_tx_get_bit(&tx);
@@ -531,11 +531,11 @@ static int test_hdlc_crc_error_handling(void)
         if (framing_ok_reported)
         {
             printf("Framing OK reported at bit %d (%d)\n", i, framing_ok_reports);
-            framing_ok_reported = FALSE;
+            framing_ok_reported = false;
         }
         if (underflow_reported)
         {
-            underflow_reported = FALSE;
+            underflow_reported = false;
             for (j = 0;  j < 20;  j++)
             {
                 nextbyte = hdlc_tx_get_bit(&tx);
@@ -543,7 +543,7 @@ static int test_hdlc_crc_error_handling(void)
                 if (framing_ok_reported)
                 {
                     printf("Framing OK reported at bit %d (%d) - %d\n", i, framing_ok_reports, frame_handled);
-                    framing_ok_reported = FALSE;
+                    framing_ok_reported = false;
                 }
             }
             if (ref_len)
@@ -571,7 +571,7 @@ static int test_hdlc_crc_error_handling(void)
             hdlc_tx_frame(&tx, buf, ref_len);
             if ((corrupt = rand() & 1))
                 hdlc_tx_corrupt_frame(&tx);
-            frame_handled = FALSE;
+            frame_handled = false;
         }
     }
 
@@ -590,22 +590,22 @@ static int test_hdlc_abort_handling(void)
     printf("Testing abort handling using CRC-16 (bit by bit)\n");
     frame_len_errors = 0;
     frame_data_errors = 0;
-    hdlc_tx_init(&tx, FALSE, 2, FALSE, underflow_handler, NULL);
-    hdlc_rx_init(&rx, FALSE, TRUE, 0, frame_handler, NULL);
-    underflow_reported = FALSE;
-    framing_ok_reported = FALSE;
+    hdlc_tx_init(&tx, false, 2, false, underflow_handler, NULL);
+    hdlc_rx_init(&rx, false, true, 0, frame_handler, NULL);
+    underflow_reported = false;
+    framing_ok_reported = false;
     framing_ok_reports = 0;
 
     hdlc_tx_flags(&tx, 10);
     /* Don't push an initial message so we should get an underflow after the preamble. */
     /* Lie for the first message, as there isn't really one */
-    frame_handled = TRUE;
-    frame_failed = FALSE;
+    frame_handled = true;
+    frame_failed = false;
     frames_sent = 0;
     bytes_sent = 0;
     ref_len = 0;
-    abort = FALSE;
-    abort_reported = FALSE;
+    abort = false;
+    abort_reported = false;
     for (i = 0;  i < 8*1000000;  i++)
     {
         nextbyte = hdlc_tx_get_bit(&tx);
@@ -613,11 +613,11 @@ static int test_hdlc_abort_handling(void)
         if (framing_ok_reported)
         {
             printf("Framing OK reported at bit %d (%d)\n", i, framing_ok_reports);
-            framing_ok_reported = FALSE;
+            framing_ok_reported = false;
         }
         if (underflow_reported)
         {
-            underflow_reported = FALSE;
+            underflow_reported = false;
             for (j = 0;  j < 20;  j++)
             {
                 nextbyte = hdlc_tx_get_bit(&tx);
@@ -625,7 +625,7 @@ static int test_hdlc_abort_handling(void)
                 if (framing_ok_reported)
                 {
                     printf("Framing OK reported at bit %d (%d) - %d\n", i, framing_ok_reports, frame_handled);
-                    framing_ok_reported = FALSE;
+                    framing_ok_reported = false;
                 }
             }
             if (ref_len)
@@ -667,8 +667,8 @@ static int test_hdlc_abort_handling(void)
             hdlc_tx_frame(&tx, buf, ref_len);
             if ((abort = rand() & 1))
                 hdlc_tx_abort(&tx);
-            frame_handled = FALSE;
-            abort_reported = FALSE;
+            frame_handled = false;
+            abort_reported = false;
         }
     }
 
@@ -687,19 +687,19 @@ static int test_hdlc_octet_count_handling(void)
     printf("Testing the octet_counting handling using CRC-16 (bit by bit)\n");
     frame_len_errors = 0;
     frame_data_errors = 0;
-    hdlc_tx_init(&tx, FALSE, 2, FALSE, underflow_handler, NULL);
-    hdlc_rx_init(&rx, FALSE, TRUE, 0, frame_handler, NULL);
+    hdlc_tx_init(&tx, false, 2, false, underflow_handler, NULL);
+    hdlc_rx_init(&rx, false, true, 0, frame_handler, NULL);
     //hdlc_rx_set_max_frame_len(&rx, 50);
     hdlc_rx_set_octet_counting_report_interval(&rx, 16);
-    underflow_reported = FALSE;
-    framing_ok_reported = FALSE;
+    underflow_reported = false;
+    framing_ok_reported = false;
     framing_ok_reports = 0;
 
     hdlc_tx_flags(&tx, 10);
     /* Don't push an initial message so we should get an underflow after the preamble. */
     /* Lie for the first message, as there isn't really one */
-    frame_handled = TRUE;
-    frame_failed = FALSE;
+    frame_handled = true;
+    frame_failed = false;
     frames_sent = 0;
     bytes_sent = 0;
     ref_len = 0;
@@ -710,11 +710,11 @@ static int test_hdlc_octet_count_handling(void)
         if (framing_ok_reported)
         {
             printf("Framing OK reported at bit %d (%d)\n", i, framing_ok_reports);
-            framing_ok_reported = FALSE;
+            framing_ok_reported = false;
         }
         if (underflow_reported)
         {
-            underflow_reported = FALSE;
+            underflow_reported = false;
             for (j = 0;  j < 20;  j++)
             {
                 nextbyte = hdlc_tx_get_bit(&tx);
@@ -722,7 +722,7 @@ static int test_hdlc_octet_count_handling(void)
                 if (framing_ok_reported)
                 {
                     printf("Framing OK reported at bit %d (%d) - %d\n", i, framing_ok_reports, frame_handled);
-                    framing_ok_reported = FALSE;
+                    framing_ok_reported = false;
                 }
             }
             if (ref_len)
@@ -741,7 +741,7 @@ static int test_hdlc_octet_count_handling(void)
             hdlc_tx_frame(&tx, buf, ref_len);
             hdlc_tx_abort(&tx);
             //hdlc_tx_corrupt_frame(&tx);
-            frame_handled = FALSE;
+            frame_handled = false;
         }
     }
 
@@ -825,7 +825,7 @@ static void decode_bitstream(const char *in_file_name)
         exit(2);
     }
 
-    hdlc_rx_init(&rx, FALSE, TRUE, 2, decode_handler, NULL);
+    hdlc_rx_init(&rx, false, true, 2, decode_handler, NULL);
     while (fgets(buf, 1024, in))
     {
         if (sscanf(buf, "Rx bit %d - %d", &num, &bit) == 2)
index dcf2a6a4cb1bc3a72c7629e8d3823333a8b7df8f..e0803303137068b5a41787a64310e106eb6bfc62 100644 (file)
@@ -80,18 +80,18 @@ int main(int argc, char *argv[])
     int total_pre_samples;
     int total_compressed_bytes;
     int total_post_samples;
-    const char *in_file_name;
     int variant;
     int chunk_size;
     int enc_chunk_size;
-    int log_encoded_data;
     int opt;
+    bool log_encoded_data;
+    const char *in_file_name;
 
     variant = IMA_ADPCM_DVI4;
     in_file_name = IN_FILE_NAME;
     chunk_size = 160;
     enc_chunk_size = 0;
-    log_encoded_data = FALSE;
+    log_encoded_data = false;
     while ((opt = getopt(argc, argv, "ac:i:lv")) != -1)
     {
         switch (opt)
@@ -107,7 +107,7 @@ int main(int argc, char *argv[])
             in_file_name = optarg;
             break;
         case 'l':
-            log_encoded_data = TRUE;
+            log_encoded_data = true;
             break;
         case 'v':
             variant = IMA_ADPCM_VDVI;
index 51807f10c76a2fcc8e9b1f2e51d07996eec817ea..7b4fa9d3d3aa1c7280a4a1a6b3bcc82fada24bcf 100644 (file)
@@ -493,27 +493,27 @@ static void translate_tests_gray8(void)
     printf("Dithering from a 8 bit per sample gray scale to bi-level\n");
     create_undithered_50_by_50(&im, image, 1);
     s = image_translate_init(NULL, T4_IMAGE_TYPE_BILEVEL, -1, -1, T4_IMAGE_TYPE_GRAY_8BIT, im.width, im.length, row_read, &im);
-    get_bilevel_image(s, TRUE);
+    get_bilevel_image(s, true);
 
     printf("Scrunching from a 8 bit per sample gray scale to 8 bit per sample gray scale\n");
     create_undithered_50_by_50(&im, image, 1);
     s = image_translate_init(s, T4_IMAGE_TYPE_GRAY_8BIT, -1, -1, T4_IMAGE_TYPE_GRAY_8BIT, im.width, im.length, row_read, &im);
-    get_gray8_image(s, TRUE);
+    get_gray8_image(s, true);
 
     printf("Scrunching from a 8 bit per sample gray scale to 16 bit per sample gray scale\n");
     create_undithered_50_by_50(&im, image, 1);
     s = image_translate_init(s, T4_IMAGE_TYPE_GRAY_12BIT, -1, -1, T4_IMAGE_TYPE_GRAY_8BIT, im.width, im.length, row_read, &im);
-    get_gray16_image(s, TRUE);
+    get_gray16_image(s, true);
 
     printf("Scrunching from a 8 bit per sample gray scale to 3x8 bit per sample colour\n");
     create_undithered_50_by_50(&im, image, 1);
     s = image_translate_init(s, T4_IMAGE_TYPE_COLOUR_8BIT, -1, -1, T4_IMAGE_TYPE_GRAY_8BIT, im.width, im.length, row_read, &im);
-    get_colour8_image(s, TRUE);
+    get_colour8_image(s, true);
 
     printf("Scrunching from a 8 bit per sample gray scale to 3x16 bit per sample colour\n");
     create_undithered_50_by_50(&im, image, 1);
     s = image_translate_init(s, T4_IMAGE_TYPE_COLOUR_12BIT, -1, -1, T4_IMAGE_TYPE_GRAY_8BIT, im.width, im.length, row_read, &im);
-    get_colour16_image(s, TRUE);
+    get_colour16_image(s, true);
 
     image_translate_free(s);
 }
@@ -528,27 +528,27 @@ static void translate_tests_gray16(void)
     printf("Dithering from a 16 bit per sample gray scale to bi-level\n");
     create_undithered_50_by_50(&im, (uint8_t *) image, 2);
     s = image_translate_init(NULL, T4_IMAGE_TYPE_BILEVEL, -1, -1, T4_IMAGE_TYPE_GRAY_12BIT, im.width, im.length, row_read, &im);
-    get_bilevel_image(s, TRUE);
+    get_bilevel_image(s, true);
 
     printf("Scrunching from a 16 bit per sample gray scale to 8 bit per sample gray scale\n");
     create_undithered_50_by_50(&im, (uint8_t *) image, 2);
     s = image_translate_init(s, T4_IMAGE_TYPE_GRAY_8BIT, -1, -1, T4_IMAGE_TYPE_GRAY_12BIT, im.width, im.length, row_read, &im);
-    get_gray8_image(s, TRUE);
+    get_gray8_image(s, true);
 
     printf("Scrunching from a 16 bit per sample gray scale to 16 bit per sample gray scale\n");
     create_undithered_50_by_50(&im, (uint8_t *) image, 2);
     s = image_translate_init(s, T4_IMAGE_TYPE_GRAY_12BIT, -1, -1, T4_IMAGE_TYPE_GRAY_12BIT, im.width, im.length, row_read, &im);
-    get_gray16_image(s, TRUE);
+    get_gray16_image(s, true);
 
     printf("Scrunching from a 16 bit per sample gray scale to 3x8 bit per sample colour\n");
     create_undithered_50_by_50(&im, (uint8_t *) image, 2);
     s = image_translate_init(s, T4_IMAGE_TYPE_COLOUR_8BIT, -1, -1, T4_IMAGE_TYPE_GRAY_12BIT, im.width, im.length, row_read, &im);
-    get_colour8_image(s, TRUE);
+    get_colour8_image(s, true);
 
     printf("Scrunching from a 16 bit per sample gray scale to 3x16 bit per sample colour\n");
     create_undithered_50_by_50(&im, (uint8_t *) image, 2);
     s = image_translate_init(s, T4_IMAGE_TYPE_COLOUR_12BIT, -1, -1, T4_IMAGE_TYPE_GRAY_12BIT, im.width, im.length, row_read, &im);
-    get_colour16_image(s, TRUE);
+    get_colour16_image(s, true);
 
     image_translate_free(s);
 }
@@ -563,27 +563,27 @@ static void translate_tests_colour8(void)
     printf("Dithering from a 3x8 bit per sample colour to bi-level\n");
     create_undithered_50_by_50(&im, image, 3);
     s = image_translate_init(NULL, T4_IMAGE_TYPE_BILEVEL, -1, -1, T4_IMAGE_TYPE_COLOUR_8BIT, im.width, im.length, row_read, &im);
-    get_bilevel_image(s, TRUE);
+    get_bilevel_image(s, true);
 
     printf("Scrunching from a 3x8 bit per sample colour to 8 bit per sample gray scale\n");
     create_undithered_50_by_50(&im, image, 3);
     s = image_translate_init(s, T4_IMAGE_TYPE_GRAY_8BIT, -1, -1, T4_IMAGE_TYPE_COLOUR_8BIT, im.width, im.length, row_read, &im);
-    get_gray8_image(s, TRUE);
+    get_gray8_image(s, true);
 
     printf("Scrunching from a 3x8 bit per sample colour to 16 bit per sample gray scale\n");
     create_undithered_50_by_50(&im, image, 3);
     s = image_translate_init(s, T4_IMAGE_TYPE_GRAY_12BIT, -1, -1, T4_IMAGE_TYPE_COLOUR_8BIT, im.width, im.length, row_read, &im);
-    get_gray16_image(s, TRUE);
+    get_gray16_image(s, true);
 
     printf("Scrunching from a 3x8 bit per sample colour to 3x8 bit per sample colour\n");
     create_undithered_50_by_50(&im, image, 3);
     s = image_translate_init(s, T4_IMAGE_TYPE_COLOUR_8BIT, -1, -1, T4_IMAGE_TYPE_COLOUR_8BIT, im.width, im.length, row_read, &im);
-    get_colour8_image(s, TRUE);
+    get_colour8_image(s, true);
 
     printf("Scrunching from a 3x8 bit per sample colour to 3x16 bit per sample colour\n");
     create_undithered_50_by_50(&im, image, 3);
     s = image_translate_init(s, T4_IMAGE_TYPE_COLOUR_12BIT, -1, -1, T4_IMAGE_TYPE_COLOUR_8BIT, im.width, im.length, row_read, &im);
-    get_colour16_image(s, TRUE);
+    get_colour16_image(s, true);
 
     image_translate_free(s);
 }
@@ -598,27 +598,27 @@ static void translate_tests_colour16(void)
     printf("Dithering from a 3x16 bit per sample colour to bi-level\n");
     create_undithered_50_by_50(&im, (uint8_t *) image, 6);
     s = image_translate_init(NULL, T4_IMAGE_TYPE_BILEVEL, -1, -1, T4_IMAGE_TYPE_COLOUR_12BIT, im.width, im.length, row_read, &im);
-    get_bilevel_image(s, TRUE);
+    get_bilevel_image(s, true);
 
     printf("Scrunching from a 3x16 bit per sample colour to 8 bit per sample gray scale\n");
     create_undithered_50_by_50(&im, (uint8_t *) image, 6);
     s = image_translate_init(s, T4_IMAGE_TYPE_GRAY_8BIT, -1, -1, T4_IMAGE_TYPE_COLOUR_12BIT, im.width, im.length, row_read, &im);
-    get_gray8_image(s, TRUE);
+    get_gray8_image(s, true);
 
     printf("Scrunching from a 3x16 bit per sample colour to 16 bit per sample gray scale\n");
     create_undithered_50_by_50(&im, (uint8_t *) image, 6);
     s = image_translate_init(s, T4_IMAGE_TYPE_GRAY_12BIT, -1, -1, T4_IMAGE_TYPE_COLOUR_12BIT, im.width, im.length, row_read, &im);
-    get_gray16_image(s, TRUE);
+    get_gray16_image(s, true);
 
     printf("Scrunching from a 3x16 bit per sample colour to 3x8 bit per sample colour\n");
     create_undithered_50_by_50(&im, (uint8_t *) image, 6);
     s = image_translate_init(s, T4_IMAGE_TYPE_COLOUR_8BIT, -1, -1, T4_IMAGE_TYPE_COLOUR_12BIT, im.width, im.length, row_read, &im);
-    get_colour8_image(s, TRUE);
+    get_colour8_image(s, true);
 
     printf("Scrunching from a 3x16 bit per sample colour to 3x16 bit per sample colour\n");
     create_undithered_50_by_50(&im, (uint8_t *) image, 6);
     s = image_translate_init(s, T4_IMAGE_TYPE_COLOUR_12BIT, -1, -1, T4_IMAGE_TYPE_COLOUR_12BIT, im.width, im.length, row_read, &im);
-    get_colour16_image(s, TRUE);
+    get_colour16_image(s, true);
 
     image_translate_free(s);
 }
@@ -634,7 +634,7 @@ static void grow_tests_colour8(void)
     create_undithered_50_by_50(&im, image, 3);
 
     s = image_translate_init(NULL, T4_IMAGE_TYPE_BILEVEL, 200, -1, T4_IMAGE_TYPE_COLOUR_8BIT, im.width, im.length, row_read, &im);
-    get_bilevel_image(s, FALSE);
+    get_bilevel_image(s, false);
     image_translate_free(s);
 }
 /*- End of function --------------------------------------------------------*/
index 8f2091e3fb1938f53d431e46d9f07f11190111b4..8d31413cd4925754403222d4cea0d4fb1c814e38 100644 (file)
@@ -363,13 +363,13 @@ static void test_line_filter(int line_model_no)
 int main(int argc, char *argv[])
 {
     int line_model_no;
-    int speech_test;
     int opt;
+    bool speech_test;
 
     channel_codec = MUNGE_CODEC_NONE;
     line_model_no = 0;
     rbs_pattern = 0;
-    speech_test = FALSE;
+    speech_test = false;
     while ((opt = getopt(argc, argv, "c:m:r:s:")) != -1)
     {
         switch (opt)
index 085fd0ecbc58cab3f57bbfac04704ee44961ddd4..666fc1e9bbb7ae47838968311a00a9859e107f66 100644 (file)
 
 #include "spandsp.h"
 
-static int tests_failed = FALSE;
+static bool tests_failed = false;
 
 static int msg_step = 0;
 static int msg2_step = 0;
-static int msg_done = FALSE;
-static int msg2_done = FALSE;
+static bool msg_done = false;
+static bool msg2_done = false;
 
 static void message_handler(void *user_data, int level, const char *text)
 {
@@ -78,10 +78,10 @@ static void message_handler(void *user_data, int level, const char *text)
     if (strcmp(ref[msg_step], text))
     {
         printf(">>>: %s", ref[msg_step]);
-        tests_failed = TRUE;
+        tests_failed = true;
     }
     if (ref[++msg_step][0] == '\0')
-        msg_done = TRUE;
+        msg_done = true;
     printf("MSG: %s", text);
 }
 /*- End of function --------------------------------------------------------*/
@@ -92,10 +92,10 @@ static void message_handler2(void *user_data, int level, const char *text)
     if (strcmp(" FLOW Protocol NewTag Date/time tagged log 1 2 3\n", text + 23))
     {
         printf(">>>: %s", text + 23);
-        tests_failed = TRUE;
+        tests_failed = true;
     }
     if (++msg2_step == 10)
-        msg2_done = TRUE;
+        msg2_done = true;
     printf("MSG: %s", text);
 }
 /*- End of function --------------------------------------------------------*/
@@ -172,7 +172,7 @@ int main(int argc, char *argv[])
         if (!span_log_test(log, i))
         {
             if (i != 6)
-                tests_failed = TRUE;
+                tests_failed = true;
             break;
         }
     }
index dee9a624e1a6ed10fc8885bbade7cc3670698fe3..0ecacfb8479b09875ce36947b964bd94c369cd48 100644 (file)
@@ -79,9 +79,9 @@ int main(int argc, char *argv[])
     lpc10_decode_state_t *lpc10_dec_state;
     int i;
     int block_no;
-    int log_error;
-    int compress;
-    int decompress;
+    bool log_error;
+    bool compress;
+    bool decompress;
     const char *in_file_name;
     int compress_file;
     int decompress_file;
@@ -90,25 +90,25 @@ int main(int argc, char *argv[])
     int enc_len;
     int dec_len;
 
-    compress = FALSE;
-    decompress = FALSE;
-    log_error = TRUE;
+    compress = false;
+    decompress = false;
+    log_error = true;
     in_file_name = IN_FILE_NAME;
     while ((opt = getopt(argc, argv, "cdi:l")) != -1)
     {
         switch (opt)
         {
         case 'c':
-            compress = TRUE;
+            compress = true;
             break;
         case 'd':
-            decompress = TRUE;
+            decompress = true;
             break;
         case 'i':
             in_file_name = optarg;
             break;
         case 'l':
-            log_error = FALSE;
+            log_error = false;
             break;
         default:
             //usage();
@@ -150,13 +150,13 @@ int main(int argc, char *argv[])
         exit(2);
     }
 
-    if ((lpc10_enc_state = lpc10_encode_init(NULL, TRUE)) == NULL)
+    if ((lpc10_enc_state = lpc10_encode_init(NULL, true)) == NULL)
     {
         fprintf(stderr, "    Cannot create encoder\n");
         exit(2);
     }
 
-    if ((lpc10_dec_state = lpc10_decode_init(NULL, TRUE)) == NULL)
+    if ((lpc10_dec_state = lpc10_decode_init(NULL, true)) == NULL)
     {
         fprintf(stderr, "    Cannot create decoder\n");
         exit(2);
index fd7f104992608f4a9ce8c368392e661c41d841fb..1f99201b5564bfbaab1b9603f74b098496d0ad24 100644 (file)
@@ -49,9 +49,6 @@ These tests...
 #define MITEL_DIR                       "../test-data/mitel/"
 #define BELLCORE_DIR                    "../test-data/bellcore/"
 
-#define FALSE 0
-#define TRUE (!FALSE)
-
 #define LEVEL_MAX                       -5
 #define LEVEL_MIN                       -48
 #define LEVEL_MIN_ACCEPT                -43
@@ -230,13 +227,13 @@ int main(int argc, char *argv[])
     int frames;
     int samples;
     int hit;
-    int false_hit;
-    int false_miss;
     int level2;
     int max_level2;
     int tone_type;
     int test_list;
     int opt;
+    bool false_hit;
+    bool false_miss;
     char *decode_test_file;
     fsk_tx_state_t preamble_tx;
 
@@ -480,8 +477,8 @@ int main(int argc, char *argv[])
         printf("Test 2a: CNG detection with frequency\n");
         tone_type = MODEM_CONNECT_TONES_FAX_CNG;
         awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f);
-        false_hit = FALSE;
-        false_miss = FALSE;
+        false_hit = false;
+        false_miss = false;
         for (pitch = 1100 - 500;  pitch <= 1100 + 500;  pitch++)
         {
             /* Use the transmitter to test the receiver */
@@ -509,13 +506,13 @@ int main(int argc, char *argv[])
             if (pitch < (1100 - CED_FREQ_BLACKOUT)  ||  pitch > (1100 + CED_FREQ_BLACKOUT))
             {
                 if (hit != MODEM_CONNECT_TONES_NONE)
-                    false_hit = TRUE;
+                    false_hit = true;
                 /*endif*/
             }
             else if (pitch > (1100 - CED_FREQ_TOLERANCE)  &&  pitch < (1100 + CED_FREQ_TOLERANCE))
             {
                 if (hit != tone_type)
-                    false_miss = TRUE;
+                    false_miss = true;
                 /*endif*/
             }
             /*endif*/
@@ -538,8 +535,8 @@ int main(int argc, char *argv[])
     {
         printf("Test 2b: CED/ANS detection with frequency\n");
         awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f);
-        false_hit = FALSE;
-        false_miss = FALSE;
+        false_hit = false;
+        false_miss = false;
         for (pitch = 2100 - 500;  pitch < 2100 + 500;  pitch++)
         {
             /* Use the transmitter to test the receiver */
@@ -560,13 +557,13 @@ int main(int argc, char *argv[])
             if (pitch < (2100 - CNG_FREQ_BLACKOUT)  ||  pitch > (2100 + CNG_FREQ_BLACKOUT))
             {
                 if (hit != MODEM_CONNECT_TONES_NONE)
-                    false_hit = TRUE;
+                    false_hit = true;
                 /*endif*/
             }
             else if (pitch > (2100 - CNG_FREQ_TOLERANCE)  &&  pitch < (2100 + CNG_FREQ_TOLERANCE))
             {
                 if (hit != MODEM_CONNECT_TONES_FAX_CED)
-                    false_miss = TRUE;
+                    false_miss = true;
                 /*endif*/
             }
             /*endif*/
@@ -589,8 +586,8 @@ int main(int argc, char *argv[])
         printf("Test 2c: ANSam detection with frequency\n");
         tone_type = MODEM_CONNECT_TONES_ANSAM;
         awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f);
-        false_hit = FALSE;
-        false_miss = FALSE;
+        false_hit = false;
+        false_miss = false;
         for (pitch = 2100 - 100;  pitch <= 2100 + 100;  pitch++)
         {
             /* Use the transmitter to test the receiver */
@@ -611,13 +608,13 @@ int main(int argc, char *argv[])
             if (pitch < (2100 - CNG_FREQ_BLACKOUT)  ||  pitch > (2100 + CNG_FREQ_BLACKOUT))
             {
                 if (hit != MODEM_CONNECT_TONES_NONE)
-                    false_hit = TRUE;
+                    false_hit = true;
                 /*endif*/
             }
             else if (pitch > (2100 - CNG_FREQ_TOLERANCE)  &&  pitch < (2100 + CNG_FREQ_TOLERANCE))
             {
                 if (hit != tone_type)
-                    false_miss = TRUE;
+                    false_miss = true;
                 /*endif*/
             }
             /*endif*/
@@ -641,8 +638,8 @@ int main(int argc, char *argv[])
         printf("Test 2d: ANS/ (EC-disable) detection with frequency\n");
         tone_type = MODEM_CONNECT_TONES_ANS_PR;
         awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f);
-        false_hit = FALSE;
-        false_miss = FALSE;
+        false_hit = false;
+        false_miss = false;
         for (pitch = 2100 - 100;  pitch <= 2100 + 100;  pitch++)
         {
             /* Use the transmitter to test the receiver */
@@ -663,13 +660,13 @@ int main(int argc, char *argv[])
             if (pitch < (2100 - CNG_FREQ_BLACKOUT)  ||  pitch > (2100 + CNG_FREQ_BLACKOUT))
             {
                 if (hit != MODEM_CONNECT_TONES_NONE)
-                    false_hit = TRUE;
+                    false_hit = true;
                 /*endif*/
             }
             else if (pitch > (2100 - CNG_FREQ_TOLERANCE)  &&  pitch < (2100 + CNG_FREQ_TOLERANCE))
             {
                 if (hit != tone_type)
-                    false_miss = TRUE;
+                    false_miss = true;
                 /*endif*/
             }
             /*endif*/
@@ -693,8 +690,8 @@ int main(int argc, char *argv[])
         printf("Test 2e: ANSam/ (Modulated EC-disable) detection with frequency\n");
         tone_type = MODEM_CONNECT_TONES_ANSAM_PR;
         awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f);
-        false_hit = FALSE;
-        false_miss = FALSE;
+        false_hit = false;
+        false_miss = false;
         for (pitch = 2100 - 100;  pitch <= 2100 + 100;  pitch++)
         {
             /* Use the transmitter to test the receiver */
@@ -715,13 +712,13 @@ int main(int argc, char *argv[])
             if (pitch < (2100 - CNG_FREQ_BLACKOUT)  ||  pitch > (2100 + CNG_FREQ_BLACKOUT))
             {
                 if (hit != MODEM_CONNECT_TONES_NONE)
-                    false_hit = TRUE;
+                    false_hit = true;
                 /*endif*/
             }
             else if (pitch > (2100 - CNG_FREQ_TOLERANCE)  &&  pitch < (2100 + CNG_FREQ_TOLERANCE))
             {
                 if (hit != tone_type)
-                    false_miss = TRUE;
+                    false_miss = true;
                 /*endif*/
             }
             /*endif*/
@@ -745,8 +742,8 @@ int main(int argc, char *argv[])
         printf("Test 2f: Bell answer tone detection with frequency\n");
         tone_type = MODEM_CONNECT_TONES_BELL_ANS;
         awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f);
-        false_hit = FALSE;
-        false_miss = FALSE;
+        false_hit = false;
+        false_miss = false;
         for (pitch = 2225 - 500;  pitch <= 2225 + 500;  pitch++)
         {
             /* Use the transmitter to test the receiver */
@@ -774,13 +771,13 @@ int main(int argc, char *argv[])
             if (pitch < (2225 - BELL_ANS_FREQ_BLACKOUT)  ||  pitch > (2225 + BELL_ANS_FREQ_BLACKOUT))
             {
                 if (hit != MODEM_CONNECT_TONES_NONE)
-                    false_hit = TRUE;
+                    false_hit = true;
                 /*endif*/
             }
             else if (pitch > (2225 - BELL_ANS_FREQ_TOLERANCE)  &&  pitch < (2225 + BELL_ANS_FREQ_TOLERANCE))
             {
                 if (hit != tone_type)
-                    false_miss = TRUE;
+                    false_miss = true;
                 /*endif*/
             }
             /*endif*/
@@ -804,8 +801,8 @@ int main(int argc, char *argv[])
         printf("Test 2g: Calling tone detection with frequency\n");
         tone_type = MODEM_CONNECT_TONES_CALLING_TONE;
         awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f);
-        false_hit = FALSE;
-        false_miss = FALSE;
+        false_hit = false;
+        false_miss = false;
         for (pitch = 1300 - 500;  pitch <= 1300 + 500;  pitch++)
         {
             /* Use the transmitter to test the receiver */
@@ -833,13 +830,13 @@ int main(int argc, char *argv[])
             if (pitch < (1300 - CALLING_TONE_FREQ_BLACKOUT)  ||  pitch > (1300 + CALLING_TONE_FREQ_BLACKOUT))
             {
                 if (hit != MODEM_CONNECT_TONES_NONE)
-                    false_hit = TRUE;
+                    false_hit = true;
                 /*endif*/
             }
             else if (pitch > (1300 - CALLING_TONE_FREQ_TOLERANCE)  &&  pitch < (1300 + CALLING_TONE_FREQ_TOLERANCE))
             {
                 if (hit != tone_type)
-                    false_miss = TRUE;
+                    false_miss = true;
                 /*endif*/
             }
             /*endif*/
@@ -863,8 +860,8 @@ int main(int argc, char *argv[])
         printf("Test 3a: CNG detection with level\n");
         tone_type = MODEM_CONNECT_TONES_FAX_CNG;
         awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f);
-        false_hit = FALSE;
-        false_miss = FALSE;
+        false_hit = false;
+        false_miss = false;
         for (pitch = 1100 - CED_FREQ_TOLERANCE;  pitch <= 1100 + CED_FREQ_TOLERANCE;  pitch += 2*CED_FREQ_TOLERANCE)
         {
             for (level = LEVEL_MAX;  level >= LEVEL_MIN;  level--)
@@ -888,13 +885,13 @@ int main(int argc, char *argv[])
                 if (level < LEVEL_MIN_REJECT)
                 {
                     if (hit != MODEM_CONNECT_TONES_NONE)
-                        false_hit = TRUE;
+                        false_hit = true;
                     /*endif*/
                 }
                 else if (level > LEVEL_MIN_ACCEPT)
                 {
                     if (hit != tone_type)
-                        false_miss = TRUE;
+                        false_miss = true;
                     /*endif*/
                 }
                 /*endif*/
@@ -920,8 +917,8 @@ int main(int argc, char *argv[])
         printf("Test 3b: CED/ANS detection with level\n");
         tone_type = MODEM_CONNECT_TONES_ANS;
         awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f);
-        false_hit = FALSE;
-        false_miss = FALSE;
+        false_hit = false;
+        false_miss = false;
         for (pitch = 2100 - CNG_FREQ_TOLERANCE;  pitch <= 2100 + CNG_FREQ_TOLERANCE;  pitch += 2*CNG_FREQ_TOLERANCE)
         {
             for (level = LEVEL_MAX;  level >= LEVEL_MIN;  level--)
@@ -945,13 +942,13 @@ int main(int argc, char *argv[])
                 if (level < LEVEL_MIN_REJECT)
                 {
                     if (hit != MODEM_CONNECT_TONES_NONE)
-                        false_hit = TRUE;
+                        false_hit = true;
                     /*endif*/
                 }
                 else if (level > LEVEL_MIN_ACCEPT)
                 {
                     if (hit != tone_type)
-                        false_miss = TRUE;
+                        false_miss = true;
                     /*endif*/
                 }
                 /*endif*/
@@ -977,8 +974,8 @@ int main(int argc, char *argv[])
         printf("Test 3c: ANSam detection with level\n");
         tone_type = MODEM_CONNECT_TONES_ANSAM;
         awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f);
-        false_hit = FALSE;
-        false_miss = FALSE;
+        false_hit = false;
+        false_miss = false;
         for (pitch = 2100 - CNG_FREQ_TOLERANCE;  pitch <= 2100 + CNG_FREQ_TOLERANCE;  pitch += 2*CNG_FREQ_TOLERANCE)
         {
             //for (level = LEVEL_MAX;  level >= LEVEL_MIN;  level--)
@@ -1004,13 +1001,13 @@ int main(int argc, char *argv[])
                 if (level < LEVEL_MIN_REJECT)
                 {
                     if (hit != MODEM_CONNECT_TONES_NONE)
-                        false_hit = TRUE;
+                        false_hit = true;
                     /*endif*/
                 }
                 else if (level > LEVEL_MIN_ACCEPT)
                 {
                     if (hit != tone_type)
-                        false_miss = TRUE;
+                        false_miss = true;
                     /*endif*/
                 }
                 /*endif*/
@@ -1036,8 +1033,8 @@ int main(int argc, char *argv[])
         printf("Test 3d: ANS/ (EC-disable) detection with level\n");
         tone_type = MODEM_CONNECT_TONES_ANS_PR;
         awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f);
-        false_hit = FALSE;
-        false_miss = FALSE;
+        false_hit = false;
+        false_miss = false;
         for (pitch = 2100 - CNG_FREQ_TOLERANCE;  pitch <= 2100 + CNG_FREQ_TOLERANCE;  pitch += 2*CNG_FREQ_TOLERANCE)
         {
             for (level = LEVEL_MAX;  level >= LEVEL_MIN;  level--)
@@ -1061,13 +1058,13 @@ int main(int argc, char *argv[])
                 if (level < LEVEL_MIN_REJECT)
                 {
                     if (hit != MODEM_CONNECT_TONES_NONE)
-                        false_hit = TRUE;
+                        false_hit = true;
                     /*endif*/
                 }
                 else if (level > LEVEL_MIN_ACCEPT)
                 {
                     if (hit != tone_type)
-                        false_miss = TRUE;
+                        false_miss = true;
                     /*endif*/
                 }
                 /*endif*/
@@ -1093,8 +1090,8 @@ int main(int argc, char *argv[])
         printf("Test 3e: ANSam/ (Modulated EC-disable) detection with level\n");
         tone_type = MODEM_CONNECT_TONES_ANSAM_PR;
         awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f);
-        false_hit = FALSE;
-        false_miss = FALSE;
+        false_hit = false;
+        false_miss = false;
         for (pitch = 2100 - CNG_FREQ_TOLERANCE;  pitch <= 2100 + CNG_FREQ_TOLERANCE;  pitch += 2*CNG_FREQ_TOLERANCE)
         {
             for (level = LEVEL_MAX;  level >= LEVEL_MIN;  level--)
@@ -1119,13 +1116,13 @@ int main(int argc, char *argv[])
                 if (level < LEVEL_MIN_REJECT)
                 {
                     if (hit != MODEM_CONNECT_TONES_NONE)
-                        false_hit = TRUE;
+                        false_hit = true;
                     /*endif*/
                 }
                 else if (level > LEVEL_MIN_ACCEPT)
                 {
                     if (hit != tone_type)
-                        false_miss = TRUE;
+                        false_miss = true;
                     /*endif*/
                 }
                 /*endif*/
@@ -1151,8 +1148,8 @@ int main(int argc, char *argv[])
         printf("Test 3f: Bell answer tone detection with level\n");
         tone_type = MODEM_CONNECT_TONES_BELL_ANS;
         awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f);
-        false_hit = FALSE;
-        false_miss = FALSE;
+        false_hit = false;
+        false_miss = false;
         for (pitch = 2225 - BELL_ANS_FREQ_TOLERANCE;  pitch <= 2225 + BELL_ANS_FREQ_TOLERANCE;  pitch += 2*BELL_ANS_FREQ_TOLERANCE)
         {
             for (level = LEVEL_MAX;  level >= LEVEL_MIN;  level--)
@@ -1176,13 +1173,13 @@ int main(int argc, char *argv[])
                 if (level < LEVEL_MIN_REJECT)
                 {
                     if (hit != MODEM_CONNECT_TONES_NONE)
-                        false_hit = TRUE;
+                        false_hit = true;
                     /*endif*/
                 }
                 else if (level > LEVEL_MIN_ACCEPT)
                 {
                     if (hit != tone_type)
-                        false_miss = TRUE;
+                        false_miss = true;
                     /*endif*/
                 }
                 /*endif*/
@@ -1208,8 +1205,8 @@ int main(int argc, char *argv[])
         printf("Test 3g: Calling tone detection with level\n");
         tone_type = MODEM_CONNECT_TONES_CALLING_TONE;
         awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f);
-        false_hit = FALSE;
-        false_miss = FALSE;
+        false_hit = false;
+        false_miss = false;
         for (pitch = 1300 - CALLING_TONE_FREQ_TOLERANCE;  pitch <= 1300 + CALLING_TONE_FREQ_TOLERANCE;  pitch += 2*CALLING_TONE_FREQ_TOLERANCE)
         {
             for (level = LEVEL_MAX;  level >= LEVEL_MIN;  level--)
@@ -1233,13 +1230,13 @@ int main(int argc, char *argv[])
                 if (level < LEVEL_MIN_REJECT)
                 {
                     if (hit != MODEM_CONNECT_TONES_NONE)
-                        false_hit = TRUE;
+                        false_hit = true;
                     /*endif*/
                 }
                 else if (level > LEVEL_MIN_ACCEPT)
                 {
                     if (hit != tone_type)
-                        false_miss = TRUE;
+                        false_miss = true;
                     /*endif*/
                 }
                 /*endif*/
@@ -1263,8 +1260,8 @@ int main(int argc, char *argv[])
     if ((test_list & PERFORM_TEST_4))
     {
         printf("Test 4: CED detection, when stimulated with V.21 preamble\n");
-        false_hit = FALSE;
-        false_miss = FALSE;
+        false_hit = false;
+        false_miss = false;
 
         /* Send 255 bits of preamble (0.85s, the minimum specified preamble for T.30), and then
            some random bits. Check the preamble detector comes on, and goes off at reasonable times. */
@@ -1299,8 +1296,8 @@ int main(int argc, char *argv[])
         printf("Test 5A: ANS and ANS/ detection with reversal interval\n");
         tone_type = MODEM_CONNECT_TONES_ANS_PR;
         awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f);
-        false_hit = FALSE;
-        false_miss = FALSE;
+        false_hit = false;
+        false_miss = false;
         for (interval = 400;  interval < 800;  interval++)
         {
             printf("Reversal interval = %d\n", interval);
@@ -1331,13 +1328,13 @@ int main(int argc, char *argv[])
             if (interval < (450 - 25)  ||  interval > (450 + 25))
             {
                 if (hits != 0)
-                    false_hit = TRUE;
+                    false_hit = true;
                 /*endif*/
             }
             else if (interval > (450 - 25)  &&  interval < (450 + 25))
             {
                 if (hits == 0)
-                    false_miss = TRUE;
+                    false_miss = true;
                 /*endif*/
             }
             /*endif*/
@@ -1361,8 +1358,8 @@ int main(int argc, char *argv[])
         printf("Test 5B: ANS and ANS/ detection with mixed reversal intervals\n");
         awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f);
         tone_type = MODEM_CONNECT_TONES_ANS_PR;
-        false_hit = FALSE;
-        false_miss = FALSE;
+        false_hit = false;
+        false_miss = false;
         interval = 450;
         printf("Reversal interval = %d\n", interval);
         /* Use the transmitter to test the receiver */
@@ -1410,8 +1407,8 @@ int main(int argc, char *argv[])
         printf("Test 6a: ANSam detection with AM pitch\n");
         tone_type = MODEM_CONNECT_TONES_ANSAM;
         awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f);
-        false_hit = FALSE;
-        false_miss = FALSE;
+        false_hit = false;
+        false_miss = false;
         for (pitch = 5;  pitch < 25;  pitch++)
         {
             /* Use the transmitter to test the receiver */
@@ -1432,13 +1429,13 @@ int main(int argc, char *argv[])
             if (pitch < (15 - 10)  ||  pitch > (15 + 10))
             {
                 if (hit == tone_type)
-                    false_hit = TRUE;
+                    false_hit = true;
                 /*endif*/
             }
             else if (pitch > (15 - AM_FREQ_TOLERANCE)  &&  pitch < (15 + AM_FREQ_TOLERANCE))
             {
                 if (hit != tone_type)
-                    false_miss = TRUE;
+                    false_miss = true;
                 /*endif*/
             }
             /*endif*/
@@ -1462,8 +1459,8 @@ int main(int argc, char *argv[])
         printf("Test 6b: ANSam/ (Modulated EC-disable) detection with AM pitch\n");
         tone_type = MODEM_CONNECT_TONES_ANSAM_PR;
         awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f);
-        false_hit = FALSE;
-        false_miss = FALSE;
+        false_hit = false;
+        false_miss = false;
         for (pitch = 5;  pitch < 25;  pitch++)
         {
             /* Use the transmitter to test the receiver */
@@ -1484,13 +1481,13 @@ int main(int argc, char *argv[])
             if (pitch < (15 - 10)  ||  pitch > (15 + 10))
             {
                 if (hit == tone_type)
-                    false_hit = TRUE;
+                    false_hit = true;
                 /*endif*/
             }
             else if (pitch > (15 - AM_FREQ_TOLERANCE)  &&  pitch < (15 + AM_FREQ_TOLERANCE))
             {
                 if (hit != tone_type)
-                    false_miss = TRUE;
+                    false_miss = true;
                 /*endif*/
             }
             /*endif*/
@@ -1515,8 +1512,8 @@ int main(int argc, char *argv[])
         tone_type = MODEM_CONNECT_TONES_ANSAM;
         pitch = 2100;
         awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f);
-        false_hit = FALSE;
-        false_miss = FALSE;
+        false_hit = false;
+        false_miss = false;
         for (depth = 0;  depth < 40;  depth++)
         {
             /* Use the transmitter to test the receiver */
@@ -1537,13 +1534,13 @@ int main(int argc, char *argv[])
             if (depth < 10)
             {
                 if (hit == tone_type)
-                    false_hit = TRUE;
+                    false_hit = true;
                 /*endif*/
             }
             else if (depth > 15)
             {
                 if (hit != tone_type)
-                    false_miss = TRUE;
+                    false_miss = true;
                 /*endif*/
             }
             /*endif*/
@@ -1568,8 +1565,8 @@ int main(int argc, char *argv[])
         tone_type = MODEM_CONNECT_TONES_ANSAM_PR;
         pitch = 2100;
         awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f);
-        false_hit = FALSE;
-        false_miss = FALSE;
+        false_hit = false;
+        false_miss = false;
         for (depth = 0;  depth < 40;  depth++)
         {
             /* Use the transmitter to test the receiver */
@@ -1590,13 +1587,13 @@ int main(int argc, char *argv[])
             if (depth < 10)
             {
                 if (hit == tone_type)
-                    false_hit = TRUE;
+                    false_hit = true;
                 /*endif*/
             }
             else if (depth > 15)
             {
                 if (hit != tone_type)
-                    false_miss = TRUE;
+                    false_miss = true;
                 /*endif*/
             }
             /*endif*/
index c6ce135a027b98380dac44cfec9c1a301acdea77..2cc50f4294250ab120b81d92cb36e39588e82e9a 100644 (file)
@@ -118,8 +118,8 @@ fir32_state_t line_model;
 SNDFILE *resulthandle;
 int16_t residue_sound[8000];
 int residue_cur = 0;
-int do_codec_munge = TRUE;
-int use_gui = FALSE;
+int do_codec_munge = true;
+int use_gui = false;
 
 static const int16_t tone_1khz[] = {10362, 7327, 0, -7327, -10362, -7327, 0, 7327};
 
@@ -268,12 +268,12 @@ int main(int argc, char *argv[])
 #endif
 
     line_model_no = 0;
-    use_gui = FALSE;
+    use_gui = false;
     for (i = 1;  i < argc;  i++)
     {
         if (strcmp(argv[i], "-g") == 0)
         {
-            use_gui = TRUE;
+            use_gui = true;
             continue;
         }
         line_model_no = atoi(argv[1]);
@@ -307,7 +307,7 @@ int main(int argc, char *argv[])
     power_meter_init(&power_after, 5);
 
     /* Measure the echo power before adaption */
-    modem_echo_can_adaption_mode(ctx, FALSE);
+    modem_echo_can_adaption_mode(ctx, false);
     for (i = 0;  i < 8000*5;  i++)
     {
         tx = tone_1khz[i & 7];
@@ -322,7 +322,7 @@ int main(int argc, char *argv[])
 
     /* Converge the canceller */
     signal_restart(&local_css);
-    modem_echo_can_adaption_mode(ctx, TRUE);
+    modem_echo_can_adaption_mode(ctx, true);
     for (i = 0;  i < 800*2;  i++)
     {
         clean = modem_echo_can_update(ctx, 0, 0);
@@ -352,7 +352,7 @@ int main(int argc, char *argv[])
     }
 
     /* Now lets see how well adapted we are */
-    modem_echo_can_adaption_mode(ctx, FALSE);
+    modem_echo_can_adaption_mode(ctx, false);
     for (i = 0;  i < 8000*5;  i++)
     {
         tx = tone_1khz[i & 7];
index ff87b20605aa564babd083cdfd44322c4e09fbb5..f41208239c7d8d3e3c0e28af38e453275b4d9486 100644 (file)
@@ -88,13 +88,13 @@ int main(int argc, char *argv[])
     int encoded_fd;
     const char *encoded_file_name;
     const char *in_file_name;
-    int log_encoded_data;
+    bool log_encoded_data;
     int opt;
 
     bit_rate = 32000;
     encoded_file_name = NULL;
     in_file_name = IN_FILE_NAME;
-    log_encoded_data = FALSE;
+    log_encoded_data = false;
     while ((opt = getopt(argc, argv, "2d:i:l")) != -1)
     {
         switch (opt)
@@ -109,7 +109,7 @@ int main(int argc, char *argv[])
             in_file_name = optarg;
             break;
         case 'l':
-            log_encoded_data = TRUE;
+            log_encoded_data = true;
             break;
         default:
             //usage();
index 4e97d96321d858e61a48aeab4bae4c8427fb168b..78e645d3174a8212ee2f02d64377b65882b1590a 100644 (file)
@@ -70,18 +70,18 @@ int main(int argc, char *argv[])
     int block_len;
     int loss_rate;
     int dropit;
-    int block_real;
-    int block_synthetic;
     int tone;
     int i;
+    int opt;
+    bool block_real;
+    bool block_synthetic;
     uint32_t phase_acc;
     int32_t phase_rate;
-    int opt;
 
     loss_rate = 25;
     block_len = 160;
-    block_real = FALSE;
-    block_synthetic = FALSE;
+    block_real = false;
+    block_synthetic = false;
     tone = -1;
     while ((opt = getopt(argc, argv, "b:l:rst:")) != -1)
     {
@@ -94,10 +94,10 @@ int main(int argc, char *argv[])
             loss_rate = atoi(optarg);
             break;
         case 'r':
-            block_real = TRUE;
+            block_real = true;
             break;
         case 's':
-            block_synthetic = TRUE;
+            block_synthetic = true;
             break;
         case 't':
             tone = atoi(optarg);
index 0dd04c74248c26ee821ae49216d91dd7d9f2d4ac..da0437277847d3ec68c13c25adc43d307a4736df 100644 (file)
@@ -75,7 +75,7 @@ static int power_surge_detector_tests(void)
         exit(2);
     }
     sig = power_surge_detector_init(NULL, -50.0f, 5.0f);
-    prev_signal_present = FALSE;
+    prev_signal_present = false;
 
     phase_rate = dds_phase_rate(450.0f);
     phase_acc = 0;
@@ -178,7 +178,7 @@ static int power_surge_detector_file_test(const char *file)
         exit(2);
     }
     sig = power_surge_detector_init(NULL, -50.0f, 6.0f);
-    prev_signal_present = FALSE;
+    prev_signal_present = false;
 
     sample = 0;
     while ((inframes = sf_readf_short(inhandle, amp, 8000)))
@@ -271,7 +271,7 @@ static int power_meter_tests(void)
                              0,
                              0,
                              0,
-                             TRUE);
+                             true);
     tone_gen_init(&gen, &tone_desc);
     len = tone_gen(&gen, amp, 1000);
     for (i = 0;  i < len;  i++)
@@ -335,13 +335,13 @@ static int power_meter_tests(void)
 
 int main(int argc, char *argv[])
 {
-    int basic_tests;
-    int decode;
+    bool basic_tests;
+    bool decode;
     int opt;
     const char *in_file;
 
-    basic_tests = TRUE;
-    decode = FALSE;
+    basic_tests = true;
+    decode = false;
     in_file = IN_FILE_NAME;
     while ((opt = getopt(argc, argv, "d:")) != -1)
     {
@@ -349,8 +349,8 @@ int main(int argc, char *argv[])
         {
         case 'd':
             in_file = optarg;
-            basic_tests = FALSE;
-            decode = TRUE;
+            basic_tests = false;
+            decode = true;
             break;
         default:
             //usage();
index f973801d130866ca6125664a478bbdf9cf835ea7..c7bc2e67ebbfc3df54af41bd9f30b06a796d2ad0 100644 (file)
@@ -172,7 +172,7 @@ int psuedo_terminal_create(modem_t *modem)
         psuedo_terminal_close(modem);
         return -1;
     }
-    modem->threadAbort = CreateEvent(NULL, TRUE, FALSE, NULL);
+    modem->threadAbort = CreateEvent(NULL, true, false, NULL);
 #else
     modem->slot = next_id++;
     snprintf(modem->devlink, sizeof(modem->devlink), "/dev/spandsp/%d", modem->slot);
index d01aa60ec9a58b83543f5c9046e7db6edb24d6cd..f648b155f8e5bb87e9a418d4336f23104e9dd66d 100644 (file)
@@ -691,21 +691,21 @@ static void functional_message_tests(void)
 
 int main(int argc, char *argv[])
 {
-    int threaded_messages;
-    int threaded_streams;
+    bool threaded_messages;
+    bool threaded_streams;
     int opt;
 
-    threaded_messages = FALSE;
-    threaded_streams = FALSE;
+    threaded_messages = false;
+    threaded_streams = false;
     while ((opt = getopt(argc, argv, "ms")) != -1)
     {
         switch (opt)
         {
         case 'm':
-            threaded_messages = TRUE;
+            threaded_messages = true;
             break;
         case 's':
-            threaded_streams = TRUE;
+            threaded_streams = true;
             break;
         }
     }
index 6fb9b0781dbf8bc52d369276f3d1417c27e8be80..2402634131067a0764c8d197fb5ede05b7807241 100644 (file)
@@ -165,7 +165,7 @@ static void my_mf_gen_init(float low_fudge,
                                  0,
                                  0,
                                  0,
-                                 FALSE);
+                                 false);
     }
 }
 /*- End of function --------------------------------------------------------*/
@@ -205,7 +205,7 @@ static void digit_delivery(void *data, int digit, int level, int delay)
 
     if (data != (void *) 0x12345678)
     {
-        callback_ok = FALSE;
+        callback_ok = false;
         return;
     }
     if ((callback_roll & 1))
@@ -213,13 +213,13 @@ static void digit_delivery(void *data, int digit, int level, int delay)
     else
         ch = r2_mf_tone_codes[callback_roll >> 1];
     if (ch == digit)
-        callback_ok = TRUE;
+        callback_ok = true;
     else
-        callback_ok = FALSE;
+        callback_ok = false;
     if (r2_mf_tone_codes[callback_roll >> 1])
         callback_roll++;
     else
-        callback_ok = FALSE;
+        callback_ok = false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -539,7 +539,7 @@ static int test_a_tone_set(int fwd)
     printf("    Passed\n");
 
     printf("Test 8: Callback digit delivery mode.\n");
-    callback_ok = FALSE;
+    callback_ok = false;
     callback_roll = 0;
     mf_state = r2_mf_rx_init(NULL, fwd, digit_delivery, (void *) 0x12345678);
     my_mf_gen_init(0.0, -3, 0.0, -3, 68, fwd);
@@ -583,9 +583,9 @@ int main(int argc, char *argv[])
 
     now = time(NULL);
     printf("R2 forward tones\n");
-    test_a_tone_set(TRUE);
+    test_a_tone_set(true);
     printf("R2 backward tones\n");
-    test_a_tone_set(FALSE);
+    test_a_tone_set(false);
     duration = time(NULL) - now;
     printf("Tests passed in %lds\n", duration);
     return 0;
index ff6c5b82d55a25a52c3ca814e3e2c2928993e690..0348f799e8482258933c53ebb2bcaae12cfc6fbc 100644 (file)
@@ -64,7 +64,7 @@ int main(int argc, char *argv[])
         exit(2);
     }
 
-    r2_mf_tx_init(&gen, FALSE);
+    r2_mf_tx_init(&gen, false);
     for (digit = 0;  digits[digit];  digit++)
     {
         r2_mf_tx_put(&gen, digits[digit]);
@@ -79,7 +79,7 @@ int main(int argc, char *argv[])
             sf_writef_short(outhandle, amp, len);
     }
 
-    r2_mf_tx_init(&gen, TRUE);
+    r2_mf_tx_init(&gen, true);
     for (digit = 0;  digits[digit];  digit++)
     {
         r2_mf_tx_put(&gen, digits[digit]);
index 2c2700fc4443f1e2dfe8b6a10d11e14fe7b46b8f..95d8f6b9717a71b29af6e2ce620b2bcab9538451 100644 (file)
@@ -89,7 +89,7 @@ int main(int argc, char *argv[])
 #endif
 
 #if defined(ENABLE_GUI)
-    use_gui = FALSE;
+    use_gui = false;
 #endif
     model_no = MODEL_NO;
     speed_pattern_no = SPEED_PATTERN_NO;
@@ -100,7 +100,7 @@ int main(int argc, char *argv[])
         {
         case 'g':
 #if defined(ENABLE_GUI)
-            use_gui = TRUE;
+            use_gui = true;
 #else
             fprintf(stderr, "Graphical monitoring not available\n");
             exit(2);
index 4288891e5788e9560c60d7b6ad74cc6198718375..00af89eeba77c4f8be67e1bd7b56223c13e603ed 100644 (file)
@@ -83,7 +83,7 @@ static int dial_pulses = 0;
 static int rx_handler_callbacks = 0;
 static int tx_handler_callbacks = 0;
 
-static int use_gui = FALSE;
+static bool use_gui = false;
 
 static void plot_frequency_response(void)
 {
@@ -522,13 +522,13 @@ int main(int argc, char *argv[])
     template_t template[10];
     int opt;
 
-    use_gui = FALSE;
+    use_gui = false;
     while ((opt = getopt(argc, argv, "g")) != -1)
     {
         switch (opt)
         {
         case 'g':
-            use_gui = TRUE;
+            use_gui = true;
             break;
         default:
             //usage();
index 9ff6bc462febcd85486a90dc75bb934654f2becb..aebc54a409af4d9dc4262fb2442cb4047c938c80 100644 (file)
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
     }
 
     printf("Test with swept tone.\n");
-    s = swept_tone_init(NULL, 200.0f, 3900.0f, -10.0f, 60*SAMPLE_RATE, TRUE);
+    s = swept_tone_init(NULL, 200.0f, 3900.0f, -10.0f, 60*SAMPLE_RATE, true);
     for (j = 0;  j < 60*SAMPLE_RATE;  j += BLOCK_LEN)
     {
         len = swept_tone(s, buf, BLOCK_LEN);
index da32c80c9fefd43a97a118845de01d0f24188fd8..7c0825e4b5de389d471fdffa6aff820edbe4836d 100644 (file)
@@ -80,14 +80,14 @@ g1050_state_t *path_b_to_a;
 
 double when = 0.0;
 
-int t38_mode = FALSE;
+int t38_mode = false;
 
 struct modem_s modem[10];
 
 char *decode_test_file = NULL;
 int countdown = 0;
 int answered = 0;
-int done = FALSE;
+int done = false;
 
 int test_seq_ptr = 0;
 
@@ -155,7 +155,7 @@ printf("\n");
 
     modem = (modem_t *) user_data;
 #if defined(WIN32)
-    o.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
+    o.hEvent = CreateEvent(NULL, true, false, NULL);
     /* Initialize the rest of the OVERLAPPED structure to zero. */
     o.Internal = 0;
     o.InternalHigh = 0;
@@ -163,7 +163,7 @@ printf("\n");
     o.OffsetHigh = 0;
     assert(o.hEvent);
     if (!WriteFile(modem->master, buf, (DWORD) len, &res, &o))
-        GetOverlappedResult(modem->master, &o, &res, TRUE);
+        GetOverlappedResult(modem->master, &o, &res, true);
     CloseHandle(o.hEvent);
 #else
     res = write(modem->master, buf, len);
@@ -205,7 +205,7 @@ static int t31_call_control(t31_state_t *s, void *user_data, int op, const char
         answered = 1;
         break;
     case AT_MODEM_CONTROL_HANGUP:
-        //done = TRUE;
+        //done = true;
         break;
     case AT_MODEM_CONTROL_OFFHOOK:
         break;
@@ -302,7 +302,7 @@ static int modem_wait_sock(modem_t *modem, int ms, modem_poll_t flags)
     ret = MODEM_POLL_ERROR;
     arHandles[0] = modem->threadAbort;
 
-    o.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
+    o.hEvent = CreateEvent(NULL, true, false, NULL);
     arHandles[1] = o.hEvent;
 
     /* Initialize the rest of the OVERLAPPED structure to zero. */
@@ -323,7 +323,7 @@ static int modem_wait_sock(modem_t *modem, int ms, modem_poll_t flags)
         else
         {
             /* IO is pending, wait for it to finish */
-            dwWait = WaitForMultipleObjects(2, arHandles, FALSE, INFINITE);
+            dwWait = WaitForMultipleObjects(2, arHandles, false, INFINITE);
             if (dwWait == WAIT_OBJECT_0 + 1  &&  !modem->block_read)
                 ret = MODEM_POLL_READ;
         }
@@ -415,8 +415,8 @@ static int t30_tests(int t38_mode, int use_ecm, int use_gui, int log_audio, int
 
     /* Set up the test environment */
     t38_version = 1;
-    without_pacing = FALSE;
-    use_tep = FALSE;
+    without_pacing = false;
+    use_tep = false;
 
     wave_handle = NULL;
     if (log_audio)
@@ -456,7 +456,7 @@ static int t30_tests(int t38_mode, int use_ecm, int use_gui, int log_audio, int
     {
         if (t38_mode)
         {
-            if ((t38_state = t38_terminal_init(NULL, FALSE, t38_tx_packet_handler, t31_state)) == NULL)
+            if ((t38_state = t38_terminal_init(NULL, false, t38_tx_packet_handler, t31_state)) == NULL)
             {
                 fprintf(stderr, "Cannot start the T.38 channel\n");
                 exit(2);
@@ -465,7 +465,7 @@ static int t30_tests(int t38_mode, int use_ecm, int use_gui, int log_audio, int
         }
         else
         {
-            fax_state = fax_init(NULL, FALSE);
+            fax_state = fax_init(NULL, false);
             t30 = fax_get_t30_state(fax_state);
         }
         t30_set_rx_file(t30, OUTPUT_FILE_NAME, -1);
@@ -475,7 +475,7 @@ static int t30_tests(int t38_mode, int use_ecm, int use_gui, int log_audio, int
     {
         if (t38_mode)
         {
-            if ((t38_state = t38_terminal_init(NULL, TRUE, t38_tx_packet_handler, t31_state)) == NULL)
+            if ((t38_state = t38_terminal_init(NULL, true, t38_tx_packet_handler, t31_state)) == NULL)
             {
                 fprintf(stderr, "Cannot start the T.38 channel\n");
                 exit(2);
@@ -484,7 +484,7 @@ static int t30_tests(int t38_mode, int use_ecm, int use_gui, int log_audio, int
         }
         else
         {
-            fax_state = fax_init(NULL, TRUE);
+            fax_state = fax_init(NULL, true);
             t30 = fax_get_t30_state(fax_state);
         }
         t30_set_tx_file(t30, INPUT_FILE_NAME, -1, -1);
@@ -559,7 +559,7 @@ static int t30_tests(int t38_mode, int use_ecm, int use_gui, int log_audio, int
         span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME);
         span_log_set_tag(logging, "T.31");
 
-        t31_set_mode(t31_state, TRUE);
+        t31_set_mode(t31_state, true);
         t38_set_t38_version(t38_core, t38_version);
     }
 
@@ -606,7 +606,7 @@ printf("ZZZ\n");
         if ((ret & MODEM_POLL_READ))
         {
 #if defined(WIN32)
-            o.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
+            o.hEvent = CreateEvent(NULL, true, false, NULL);
 
             /* Initialize the rest of the OVERLAPPED structure to zero. */
             o.Internal = 0;
@@ -615,7 +615,7 @@ printf("ZZZ\n");
             o.OffsetHigh = 0;
             assert(o.hEvent);
             if (!ReadFile(modem->master, buf, avail, &read_bytes, &o))
-                GetOverlappedResult(modem->master, &o, &read_bytes, TRUE);
+                GetOverlappedResult(modem->master, &o, &read_bytes, true);
             CloseHandle (o.hEvent);
             if ((len = read_bytes))
 #else
@@ -767,11 +767,11 @@ int main(int argc, char *argv[])
 #endif
 
     decode_test_file = NULL;
-    log_audio = FALSE;
-    test_sending = FALSE;
-    t38_mode = FALSE;
-    use_ecm = FALSE;
-    use_gui = FALSE;
+    log_audio = false;
+    test_sending = false;
+    t38_mode = false;
+    use_ecm = false;
+    use_gui = false;
     g1050_model_no = 0;
     g1050_speed_pattern_no = 1;
     while ((opt = getopt(argc, argv, "d:eglM:rS:st")) != -1)
@@ -782,33 +782,33 @@ int main(int argc, char *argv[])
             decode_test_file = optarg;
             break;
         case 'e':
-            use_ecm = TRUE;
+            use_ecm = true;
             break;
         case 'g':
 #if defined(ENABLE_GUI)
-            use_gui = TRUE;
+            use_gui = true;
 #else
             fprintf(stderr, "Graphical monitoring not available\n");
             exit(2);
 #endif
             break;
         case 'l':
-            log_audio = TRUE;
+            log_audio = true;
             break;
         case 'M':
             g1050_model_no = optarg[0] - 'A' + 1;
             break;
         case 'r':
-            test_sending = FALSE;
+            test_sending = false;
             break;
         case 'S':
             g1050_speed_pattern_no = atoi(optarg);
             break;
         case 's':
-            test_sending = TRUE;
+            test_sending = true;
             break;
         case 't':
-            t38_mode = TRUE;
+            t38_mode = true;
             break;
         default:
             //usage();
index c7d941384febff194391fe50f176c1c57045ef5e..12c3426b4d8b8694350cd34c7145cff7e172f398 100644 (file)
@@ -82,7 +82,7 @@ g1050_state_t *path_b_to_a;
 
 double when = 0.0;
 
-int t38_mode = FALSE;
+int t38_mode = false;
 
 #define EXCHANGE(a,b) {a, sizeof(a) - 1, b, sizeof(b) - 1}
 #define RESPONSE(b) {"", 0, b, sizeof(b) - 1}
@@ -268,11 +268,11 @@ int countdown = 0;
 int command_response_test_step = -1;
 char response_buf[1000];
 int response_buf_ptr = 0;
-int answered = FALSE;
-int kick = FALSE;
-int dled = FALSE;
-int done = FALSE;
-int sequence_terminated = FALSE;
+int answered = false;
+int kick = false;
+int dled = false;
+int done = false;
+int sequence_terminated = false;
 
 static const struct command_response_s *fax_test_seq;
 
@@ -333,10 +333,10 @@ static int modem_call_control(t31_state_t *s, void *user_data, int op, const cha
         t31_call_event(t31_state, AT_CALL_EVENT_CONNECTED);
         break;
     case AT_MODEM_CONTROL_ANSWER:
-        answered = TRUE;
+        answered = true;
         break;
     case AT_MODEM_CONTROL_HANGUP:
-        done = TRUE;
+        done = true;
         break;
     case AT_MODEM_CONTROL_OFFHOOK:
         break;
@@ -393,17 +393,17 @@ static int at_tx_handler(at_state_t *s, void *user_data, const uint8_t *buf, siz
                     response_buf[response_buf_ptr] = '\0';
                     test_seq_ptr++;
                     if (fax_test_seq[test_seq_ptr].command == NULL  &&  fax_test_seq[test_seq_ptr].command == NULL)
-                        sequence_terminated = TRUE;
+                        sequence_terminated = true;
                     if (fax_test_seq[test_seq_ptr].command)
-                        kick = TRUE;
+                        kick = true;
                     break;
                 }
-                dled = FALSE;
+                dled = false;
             }
             else
             {
                 if (buf[i] == DLE)
-                    dled = TRUE;
+                    dled = true;
             }
         }
         i++;
@@ -432,13 +432,13 @@ static int at_tx_handler(at_state_t *s, void *user_data, const uint8_t *buf, siz
         printf("\nMatched\n");
         test_seq_ptr++;
         if (fax_test_seq[test_seq_ptr].command == NULL  &&  fax_test_seq[test_seq_ptr].command == NULL)
-            sequence_terminated = TRUE;
+            sequence_terminated = true;
         response_buf_ptr = 0;
         response_buf[response_buf_ptr] = '\0';
         if (fax_test_seq[test_seq_ptr].command)
-            kick = TRUE;
+            kick = true;
         else
-            dled = FALSE;
+            dled = false;
     }
     return 0;
 }
@@ -511,8 +511,8 @@ static int t30_tests(int t38_mode, int use_gui, int log_audio, int test_sending,
 
     /* Set up the test environment */
     t38_version = 1;
-    without_pacing = FALSE;
-    use_tep = FALSE;
+    without_pacing = false;
+    use_tep = false;
 
     wave_handle = NULL;
     if (log_audio)
@@ -552,7 +552,7 @@ static int t30_tests(int t38_mode, int use_gui, int log_audio, int test_sending,
     {
         if (t38_mode)
         {
-            if ((t38_state = t38_terminal_init(NULL, FALSE, t38_tx_packet_handler, t31_state)) == NULL)
+            if ((t38_state = t38_terminal_init(NULL, false, t38_tx_packet_handler, t31_state)) == NULL)
             {
                 fprintf(stderr, "Cannot start the T.38 channel\n");
                 exit(2);
@@ -561,7 +561,7 @@ static int t30_tests(int t38_mode, int use_gui, int log_audio, int test_sending,
         }
         else
         {
-            fax_state = fax_init(NULL, FALSE);
+            fax_state = fax_init(NULL, false);
             t30 = fax_get_t30_state(fax_state);
         }
         t30_set_rx_file(t30, OUTPUT_FILE_NAME, -1);
@@ -572,7 +572,7 @@ static int t30_tests(int t38_mode, int use_gui, int log_audio, int test_sending,
     {
         if (t38_mode)
         {
-            if ((t38_state = t38_terminal_init(NULL, TRUE, t38_tx_packet_handler, t31_state)) == NULL)
+            if ((t38_state = t38_terminal_init(NULL, true, t38_tx_packet_handler, t31_state)) == NULL)
             {
                 fprintf(stderr, "Cannot start the T.38 channel\n");
                 exit(2);
@@ -581,7 +581,7 @@ static int t30_tests(int t38_mode, int use_gui, int log_audio, int test_sending,
         }
         else
         {
-            fax_state = fax_init(NULL, TRUE);
+            fax_state = fax_init(NULL, true);
             t30 = fax_get_t30_state(fax_state);
         }
         t30_set_tx_file(t30, INPUT_FILE_NAME, -1, -1);
@@ -652,14 +652,14 @@ static int t30_tests(int t38_mode, int use_gui, int log_audio, int test_sending,
         span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME);
         span_log_set_tag(logging, "T.31");
 
-        t31_set_mode(t31_state, TRUE);
+        t31_set_mode(t31_state, true);
         t38_set_t38_version(t38_core, t38_version);
     }
 
-    fast_send = FALSE;
-    fast_send_tcf = TRUE;
+    fast_send = false;
+    fast_send_tcf = true;
     fast_blocks = 0;
-    kick = TRUE;
+    kick = true;
 #if defined(ENABLE_GUI)
     if (use_gui)
         start_media_monitor();
@@ -684,7 +684,7 @@ static int t30_tests(int t38_mode, int use_gui, int log_audio, int test_sending,
         if (kick)
         {
             /* Work through the script */
-            kick = FALSE;
+            kick = false;
             if (fax_test_seq[test_seq_ptr].command > (const char *) 2)
             {
                 if (fax_test_seq[test_seq_ptr].command[0])
@@ -698,15 +698,15 @@ static int t30_tests(int t38_mode, int use_gui, int log_audio, int test_sending,
                 if (fax_test_seq[test_seq_ptr].command == (const char *) 2)
                 {
                     printf("Fast send TCF\n");
-                    fast_send = TRUE;
-                    fast_send_tcf = TRUE;
+                    fast_send = true;
+                    fast_send_tcf = true;
                     fast_blocks = 100;
                 }
                 else
                 {
                     printf("Fast send image\n");
-                    fast_send = TRUE;
-                    fast_send_tcf = FALSE;
+                    fast_send = true;
+                    fast_send_tcf = false;
                     fast_blocks = 100;
                 }
             }
@@ -756,7 +756,7 @@ static int t30_tests(int t38_mode, int use_gui, int log_audio, int test_sending,
             }
             t31_at_rx(t31_state, (char *) fast_buf, 36);
             if (--fast_blocks == 0)
-                fast_send = FALSE;
+                fast_send = false;
         }
 
         if (t38_mode)
@@ -888,10 +888,10 @@ int main(int argc, char *argv[])
     int opt;
 
     decode_test_file = NULL;
-    log_audio = FALSE;
-    test_sending = FALSE;
-    t38_mode = FALSE;
-    use_gui = FALSE;
+    log_audio = false;
+    test_sending = false;
+    t38_mode = false;
+    use_gui = false;
     g1050_model_no = 0;
     g1050_speed_pattern_no = 1;
     while ((opt = getopt(argc, argv, "d:glM:rS:st")) != -1)
@@ -903,29 +903,29 @@ int main(int argc, char *argv[])
             break;
         case 'g':
 #if defined(ENABLE_GUI)
-            use_gui = TRUE;
+            use_gui = true;
 #else
             fprintf(stderr, "Graphical monitoring not available\n");
             exit(2);
 #endif
             break;
         case 'l':
-            log_audio = TRUE;
+            log_audio = true;
             break;
         case 'M':
             g1050_model_no = optarg[0] - 'A' + 1;
             break;
         case 'r':
-            test_sending = FALSE;
+            test_sending = false;
             break;
         case 'S':
             g1050_speed_pattern_no = atoi(optarg);
             break;
         case 's':
-            test_sending = TRUE;
+            test_sending = true;
             break;
         case 't':
-            t38_mode = TRUE;
+            t38_mode = true;
             break;
         default:
             //usage();
index 62599e763054db005c3bff9a64a0a3e60483fd14..b65e30189de597016278ec4c3221b0947c3f0f4e 100644 (file)
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
     const char *country;
     const char *model;
     const char *real_country;
-    int first_hit;
+    bool first_hit;
 
     printf("Sweep through all the possible countries\n");
     for (i = 0;  i < 256;  i++)
@@ -75,7 +75,7 @@ int main(int argc, char *argv[])
         msg[0] = i;
         msg[1] = '\x00';
         msg[2] = '\x00';
-        first_hit = TRUE;
+        first_hit = true;
         for (j = 0;  j < 65536;  j++)
         {
             msg[1] = (j >> 8) & 0xFF;
@@ -88,7 +88,7 @@ int main(int argc, char *argv[])
                         printf("%s\n", real_country);
                     else
                         printf("???\n");
-                    first_hit = FALSE;
+                    first_hit = false;
                 }
                 printf("    0x%02x 0x%02x 0x%02x '%s'\n", msg[0], msg[1], msg[2], vendor);
             }
index 094e68882734c338a04c044a2c192054275bff58..21c131bf3c907bdd577e04c537a3603143c6363d 100644 (file)
@@ -51,8 +51,8 @@ These tests exercise the T.38 core ASN.1 processing code.
 #define MAX_FIELDS      42
 #define MAX_FIELD_LEN   8192
 
+static bool succeeded = true;
 static int t38_version;
-static int succeeded = TRUE;
 static int ok_indicator_packets;
 static int bad_indicator_packets;
 static int ok_data_packets;
@@ -130,7 +130,7 @@ static int tx_packet_handler(t38_core_state_t *s, void *user_data, const uint8_t
     t = (t38_core_state_t *) user_data;
     span_log(t38_core_get_logging_state(s), SPAN_LOG_FLOW, "Send seq %d, len %d, count %d\n", s->tx_seq_no, len, count);
     if (t38_core_rx_ifp_packet(t, buf, len, seq_no) < 0)
-        succeeded = FALSE;
+        succeeded = false;
     seq_no++;
     return 0;
 }
@@ -400,7 +400,7 @@ static int encode_then_decode_tests(t38_core_state_t *a, t38_core_state_t *b)
     for (i = 0, seq_no = 0;  i < concat_len;  i += len)
     {
         if ((len = t38_core_rx_ifp_stream(b, &concat[i], concat_len - i, seq_no)) < 0)
-            succeeded = FALSE;
+            succeeded = false;
         seq_no++;
     }
 
@@ -597,8 +597,8 @@ int main(int argc, char *argv[])
         t38_set_t38_version(t38_core_a, t38_version);
         t38_set_t38_version(t38_core_b, t38_version);
 
-        t38_set_pace_transmission(t38_core_a, FALSE);
-        t38_set_pace_transmission(t38_core_b, FALSE);
+        t38_set_pace_transmission(t38_core_a, false);
+        t38_set_pace_transmission(t38_core_b, false);
 
         t38_set_data_transport_protocol(t38_core_a, T38_TRANSPORT_TCP);
         t38_set_data_transport_protocol(t38_core_b, T38_TRANSPORT_TCP);
@@ -629,7 +629,7 @@ int main(int argc, char *argv[])
 
         t38_set_t38_version(t38_core_a, t38_version);
 
-        t38_set_pace_transmission(t38_core_a, FALSE);
+        t38_set_pace_transmission(t38_core_a, false);
 
         t38_set_data_transport_protocol(t38_core_a, T38_TRANSPORT_TCP);
 
@@ -677,8 +677,8 @@ int main(int argc, char *argv[])
         t38_set_t38_version(t38_core_a, t38_version);
         t38_set_t38_version(t38_core_b, t38_version);
 
-        t38_set_pace_transmission(t38_core_a, FALSE);
-        t38_set_pace_transmission(t38_core_b, FALSE);
+        t38_set_pace_transmission(t38_core_a, false);
+        t38_set_pace_transmission(t38_core_b, false);
 
         t38_set_data_transport_protocol(t38_core_a, T38_TRANSPORT_TCP_TPKT);
         t38_set_data_transport_protocol(t38_core_b, T38_TRANSPORT_TCP_TPKT);
@@ -708,7 +708,7 @@ int main(int argc, char *argv[])
         }
         t38_set_t38_version(t38_core_a, t38_version);
 
-        t38_set_pace_transmission(t38_core_a, FALSE);
+        t38_set_pace_transmission(t38_core_a, false);
 
         t38_set_data_transport_protocol(t38_core_a, T38_TRANSPORT_TCP_TPKT);
 
index c65cb2027d7c20ea2d3033fb297f2f07afdf87c0..34f072b781bde4fd32bd6e6e17a1b3ebda80c41a 100644 (file)
@@ -65,9 +65,9 @@ static SNDFILE *wave_handle;
 
 static int log_audio;
 static int use_transmit_on_idle;
-static int done = FALSE;
+static int done = false;
 
-static int started = FALSE;
+static int started = false;
 static int64_t current = 0;
 
 static int phase_b_handler(t30_state_t *s, void *user_data, int result)
@@ -263,7 +263,7 @@ static int ifp_handler(void *user_data, const uint8_t msg[], int len, int seq_no
 {
     int i;
 
-    started = TRUE;
+    started = true;
 
     printf("%5d >>> ", seq_no);
     for (i = 0;  i < len;  i++)
@@ -333,17 +333,17 @@ int main(int argc, char *argv[])
     uint32_t dest_addr;
     uint16_t dest_port;
 
-    caller = FALSE;
-    use_ecm = FALSE;
+    caller = false;
+    use_ecm = false;
     t38_version = 0;
     options = 0;
     input_file_name = INPUT_FILE_NAME;
-    fill_removal = FALSE;
-    use_tep = FALSE;
-    use_transmit_on_idle = TRUE;
+    fill_removal = false;
+    use_tep = false;
+    use_transmit_on_idle = true;
     supported_modems = T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17;
-    t38_terminal_operation = TRUE;
-    log_audio = FALSE;
+    t38_terminal_operation = true;
+    log_audio = false;
     src_addr = 0;
     src_port = 0;
     dest_addr = 0;
@@ -353,7 +353,7 @@ int main(int argc, char *argv[])
         switch (opt)
         {
         case 'c':
-            caller = TRUE;
+            caller = true;
             break;
         case 'D':
             dest_addr = parse_inet_addr(optarg);
@@ -362,19 +362,19 @@ int main(int argc, char *argv[])
             dest_port = atoi(optarg);
             break;
         case 'e':
-            use_ecm = TRUE;
+            use_ecm = true;
             break;
         case 'F':
-            fill_removal = TRUE;
+            fill_removal = true;
             break;
         case 'G':
-            t38_terminal_operation = FALSE;
+            t38_terminal_operation = false;
             break;
         case 'i':
             input_file_name = optarg;
             break;
         case 'l':
-            log_audio = TRUE;
+            log_audio = true;
             break;
         case 'm':
             supported_modems = atoi(optarg);
@@ -389,7 +389,7 @@ int main(int argc, char *argv[])
             src_port = atoi(optarg);
             break;
         case 't':
-            use_tep = TRUE;
+            use_tep = true;
             break;
         case 'v':
             t38_version = atoi(optarg);
index c9fa046cb4751c158711873e0d5a12596337432f..9b4cb4039c026ca9e23c06e8d610fa980240f80d 100644 (file)
@@ -144,7 +144,7 @@ int main(int argc, char *argv[])
     span_log_set_protocol(&logging, "Buffer");
 
     printf("1 - Impose no minimum for the bits per row\n");
-    t38_non_ecm_buffer_init(&buffer, TRUE, 0);
+    t38_non_ecm_buffer_init(&buffer, true, 0);
     n = 0;
     bit_no = 0;
     /* We should get ones until the buffers recognises an EOL */
@@ -170,7 +170,7 @@ int main(int argc, char *argv[])
     t38_non_ecm_buffer_report_output_status(&buffer, &logging);
 
     printf("2 - Impose no minimum for the bits per row, different alignment\n");
-    t38_non_ecm_buffer_init(&buffer, TRUE, 0);
+    t38_non_ecm_buffer_init(&buffer, true, 0);
     n = 0;
     memset(buf, 0, sizeof(buf));
     /* The first one in this should be seen as the first EOL */
@@ -235,7 +235,7 @@ int main(int argc, char *argv[])
     t38_non_ecm_buffer_report_output_status(&buffer, &logging);
 
     printf("3 - Demand a fairly high minimum for the bits per row\n");
-    t38_non_ecm_buffer_init(&buffer, TRUE, 400);
+    t38_non_ecm_buffer_init(&buffer, true, 400);
     n = 0;
     memset(buf, 0, sizeof(buf));
     /* The first one in this should be seen as the first EOL */
@@ -300,7 +300,7 @@ int main(int argc, char *argv[])
     t38_non_ecm_buffer_report_output_status(&buffer, &logging);
 
     printf("4 - Take some time to get to the first row of the image, output ahead\n");
-    t38_non_ecm_buffer_init(&buffer, TRUE, 400);
+    t38_non_ecm_buffer_init(&buffer, true, 400);
     n = 0;
     /* Get some initial bits from an empty buffer. These should be ones */
     for (i = 0;  i < 1000;  i++)
@@ -448,7 +448,7 @@ int main(int argc, char *argv[])
     t38_non_ecm_buffer_report_output_status(&buffer, &logging);
 
     printf("5 - Take some time to get to the first row of the image, output behind\n");
-    t38_non_ecm_buffer_init(&buffer, TRUE, 400);
+    t38_non_ecm_buffer_init(&buffer, true, 400);
     n = 0;
     /* Inject some ones. */
     memset(buf, 0xFF, 100);
@@ -585,7 +585,7 @@ int main(int argc, char *argv[])
     t38_non_ecm_buffer_report_output_status(&buffer, &logging);
 
     printf("6 - TCF without leading ones\n");
-    t38_non_ecm_buffer_init(&buffer, FALSE, 400);
+    t38_non_ecm_buffer_init(&buffer, false, 400);
     n = 0;
     /* Get some initial bits from an empty buffer. These should be ones */
     for (i = 0;  i < 1000;  i++)
@@ -630,7 +630,7 @@ int main(int argc, char *argv[])
     t38_non_ecm_buffer_report_output_status(&buffer, &logging);
 
     printf("7 - TCF with leading ones\n");
-    t38_non_ecm_buffer_init(&buffer, FALSE, 400);
+    t38_non_ecm_buffer_init(&buffer, false, 400);
     n = 0;
     /* Get some initial bits from an empty buffer. These should be ones */
     for (i = 0;  i < 1000;  i++)
index 58438c5ec6b5544532a55348742966e05c9deb36..fe6b773e23318bdfa72fc716ae8cc4d7156e04b5 100644 (file)
@@ -163,7 +163,7 @@ int main(int argc, char *argv[])
 
     /* The default luminant is D50 */
     set_lab_illuminant(&lab_param, 96.422f, 100.000f,  82.521f);
-    set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, FALSE);
+    set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, false);
 
     source_file = (argc > 1)  ?  argv[1]  :  IN_FILE_NAME;
     /* sRGB to ITU */
@@ -225,7 +225,7 @@ int main(int argc, char *argv[])
 
         /* The default luminant is D50 */
         set_lab_illuminant(&lab, 96.422f, 100.000f,  82.521f);
-        set_lab_gamut(&lab, 0, 100, -85, 85, -75, 125, FALSE);
+        set_lab_gamut(&lab, 0, 100, -85, 85, -75, 125, false);
         lab_to_srgb(&lab, colour_map, colour_map, 256);
         for (i = 0;  i < (1 << bits_per_pixel);  i++)
             printf("Map %3d - %5d %5d %5d\n", i, colour_map[3*i], colour_map[3*i + 1], colour_map[3*i + 2]);
@@ -234,7 +234,7 @@ int main(int argc, char *argv[])
     {
         printf("There is no colour map\n");
     }
-    process_raw = FALSE;
+    process_raw = false;
     printf("Compression is ");
     switch (compression)
     {
@@ -246,18 +246,18 @@ int main(int argc, char *argv[])
         return 0;
     case COMPRESSION_T85:
         printf("T.85\n");
-        process_raw = TRUE;
+        process_raw = true;
         break;
     case COMPRESSION_T43:
         printf("T.43\n");
-        process_raw = TRUE;
+        process_raw = true;
         break;
     case COMPRESSION_JPEG:
         printf("JPEG");
         if (photometric == PHOTOMETRIC_ITULAB)
         {
             printf(" ITULAB");
-            process_raw = TRUE;
+            process_raw = true;
         }
         printf("\n");
         break;
@@ -474,13 +474,13 @@ int main(int argc, char *argv[])
                 printf("CIELAB\n");
                 /* The default luminant is D50 */
                 set_lab_illuminant(&lab_param, 96.422f, 100.000f,  82.521f);
-                set_lab_gamut(&lab_param, 0, 100, -128, 127, -128, 127, TRUE);
+                set_lab_gamut(&lab_param, 0, 100, -128, 127, -128, 127, true);
                 lab_to_srgb(&lab_param, data, data, w*h);
                 break;
             case PHOTOMETRIC_ITULAB:
                 /* The default luminant is D50 */
                 set_lab_illuminant(&lab_param, 96.422f, 100.000f,  82.521f);
-                set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, FALSE);
+                set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, false);
                 break;
             }
             //if (!t42_srgb_to_itulab_jpeg(logging, &lab_param, (tdata_t) &outptr, &outsize, data, off, w, h, 3))
@@ -543,7 +543,7 @@ int main(int argc, char *argv[])
         totdata = h*bytes_per_row;
         /* The default luminant is D50 */
         set_lab_illuminant(&lab_param, 96.422f, 100.000f,  82.521f);
-        set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, FALSE);
+        set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, false);
 #if 0
         start = rdtscll();
         data2 = NULL;
index 17d652dfd34c95dd930d915a08c1367c8936ac52..7d51d7dfb4788bd9c9423ae8b3a50c5d40319387 100644 (file)
@@ -67,18 +67,18 @@ typedef struct
 /* TIFF-FX related extensions to the tag set supported by libtiff */
 static const TIFFFieldInfo tiff_fx_tiff_field_info[] =
 {
-    {TIFFTAG_INDEXED, 1, 1, TIFF_SHORT, FIELD_CUSTOM, FALSE, FALSE, (char *) "Indexed"},
-       {TIFFTAG_GLOBALPARAMETERSIFD, 1, 1, TIFF_IFD8, FIELD_CUSTOM, FALSE, FALSE, (char *) "GlobalParametersIFD"},
-    {TIFFTAG_PROFILETYPE, 1, 1, TIFF_LONG, FIELD_CUSTOM, FALSE, FALSE, (char *) "ProfileType"},
-    {TIFFTAG_FAXPROFILE, 1, 1, TIFF_BYTE, FIELD_CUSTOM, FALSE, FALSE, (char *) "FaxProfile"},
-    {TIFFTAG_CODINGMETHODS, 1, 1, TIFF_LONG, FIELD_CUSTOM, FALSE, FALSE, (char *) "CodingMethods"},
-    {TIFFTAG_VERSIONYEAR, 4, 4, TIFF_BYTE, FIELD_CUSTOM, FALSE, FALSE, (char *) "VersionYear"},
-    {TIFFTAG_MODENUMBER, 1, 1, TIFF_BYTE, FIELD_CUSTOM, FALSE, FALSE, (char *) "ModeNumber"},
-    {TIFFTAG_DECODE, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_SRATIONAL, FIELD_CUSTOM, FALSE, TRUE, (char *) "Decode"},
-    {TIFFTAG_IMAGEBASECOLOR, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_SHORT, FIELD_CUSTOM, FALSE, TRUE, (char *) "ImageBaseColor"},
-    {TIFFTAG_T82OPTIONS, 1, 1, TIFF_LONG, FIELD_CUSTOM, FALSE, FALSE, (char *) "T82Options"},
-    {TIFFTAG_STRIPROWCOUNTS, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_LONG, FIELD_CUSTOM, FALSE, TRUE, (char *) "StripRowCounts"},
-    {TIFFTAG_IMAGELAYER, 2, 2, TIFF_LONG, FIELD_CUSTOM, FALSE, FALSE, (char *) "ImageLayer"},
+    {TIFFTAG_INDEXED, 1, 1, TIFF_SHORT, FIELD_CUSTOM, false, false, (char *) "Indexed"},
+       {TIFFTAG_GLOBALPARAMETERSIFD, 1, 1, TIFF_IFD8, FIELD_CUSTOM, false, false, (char *) "GlobalParametersIFD"},
+    {TIFFTAG_PROFILETYPE, 1, 1, TIFF_LONG, FIELD_CUSTOM, false, false, (char *) "ProfileType"},
+    {TIFFTAG_FAXPROFILE, 1, 1, TIFF_BYTE, FIELD_CUSTOM, false, false, (char *) "FaxProfile"},
+    {TIFFTAG_CODINGMETHODS, 1, 1, TIFF_LONG, FIELD_CUSTOM, false, false, (char *) "CodingMethods"},
+    {TIFFTAG_VERSIONYEAR, 4, 4, TIFF_BYTE, FIELD_CUSTOM, false, false, (char *) "VersionYear"},
+    {TIFFTAG_MODENUMBER, 1, 1, TIFF_BYTE, FIELD_CUSTOM, false, false, (char *) "ModeNumber"},
+    {TIFFTAG_DECODE, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_SRATIONAL, FIELD_CUSTOM, false, true, (char *) "Decode"},
+    {TIFFTAG_IMAGEBASECOLOR, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_SHORT, FIELD_CUSTOM, false, true, (char *) "ImageBaseColor"},
+    {TIFFTAG_T82OPTIONS, 1, 1, TIFF_LONG, FIELD_CUSTOM, false, false, (char *) "T82Options"},
+    {TIFFTAG_STRIPROWCOUNTS, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_LONG, FIELD_CUSTOM, false, true, (char *) "StripRowCounts"},
+    {TIFFTAG_IMAGELAYER, 2, 2, TIFF_LONG, FIELD_CUSTOM, false, false, (char *) "ImageLayer"},
 };
 
 static TIFFFieldArray tifffxFieldArray;
@@ -509,7 +509,7 @@ int read_file(meta_t *meta, int page)
 #endif
             /* The default luminant is D50 */
             set_lab_illuminant(&lab_param, 96.422f, 100.000f,  82.521f);
-            set_lab_gamut(&lab, 0, 100, -85, 85, -75, 125, FALSE);
+            set_lab_gamut(&lab, 0, 100, -85, 85, -75, 125, false);
             lab_to_srgb(&lab, meta->colour_map, meta->colour_map, 256);
             for (i = 0;  i < entries;  i++)
                 printf("Map %3d - %5d %5d %5d\n", i, meta->colour_map[3*i], meta->colour_map[3*i + 1], meta->colour_map[3*i + 2]);
@@ -920,7 +920,7 @@ int main(int argc, char *argv[])
 
     /* The default luminant is D50 */
     set_lab_illuminant(&lab_param, 96.422f, 100.000f,  82.521f);
-    set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, FALSE);
+    set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, false);
 
     outptr = NULL;
     for (page_no = 0;   ;  page_no++)
@@ -965,7 +965,7 @@ int main(int argc, char *argv[])
                 printf("Bi-level\n");
 
                 /* We have finished acquiring the image. Now we need to push it out */
-                meta.pre_compressed = FALSE;
+                meta.pre_compressed = false;
                 meta.image_width = in_meta.image_width;
                 meta.image_length = in_meta.image_length;
                 meta.x_resolution = in_meta.x_resolution;
@@ -1023,7 +1023,7 @@ int main(int argc, char *argv[])
                 off = in_meta.samples_per_pixel*in_meta.image_width*in_meta.image_length;
 
                 /* We have finished acquiring the image. Now we need to push it out */
-                meta.pre_compressed = FALSE;
+                meta.pre_compressed = false;
                 meta.image_width = in_meta.image_width;
                 meta.image_length = in_meta.image_length;
                 meta.x_resolution = in_meta.x_resolution;
@@ -1052,7 +1052,7 @@ int main(int argc, char *argv[])
                 free(data);
                 data = (uint8_t *) outptr;
 
-                meta.pre_compressed = FALSE;
+                meta.pre_compressed = false;
                 meta.image_width = in_meta.image_width;
                 meta.image_length = in_meta.image_length;
                 meta.x_resolution = in_meta.x_resolution;
@@ -1074,7 +1074,7 @@ int main(int argc, char *argv[])
                     /* Convert this to sRGB first */
                     /* The default luminant is D50 */
                     set_lab_illuminant(&lab_param, 96.422f, 100.000f,  82.521f);
-                    set_lab_gamut(&lab_param, 0, 100, -128, 127, -128, 127, TRUE);
+                    set_lab_gamut(&lab_param, 0, 100, -128, 127, -128, 127, true);
                     lab_to_srgb(&lab_param, data, data, in_meta.image_width*in_meta.image_length);
                     break;
                 case PHOTOMETRIC_RGB:
@@ -1134,7 +1134,7 @@ int main(int argc, char *argv[])
 #if 0
                 /* The default luminant is D50 */
                 set_lab_illuminant(&lab_param, 96.422f, 100.000f,  82.521f);
-                set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, FALSE);
+                set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, false);
                 if (!t42_srgb_to_itulab_jpeg(&logging2, &lab_param, (tdata_t) &outptr, &outsize, data, off, in_meta.image_width, in_meta.image_length, 3))
                 {
                     printf("Failed to convert to ITULAB (B).\n");
@@ -1147,7 +1147,7 @@ int main(int argc, char *argv[])
                 off = outsize;
 #endif
 #endif
-                meta.pre_compressed = FALSE;
+                meta.pre_compressed = false;
                 meta.image_width = in_meta.image_width;
                 meta.image_length = in_meta.image_length;
                 meta.x_resolution = in_meta.x_resolution;
@@ -1190,7 +1190,7 @@ int main(int argc, char *argv[])
                     /* Convert this to sRGB first */
                     /* The default luminant is D50 */
                     set_lab_illuminant(&lab_param, 96.422f, 100.000f,  82.521f);
-                    set_lab_gamut(&lab_param, 0, 100, -128, 127, -128, 127, TRUE);
+                    set_lab_gamut(&lab_param, 0, 100, -128, 127, -128, 127, true);
                     lab_to_srgb(&lab_param, data, data, in_meta.image_width*in_meta.image_length);
                     break;
                 case PHOTOMETRIC_SEPARATED:
@@ -1219,7 +1219,7 @@ int main(int argc, char *argv[])
 
                 /* The default luminant is D50 */
                 set_lab_illuminant(&lab_param, 96.422f, 100.000f,  82.521f);
-                set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, FALSE);
+                set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, false);
                 //if (!t42_srgb_to_itulab_jpeg(&logging2, &lab_param, (tdata_t) &outptr, &outsize, data, off, in_meta.image_width, in_meta.image_length, 3))
                 {
                     printf("Failed to convert to ITULAB (D).\n");
@@ -1230,7 +1230,7 @@ int main(int argc, char *argv[])
                 off = outsize;
                 in_meta.bits_per_sample = 8;
             }
-            meta.pre_compressed = FALSE;
+            meta.pre_compressed = false;
             meta.image_width = in_meta.image_width;
             meta.image_length = in_meta.image_length;
             meta.x_resolution = in_meta.x_resolution;
@@ -1252,7 +1252,7 @@ int main(int argc, char *argv[])
 
     /* We now have the image in memory in ITULAB form */
 
-    meta.pre_compressed = FALSE;
+    meta.pre_compressed = false;
     meta.compressed_image_len = off;
     meta.image_width = in_meta.image_width;
     meta.image_length = in_meta.image_length;
@@ -1326,7 +1326,7 @@ int main(int argc, char *argv[])
             totdata = meta.image_length*bytes_per_row;
             /* The default luminant is D50 */
             set_lab_illuminant(&lab_param, 96.422f, 100.000f,  82.521f);
-            set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, FALSE);
+            set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, false);
 #if 0
             start = rdtscll();
             data2 = NULL;
index c735557fb7ea479b288af903d8d860a184e09a0b..0e583ab059dd5420b01630d09630f3fb6636545b 100644 (file)
@@ -327,7 +327,7 @@ int main(int argc, char *argv[])
         }
     }
 
-    end_of_page = FALSE;
+    end_of_page = false;
 #if 1
     printf("Testing image_function->compress->decompress->image_function\n");
     /* Send end gets image from a function */
@@ -372,7 +372,7 @@ int main(int argc, char *argv[])
         switch (block_size)
         {
         case 0:
-            end_of_page = FALSE;
+            end_of_page = false;
             for (;;)
             {
                 bit = t4_t6_encode_get_bit(send_state);
index f01b1d3db76511894408f74c43b17a2cce857c5c..0af75b1ab52b7b4ba4422af98d247a86f24e91e6 100644 (file)
@@ -211,10 +211,7 @@ int main(int argc, char *argv[])
     int res;
     int compression;
     int compression_step;
-    int add_page_headers;
-    int overlay_page_headers;
     int min_row_bits;
-    int restart_pages;
     int block_size;
     char buf[1024];
     uint8_t block[1024];
@@ -226,8 +223,11 @@ int main(int argc, char *argv[])
     int len;
     int i;
     int bit_error_rate;
-    int dump_as_xxx;
     int tests_failed;
+    bool restart_pages;
+    bool add_page_headers;
+    bool overlay_page_headers;
+    bool dump_as_xxx;
     unsigned int last_pkt_no;
     unsigned int pkt_no;
     int page_ended;
@@ -236,9 +236,9 @@ int main(int argc, char *argv[])
     tests_failed = 0;
     compression = -1;
     compression_step = 0;
-    add_page_headers = FALSE;
-    overlay_page_headers = FALSE;
-    restart_pages = FALSE;
+    add_page_headers = false;
+    overlay_page_headers = false;
+    restart_pages = false;
     in_file_name = IN_FILE_NAME;
     decode_file_name = NULL;
     page_header_tz = NULL;
@@ -247,7 +247,7 @@ int main(int argc, char *argv[])
     min_row_bits = 50;
     block_size = 1;
     bit_error_rate = 0;
-    dump_as_xxx = FALSE;
+    dump_as_xxx = false;
     while ((opt = getopt(argc, argv, "b:c:d:ehHri:m:t:x")) != -1)
     {
         switch (opt)
@@ -322,15 +322,15 @@ int main(int argc, char *argv[])
             bit_error_rate = 0x3FF;
             break;
         case 'h':
-            add_page_headers = TRUE;
-            overlay_page_headers = FALSE;
+            add_page_headers = true;
+            overlay_page_headers = false;
             break;
         case 'H':
-            add_page_headers = TRUE;
-            overlay_page_headers = TRUE;
+            add_page_headers = true;
+            overlay_page_headers = true;
             break;
         case 'r':
-            restart_pages = TRUE;
+            restart_pages = true;
             break;
         case 'i':
             in_file_name = optarg;
@@ -342,7 +342,7 @@ int main(int argc, char *argv[])
             page_header_tz = optarg;
             break;
         case 'x':
-            dump_as_xxx = TRUE;
+            dump_as_xxx = true;
             break;
         default:
             //usage();
@@ -557,7 +557,7 @@ int main(int argc, char *argv[])
             }
             t4_rx_start_page(receive_state);
             detect_non_ecm_page_end(-1, compression);
-            page_ended = FALSE;
+            page_ended = false;
             switch (block_size)
             {
             case 0:
index 748a8259dbbe686076bb422c920af132447d6c85..8de5749928a2f02e8c3b181371d9d5a846afa050 100644 (file)
@@ -52,9 +52,6 @@ the present time.
 
 #define MSG_SIZE 10000
 
-#define FALSE 0
-#define TRUE (!FALSE)
-
 uint8_t msg[MSG_SIZE];
 
 int32_t msg_len;
@@ -134,7 +131,7 @@ int main(int argc, char *argv[])
 
     printf("Arithmetic decoder tests from ITU-T T.82/7.1\n");
     printf("Decoding byte by byte...\n");
-    test_failed = FALSE;
+    test_failed = false;
     if ((sd = t81_t82_arith_decode_init(NULL)) == NULL)
     {
         fprintf(stderr, "Failed to allocate arithmetic decoder!\n");
@@ -162,7 +159,7 @@ int main(int argc, char *argv[])
                 printf("Bad pixel %d, byte %" PRIdPTR ".\n\n",
                        i*16 + j + 1,
                        sd->pscd_ptr - sd->pscd_end);
-                test_failed = TRUE;
+                test_failed = true;
                 break;
             }
             if (pix != ((pix_7_1[i] >> (15 - j)) & 1))
@@ -170,7 +167,7 @@ int main(int argc, char *argv[])
                 printf("Bad PIX (%d) at pixel %d.\n\n",
                        pix,
                        i*16 + j + 1);
-                test_failed = TRUE;
+                test_failed = true;
                 break;
             }
         }
@@ -179,7 +176,7 @@ int main(int argc, char *argv[])
     {
         printf("%" PRIdPTR " bytes left after decoder finished.\n\n",
                sd->pscd_end - sd->pscd_ptr - 2);
-        test_failed = TRUE;
+        test_failed = true;
     }
     if (test_failed)
     {
@@ -189,7 +186,7 @@ int main(int argc, char *argv[])
     printf("Test passed\n");
 
     printf("Decoding chunk by chunk...\n");
-    test_failed = FALSE;
+    test_failed = false;
     t81_t82_arith_decode_init(sd);
     sd->pscd_ptr = sde_7_1;
     sd->pscd_end = sde_7_1 + SDE_7_1_FULL_LEN;
@@ -203,7 +200,7 @@ int main(int argc, char *argv[])
                 printf("Bad pixel %d, byte %" PRIdPTR ".\n\n",
                        i*16 + j + 1,
                        sd->pscd_ptr - sd->pscd_end);
-                test_failed = TRUE;
+                test_failed = true;
                 break;
             }
             if (pix != ((pix_7_1[i] >> (15 - j)) & 1))
@@ -211,7 +208,7 @@ int main(int argc, char *argv[])
                 printf("Bad PIX (%d) at pixel %d.\n\n",
                        pix,
                        i*16 + j + 1);
-                test_failed = TRUE;
+                test_failed = true;
                 break;
             }
         }
@@ -220,7 +217,7 @@ int main(int argc, char *argv[])
     {
         printf("%" PRIdPTR " bytes left after decoder finished.\n\n",
                sd->pscd_end - sd->pscd_ptr - 2);
-        test_failed = TRUE;
+        test_failed = true;
     }
     if (test_failed)
     {
index b7047d2ad6b93171981ca5a9e9536817574d54eb..8acca038c5517dca25fa4163fbcef4149eb93420 100644 (file)
@@ -57,9 +57,6 @@ in ITU specifications T.85.
 #define TESTBUF_SIZE        400000
 #define TEST_IMAGE_SIZE     (1951*1960/8)
 
-#define FALSE 0
-#define TRUE (!FALSE)
-
 uint8_t testbuf[TESTBUF_SIZE];
 uint8_t test_image[TEST_IMAGE_SIZE];
 
index 8e6ae191175b317c129fec7d81cd9f4646fed348..3400b5f9b25dce0d532e41b04eb1210fefdce596 100644 (file)
@@ -69,11 +69,11 @@ int main(int argc, char *argv[])
     float rate;
     float sample_rate;
     const char *in_file_name;
-    int sweep_rate;
+    bool sweep_rate;
     int opt;
 
     rate = 1.8f;
-    sweep_rate = FALSE;
+    sweep_rate = false;
     in_file_name = IN_FILE_NAME;
     while ((opt = getopt(argc, argv, "i:r:s")) != -1)
     {
@@ -86,7 +86,7 @@ int main(int argc, char *argv[])
             rate = atof(optarg);
             break;
         case 's':
-            sweep_rate = TRUE;
+            sweep_rate = true;
             break;
         default:
             //usage();
index 9ec4af76d705a39d4f027c123f4f7ec9d8050626..ab4efe6890ceeee0e95ee6faf06f02eba6fb5ecd 100644 (file)
 
 #include "spandsp.h"
 
-#ifndef FALSE
-#define FALSE    0
-#endif
-
-#ifndef TRUE
-#define TRUE    (!FALSE)
-#endif
-
 int main(int argc, char *argv[])
 {
     struct tm tms;
index 54b7c4e8284b1209a2176aed15c471e4593fb10d..6f1f8af4ea62cfecd556322ac4efa2a6b7d10bc3 100644 (file)
@@ -68,7 +68,7 @@ int main(int argc, char *argv[])
                              200,
                              300,
                              400,
-                             FALSE);
+                             false);
     tone_gen_init(&tone_state, &tone_desc);
 
     for (i = 0;  i < 1000;  i++)
@@ -90,7 +90,7 @@ int main(int argc, char *argv[])
                              300,
                              200,
                              100,
-                             TRUE);
+                             true);
     tone_gen_init(&tone_state, &tone_desc);
 
     for (i = 0;  i < 1000;  i++)
@@ -112,7 +112,7 @@ int main(int argc, char *argv[])
                              200,
                              300,
                              400,
-                             TRUE);
+                             true);
     tone_gen_init(&tone_state, &tone_desc);
 
     for (i = 0;  i < 1000;  i++)
@@ -134,7 +134,7 @@ int main(int argc, char *argv[])
                              200,
                              300,
                              400,
-                             TRUE);
+                             true);
     tone_gen_init(&tone_state, &tone_desc);
 
     for (i = 0;  i < 1000;  i++)
@@ -156,7 +156,7 @@ int main(int argc, char *argv[])
                              0,
                              0,
                              0,
-                             FALSE);
+                             false);
     tone_gen_init(&tone_state, &tone_desc);
 
     for (i = 0;  i < 1000;  i++)
@@ -178,7 +178,7 @@ int main(int argc, char *argv[])
                              0,
                              0,
                              0,
-                             FALSE);
+                             false);
     tone_gen_init(&tone_state, &tone_desc);
 
     for (i = 0;  i < 1000;  i++)
@@ -200,7 +200,7 @@ int main(int argc, char *argv[])
                              200,
                              300,
                              400,
-                             TRUE);
+                             true);
     tone_gen_init(&tone_state, &tone_desc);
 
     for (i = 0;  i < 1000;  i++)
@@ -222,7 +222,7 @@ int main(int argc, char *argv[])
                              200,
                              300,
                              400,
-                             TRUE);
+                             true);
     tone_gen_init(&tone_state, &tone_desc);
 
     for (i = 0;  i < 1000;  i++)
index e8064b3d45cd0fae0136b009ad344f0bcec7cd7b..c8012162ef5e2d45ac9fc38182643e41d349da17 100644 (file)
 
 SNDFILE *out_handle;
 
-int use_receiver_not_ready = FALSE;
-int test_local_interrupt = FALSE;
+bool use_receiver_not_ready = false;
+bool test_local_interrupt = false;
 
 const char *output_tiff_file_name;
 
-int log_audio = FALSE;
+bool log_audio = false;
 
 fax_state_t *fax;
 faxtester_state_t state;
@@ -230,7 +230,7 @@ static int phase_d_handler(t30_state_t *s, void *user_data, int result)
         if (i == 'A')
         {
             printf("%c: Initiating interrupt request\n", i);
-            t30_local_interrupt_request(s, TRUE);
+            t30_local_interrupt_request(s, true);
         }
         else
         {
@@ -241,7 +241,7 @@ static int phase_d_handler(t30_state_t *s, void *user_data, int result)
             case T30_PRI_EOM:
             case T30_PRI_EOP:
                 printf("%c: Accepting interrupt request\n", i);
-                t30_local_interrupt_request(s, TRUE);
+                t30_local_interrupt_request(s, true);
                 break;
             case T30_PIN:
                 break;
@@ -268,7 +268,7 @@ static void phase_e_handler(t30_state_t *s, void *user_data, int result)
 
 static void t30_real_time_frame_handler(t30_state_t *s,
                                         void *user_data,
-                                        int direction,
+                                        bool incoming,
                                         const uint8_t *msg,
                                         int len)
 {
@@ -279,7 +279,7 @@ static void t30_real_time_frame_handler(t30_state_t *s,
     {
         fprintf(stderr,
                 "T.30: Real time frame handler - %s, %s, length = %d\n",
-                (direction)  ?  "line->T.30"  : "T.30->line",
+                (incoming)  ?  "line->T.30"  : "T.30->line",
                 t30_frametype(msg[2]),
                 len);
     }
@@ -296,9 +296,9 @@ static int document_handler(t30_state_t *s, void *user_data, int event)
     {
         t30_set_tx_file(s, next_tx_file, -1, -1);
         next_tx_file[0] = '\0';
-        return TRUE;
+        return true;
     }
-    return FALSE;
+    return false;
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -367,8 +367,8 @@ static void fax_prepare(void)
     logging_state_t *logging;
 
     t30 = fax_get_t30_state(fax);
-    fax_set_transmit_on_idle(fax, TRUE);
-    fax_set_tep_mode(fax, TRUE);
+    fax_set_transmit_on_idle(fax, true);
+    fax_set_tep_mode(fax, true);
 #if 0
     t30_set_tx_ident(t30, "1234567890");
     t30_set_tx_sub_address(t30, "Sub-address");
@@ -380,7 +380,7 @@ static void fax_prepare(void)
     t30_set_tx_nsf(t30, (const uint8_t *) "\x50\x00\x00\x00Spandsp NSF\x00", 16);
     //t30_set_tx_nss(t30, (const uint8_t *) "\x50\x00\x00\x00Spandsp NSS\x00", 16);
     t30_set_tx_nsc(t30, (const uint8_t *) "\x50\x00\x00\x00Spandsp NSC\x00", 16);
-    t30_set_ecm_capability(t30, TRUE);
+    t30_set_ecm_capability(t30, true);
     t30_set_supported_t30_features(t30,
                                    T30_SUPPORT_IDENTIFICATION
                                  | T30_SUPPORT_SELECTIVE_POLLING
@@ -640,9 +640,9 @@ static int next_step(faxtester_state_t *s)
             /* Add a bit of waiting at the end, to ensure everything gets flushed through,
                any timers can expire, etc. */
             faxtester_set_timeout(s, -1);
-            faxtester_set_rx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE);
-            faxtester_set_tx_type(s, T30_MODEM_PAUSE, 0, 120000, FALSE);
-            s->final_delayed = TRUE;
+            faxtester_set_rx_type(s, T30_MODEM_NONE, 0, false, false);
+            faxtester_set_tx_type(s, T30_MODEM_PAUSE, 0, 120000, false);
+            s->final_delayed = true;
             return 1;
         }
         /* Finished */
@@ -700,10 +700,10 @@ static int next_step(faxtester_state_t *s)
         {
             hdlc = (strcasecmp((const char *) type, "PREAMBLE") == 0);
             short_train = (strcasecmp((const char *) type, "TCF") != 0);
-            faxtester_set_tx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE);
+            faxtester_set_tx_type(s, T30_MODEM_NONE, 0, false, false);
             if (strcasecmp((const char *) modem, "V.21") == 0)
             {
-                faxtester_set_rx_type(s, T30_MODEM_V21, 300, FALSE, TRUE);
+                faxtester_set_rx_type(s, T30_MODEM_V21, 300, false, true);
             }
             else if (strcasecmp((const char *) modem, "V.17/14400") == 0)
             {
@@ -723,19 +723,19 @@ static int next_step(faxtester_state_t *s)
             }
             else if (strcasecmp((const char *) modem, "V.29/9600") == 0)
             {
-                faxtester_set_rx_type(s, T30_MODEM_V29, 9600, FALSE, hdlc);
+                faxtester_set_rx_type(s, T30_MODEM_V29, 9600, false, hdlc);
             }
             else if (strcasecmp((const char *) modem, "V.29/7200") == 0)
             {
-                faxtester_set_rx_type(s, T30_MODEM_V29, 7200, FALSE, hdlc);
+                faxtester_set_rx_type(s, T30_MODEM_V29, 7200, false, hdlc);
             }
             else if (strcasecmp((const char *) modem, "V.27ter/4800") == 0)
             {
-                faxtester_set_rx_type(s, T30_MODEM_V27TER, 4800, FALSE, hdlc);
+                faxtester_set_rx_type(s, T30_MODEM_V27TER, 4800, false, hdlc);
             }
             else if (strcasecmp((const char *) modem, "V.27ter/2400") == 0)
             {
-                faxtester_set_rx_type(s, T30_MODEM_V27TER, 2400, FALSE, hdlc);
+                faxtester_set_rx_type(s, T30_MODEM_V27TER, 2400, false, hdlc);
             }
             else
             {
@@ -762,14 +762,14 @@ static int next_step(faxtester_state_t *s)
         else if (strcasecmp((const char *) type, "CNG") == 0)
         {
             /* Look for CNG */
-            faxtester_set_rx_type(s, T30_MODEM_CNG, 0, FALSE, FALSE);
-            faxtester_set_tx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE);
+            faxtester_set_rx_type(s, T30_MODEM_CNG, 0, false, false);
+            faxtester_set_tx_type(s, T30_MODEM_NONE, 0, false, false);
         }
         else if (strcasecmp((const char *) type, "CED") == 0)
         {
             /* Look for CED */
-            faxtester_set_rx_type(s, T30_MODEM_CED, 0, FALSE, FALSE);
-            faxtester_set_tx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE);
+            faxtester_set_rx_type(s, T30_MODEM_CED, 0, false, false);
+            faxtester_set_tx_type(s, T30_MODEM_NONE, 0, false, false);
         }
         else if (strcasecmp((const char *) type, "HDLC") == 0)
         {
@@ -803,10 +803,10 @@ static int next_step(faxtester_state_t *s)
         {
             hdlc = (strcasecmp((const char *) type, "PREAMBLE") == 0);
             short_train = (strcasecmp((const char *) type, "TCF") != 0);
-            faxtester_set_rx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE);
+            faxtester_set_rx_type(s, T30_MODEM_NONE, 0, false, false);
             if (strcasecmp((const char *) modem, "V.21") == 0)
             {
-                faxtester_set_tx_type(s, T30_MODEM_V21, 300, FALSE, TRUE);
+                faxtester_set_tx_type(s, T30_MODEM_V21, 300, false, true);
             }
             else if (strcasecmp((const char *) modem, "V.17/14400") == 0)
             {
@@ -826,19 +826,19 @@ static int next_step(faxtester_state_t *s)
             }
             else if (strcasecmp((const char *) modem, "V.29/9600") == 0)
             {
-                faxtester_set_tx_type(s, T30_MODEM_V29, 9600, FALSE, hdlc);
+                faxtester_set_tx_type(s, T30_MODEM_V29, 9600, false, hdlc);
             }
             else if (strcasecmp((const char *) modem, "V.29/7200") == 0)
             {
-                faxtester_set_tx_type(s, T30_MODEM_V29, 7200, FALSE, hdlc);
+                faxtester_set_tx_type(s, T30_MODEM_V29, 7200, false, hdlc);
             }
             else if (strcasecmp((const char *) modem, "V.27ter/4800") == 0)
             {
-                faxtester_set_tx_type(s, T30_MODEM_V27TER, 4800, FALSE, hdlc);
+                faxtester_set_tx_type(s, T30_MODEM_V27TER, 4800, false, hdlc);
             }
             else if (strcasecmp((const char *) modem, "V.27ter/2400") == 0)
             {
-                faxtester_set_tx_type(s, T30_MODEM_V27TER, 2400, FALSE, hdlc);
+                faxtester_set_tx_type(s, T30_MODEM_V27TER, 2400, false, hdlc);
             }
             else
             {
@@ -877,7 +877,7 @@ static int next_step(faxtester_state_t *s)
         }
         else if (strcasecmp((const char *) type, "CALL") == 0)
         {
-            fax = fax_init(NULL, FALSE);
+            fax = fax_init(NULL, false);
             fax_prepare();
             next_tx_file[0] = '\0';
             t30 = fax_get_t30_state(fax);
@@ -893,7 +893,7 @@ static int next_step(faxtester_state_t *s)
         }
         else if (strcasecmp((const char *) type, "ANSWER") == 0)
         {
-            fax = fax_init(NULL, TRUE);
+            fax = fax_init(NULL, true);
             fax_prepare();
             next_tx_file[0] = '\0';
             t30 = fax_get_t30_state(fax);
@@ -908,19 +908,19 @@ static int next_step(faxtester_state_t *s)
         }
         else if (strcasecmp((const char *) type, "CNG") == 0)
         {
-            faxtester_set_rx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE);
-            faxtester_set_tx_type(s, T30_MODEM_CNG, 0, FALSE, FALSE);
+            faxtester_set_rx_type(s, T30_MODEM_NONE, 0, false, false);
+            faxtester_set_tx_type(s, T30_MODEM_CNG, 0, false, false);
         }
         else if (strcasecmp((const char *) type, "CED") == 0)
         {
-            faxtester_set_rx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE);
-            faxtester_set_tx_type(s, T30_MODEM_CED, 0, FALSE, FALSE);
+            faxtester_set_rx_type(s, T30_MODEM_NONE, 0, false, false);
+            faxtester_set_tx_type(s, T30_MODEM_CED, 0, false, false);
         }
         else if (strcasecmp((const char *) type, "WAIT") == 0)
         {
             delay = (value)  ?  atoi((const char *) value)  :  1;
-            faxtester_set_rx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE);
-            faxtester_set_tx_type(s, T30_MODEM_PAUSE, 0, delay, FALSE);
+            faxtester_set_rx_type(s, T30_MODEM_NONE, 0, false, false);
+            faxtester_set_tx_type(s, T30_MODEM_PAUSE, 0, delay, false);
         }
         else if (strcasecmp((const char *) type, "PREAMBLE") == 0)
         {
@@ -937,9 +937,9 @@ static int next_step(faxtester_state_t *s)
             i = string_to_msg(buf, mask, (const char *) value);
             bit_reverse(buf, buf, abs(i));
             if (crc_error  &&  strcasecmp((const char *) crc_error, "0") == 0)
-                faxtester_send_hdlc_msg(s, buf, abs(i), FALSE);
+                faxtester_send_hdlc_msg(s, buf, abs(i), false);
             else
-                faxtester_send_hdlc_msg(s, buf, abs(i), TRUE);
+                faxtester_send_hdlc_msg(s, buf, abs(i), true);
         }
         else if (strcasecmp((const char *) type, "TCF") == 0)
         {
@@ -1138,12 +1138,12 @@ static void exchange(faxtester_state_t *s)
 
     total_audio_time = 0;
 
-    faxtester_set_transmit_on_idle(&state, TRUE);
+    faxtester_set_transmit_on_idle(&state, true);
     faxtester_set_real_time_frame_handler(&state, faxtester_real_time_frame_handler, NULL);
     faxtester_set_front_end_step_complete_handler(&state, faxtester_front_end_step_complete_handler, NULL);
     faxtester_set_front_end_step_timeout_handler(&state, faxtester_front_end_step_timeout_handler, NULL);
 
-    fax = fax_init(NULL, FALSE);
+    fax = fax_init(NULL, false);
     fax_prepare();
     next_tx_file[0] = '\0';
 
@@ -1355,13 +1355,13 @@ int main(int argc, char *argv[])
 
     xml_file_name = "../spandsp/tsb85.xml";
     test_name = "MRGN01";
-    log_audio = FALSE;
+    log_audio = false;
     while ((opt = getopt(argc, argv, "lx:")) != -1)
     {
         switch (opt)
         {
         case 'l':
-            log_audio = TRUE;
+            log_audio = true;
             break;
         case 'x':
             xml_file_name = optarg;
@@ -1378,7 +1378,7 @@ int main(int argc, char *argv[])
         test_name = argv[0];
 
     strcpy(image_path, ".");
-    faxtester_init(&state, TRUE);
+    faxtester_init(&state, true);
     memset(&expected_rx_info, 0, sizeof(expected_rx_info));
     span_log_set_level(&state.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW);
     span_log_set_tag(&state.logging, "B");
index c153a6c8031d5e489ea8c74a09186d506d6cfdca..1ddb8e346d141c13fca33dee9e3a9809799496a7 100644 (file)
 #include <sys/types.h>
 #include <inttypes.h>
 #include <memory.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include <spandsp/stdbool.h>
+#endif
 
 #include "udptl.h"
 
-#if !defined(FALSE)
-#define FALSE 0
-#endif
-#if !defined(TRUE)
-#define TRUE (!FALSE)
-#endif
-
 static int decode_length(const uint8_t *buf, int limit, int *len, int *pvalue)
 {
     if (*len >= limit)
@@ -296,7 +294,7 @@ int udptl_rx_packet(udptl_state_t *s, const uint8_t buf[], int len)
         s->rx[x].fec_span = span;
 
         memset(repaired, 0, sizeof(repaired));
-        repaired[x] = TRUE;
+        repaired[x] = true;
 
         /* The number of entries is defined as a length, but will only ever be a small
            value. Treat it as such. */
@@ -355,7 +353,7 @@ int udptl_rx_packet(udptl_state_t *s, const uint8_t buf[], int len)
                         }
                     }
                     s->rx[which].buf_len = s->rx[l].fec_len[m];
-                    repaired[which] = TRUE;
+                    repaired[which] = true;
                 }
             }
         }
index ca6bd54ca524c93120fda5b23b214d02e5eecc43..8ceb12060ecc8ea5d94855edb4fa4fa3a8d2f057 100644 (file)
@@ -79,7 +79,7 @@ display of modem status is maintained.
 #define OUT_FILE_NAME   "v17.wav"
 
 char *decode_test_file = NULL;
-int use_gui = FALSE;
+bool use_gui = false;
 
 int symbol_no = 0;
 
@@ -319,29 +319,29 @@ int main(int argc, char *argv[])
     SNDFILE *outhandle;
     int outframes;
     int samples;
-    int tep;
     int block_no;
     int noise_level;
     int signal_level;
     int bits_per_test;
     int line_model_no;
-    int log_audio;
     int channel_codec;
     int rbs_pattern;
     int opt;
+    bool tep;
+    bool log_audio;
     logging_state_t *logging;
 
     channel_codec = MUNGE_CODEC_NONE;
     rbs_pattern = 0;
     test_bps = 14400;
-    tep = FALSE;
+    tep = false;
     line_model_no = 0;
     decode_test_file = NULL;
-    use_gui = FALSE;
+    use_gui = false;
     noise_level = -70;
     signal_level = -13;
     bits_per_test = 50000;
-    log_audio = FALSE;
+    log_audio = false;
     while ((opt = getopt(argc, argv, "b:B:c:d:glm:n:r:s:t")) != -1)
     {
         switch (opt)
@@ -374,14 +374,14 @@ int main(int argc, char *argv[])
             break;
         case 'g':
 #if defined(ENABLE_GUI)
-            use_gui = TRUE;
+            use_gui = true;
 #else
             fprintf(stderr, "Graphical monitoring not available\n");
             exit(2);
 #endif
             break;
         case 'l':
-            log_audio = TRUE;
+            log_audio = true;
             break;
         case 'm':
             line_model_no = atoi(optarg);
@@ -396,7 +396,7 @@ int main(int argc, char *argv[])
             signal_level = atoi(optarg);
             break;
         case 't':
-            tep = TRUE;
+            tep = true;
             break;
         default:
             //usage();
@@ -529,9 +529,9 @@ int main(int argc, char *argv[])
                 /* Bump the receiver AGC gain by 1dB, to compensate for the above */
                 rx->agc_scaling_save *= 1.122f;
 #endif
-                v17_tx_restart(tx, test_bps, tep, TRUE);
+                v17_tx_restart(tx, test_bps, tep, true);
                 v17_tx_power(tx, signal_level);
-                v17_rx_restart(rx, test_bps, TRUE);
+                v17_rx_restart(rx, test_bps, true);
                 //rx.eq_put_step = rand()%(192*10/3);
                 bert_init(&bert, bits_per_test, BERT_PATTERN_ITU_O152_11, test_bps, 20);
                 bert_set_report(&bert, 10000, reporter, NULL);
index 64a47a15935bf4544df7f3f6e81c7fb9ffd30378..948ffef50187ba2e6b4bba09cebeb24bc7442b1f 100644 (file)
 #include "spandsp.h"
 #include "spandsp-sim.h"
 
-#define FALSE 0
-#define TRUE (!FALSE)
-
 #define OUTPUT_FILE_NAME    "v18.wav"
 
 #define SAMPLES_PER_CHUNK   160
 
-int log_audio = FALSE;
+int log_audio = false;
 SNDFILE *outhandle = NULL;
 char result[2][1024];
-int unexpected_echo = FALSE;
+int unexpected_echo = false;
 
 char *decode_test_file = NULL;
 
@@ -81,7 +78,7 @@ static void put_text_msg(void *user_data, const uint8_t *msg, int len)
     }
     else
     {
-        good_message_received = TRUE;
+        good_message_received = true;
     }
 }
 /*- End of function --------------------------------------------------------*/
@@ -99,11 +96,11 @@ static void basic_tests(int mode)
     int j;
 
     printf("Testing %s\n", v18_mode_to_str(mode));
-    v18[0] = v18_init(NULL, TRUE, mode, V18_AUTOMODING_GLOBAL, put_text_msg, NULL);
+    v18[0] = v18_init(NULL, true, mode, V18_AUTOMODING_GLOBAL, put_text_msg, NULL);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, mode, V18_AUTOMODING_GLOBAL, put_text_msg, NULL);
+    v18[1] = v18_init(NULL, false, mode, V18_AUTOMODING_GLOBAL, put_text_msg, NULL);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -124,7 +121,7 @@ static void basic_tests(int mode)
     }
 
     /* Fake an OK condition for the first message test */
-    good_message_received = TRUE;
+    good_message_received = true;
     push = 0;
     if (v18_put(v18[0], qbf_tx, -1) != strlen(qbf_tx))
     {
@@ -152,7 +149,7 @@ static void basic_tests(int mode)
                     printf("No message received\n");
                     exit(2);
                 }
-                good_message_received = FALSE;
+                good_message_received = false;
                 if (v18_put(v18[0], qbf_tx, -1) != strlen(qbf_tx))
                 {
                     printf("V.18 put failed\n");
@@ -232,11 +229,11 @@ static int test_misc_01(void)
                         TUT should continue to probe until the test is terminated.
         Comments:       This feature should also be verified by observation during the automoding tests.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_01_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_01_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_01_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_01_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -337,11 +334,11 @@ static int test_misc_02(void)
         Comments:       The TUT should indicate that carrier has been lost at some time after the 1650Hz
                         signal is lost.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_02_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_02_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_02_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_02_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -442,11 +439,11 @@ static int test_misc_03(void)
         Comments:       The TUT should indicate that carrier has been lost at some time after the carrier
                         signal is removed and not disconnect.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_03_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_03_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_03_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_03_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -546,11 +543,11 @@ static int test_misc_04(void)
                         automatically hang up when busy tone is detected. PABX busy tones may differ in
                         frequency and cadence from national parameters.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_04_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_04_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_04_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_04_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -647,11 +644,11 @@ static int test_misc_05(void)
         Pass criteria:  The RINGING condition should be visually indicated by the TUT.
         Comments:       This test should be repeated across a range of valid timings and ring voltages.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_05_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_05_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_05_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_05_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -751,11 +748,11 @@ static int test_misc_06(void)
                         mode. There may be other cases, e.g. where the V.18 DCE is used in a gateway,
                         when automatic disconnection is required.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_06_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_06_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_06_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_06_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -853,11 +850,11 @@ static int test_misc_07(void)
                         However, this may possibly not be indicated by the DTE.
         Comments:       The possible modes are: V.21, V.23, Baudot 45, Baudot 50, EDT, Bell 103, DTMF.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_07_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_07_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_07_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_07_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -956,11 +953,11 @@ static int test_misc_08(void)
         Comment:        The response times and signal level thresholds of Circuit 135 are not specified in
                         ITU-T V.18 or V.24 and therefore the pattern indicated may vary.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_08_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_08_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_08_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_08_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -1056,11 +1053,11 @@ static int test_misc_09(void)
         Pass criteria:  TBD
         Comment:        TBD
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_09_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_09_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_09_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_09_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -1165,11 +1162,11 @@ static int test_org_01(void)
                         8) The whole sequence should be repeated until the call is cleared.
                         9) When V.18 to V.18, the XCI must not force V.23 or Minitel mode.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_01_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_01_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_01_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_01_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -1268,11 +1265,11 @@ static int test_org_02(void)
                         2) The TUT should reply with transmission of TXP as defined in 5.1.2.
                         3) Verify that TXP sequence has correct bit pattern.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_02_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_02_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_02_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_02_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -1369,11 +1366,11 @@ static int test_org_03(void)
         Pass criteria:  The TUT should stop sending TXP at the end of the current sequence when ANS
                         tone ceases.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_03_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_03_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_03_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_03_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -1474,11 +1471,11 @@ static int test_org_04(void)
                            with the V.18 operational requirements.
         Comments:       The TUT should indicate that V.18 mode has been selected.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_04_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_04_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_04_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_04_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -1580,11 +1577,11 @@ static int test_org_05(void)
                         examination of TUT. If there is no visual indication, verify by use of ITU-T T.50 for
                         ITU-T V.21 as opposed to UTF-8 coded ISO 10646 character set for ITU-T V.18.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_05_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_05_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_05_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_05_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -1685,11 +1682,11 @@ static int test_org_06(void)
                            by the TUT to comply with Annex E.
         Comments:       The TUT should indicate that V.23 mode has been selected.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_06_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_06_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_06_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_06_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -1790,11 +1787,11 @@ static int test_org_07(void)
                         literally. It may however, occur when connected to certain Swedish textphones if the
                         handset is lifted just after the start of an automatically answered incoming call.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_07_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_07_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_07_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_07_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -1891,11 +1888,11 @@ static int test_org_08(void)
                         2) Data should be transmitted and received at 300 bit/s to comply with Annex D.
         Comments:       The TUT should indicate that Bell 103 mode has been selected.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_08_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_08_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_08_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_08_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -1992,11 +1989,11 @@ static int test_org_09(void)
                         2) Data should be transmitted and received at 300 bit/s to comply with Annex F.
         Comments:       The TUT should indicate that V.21 mode has been selected.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_09_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_09_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_09_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_09_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -2094,11 +2091,11 @@ static int test_org_10(void)
                            by the TUT to comply with Annex E.
         Comments:       The TUT should indicate that V.23 mode has been selected.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_10_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_10_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_10_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_10_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -2199,11 +2196,11 @@ static int test_org_11(void)
         Comments:       The TUT should indicate that V.23 mode has been selected at least 3s after
                         the start of the 390Hz tone.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_11_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_11_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_11_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_11_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -2309,11 +2306,11 @@ static int test_org_12(void)
                         automode answer state. The TUT may then select either 45.45 or 50 bit/s for the
                         transmission.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_12_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_12_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_12_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_12_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -2413,11 +2410,11 @@ static int test_org_13(void)
                         TUT should comply with ITU-T Q.24 for the Danish Administration while
                         receiving for best possible performance.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_13_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_13_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_13_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_13_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -2519,11 +2516,11 @@ static int test_org_14(void)
                         the number lost should be minimal. The data bits and parity are specified in
                         Annex C.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_14_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_14_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_14_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_14_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -2620,11 +2617,11 @@ static int test_org_15(void)
                         the CI signal.
         Comments:       Echoes of the CI sequences may be detected at 300 bit/s.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_15_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_15_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_15_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_15_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -2721,11 +2718,11 @@ static int test_org_16(void)
                         2) Data should be transmitted and received at 300 bit/s complying with Annex F.
         Comments:       The TUT should indicate that V.21 mode has been selected.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_16_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_16_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_16_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_16_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -2820,11 +2817,11 @@ static int test_org_17(void)
         Pass criteria:  TUT should not respond to the 980Hz tone and resume sending CI signals after a
                         maximum of 2.4s from the end of the 980Hz tone.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_17_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_17_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_17_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_17_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -2921,11 +2918,11 @@ static int test_org_18(void)
         Comments:       This implies timer Tr has expired 2s after the start of the 980Hz tone and
                         then 1650Hz has been detected for 0.5s.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_18_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_18_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_18_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_18_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -3021,11 +3018,11 @@ static int test_org_19(void)
                         2) Data should be transmitted and received at 300 bit/s complying with Annex D.
         Comments:       The TUT should indicate that Bell 103 mode has been selected.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_19_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_19_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_19_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_19_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -3128,11 +3125,11 @@ static int test_org_20(void)
                         presence and cadence of the tones for instance by a flashing light. The TUT may
                         disconnect on reception of tones indicating a failed call attempt.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_20_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_20_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_20_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_20_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -3231,11 +3228,11 @@ static int test_org_21(void)
         Comments:       Some high speed modems may fall back to a compatibility mode, e.g. V.21 or V.23
                         that should be correctly detected by the TUT.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_21_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_21_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_21_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_21_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -3333,11 +3330,11 @@ static int test_org_22(void)
         Comments:       Ideally the TUT should detect the presence of a fax machine and report it back to
                         the user.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_22_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_22_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_22_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_22_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -3435,11 +3432,11 @@ static int test_org_23(void)
         Comments:       Ideally the TUT should report the presence of speech back to the user, e.g. via
                         circuit 135.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_23_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_23_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_23_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_23_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -3539,11 +3536,11 @@ static int test_org_24(void)
                         2) The TUT should reply with transmission of CM as defined in 5.2.13.
                         3) Verify that CM sequence has correct bit pattern.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_24_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_24_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_24_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_24_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -3638,11 +3635,11 @@ static int test_org_25(void)
         Method:         The Test System waits for the TUT to start transmitting V.21 carrier (1).
         Pass criteria:  The TUT should connect by sending V.21 carrier (1).
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_25_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_25_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_25_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_25_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -3738,11 +3735,11 @@ static int test_ans_01(void)
                         answers the call. It will then monitor for any signal.
         Pass criteria:  The TUT should start probing 3s after answering the call.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_01_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_01_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_01_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_01_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -3840,11 +3837,11 @@ static int test_ans_02(void)
         Comments:       The ANSam tone is a modulated 2100Hz tone. It may have phase reversals. The
                         XCI signal is tested in a separate test.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_02_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_02_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_02_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_02_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -3946,11 +3943,11 @@ static int test_ans_03(void)
                            V.18 mode connection is completed.
         Comments:       The TUT should indicate V.18 mode.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_03_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_03_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_03_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_03_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -4046,11 +4043,11 @@ static int test_ans_04(void)
         Pass criteria:  The TUT should start probing 3s after ANSam disappears.
         Comments:       It is assumed that timer Ta is restarted on return to Monitor A.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_04_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_04_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_04_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_04_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -4147,11 +4144,11 @@ static int test_ans_05(void)
         Pass criteria:  TUT should respond with 1650Hz within 400+-100ms of start of 980Hz.
         Comments:       The TUT should indicate that V.21 mode has been selected.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_05_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_05_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_05_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_05_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -4248,11 +4245,11 @@ static int test_ans_06(void)
         Pass criteria:  TUT should respond with 390Hz after 1.7(+0.2-0.0)s of start of 1300Hz.
         Comments:       The TUT should indicate that V.23 mode has been selected.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_06_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_06_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_06_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_06_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -4349,11 +4346,11 @@ static int test_ans_07(void)
         Pass criteria:  TUT should respond with 980Hz within 400+-100ms of start of 1650Hz.
         Comments:       The TUT should indicate that V.21 mode has been selected.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_07_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_07_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_07_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_07_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -4452,11 +4449,11 @@ static int test_ans_08(void)
         Comments:       The TUT should indicate a V.21 connection. The time for which each frequency is
                         transmitted is random and varies between 0.64 and 2.56s.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_08_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_08_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_08_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_08_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -4554,11 +4551,11 @@ static int test_ans_09(void)
                            700ms followed by 1s of silence.
         Comments:       The probe sent by the TUT will depend on the country setting.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_09_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_09_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_09_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_09_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -4654,11 +4651,11 @@ static int test_ans_10(void)
         Pass criteria:  The TUT should respond with a 1650Hz tone in 1.5+-0.1s.
         Comments:       The TUT should indicate that V.21 mode has been selected.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_10_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_10_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_10_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_10_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -4758,11 +4755,11 @@ static int test_ans_11(void)
                         be lost during the detection process. However, the number lost should be minimal.
                         The data bits and parity are specified in Annex C.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_11_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_11_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_11_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_11_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -4863,11 +4860,11 @@ static int test_ans_12(void)
                         (1650Hz) probe. However, it is catered for in V.18. It is more likely that this is
                         where CI or TXP characters would be detected (see test ANS-02).
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_12_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_12_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_12_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_12_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -4967,11 +4964,11 @@ static int test_ans_13(void)
                         when timer Tr will start. It is assumed that timer Ta is restarted on re-entering the
                         Monitor A state.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_13_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_13_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_13_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_13_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -5068,11 +5065,11 @@ static int test_ans_14(void)
         Comments:       It is assumed that timer Ta (3s) is restarted on re-entering the Monitor A
                         state.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_14_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_14_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_14_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_14_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -5179,11 +5176,11 @@ static int test_ans_15(void)
                         automode answer state. The TUT may then select either 45.45 or 50 bit/s for the
                         transmission.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_15_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_15_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_15_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_15_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -5281,11 +5278,11 @@ static int test_ans_16(void)
         Comments:       The TUT should indicate that it has selected DTMF mode. The DTMF capabilities
                         of the TUT should comply with ITU-T Q.24 for the Danish Administration.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_16_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_16_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_16_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_16_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -5380,11 +5377,11 @@ static int test_ans_17(void)
         Pass criteria:  TUT should respond with 2225Hz tone after 0.7+-0.1s.
         Comments:       The TUT should indicate that Bell 103 mode has been selected.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_17_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_17_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_17_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_17_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -5480,11 +5477,11 @@ static int test_ans_18(void)
         Comments:       The TUT should indicate that Bell 103 mode has been selected. Bell 103 modems
                         use 2225Hz as both answer tone and higher frequency of the upper channel.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_18_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_18_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_18_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_18_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -5579,11 +5576,11 @@ static int test_ans_19(void)
         Pass criteria:  The TUT should respond with 980Hz after 0.4+-0.2s.
         Comments:       The TUT should indicate that V.21 mode has been selected.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_19_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_19_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_19_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_19_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -5681,11 +5678,11 @@ static int test_ans_20(void)
                            700ms followed by 1s of silence.
         Comments:       The probe sent by the TUT will depend on the country setting.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_20_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_20_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_20_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_20_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -5780,11 +5777,11 @@ static int test_ans_21(void)
                         Pass criteria: The TUT should respond with 390Hz after 1.7+-0.1s.
         Comments:       The TUT should indicate that V.23 mode has been selected.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_21_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_21_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_21_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_21_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -5879,11 +5876,11 @@ static int test_ans_22(void)
                         silent for 500ms then transmit the TXP signal in V.21 (1) mode.
         Pass criteria:  The TUT should respond with TXP using V.21 (2) and select V.18 mode.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_22_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_22_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_22_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_22_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -5981,11 +5978,11 @@ static int test_ans_23(void)
         Pass criteria:  The TUT should use the orders described in Appendix I.
         Comments:       The order of the probes is not mandatory.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_23_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_23_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_23_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_23_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -6083,11 +6080,11 @@ static int test_ans_24(void)
                         modes followed by a pause of Tm (default 3)s.
         Comments:       The carrierless modes are those described in Annexes A, B and C.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_24_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_24_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_24_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_24_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -6185,11 +6182,11 @@ static int test_ans_25(void)
         Pass criteria:  The TUT should transmit silence on detecting the 1270Hz tone and then continue
                         probing starting with the V.23 probe 20s after the end of the 1270Hz signal.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_25_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_25_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_25_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_25_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -6287,11 +6284,11 @@ static int test_ans_26(void)
                         75+-5ms and then the 1650Hz, 1300Hz and 2225Hz probes for time Tc.
         Comments:       The carrier modes are those described in Annexes D, E, and F.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_26_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_26_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_26_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_26_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -6393,11 +6390,11 @@ static int test_ans_27(void)
                         390Hz. When the 1300Hz probe is not being transmitted, a 390Hz tone may be
                         interpreted as a 400Hz network tone.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_27_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_27_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_27_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_27_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -6497,11 +6494,11 @@ static int test_ans_28(void)
         Comments:       It is most likely that the TUT will return to probing time Ta (3s) after the
                         1270Hz tone ceases. This condition needs further clarification.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_28_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_28_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_28_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_28_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -6600,11 +6597,11 @@ static int test_ans_29(void)
         Comments:       The TUT may not respond to any signals while a carrierless mode probe is being
                         sent since these modes are half duplex.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_29_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_29_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_29_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_29_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -6705,11 +6702,11 @@ static int test_ans_30(void)
                         tones may be ignored. Some devices may only provide a visual indication of the
                         presence and cadence of the tones for instance by a flashing light.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_30_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_30_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_30_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_30_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -6807,11 +6804,11 @@ static int test_ans_31(void)
         Comments:       This is an optional test as detection of the fax calling tone is not required by
                         ITU-T V.18.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_31_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_31_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_31_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_31_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -6909,11 +6906,11 @@ static int test_ans_32(void)
         Comments:       Ideally the TUT should report the presence of speech back to the user. This is an
                         optional test.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_32_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_32_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_32_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_32_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -7016,11 +7013,11 @@ static int test_ans_33(void)
                            V.18 mode connection is completed.
         Comments:       The TUT should indicate V.18 mode.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_33_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_33_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_33_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_33_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -7128,11 +7125,11 @@ static int test_mon_21(void)
                         for 1 minute.
         Pass criteria:  The TUT should not start probing.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_21_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_21_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_21_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_21_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -7232,11 +7229,11 @@ static int test_mon_22(void)
         Comments:       In automode answer, the 1300Hz calling causes the DCE to start probing. In
                         monitor mode it should only report detection to the DTE.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_22_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_22_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_22_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_22_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -7336,11 +7333,11 @@ static int test_mon_23(void)
         Comments:       In automode answer, the 980Hz calling causes the DCE to start probing. In monitor
                         mode it should only report detection to the DTE.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_23_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_23_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_23_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_23_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -7415,8 +7412,8 @@ static void x_01_put_text_msg(void *user_data, const uint8_t *msg, int len)
 printf("1-1 %d '%s'\n", len, msg);
     if (user_data == NULL)
         strcat(result[1], (const char *) msg);
-    //else
-    //    v18_put(v18[1], "abcdefghij", 10);
+    else
+        v18_put(v18[1], "abcdefghij", 10);
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -7447,11 +7444,11 @@ static int test_x_01(void)
                         3) The tester will confirm that 1 start bit and at least 1.5 stop bits are used.
         Comments:       The carrier should be maintained during the 300ms after a character.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, x_01_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, x_01_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, x_01_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, x_01_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -7552,11 +7549,11 @@ static int test_x_02(void)
                         transmit the string "abcdef" at each rate.
         Pass criteria:  The tester will measure the bit timings and confirm the rates.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, x_02_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, x_02_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, x_02_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, x_02_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -7655,11 +7652,11 @@ static int test_x_03(void)
         Comments:       The probe message must be long enough for the tester to establish the bit rate. "GA"
                         may not be sufficient.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_5BIT_4545, V18_AUTOMODING_USA, x_03_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_5BIT_4545, V18_AUTOMODING_USA, x_03_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_5BIT_4545, V18_AUTOMODING_USA, x_03_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_5BIT_4545, V18_AUTOMODING_USA, x_03_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -7735,7 +7732,7 @@ static void x_04_put_text_msg(void *user_data, const uint8_t *msg, int len)
     {
         strcat(result[0], (const char *) msg);
 printf("Unexpected ECHO received (%d) '%s'\n", len, msg);
-        unexpected_echo = TRUE;
+        unexpected_echo = true;
     }
     else
     {
@@ -7778,11 +7775,11 @@ static int test_x_04(void)
                         assumed that the character conversion is the same for Baudot at 50 bit/s and any
                         other supported speed.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_5BIT_4545 | V18_MODE_REPETITIVE_SHIFTS_OPTION, V18_AUTOMODING_GLOBAL, x_04_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_5BIT_4545 | V18_MODE_REPETITIVE_SHIFTS_OPTION, V18_AUTOMODING_GLOBAL, x_04_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_5BIT_4545 | V18_MODE_REPETITIVE_SHIFTS_OPTION, V18_AUTOMODING_GLOBAL, x_04_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_5BIT_4545 | V18_MODE_REPETITIVE_SHIFTS_OPTION, V18_AUTOMODING_GLOBAL, x_04_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -7804,7 +7801,7 @@ static int test_x_04(void)
 
     result[0][0] =
     result[1][0] = '\0';
-    unexpected_echo = FALSE;
+    unexpected_echo = false;
     for (i = 0;  i < 127;  i++)
         msg[i] = i + 1;
     msg[127] = '\0';
@@ -7903,11 +7900,11 @@ static int test_x_05(void)
                         display will show when its receiver is re-enabled.
         Pass criteria:  The receiver should be re-enabled after 300ms.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_05_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_05_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_05_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_05_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -8021,11 +8018,11 @@ static int test_x_06(void)
                         receiving character from the TUT. It is assumed that the echo delay in the test
                         system is negligible.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_06_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_06_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_06_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_06_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -8138,11 +8135,11 @@ static int test_x_07(void)
                         3) The tester will confirm that 1 start bit and at least 1.5 stop bits are used.
         Comments:       The carrier should be maintained during the 300ms after a character.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_07_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_07_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_07_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_07_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -8239,11 +8236,11 @@ static int test_x_08(void)
                         2) The tester should confirm that 1 start bit, 7 data bits, 1 even parity bit and 2 stop
                            bits are used.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_08_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_08_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_08_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_08_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -8343,11 +8340,11 @@ static int test_x_09(void)
                            that there are no duplicate characters on the TUT display.
                         3) The received string should be correctly displayed despite the incorrect parity.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_09_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_09_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_09_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_09_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -8450,11 +8447,11 @@ static int test_x_10(void)
         Comments:       This test is only applicable to Minitel Dialogue terminals. Prestel and Minitel
                         Normal terminals cannot operate in this mode.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_10_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_10_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_10_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_10_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -8555,11 +8552,11 @@ static int test_x_11(void)
                         4) The last five characters on the TUT display should be "12345" (no "6")
                            correctly displayed despite the incorrect parity.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_11_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_11_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_11_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_11_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -8657,11 +8654,11 @@ static int test_x_12(void)
         Pass criteria:  The tester should confirm UTF8 encoded UNICODE characters are used with the
                         controls specified in ITU-T T.140.
      */
-    v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_12_put_text_msg, (void *) (intptr_t) 0);
+    v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_12_put_text_msg, (void *) (intptr_t) 0);
     logging = v18_get_logging_state(v18[0]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "Tester");
-    v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_12_put_text_msg, (void *) (intptr_t) 1);
+    v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_12_put_text_msg, (void *) (intptr_t) 1);
     logging = v18_get_logging_state(v18[1]);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "TUT");
@@ -8756,7 +8753,7 @@ static int decode_test_data_file(int mode, const char *filename)
         fprintf(stderr, "    Cannot open audio file '%s'\n", decode_test_file);
         exit(2);
     }
-    v18_state = v18_init(NULL, FALSE, mode, V18_AUTOMODING_GLOBAL, put_v18_msg, NULL);
+    v18_state = v18_init(NULL, false, mode, V18_AUTOMODING_GLOBAL, put_v18_msg, NULL);
     logging = v18_get_logging_state(v18_state);
     span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
     span_log_set_tag(logging, "");
@@ -8882,7 +8879,7 @@ int main(int argc, char *argv[])
 {
     int i;
     int res;
-    int hit;
+    bool hit;
     const char *match;
     int test_standard;
     int opt;
@@ -8897,7 +8894,7 @@ int main(int argc, char *argv[])
             decode_test_file = optarg;
             break;
         case 'l':
-            log_audio = TRUE;
+            log_audio = true;
             break;
         case 's':
             test_standard = atoi(optarg);
@@ -8928,7 +8925,7 @@ int main(int argc, char *argv[])
         }
     }
 
-    hit = FALSE;
+    hit = false;
     for (i = 0;  test_list[i].title[0];  i++)
     {
         if (test_list[i].func
@@ -8939,7 +8936,7 @@ int main(int argc, char *argv[])
                     &&
                     test_list[i].title[strlen(match)] == ' ')))
         {
-            hit = TRUE;
+            hit = true;
             printf("%s\n", test_list[i].title);
             res = test_list[i].func();
             if (res < 0)
index aade32c726d0de20d18e7023f0ef936d2273074c..3729687c35aefed8492a40e133e791b6c9c085f3 100644 (file)
@@ -63,7 +63,7 @@ display of modem status is maintained.
 #define OUT_FILE_NAME   "v22bis.wav"
 
 char *decode_test_file = NULL;
-int use_gui = FALSE;
+bool use_gui = false;
 
 int rx_bits = 0;
 
@@ -266,11 +266,11 @@ int main(int argc, char *argv[])
     int bits_per_test;
     int noise_level;
     int signal_level;
-    int log_audio;
     int channel_codec;
     int rbs_pattern;
     int guard_tone_option;
     int opt;
+    bool log_audio;
 
     channel_codec = MUNGE_CODEC_NONE;
     rbs_pattern = 0;
@@ -281,7 +281,7 @@ int main(int argc, char *argv[])
     signal_level = -13;
     bits_per_test = 50000;
     guard_tone_option = V22BIS_GUARD_TONE_1800HZ;
-    log_audio = FALSE;
+    log_audio = false;
     while ((opt = getopt(argc, argv, "b:B:c:d:gG:lm:n:r:s:")) != -1)
     {
         switch (opt)
@@ -305,7 +305,7 @@ int main(int argc, char *argv[])
             break;
         case 'g':
 #if defined(ENABLE_GUI)
-            use_gui = TRUE;
+            use_gui = true;
 #else
             fprintf(stderr, "Graphical monitoring not available\n");
             exit(2);
@@ -315,7 +315,7 @@ int main(int argc, char *argv[])
             guard_tone_option = atoi(optarg);
             break;
         case 'l':
-            log_audio = TRUE;
+            log_audio = true;
             break;
         case 'm':
             line_model_no = atoi(optarg);
index cb1b74a88cae2e1d824fff9a4cfd16a44d35a0f0..671fd935affad9547fcd5a00589a7ff61efbff16 100644 (file)
@@ -78,7 +78,7 @@ display of modem status is maintained.
 #define OUT_FILE_NAME   "v27ter.wav"
 
 char *decode_test_file = NULL;
-int use_gui = FALSE;
+bool use_gui = false;
 
 int symbol_no = 0;
 
@@ -341,30 +341,30 @@ int main(int argc, char *argv[])
     SNDFILE *outhandle;
     int outframes;
     int samples;
-    int tep;
     int test_bps;
     int noise_level;
     int signal_level;
     int bits_per_test;
     int line_model_no;
     int block_no;
-    int log_audio;
     int channel_codec;
     int rbs_pattern;
     int opt;
+    bool tep;
+    bool log_audio;
     logging_state_t *logging;
 
     channel_codec = MUNGE_CODEC_NONE;
     rbs_pattern = 0;
     test_bps = 4800;
-    tep = FALSE;
+    tep = false;
     line_model_no = 0;
     decode_test_file = NULL;
-    use_gui = FALSE;
+    use_gui = false;
     noise_level = -70;
     signal_level = -13;
     bits_per_test = 50000;
-    log_audio = FALSE;
+    log_audio = false;
     while ((opt = getopt(argc, argv, "b:B:c:d:glm:n:r:s:t")) != -1)
     {
         switch (opt)
@@ -388,14 +388,14 @@ int main(int argc, char *argv[])
             break;
         case 'g':
 #if defined(ENABLE_GUI)
-            use_gui = TRUE;
+            use_gui = true;
 #else
             fprintf(stderr, "Graphical monitoring not available\n");
             exit(2);
 #endif
             break;
         case 'l':
-            log_audio = TRUE;
+            log_audio = true;
             break;
         case 'm':
             line_model_no = atoi(optarg);
@@ -410,7 +410,7 @@ int main(int argc, char *argv[])
             signal_level = atoi(optarg);
             break;
         case 't':
-            tep = TRUE;
+            tep = true;
             break;
         default:
             //usage();
@@ -537,7 +537,7 @@ int main(int argc, char *argv[])
                 signal_level--;
                 v27ter_tx_restart(tx, test_bps, tep);
                 v27ter_tx_power(tx, signal_level);
-                v27ter_rx_restart(rx, test_bps, FALSE);
+                v27ter_rx_restart(rx, test_bps, false);
                 bert_init(&bert, bits_per_test, BERT_PATTERN_ITU_O152_11, test_bps, 20);
                 bert_set_report(&bert, 10000, reporter, NULL);
                 one_way_line_model_release(line_model);
index 246c217fd15f62fb5f113af9b8dc201cffeca2af..ec678c148a55c2381cb0b16c2657f838ded37104 100644 (file)
@@ -78,7 +78,7 @@ display of modem status is maintained.
 #define OUT_FILE_NAME   "v29.wav"
 
 char *decode_test_file = NULL;
-int use_gui = FALSE;
+bool use_gui = false;
 
 int symbol_no = 0;
 int rx_bits = 0;
@@ -315,30 +315,30 @@ int main(int argc, char *argv[])
     SNDFILE *outhandle;
     int outframes;
     int samples;
-    int tep;
     int test_bps;
     int noise_level;
     int signal_level;
     int bits_per_test;
     int line_model_no;
     int block_no;
-    int log_audio;
     int channel_codec;
     int rbs_pattern;
     int opt;
+    bool tep;
+    bool log_audio;
     logging_state_t *logging;
 
     channel_codec = MUNGE_CODEC_NONE;
     rbs_pattern = 0;
     test_bps = 9600;
-    tep = FALSE;
+    tep = false;
     line_model_no = 0;
     decode_test_file = NULL;
-    use_gui = FALSE;
+    use_gui = false;
     noise_level = -70;
     signal_level = -13;
     bits_per_test = 50000;
-    log_audio = FALSE;
+    log_audio = false;
     while ((opt = getopt(argc, argv, "b:B:c:d:glm:n:r:s:t")) != -1)
     {
         switch (opt)
@@ -362,14 +362,14 @@ int main(int argc, char *argv[])
             break;
         case 'g':
 #if defined(ENABLE_GUI)
-            use_gui = TRUE;
+            use_gui = true;
 #else
             fprintf(stderr, "Graphical monitoring not available\n");
             exit(2);
 #endif
             break;
         case 'l':
-            log_audio = TRUE;
+            log_audio = true;
             break;
         case 'm':
             line_model_no = atoi(optarg);
@@ -384,7 +384,7 @@ int main(int argc, char *argv[])
             signal_level = atoi(optarg);
             break;
         case 't':
-            tep = TRUE;
+            tep = true;
             break;
         default:
             //usage();
@@ -514,7 +514,7 @@ int main(int argc, char *argv[])
                 signal_level--;
                 v29_tx_restart(tx, test_bps, tep);
                 v29_tx_power(tx, signal_level);
-                v29_rx_restart(rx, test_bps, FALSE);
+                v29_rx_restart(rx, test_bps, false);
 #if defined(SPANDSP_EXPOSE_INTERNAL_STRUCTURES)
                 rx->eq_put_step = rand()%(48*10/3);
 #endif
index fc4a9b17cc12f458504130692f178e8ff8a794f4..727b5a8b584c36fc9c4775dbe0292764d892a4b0 100644 (file)
@@ -128,14 +128,14 @@ static void v42_put_frames(void *user_data, const uint8_t msg[], int len)
     {
         if (++count == 5)
         {
-            v42_set_local_busy_status(s, TRUE);
+            v42_set_local_busy_status(s, true);
             xxx = 1;
         }
     }
     else
     {
         if (xxx  &&  ++count == 45)
-            v42_set_local_busy_status(caller, FALSE);
+            v42_set_local_busy_status(caller, false);
     }
 }
 /*- End of function --------------------------------------------------------*/
@@ -144,13 +144,13 @@ int main(int argc, char *argv[])
 {
     int i;
     int bit;
-    int insert_caller_bit_errors;
-    int insert_answerer_bit_errors;
+    bool insert_caller_bit_errors;
+    bool insert_answerer_bit_errors;
     int opt;
 
-    insert_caller_bit_errors = FALSE;
-    insert_answerer_bit_errors = FALSE;
-    variable_length = FALSE;
+    insert_caller_bit_errors = false;
+    insert_answerer_bit_errors = false;
+    variable_length = false;
     while ((opt = getopt(argc, argv, "bv")) != -1)
     {
         switch (opt)
@@ -160,7 +160,7 @@ int main(int argc, char *argv[])
             insert_answerer_bit_errors = 10000;
             break;
         case 'v':
-            variable_length = TRUE;
+            variable_length = true;
             break;
         default:
             //usage();
@@ -169,8 +169,8 @@ int main(int argc, char *argv[])
         }
     }
 
-    caller = v42_init(&callerx, TRUE, TRUE, v42_get_frames, v42_put_frames, (void *) &callerx);
-    answerer = v42_init(&answererx, FALSE, TRUE, v42_get_frames, v42_put_frames, (void *) &answererx);
+    caller = v42_init(&callerx, true, true, v42_get_frames, v42_put_frames, (void *) &callerx);
+    answerer = v42_init(&answererx, false, true, v42_get_frames, v42_put_frames, (void *) &answererx);
     v42_set_status_callback(caller, v42_status, (void *) caller);
     v42_set_status_callback(answerer, v42_status, (void *) answerer);
     v42_restart(caller);
index cc95967c544a46b495faac6f14011736b887963a..2ce718feba7a06ed4a87d850e9b3595e94f14ac9 100644 (file)
@@ -82,8 +82,8 @@ int main(int argc, char *argv[])
     int v42bis_fd;
     int out_fd;
     int do_compression;
-    int do_decompression;
-    int stutter_compression;
+    bool do_decompression;
+    bool stutter_compression;
     int stutter_time;
     int seg;
     int opt;
@@ -94,21 +94,21 @@ int main(int argc, char *argv[])
     const char *decompressed_file;
 
     argv0 = argv[0];
-    do_compression = FALSE;
-    do_decompression = FALSE;
-    stutter_compression = FALSE;
+    do_compression = false;
+    do_decompression = false;
+    stutter_compression = false;
     while ((opt = getopt(argc, argv, "cds")) != -1)
     {
         switch (opt)
         {
         case 'c':
-            do_compression = TRUE;
+            do_compression = true;
             break;
         case 'd':
-            do_decompression = TRUE;
+            do_decompression = true;
             break;
         case 's':
-            stutter_compression = TRUE;
+            stutter_compression = true;
             break;
         default:
             //usage();
index d9ef7b82b9f29c7960ea977c3c3c99133cb4fcc4..df9243691e983af832d0516b926426ea52893184 100644 (file)
@@ -41,9 +41,6 @@
 #include "spandsp.h"
 #include "spandsp-sim.h"
 
-#define FALSE 0
-#define TRUE (!FALSE)
-
 #define SAMPLES_PER_CHUNK   160
 
 #define OUTPUT_FILE_NAME    "v8.wav"
@@ -202,7 +199,7 @@ static int v8_calls_v8_tests(SNDFILE *outhandle)
     negotiations_ok = 0;
 
     v8_call_parms.modem_connect_tone = MODEM_CONNECT_TONES_NONE;
-    v8_call_parms.send_ci = TRUE;
+    v8_call_parms.send_ci = true;
     v8_call_parms.v92 = -1;
     v8_call_parms.call_function = V8_CALL_V_SERIES;
     v8_call_parms.modulations = caller_available_modulations;
@@ -212,12 +209,12 @@ static int v8_calls_v8_tests(SNDFILE *outhandle)
     v8_call_parms.nsf = -1;
     v8_call_parms.t66 = -1;
     v8_caller = v8_init(NULL,
-                        TRUE,
+                        true,
                         &v8_call_parms,
                         handler,
                         (void *) "caller");
     v8_answer_parms.modem_connect_tone = MODEM_CONNECT_TONES_ANSAM_PR;
-    v8_answer_parms.send_ci = TRUE;
+    v8_answer_parms.send_ci = true;
     v8_answer_parms.v92 = -1;
     v8_answer_parms.call_function = V8_CALL_V_SERIES;
     v8_answer_parms.modulations = answerer_available_modulations;
@@ -227,7 +224,7 @@ static int v8_calls_v8_tests(SNDFILE *outhandle)
     v8_answer_parms.nsf = -1;
     v8_answer_parms.t66 = -1;
     v8_answerer = v8_init(NULL,
-                          FALSE,
+                          false,
                           &v8_answer_parms,
                           handler,
                           (void *) "answerer");
@@ -329,7 +326,7 @@ static int non_v8_calls_v8_tests(SNDFILE *outhandle)
     non_v8_caller_rx = modem_connect_tones_rx_init(NULL, MODEM_CONNECT_TONES_ANS_PR, NULL, NULL);
 
     v8_answer_parms.modem_connect_tone = MODEM_CONNECT_TONES_ANSAM_PR;
-    v8_answer_parms.send_ci = TRUE;
+    v8_answer_parms.send_ci = true;
     v8_answer_parms.v92 = -1;
     v8_answer_parms.call_function = V8_CALL_V_SERIES;
     v8_answer_parms.modulations = answerer_available_modulations;
@@ -339,7 +336,7 @@ static int non_v8_calls_v8_tests(SNDFILE *outhandle)
     v8_answer_parms.nsf = -1;
     v8_answer_parms.t66 = -1;
     v8_answerer = v8_init(NULL,
-                          FALSE,
+                          false,
                           &v8_answer_parms,
                           handler,
                           (void *) "answerer");
@@ -441,7 +438,7 @@ static int v8_calls_non_v8_tests(SNDFILE *outhandle)
     negotiations_ok = 0;
 
     v8_call_parms.modem_connect_tone = MODEM_CONNECT_TONES_NONE;
-    v8_call_parms.send_ci = TRUE;
+    v8_call_parms.send_ci = true;
     v8_call_parms.v92 = -1;
     v8_call_parms.call_function = V8_CALL_V_SERIES;
     v8_call_parms.modulations = caller_available_modulations;
@@ -451,7 +448,7 @@ static int v8_calls_non_v8_tests(SNDFILE *outhandle)
     v8_call_parms.nsf = -1;
     v8_call_parms.t66 = -1;
     v8_caller = v8_init(NULL,
-                        TRUE,
+                        true,
                         &v8_call_parms,
                         handler,
                         (void *) "caller");
@@ -522,7 +519,7 @@ int main(int argc, char *argv[])
     SNDFILE *inhandle;
     SNDFILE *outhandle;
     int opt;
-    int log_audio;
+    bool log_audio;
     char *decode_test_file;
     v8_state_t *v8_caller;
     v8_state_t *v8_answerer;
@@ -531,7 +528,7 @@ int main(int argc, char *argv[])
     logging_state_t *logging;
 
     decode_test_file = NULL;
-    log_audio = FALSE;
+    log_audio = false;
     while ((opt = getopt(argc, argv, "d:l")) != -1)
     {
         switch (opt)
@@ -540,7 +537,7 @@ int main(int argc, char *argv[])
             decode_test_file = optarg;
             break;
         case 'l':
-            log_audio = TRUE;
+            log_audio = true;
             break;
         default:
             //usage();
@@ -582,7 +579,7 @@ int main(int argc, char *argv[])
 
         printf("Decode file '%s'\n", decode_test_file);
         v8_call_parms.modem_connect_tone = MODEM_CONNECT_TONES_NONE;
-        v8_call_parms.send_ci = TRUE;
+        v8_call_parms.send_ci = true;
         v8_call_parms.v92 = -1;
         v8_call_parms.call_function = V8_CALL_V_SERIES;
         v8_call_parms.modulations = caller_available_modulations;
@@ -592,7 +589,7 @@ int main(int argc, char *argv[])
         v8_call_parms.nsf = -1;
         v8_call_parms.t66 = -1;
         v8_caller = v8_init(NULL,
-                            TRUE,
+                            true,
                             &v8_call_parms,
                             handler,
                             (void *) "caller");
@@ -601,7 +598,7 @@ int main(int argc, char *argv[])
         span_log_set_tag(logging, "caller");
 
         v8_answer_parms.modem_connect_tone = MODEM_CONNECT_TONES_ANSAM_PR;
-        v8_answer_parms.send_ci = TRUE;
+        v8_answer_parms.send_ci = true;
         v8_answer_parms.v92 = -1;
         v8_answer_parms.call_function = V8_CALL_V_SERIES;
         v8_answer_parms.modulations = answerer_available_modulations;
@@ -611,7 +608,7 @@ int main(int argc, char *argv[])
         v8_answer_parms.nsf = -1;
         v8_answer_parms.t66 = -1;
         v8_answerer = v8_init(NULL,
-                              FALSE,
+                              false,
                               &v8_answer_parms,
                               handler,
                               (void *) "answerer");