/**************************************************************************** * Signal Source Module for the Real-time BBC Codec/Modem * **************************************************************************** * William L. Bahn * * Academy Center for Information Security * * Department of Computer Science * * United States Air Force Academy * * USAFA, CO 80840 * **************************************************************************** * FILE:............ source.h * * DATE CREATED:.... 08 SEP 07 * * DATE MODIFIED:... 08 SEP 07 * **************************************************************************** * * REVISION HISTORY * **************************************************************************** * * DESCRIPTION * * This module supports the signal source for both the TX and the RX * */ #ifndef SOURCEdotH #define SOURCEdotH //------------------------------------------------------------------------ // REQUIRED INCLUDES //------------------------------------------------------------------------ #include "config.h" #include "dirtyd.h" //------------------------------------------------------------------------ // STRUCTURE DECLARATIONS //------------------------------------------------------------------------ typedef struct SOURCE SOURCE; //------------------------------------------------------------------------ // STRUCTURE DEFINITIONS //------------------------------------------------------------------------ // NOTE: Normally the structure definition would be in the *.c file to make // the structure members inaccessible to outside functions except through // public function calls. But for the real-time code it has been decided // to make the structure members directly visible to the functions that // manipulate them. struct SOURCE { int streaming; // Buffer active flag DWORD sample; // Number of samples that have been processed DWORD samples; // Number of samples in buffer DWORD sample_size_bytes; // Bytes required per sample DWORD sample_limit; // Number of samples space is allocated for BYTE *v; // Buffer address DWORD file_bytes; // File size based on seek test size_t chunk_size; // File bytes bytes per message size_t buffer_size; // Size of allocated source buffer }; //------------------------------------------------------------------------ // PUBLIC FUNCTION PROTOTYPES //------------------------------------------------------------------------ SOURCE *SOURCE_Del(SOURCE *p); SOURCE *SOURCE_New(CONFIG *c, DWORD *errcode); //------------------------------------------------------------------------ #endif