********************************************************************
function: simple example decoder
- last mod: $Id: decoder_example.c,v 1.9 2000/06/15 09:18:34 xiphmont Exp $
+ last mod: $Id: decoder_example.c,v 1.10 2000/08/14 22:33:50 xiphmont Exp $
********************************************************************/
#include <fcntl.h>
#endif
+#if defined(macintosh) && defined(__MWERKS__)
+#include <console.h> /* CodeWarrior's Mac "command-line" support */
+#endif
+
int16_t convbuffer[4096]; /* take 8k out of the data segment, not the stack */
int convsize=4096;
_setmode( _fileno( stdout ), _O_BINARY );
#endif
+#if defined(macintosh) && defined(__MWERKS__)
+ int argc = 0;
+ char **argv = NULL;
+
+ argc = ccommand(&argv); /* get a "command line" from the Mac user */
+ /* this also lets the user set stdin and stdout */
+#endif
/********** Decode setup ************/
********************************************************************
function: simple example encoder
- last mod: $Id: encoder_example.c,v 1.8 2000/06/15 09:18:34 xiphmont Exp $
+ last mod: $Id: encoder_example.c,v 1.9 2000/08/14 22:33:50 xiphmont Exp $
********************************************************************/
#include <fcntl.h>
#endif
+#if defined(macintosh) && defined(__MWERKS__)
+#include <console.h> /* CodeWarrior's Mac "command-line" support */
+#endif
#define READ 1024
signed char readbuffer[READ*4+44]; /* out of the data segment, not the stack */
int eos=0;
+#if defined(macintosh) && defined(__MWERKS__)
+ int argc = 0;
+ char **argv = NULL;
+ argc = ccommand(&argv); /* get a "command line" from the Mac user */
+ /* this also lets the user set stdin and stdout */
+#endif
+
/* we cheat on the WAV header; we just bypass 44 bytes and never
verify that it matches 16bit/stereo/44.1kHz. This is just an
example, after all. */
--- /dev/null
+#include <sys/types.h>\r#include <string.h>\r#include <stdlib.h>\r\rchar *strdup(const char *inStr)\r{\r char *outStr = NULL;\r \r if (inStr == NULL) {\r return NULL;\r }\r \r outStr = malloc(strlen(inStr) + 1);\r \r if (outStr != NULL) {\r strcpy(outStr, inStr);\r }\r \r return outStr;\r}\r
\ No newline at end of file
--- /dev/null
+#ifndef __SYS_TYPES_H__\r#define __SYS_TYPES_H__ 1\r\r#include <MacTypes.h>\r#include <alloca.h>\r#include <string.h>\r\rtypedef short int16_t;\rtypedef long int32_t;\rtypedef long long int64_t;\r\r#define vorbis_size32_t long\r\r\r#if defined(__cplusplus)\rextern "C" {\r#endif\r\r#pragma options align=power\r\rchar *strdup(const char *inStr);\r\r#pragma options align=reset\r\r#if defined(__cplusplus)\r}\r#endif\r\r#endif /* __SYS_TYPES_H__ */\r
\ No newline at end of file
--- /dev/null
+### From "vorbis/codec.h"\rogg_stream_packetin\rogg_stream_pageout\rogg_sync_init\rogg_sync_clear\r#ogg_sync_destroy\rogg_sync_reset\rogg_sync_buffer\rogg_sync_wrote\rogg_sync_pageseek\rogg_sync_pageout\rogg_stream_pagein\rogg_stream_packetout\rogg_stream_init\rogg_stream_clear\rogg_stream_reset\rogg_stream_destroy\rogg_stream_eof\rogg_page_version\rogg_page_continued\rogg_page_bos\rogg_page_eos\rogg_page_frameno\rogg_page_serialno\rogg_page_pageno\rvorbis_info_init\rvorbis_info_clear\rvorbis_comment_init\rvorbis_comment_add \rvorbis_comment_clear\rvorbis_block_init\rvorbis_block_clear\rvorbis_dsp_clear\rvorbis_analysis_init\rvorbis_analysis_headerout\rvorbis_analysis_buffer\rvorbis_analysis_wrote\rvorbis_analysis_blockout\rvorbis_analysis\rvorbis_synthesis_headerin\rvorbis_synthesis_init\rvorbis_synthesis\rvorbis_synthesis_blockin\rvorbis_synthesis_pcmout\rvorbis_synthesis_read\rstrdup\r
\ No newline at end of file