From 047e98b20f19e534f0aede6f69593624dfb65dcd Mon Sep 17 00:00:00 2001 From: Tim Terriberry Date: Sat, 22 Sep 2012 02:09:19 +0000 Subject: [PATCH] Escape more things in the vorbisfile docs' example code. svn path=/trunk/vorbis/; revision=18630 --- doc/vorbisfile/chainingexample.html | 2 +- doc/vorbisfile/example.html | 18 +++++++++--------- doc/vorbisfile/seeking_example_c.html | 16 ++++++++-------- doc/vorbisfile/seeking_test_c.html | 16 ++++++++-------- doc/vorbisfile/seekingexample.html | 14 +++++++------- doc/vorbisfile/vorbisfile_example_c.html | 16 ++++++++-------- 6 files changed, 41 insertions(+), 41 deletions(-) diff --git a/doc/vorbisfile/chainingexample.html b/doc/vorbisfile/chainingexample.html index d2b529e..9e0440d 100644 --- a/doc/vorbisfile/chainingexample.html +++ b/doc/vorbisfile/chainingexample.html @@ -76,7 +76,7 @@ libvorbisfile not to close stdin later during cleanup.


-  if(ov_open_callbacks(stdin,&ov,NULL,-1,OV_CALLBACKS_NOCLOSE)<0){
+  if(ov_open_callbacks(stdin,&ov,NULL,-1,OV_CALLBACKS_NOCLOSE)<0){
     printf("Could not open input as an OggVorbis file.\n\n");
     exit(1);
   }
diff --git a/doc/vorbisfile/example.html b/doc/vorbisfile/example.html
index b1ad977..e0c4fa3 100644
--- a/doc/vorbisfile/example.html
+++ b/doc/vorbisfile/example.html
@@ -99,7 +99,7 @@ stdin later during cleanup.
 
         
 

-  if(ov_open_callbacks(stdin, &vf, NULL, 0, OV_CALLBACKS_NOCLOSE) < 0) {
+  if(ov_open_callbacks(stdin, &vf, NULL, 0, OV_CALLBACKS_NOCLOSE) < 0) {
       fprintf(stderr,"Input does not appear to be an Ogg bitstream.\n");
       exit(1);
   }
@@ -119,16 +119,16 @@ We also want to pull out and show the user a comment attached to the file using
         
 

   {
-    char **ptr=ov_comment(&vf,-1)->user_comments;
-    vorbis_info *vi=ov_info(&vf,-1);
+    char **ptr=ov_comment(&vf,-1)->user_comments;
+    vorbis_info *vi=ov_info(&vf,-1);
     while(*ptr){
       fprintf(stderr,"%s\n",*ptr);
       ++ptr;
     }
-    fprintf(stderr,"\nBitstream is %d channel, %ldHz\n",vi->channels,vi->rate);
+    fprintf(stderr,"\nBitstream is %d channel, %ldHz\n",vi->channels,vi->rate);
     fprintf(stderr,"\nDecoded length: %ld samples\n",
-            (long)ov_pcm_total(&vf,-1));
-    fprintf(stderr,"Encoded by: %s\n\n",ov_comment(&vf,-1)->vendor);
+            (long)ov_pcm_total(&vf,-1));
+    fprintf(stderr,"Encoded by: %s\n\n",ov_comment(&vf,-1)->vendor);
   }
   
 
@@ -146,11 +146,11 @@ Here's the read loop:

 
   while(!eof){
-    long ret=ov_read(&vf,pcmout,sizeof(pcmout),0,2,1,¤t_section);
+    long ret=ov_read(&vf,pcmout,sizeof(pcmout),0,2,1,&current_section);
     if (ret == 0) {
       /* EOF */
       eof=1;
-    } else if (ret < 0) {
+    } else if (ret < 0) {
       /* error in the stream.  Not a problem, just reporting it in
 	 case we (the app) cares.  In this case, we don't. */
     } else {
@@ -179,7 +179,7 @@ Now that we've finished playing, we can pack up and go home.  It's important to
         
 

 
-  ov_clear(&vf);
+  ov_clear(&vf);
     
   fprintf(stderr,"Done.\n");
   return(0);
diff --git a/doc/vorbisfile/seeking_example_c.html b/doc/vorbisfile/seeking_example_c.html
index ffb7814..eb10a98 100644
--- a/doc/vorbisfile/seeking_example_c.html
+++ b/doc/vorbisfile/seeking_example_c.html
@@ -24,8 +24,8 @@ The example program source:
 	
 

 
-#include 
-#include 
+#include <stdlib.h>
+#include <stdio.h>
 #include "vorbis/codec.h"
 #include "vorbis/vorbisfile.h"
 
@@ -38,18 +38,18 @@ int main(){
 #endif
 
   /* open the file/pipe on stdin */
-  if(ov_open_callbacks(stdin,&ov,NULL,-1,OV_CALLBACKS_NOCLOSE)==-1){
+  if(ov_open_callbacks(stdin,&ov,NULL,-1,OV_CALLBACKS_NOCLOSE)==-1){
     printf("Could not open input as an OggVorbis file.\n\n");
     exit(1);
   }
   
   /* print details about each logical bitstream in the input */
-  if(ov_seekable(&ov)){
-    double length=ov_time_total(&ov,-1);
+  if(ov_seekable(&ov)){
+    double length=ov_time_total(&ov,-1);
     printf("testing seeking to random places in %g seconds....\n",length);
-    for(i=0;i<100;i++){
+    for(i=0;i<100;i++){
       double val=(double)rand()/RAND_MAX*length;
-      ov_time_seek(&ov,val);
+      ov_time_seek(&ov,val);
       printf("\r\t%d [%gs]...     ",i,val);
       fflush(stdout);
     }
@@ -59,7 +59,7 @@ int main(){
     printf("Standard input was not seekable.\n");
   }
 
-  ov_clear(&ov);
+  ov_clear(&ov);
   return 0;
 }
 
diff --git a/doc/vorbisfile/seeking_test_c.html b/doc/vorbisfile/seeking_test_c.html
index ffb7814..eb10a98 100644
--- a/doc/vorbisfile/seeking_test_c.html
+++ b/doc/vorbisfile/seeking_test_c.html
@@ -24,8 +24,8 @@ The example program source:
 	
 

 
-#include 
-#include 
+#include <stdlib.h>
+#include <stdio.h>
 #include "vorbis/codec.h"
 #include "vorbis/vorbisfile.h"
 
@@ -38,18 +38,18 @@ int main(){
 #endif
 
   /* open the file/pipe on stdin */
-  if(ov_open_callbacks(stdin,&ov,NULL,-1,OV_CALLBACKS_NOCLOSE)==-1){
+  if(ov_open_callbacks(stdin,&ov,NULL,-1,OV_CALLBACKS_NOCLOSE)==-1){
     printf("Could not open input as an OggVorbis file.\n\n");
     exit(1);
   }
   
   /* print details about each logical bitstream in the input */
-  if(ov_seekable(&ov)){
-    double length=ov_time_total(&ov,-1);
+  if(ov_seekable(&ov)){
+    double length=ov_time_total(&ov,-1);
     printf("testing seeking to random places in %g seconds....\n",length);
-    for(i=0;i<100;i++){
+    for(i=0;i<100;i++){
       double val=(double)rand()/RAND_MAX*length;
-      ov_time_seek(&ov,val);
+      ov_time_seek(&ov,val);
       printf("\r\t%d [%gs]...     ",i,val);
       fflush(stdout);
     }
@@ -59,7 +59,7 @@ int main(){
     printf("Standard input was not seekable.\n");
   }
 
-  ov_clear(&ov);
+  ov_clear(&ov);
   return 0;
 }
 
diff --git a/doc/vorbisfile/seekingexample.html b/doc/vorbisfile/seekingexample.html
index 89459e4..8263f02 100644
--- a/doc/vorbisfile/seekingexample.html
+++ b/doc/vorbisfile/seekingexample.html
@@ -95,7 +95,7 @@ called to initialize the OggVorbis_File structure with default values.
 
         
 

-  if(ov_open_callbacks(stdin, &vf, NULL, 0, OV_CALLBACKS_NOCLOSE) < 0) {
+  if(ov_open_callbacks(stdin, &vf, NULL, 0, OV_CALLBACKS_NOCLOSE) < 0) {
       fprintf(stderr,"Input does not appear to be an Ogg bitstream.\n");
       exit(1);
   }
@@ -115,14 +115,14 @@ We also want to pull out and show the user a comment attached to the file using
         
 

   {
-    char **ptr=ov_comment(&vf,-1)->user_comments;
-    vorbis_info *vi=ov_info(&vf,-1);
+    char **ptr=ov_comment(&vf,-1)->user_comments;
+    vorbis_info *vi=ov_info(&vf,-1);
     while(*ptr){
       fprintf(stderr,"%s\n",*ptr);
       ++ptr;
     }
-    fprintf(stderr,"\nBitstream is %d channel, %ldHz\n",vi->channels,vi->rate);
-    fprintf(stderr,"Encoded by: %s\n\n",ov_comment(&vf,-1)->vendor);
+    fprintf(stderr,"\nBitstream is %d channel, %ldHz\n",vi->channels,vi->rate);
+    fprintf(stderr,"Encoded by: %s\n\n",ov_comment(&vf,-1)->vendor);
   }
   
 
@@ -140,7 +140,7 @@ Here's the read loop:

 
   while(!eof){
-    long ret=ov_read(&vf,pcmout,sizeof(pcmout),0,2,1,¤t_section);
+    long ret=ov_read(&vf,pcmout,sizeof(pcmout),0,2,1,&current_section);
     switch(ret){
     case 0:
       /* EOF */
@@ -172,7 +172,7 @@ Now that we've finished playing, we can pack up and go home.  It's important to
         
 

 
-  ov_clear(&vf);
+  ov_clear(&vf);
     
   fprintf(stderr,"Done.\n");
   return(0);
diff --git a/doc/vorbisfile/vorbisfile_example_c.html b/doc/vorbisfile/vorbisfile_example_c.html
index 899ccb7..f3ba1d6 100644
--- a/doc/vorbisfile/vorbisfile_example_c.html
+++ b/doc/vorbisfile/vorbisfile_example_c.html
@@ -46,28 +46,28 @@ int main(int argc, char **argv){
   _setmode( _fileno( stdout ), _O_BINARY );
 #endif
 
-  if(ov_open_callbacks(stdin, &vf, NULL, 0, OV_CALLBACKS_NOCLOSE) < 0) {
+  if(ov_open_callbacks(stdin, &vf, NULL, 0, OV_CALLBACKS_NOCLOSE) < 0) {
       fprintf(stderr,"Input does not appear to be an Ogg bitstream.\n");
       exit(1);
   }
 
   {
-    char **ptr=ov_comment(&vf,-1)->user_comments;
-    vorbis_info *vi=ov_info(&vf,-1);
+    char **ptr=ov_comment(&vf,-1)->user_comments;
+    vorbis_info *vi=ov_info(&vf,-1);
     while(*ptr){
       fprintf(stderr,"%s\n",*ptr);
       ++ptr;
     }
-    fprintf(stderr,"\nBitstream is %d channel, %ldHz\n",vi->channels,vi->rate);
-    fprintf(stderr,"Encoded by: %s\n\n",ov_comment(&vf,-1)->vendor);
+    fprintf(stderr,"\nBitstream is %d channel, %ldHz\n",vi->channels,vi->rate);
+    fprintf(stderr,"Encoded by: %s\n\n",ov_comment(&vf,-1)->vendor);
   }
   
   while(!eof){
-    long ret=ov_read(&vf,pcmout,sizeof(pcmout),0,2,1,¤t_section);
+    long ret=ov_read(&vf,pcmout,sizeof(pcmout),0,2,1,&current_section);
     if (ret == 0) {
       /* EOF */
       eof=1;
-    } else if (ret < 0) {
+    } else if (ret < 0) {
       /* error in the stream.  Not a problem, just reporting it in
 	 case we (the app) cares.  In this case, we don't. */
     } else {
@@ -77,7 +77,7 @@ int main(int argc, char **argv){
     }
   }
 
-  ov_clear(&vf);
+  ov_clear(&vf);
     
   fprintf(stderr,"Done.\n");
   return(0);
-- 
2.7.4