mirror of
https://github.com/D-Modem/app.git
synced 2026-11-28 17:38:05 -08:00
The UI tests, Gradle's script, the iOS app and the native test hosts (batch 6 of 8, comment lines only) and the checker's own. Every function in the app is now documented; android.yml's docs job runs tools/doc_check.py first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
37 lines
1.0 KiB
C
37 lines
1.0 KiB
C
/*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
* Copyright (C) 2026 Neo-Desktop
|
|
*
|
|
* line_speed.h - how fast the test lines run (fax_line, codec_line,
|
|
* t30_line): at the sample clock, as a phone line does,
|
|
* or LINE_SPEED=<x> times it (the tests' shorter
|
|
* calls: the DTE's timing, a fax program's T.30, then
|
|
* x times as slow beside the line's); MODEM_REALTIME=0
|
|
* as fast as it goes
|
|
*/
|
|
|
|
#ifndef LINE_SPEED_H
|
|
#define LINE_SPEED_H
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "pipe_modem.h"
|
|
|
|
/* m's clock as the environment asks: the sample clock, LINE_SPEED times as fast, or (MODEM_REALTIME=0) as fast as it goes */
|
|
static inline void line_speed(dmd::PipeModem &m)
|
|
{
|
|
const char *s = getenv("LINE_SPEED");
|
|
double x = s ? atof(s) : 1;
|
|
if (getenv("MODEM_REALTIME") && !atoi(getenv("MODEM_REALTIME"))) {
|
|
m.set_realtime(false);
|
|
m.set_speed(0);
|
|
} else if (x > 1) {
|
|
m.set_realtime(false);
|
|
m.set_speed(x);
|
|
} else {
|
|
m.set_realtime(true);
|
|
}
|
|
}
|
|
|
|
#endif
|