Commit 8b8e92eb authored by Monty's avatar Monty
Browse files

Basic MacOS9 build support; libs and examples

Monty

svn path=/trunk/vorbis/; revision=552
parent 589e3a0c
......@@ -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 $
********************************************************************/
......@@ -32,6 +32,10 @@
#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 ************/
......
......@@ -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. */
......
#include <sys/types.h> #include <string.h> #include <stdlib.h> char *strdup(const char *inStr) { char *outStr = NULL; if (inStr == NULL) { return NULL; } outStr = malloc(strlen(inStr) + 1); if (outStr != NULL) { strcpy(outStr, inStr); } return outStr; }
\ No newline at end of file
#ifndef __SYS_TYPES_H__ #define __SYS_TYPES_H__ 1 #include <MacTypes.h> #include <alloca.h> #include <string.h> typedef short int16_t; typedef long int32_t; typedef long long int64_t; #define vorbis_size32_t long #if defined(__cplusplus) extern "C" { #endif #pragma options align=power char *strdup(const char *inStr); #pragma options align=reset #if defined(__cplusplus) } #endif #endif /* __SYS_TYPES_H__ */
\ No newline at end of file
### From "vorbis/codec.h" ogg_stream_packetin ogg_stream_pageout ogg_sync_init ogg_sync_clear #ogg_sync_destroy ogg_sync_reset ogg_sync_buffer ogg_sync_wrote ogg_sync_pageseek ogg_sync_pageout ogg_stream_pagein ogg_stream_packetout ogg_stream_init ogg_stream_clear ogg_stream_reset ogg_stream_destroy ogg_stream_eof ogg_page_version ogg_page_continued ogg_page_bos ogg_page_eos ogg_page_frameno ogg_page_serialno ogg_page_pageno vorbis_info_init vorbis_info_clear vorbis_comment_init vorbis_comment_add vorbis_comment_clear vorbis_block_init vorbis_block_clear vorbis_dsp_clear vorbis_analysis_init vorbis_analysis_headerout vorbis_analysis_buffer vorbis_analysis_wrote vorbis_analysis_blockout vorbis_analysis vorbis_synthesis_headerin vorbis_synthesis_init vorbis_synthesis vorbis_synthesis_blockin vorbis_synthesis_pcmout vorbis_synthesis_read strdup
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment