comparison subreader.c @ 19066:26a30496ec96

marks several function without a prototype which arent used outside its sourcefile as static, Patch by Stefan Huehner - stefan AT huehner-org
author reynaldo
date Thu, 13 Jul 2006 20:59:18 +0000
parents ed69754aa58d
children b137cea2650e
comparison
equal deleted inserted replaced
19065:26ed3fcd5cd4 19066:26a30496ec96
93 } 93 }
94 94
95 return NULL; 95 return NULL;
96 } 96 }
97 97
98 subtitle *sub_read_line_sami(stream_t* st, subtitle *current) { 98 static subtitle *sub_read_line_sami(stream_t* st, subtitle *current) {
99 static char line[LINE_LEN+1]; 99 static char line[LINE_LEN+1];
100 static char *s = NULL, *slacktime_s; 100 static char *s = NULL, *slacktime_s;
101 char text[LINE_LEN+1], *p=NULL, *q; 101 char text[LINE_LEN+1], *p=NULL, *q;
102 int state; 102 int state;
103 103
234 234
235 return current; 235 return current;
236 } 236 }
237 237
238 238
239 char *sub_readtext(char *source, char **dest) { 239 static char *sub_readtext(char *source, char **dest) {
240 int len=0; 240 int len=0;
241 char *p=source; 241 char *p=source;
242 242
243 // printf("src=%p dest=%p \n",source,dest); 243 // printf("src=%p dest=%p \n",source,dest);
244 244
256 256
257 if (*p) return p; // not-last text field 257 if (*p) return p; // not-last text field
258 else return NULL; // last text field 258 else return NULL; // last text field
259 } 259 }
260 260
261 subtitle *sub_read_line_microdvd(stream_t *st,subtitle *current) { 261 static subtitle *sub_read_line_microdvd(stream_t *st,subtitle *current) {
262 char line[LINE_LEN+1]; 262 char line[LINE_LEN+1];
263 char line2[LINE_LEN+1]; 263 char line2[LINE_LEN+1];
264 char *p, *next; 264 char *p, *next;
265 int i; 265 int i;
266 266
284 current->lines= ++i; 284 current->lines= ++i;
285 285
286 return current; 286 return current;
287 } 287 }
288 288
289 subtitle *sub_read_line_mpl2(stream_t *st,subtitle *current) { 289 static subtitle *sub_read_line_mpl2(stream_t *st,subtitle *current) {
290 char line[LINE_LEN+1]; 290 char line[LINE_LEN+1];
291 char line2[LINE_LEN+1]; 291 char line2[LINE_LEN+1];
292 char *p, *next; 292 char *p, *next;
293 int i; 293 int i;
294 294
310 current->lines= ++i; 310 current->lines= ++i;
311 311
312 return current; 312 return current;
313 } 313 }
314 314
315 subtitle *sub_read_line_subrip(stream_t* st, subtitle *current) { 315 static subtitle *sub_read_line_subrip(stream_t* st, subtitle *current) {
316 char line[LINE_LEN+1]; 316 char line[LINE_LEN+1];
317 int a1,a2,a3,a4,b1,b2,b3,b4; 317 int a1,a2,a3,a4,b1,b2,b3,b4;
318 char *p=NULL, *q=NULL; 318 char *p=NULL, *q=NULL;
319 int len; 319 int len;
320 320
340 break; 340 break;
341 } 341 }
342 return current; 342 return current;
343 } 343 }
344 344
345 subtitle *sub_read_line_subviewer(stream_t *st,subtitle *current) { 345 static subtitle *sub_read_line_subviewer(stream_t *st,subtitle *current) {
346 char line[LINE_LEN+1]; 346 char line[LINE_LEN+1];
347 int a1,a2,a3,a4,b1,b2,b3,b4; 347 int a1,a2,a3,a4,b1,b2,b3,b4;
348 char *p=NULL; 348 char *p=NULL;
349 int i,len; 349 int i,len;
350 350
389 current->lines=i; 389 current->lines=i;
390 } 390 }
391 return current; 391 return current;
392 } 392 }
393 393
394 subtitle *sub_read_line_subviewer2(stream_t *st,subtitle *current) { 394 static subtitle *sub_read_line_subviewer2(stream_t *st,subtitle *current) {
395 char line[LINE_LEN+1]; 395 char line[LINE_LEN+1];
396 int a1,a2,a3,a4; 396 int a1,a2,a3,a4;
397 char *p=NULL; 397 char *p=NULL;
398 int i,len; 398 int i,len;
399 399
422 } 422 }
423 return current; 423 return current;
424 } 424 }
425 425
426 426
427 subtitle *sub_read_line_vplayer(stream_t *st,subtitle *current) { 427 static subtitle *sub_read_line_vplayer(stream_t *st,subtitle *current) {
428 char line[LINE_LEN+1]; 428 char line[LINE_LEN+1];
429 int a1,a2,a3; 429 int a1,a2,a3;
430 char *p=NULL, *next,separator; 430 char *p=NULL, *next,separator;
431 int i,len,plen; 431 int i,len,plen;
432 432
468 } 468 }
469 } 469 }
470 return current; 470 return current;
471 } 471 }
472 472
473 subtitle *sub_read_line_rt(stream_t *st,subtitle *current) { 473 static subtitle *sub_read_line_rt(stream_t *st,subtitle *current) {
474 //TODO: This format uses quite rich (sub/super)set of xhtml 474 //TODO: This format uses quite rich (sub/super)set of xhtml
475 // I couldn't check it since DTD is not included. 475 // I couldn't check it since DTD is not included.
476 // WARNING: full XML parses can be required for proper parsing 476 // WARNING: full XML parses can be required for proper parsing
477 char line[LINE_LEN+1]; 477 char line[LINE_LEN+1];
478 int a1,a2,a3,a4,b1,b2,b3,b4; 478 int a1,a2,a3,a4,b1,b2,b3,b4;
518 current->lines=i+1; 518 current->lines=i+1;
519 } 519 }
520 return current; 520 return current;
521 } 521 }
522 522
523 subtitle *sub_read_line_ssa(stream_t *st,subtitle *current) { 523 static subtitle *sub_read_line_ssa(stream_t *st,subtitle *current) {
524 /* 524 /*
525 * Sub Station Alpha v4 (and v2?) scripts have 9 commas before subtitle 525 * Sub Station Alpha v4 (and v2?) scripts have 9 commas before subtitle
526 * other Sub Station Alpha scripts have only 8 commas before subtitle 526 * other Sub Station Alpha scripts have only 8 commas before subtitle
527 * Reading the "ScriptType:" field is not reliable since many scripts appear 527 * Reading the "ScriptType:" field is not reliable since many scripts appear
528 * w/o it 528 * w/o it
590 current->lines++; 590 current->lines++;
591 591
592 return current; 592 return current;
593 } 593 }
594 594
595 void sub_pp_ssa(subtitle *sub) { 595 static void sub_pp_ssa(subtitle *sub) {
596 int l=sub->lines; 596 int l=sub->lines;
597 char *so,*de,*start; 597 char *so,*de,*start;
598 598
599 while (l){ 599 while (l){
600 /* eliminate any text enclosed with {}, they are font and color settings */ 600 /* eliminate any text enclosed with {}, they are font and color settings */
619 * I found some of them in http://www.scriptsclub.org/ (used for anime). 619 * I found some of them in http://www.scriptsclub.org/ (used for anime).
620 * The time is in tenths of second. 620 * The time is in tenths of second.
621 * 621 *
622 * by set, based on code by szabi (dunnowhat sub format ;-) 622 * by set, based on code by szabi (dunnowhat sub format ;-)
623 */ 623 */
624 subtitle *sub_read_line_pjs(stream_t *st,subtitle *current) { 624 static subtitle *sub_read_line_pjs(stream_t *st,subtitle *current) {
625 char line[LINE_LEN+1]; 625 char line[LINE_LEN+1];
626 char text[LINE_LEN+1], *s, *d; 626 char text[LINE_LEN+1], *s, *d;
627 627
628 if (!stream_read_line (st, line, LINE_LEN)) 628 if (!stream_read_line (st, line, LINE_LEN))
629 return NULL; 629 return NULL;
657 current->lines = 1; 657 current->lines = 1;
658 658
659 return current; 659 return current;
660 } 660 }
661 661
662 subtitle *sub_read_line_mpsub(stream_t *st, subtitle *current) { 662 static subtitle *sub_read_line_mpsub(stream_t *st, subtitle *current) {
663 char line[LINE_LEN+1]; 663 char line[LINE_LEN+1];
664 float a,b; 664 float a,b;
665 int num=0; 665 int num=0;
666 char *p, *q; 666 char *p, *q;
667 667
702 #ifndef USE_SORTSUB 702 #ifndef USE_SORTSUB
703 //we don't need this if we use previous_sub_end 703 //we don't need this if we use previous_sub_end
704 subtitle *previous_aqt_sub = NULL; 704 subtitle *previous_aqt_sub = NULL;
705 #endif 705 #endif
706 706
707 subtitle *sub_read_line_aqt(stream_t *st,subtitle *current) { 707 static subtitle *sub_read_line_aqt(stream_t *st,subtitle *current) {
708 char line[LINE_LEN+1]; 708 char line[LINE_LEN+1];
709 char *next; 709 char *next;
710 int i; 710 int i;
711 711
712 while (1) { 712 while (1) {
759 759
760 #ifndef USE_SORTSUB 760 #ifndef USE_SORTSUB
761 subtitle *previous_subrip09_sub = NULL; 761 subtitle *previous_subrip09_sub = NULL;
762 #endif 762 #endif
763 763
764 subtitle *sub_read_line_subrip09(stream_t *st,subtitle *current) { 764 static subtitle *sub_read_line_subrip09(stream_t *st,subtitle *current) {
765 char line[LINE_LEN+1]; 765 char line[LINE_LEN+1];
766 int a1,a2,a3; 766 int a1,a2,a3;
767 char * next=NULL; 767 char * next=NULL;
768 int i,len; 768 int i,len;
769 769
811 } 811 }
812 812
813 return current; 813 return current;
814 } 814 }
815 815
816 subtitle *sub_read_line_jacosub(stream_t* st, subtitle * current) 816 static subtitle *sub_read_line_jacosub(stream_t* st, subtitle * current)
817 { 817 {
818 char line1[LINE_LEN], line2[LINE_LEN], directive[LINE_LEN], *p, *q; 818 char line1[LINE_LEN], line2[LINE_LEN], directive[LINE_LEN], *p, *q;
819 unsigned a1, a2, a3, a4, b1, b2, b3, b4, comment = 0; 819 unsigned a1, a2, a3, a4, b1, b2, b3, b4, comment = 0;
820 static unsigned jacoTimeres = 30; 820 static unsigned jacoTimeres = 30;
821 static int jacoShift = 0; 821 static int jacoShift = 0;
1002 } //-- while 1002 } //-- while
1003 current->lines++; 1003 current->lines++;
1004 return current; 1004 return current;
1005 } 1005 }
1006 1006
1007 int sub_autodetect (stream_t* st, int *uses_time) { 1007 static int sub_autodetect (stream_t* st, int *uses_time) {
1008 char line[LINE_LEN+1]; 1008 char line[LINE_LEN+1];
1009 int i,j=0; 1009 int i,j=0;
1010 char p; 1010 char p;
1011 1011
1012 while (j < 100) { 1012 while (j < 100) {
1116 } 1116 }
1117 1117
1118 #define ICBUFFSIZE 512 1118 #define ICBUFFSIZE 512
1119 static char icbuffer[ICBUFFSIZE]; 1119 static char icbuffer[ICBUFFSIZE];
1120 1120
1121 subtitle* subcp_recode (subtitle *sub) 1121 static subtitle* subcp_recode (subtitle *sub)
1122 { 1122 {
1123 int l=sub->lines; 1123 int l=sub->lines;
1124 size_t ileft, oleft; 1124 size_t ileft, oleft;
1125 char *op, *ip, *ot; 1125 char *op, *ip, *ot;
1126 1126