Basic MacOS9 build support; libs and examples
authorMonty <xiphmont@xiph.org>
Mon, 14 Aug 2000 22:33:50 +0000 (22:33 +0000)
committerMonty <xiphmont@xiph.org>
Mon, 14 Aug 2000 22:33:50 +0000 (22:33 +0000)
Monty

svn path=/trunk/vorbis/; revision=552

examples/decoder_example.c
examples/encoder_example.c
mac/compat/strdup.c [new file with mode: 0644]
mac/compat/sys/types.h [new file with mode: 0644]
mac/decoder_example.mcp [new file with mode: 0644]
mac/encoder_example.mcp [new file with mode: 0644]
mac/libvorbis.mcp [new file with mode: 0644]
mac/libvorbis.mcp.exp [new file with mode: 0644]

index 656bf80..e638fc1 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  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;
 
@@ -58,6 +62,13 @@ int main(int argc, char **argv){
   _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 ************/
 
index 7963ce6..38070a9 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  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 $
 
  ********************************************************************/
 
@@ -32,6 +32,9 @@
 #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 */
@@ -51,6 +54,13 @@ int main(){
 
   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. */
diff --git a/mac/compat/strdup.c b/mac/compat/strdup.c
new file mode 100644 (file)
index 0000000..277574a
--- /dev/null
@@ -0,0 +1 @@
+#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
diff --git a/mac/compat/sys/types.h b/mac/compat/sys/types.h
new file mode 100644 (file)
index 0000000..b0d4f92
--- /dev/null
@@ -0,0 +1 @@
+#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
diff --git a/mac/decoder_example.mcp b/mac/decoder_example.mcp
new file mode 100644 (file)
index 0000000..7857354
Binary files /dev/null and b/mac/decoder_example.mcp differ
diff --git a/mac/encoder_example.mcp b/mac/encoder_example.mcp
new file mode 100644 (file)
index 0000000..faf63cd
Binary files /dev/null and b/mac/encoder_example.mcp differ
diff --git a/mac/libvorbis.mcp b/mac/libvorbis.mcp
new file mode 100644 (file)
index 0000000..2b5f5dc
Binary files /dev/null and b/mac/libvorbis.mcp differ
diff --git a/mac/libvorbis.mcp.exp b/mac/libvorbis.mcp.exp
new file mode 100644 (file)
index 0000000..5ffc7c3
--- /dev/null
@@ -0,0 +1 @@
+### 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