sublib-0.9/0000755000175000017500000000000011011375150012132 5ustar meebeymeebeysublib-0.9/config.sub0000755000175000017500000007771210621211747014142 0ustar meebeymeebey#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2006-07-02' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx | dvp \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[24]a | sh[24]a*eb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]a*eb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mipsEE* | ee | ps2) basic_machine=mips64r5900el-scei case $os in -linux*) ;; *) os=-elf ;; esac ;; iop) basic_machine=mipsel-scei os=-irx ;; dvp) basic_machine=dvp-scei os=-elf ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -irx*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: sublib-0.9/missing0000755000175000017500000002557710621211747013560 0ustar meebeymeebey#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2006-05-10.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: sublib-0.9/NEWS0000644000175000017500000002043311011371570012635 0ustar meebeymeebeySubLib ====== 0.9 (10/05/2008) ================ - Added support for the following subtitle formats: * AQ Title * MacSUB * Sofni * SubCreator 1.x * ViPlay Subtitle File - Improved subtitle format auto-detection - Allow to install the library with autotools 0.8 (06/10/2007) ================ - Added support for the following subtitle formats: * Adobe Encore DVD * DKS Subtitle Format * Karaoke Lyrics LRC * Karaoke Lyrics VKT * Panimator * Phoenix Japanimation Society * Power DivX - Different subtitle formats share similar headers, when edited - Allow to import text lines, without timings, from a plain text file 0.7 (28/06/2007) ================ - Added support for subtitle translation * Translation property in each Subtitle * Search methods now search in translation too * Select the type of text content (text or translation) to use when saving * Allow to clear translations and import a translation into existing subtitles - Try every detected encoding instead of only the first one, and use the first encoding that works - Allow to trim subtitle lines when getting them - When replacing blank lines, also apply the replacement if the text is empty - EncodingNotSupportedException is now thrown if an Encoding is not supported by the platform, when opening a file - Fixed some bugs that were visible when doing a backwards search - Updated NCharDet 0.6.1 (12/05/2007) ================== - Added a property to specify the type of newline (Macintosh, Unix or Windows) to be used when saving Subtitles 0.6 (13/04/2007) ================ - File-related state (character coding, path, subtitle format) isn't maintained anymore after parsing - SubtitleProperties now only includes properties that aren't file-related - FileProperties includes all the file-related properties - Refactored the parsing engine, with ParsingProperties being used to store the properties set during parsing - Fixed the codepage attribution for some character codings, with some being removed as no codepages were available - SubtitleSaver now includes all file saving functionality, which was simplified with most overloaded methods being removed - New and Open methods were also simplified - Updated the documentation 0.5 (05/03/2007) ================ - Find a subtitle given a specific time position - Convert from time to frames given the time in seconds 0.4 (08/12/2006) ================ - Added Search functionality: * Find with regular expressions * Find next or previous * Find with specified case sensitivity and wrapping options * Start search on the specified subtitle and text index - Added ReplaceAll functionality - Now updates the timing mode after saving a file with a different timing mode - Moved to the C# 2.0 compiler 0.3 (30/10/2006) ================ - Encoding auto-detection can now fallback to a specified encoding (and possibly try to detect a Unicode BOM) when auto-detection fails - Encoding auto-detection throws UnknownEncodingException when encoding is not detected - Renamed UnknownCharEncodingException to UnknownEncodingException - Added property to get the preferred extension for a SubtitleType - Methods and properties for returning info on the available subtitle types are now static - The Subtitles.AvailableTypes property doesn't sort types from now on, the new AvailableTypesSorted property does sort the types - Added method to return a SubtitleTypeInfo given a SubtitleType - Open files are now guaranteed to be closed when errors occur - Added method to search for an extension in a SubtitleTypeInfo 0.2 (04/10/2006) ================ - Added support for the following subtitle formats: * SubViewer 1.0 * SubViewer 2.0 * MPlayer * MPlayer 2 * MPSub (both time and frame modes) * Sub Station Alpha * Advanced Sub Station Alpha - Auto-adjust timings based on 2 correct times / synchronization points, can be used to correct all subtitles or just a range - Shift the whole set of subtitles or just a range (previously each subtitle could be set individually) - Added support for headers, which are accessed in SubtitleProperties individually for each subtitle format that supports them - Improved the performance of the parsing engine 0.1 (30/08/2006) ================ - Store subtitle-related properties (eg. SubtitleType, TimingMode, Encoding) after reading a file - New methods for Save, Save As, and to know if a file can be saved or requires "saving as" - Heuristics change in subtitle format detection, a smaller part of the text is used and a rigid match can return immediately - Regular expressions are not compiled anymore and were simplified to improve readability - OutputExpression uses the system's newline (\r\n on windows, \n on unix) - Included descriptions for the subtitle types, such as their extensions and their names - Text is trimmed by default when opening subtitles, but not trimmed when using Set with only 1 argument (the text) - Internal code cleanup and refactoring - Added methods to create and insert new subtitles at a specified position, or after/before existing subtitles, basing the new times on the existing subtitles - Current and Original frame rates can only be set internally, so they cannot be changed without using Subtitles.ChangeFrameRate or Subtitles.ChangeOriginalFrameRate - Corrected bug with not reading the last character when parsing input in some occasions - Added support for shifting subtitles' timings - Now compiles with .Net 1.1 - Added support for autotools and MonoDevelop solution files - Written complete documentation version 0.0.5 (27/02/2006) ========================== - Major namespace change, everything is inside the "SubLib" namespace now - Internal file organization change, Domain files are now under Application - Now tries western 1252 encoding if both auto-detection and the default encoding fail - Stop throwing exceptions when times and frames are accessed and invalid (use IsValid to validate) - Possibility to create a new/empty subtitle file - Associate a new subtitle file to a filename or set it unnamed - SubtitleProperties now handles file path and allows operations on it - Subtitle's duration field can now be changed, and not only the end field - Subtitles are now indexed starting at 0, instead of 1 - Enumerations changed, removed the "Unknown" item for consistency - New constructors to Times, Frames, Subtitle, SubtitleText and Subtitles - Code cleanup Bugs fixed - Adding a subtitle to the beginning of the collection inserts in position 1 instead of 0 version 0.0.4 (29/01/2006) ========================== - MicroDVD: now detects style tags anywhere inside subtitles' text - SubRip: fixed bug related to style parsing - Parsing engine optimized - Subtitle regular expressions are case-insensitive by default - Subtitles are now trimmed - Added Get() to SubtitleText, which retrieves subtitles separated by the newline character version 0.0.3 (10/29/2005) ========================== - Architecture restructured, now features a rich domain model which interacts with both the application and persistency layers - Subtitle domain now includes frames and times as objects - Frames and Times automatically update each other when changed - Parsing engine rewrite - Improved parsing engine's efficiency, using a string builder instead of common strings - Added an optional argument to the testing executable, to change the input fps before opening subtitles - Updated the nant build file with targets to make releases - Updated the README file with the most current testing executable usage version 0.0.2 (10/23/2005) ========================== - Added a Post Process mechanism to the parsing engine - Fixed some bugs with reading style tags from SubRip subtitles - Has the possibility of displaying more verbose prints - Properties mechanism sets the way subtitles are opened - New operations: changing the framerate and the input file's framerate - Includes a README file version 0.0.1 (09/24/2005) ========================== - Subtitle format auto detection - Support for MicroDVD and SubRip subtitles - Auto detect the file's character encoding (using the Mozilla libraries) - Generic parsing engine allows to add new subtitle formats using regular expressions - Relaxed rules for parsing subtitles with errors - Lists the bits of text which couldn't be read - Supported operations: reading and writing sublib-0.9/src/0000755000175000017500000000000011011375150012721 5ustar meebeymeebeysublib-0.9/src/Executable/0000755000175000017500000000000011011375151015003 5ustar meebeymeebeysublib-0.9/src/Executable/Executable.cs0000644000175000017500000002502611000453207017415 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2005-2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Collections; using System.Text; using SubLib; public enum CommandType { Unknown, Open, Save, Display, DisplayIncomplete, Stats, ChangeFrameRate, ChangeInputFrameRate, FindWithTime }; public class Command { public CommandType type = CommandType.Unknown; public string obj1 = null; public string obj2 = null; public SubtitleType subType; public Command(CommandType newType, string arg1, string arg2){ type = newType; obj1 = arg1; obj2 = arg2; } public void SetSubType(string type) { switch (type) { case "microdvd": subType = SubtitleType.MicroDVD; break; case "subrip": subType = SubtitleType.SubRip; break; case "advancedsubstationalpha": subType = SubtitleType.AdvancedSubStationAlpha; break; case "mplayer": subType = SubtitleType.MPlayer; break; case "mplayer2": subType = SubtitleType.MPlayer2; break; case "mpsub": subType = SubtitleType.MPSub; break; case "substationalpha": subType = SubtitleType.SubStationAlpha; break; case "subviewer1": subType = SubtitleType.SubViewer1; break; case "subviewer2": subType = SubtitleType.SubViewer2; break; case "aqtitle": subType = SubtitleType.AQTitle; break; case "macsub": subType = SubtitleType.MacSUB; break; case "phoenix": subType = SubtitleType.PhoenixJapanimationSociety; break; case "panimator": subType = SubtitleType.Panimator; break; case "sofni": subType = SubtitleType.Sofni; break; case "subcreator1x": subType = SubtitleType.SubCreator1x; break; case "viplay": subType = SubtitleType.ViPlaySubtitleFile; break; case "dkssubtitleformat": subType = SubtitleType.DKSSubtitleFormat; break; case "karaokelyricslrc": subType = SubtitleType.KaraokeLyricsLRC; break; case "karaokelyricsvkt": subType = SubtitleType.KaraokeLyricsVKT; break; case "adobeencoredvd": subType = SubtitleType.AdobeEncoreDVD; break; default: subType = SubtitleType.Unknown; break; } } } public class Executable { public ArrayList GetCommands(string[] args){ ArrayList commands = new ArrayList(); for(int count = 0 ; count < args.Length ; count++){ switch (args[count]){ case "-open": Command openCommand = new Command (CommandType.Open, args[++count], null); if ((count+1 < args.Length) && !args[count+1].StartsWith("-")) openCommand.obj2 = args[count+1]; commands.Add(openCommand); break; case "-save": Command saveCommand = new Command(CommandType.Save, args[++count], null); saveCommand.SetSubType(args[++count]); commands.Add(saveCommand); break; case "-display": commands.Add(new Command(CommandType.Display, null, null)); break; case "-displayincomplete": commands.Add(new Command(CommandType.DisplayIncomplete, null, null)); break; case "-stats": commands.Add(new Command(CommandType.Stats, null, null)); break; case "-changefps": commands.Add(new Command(CommandType.ChangeFrameRate, args[++count], null)); break; case "-changeinputfps": commands.Add(new Command(CommandType.ChangeInputFrameRate, args[++count], null)); break; case "-findwithtime": commands.Add(new Command(CommandType.FindWithTime, args[++count], null)); break; } } return commands; } public void ShowCommands(ArrayList commands){ Console.WriteLine("Showing " + commands.Count + " commands:"); int count = 1; foreach(Command command in commands){ Console.WriteLine("\t" + count + " - " + command.ToString()); count++; } } public void ExecuteCommands(ArrayList commands){ SubtitleFactory subtitleFactory = new SubtitleFactory(); subtitleFactory.Verbose = true; subtitleFactory.IncludeIncompleteSubtitles = true; Subtitles subtitles = null; IncompleteSubtitleCollection incompleteSubtitles = null; foreach(Command command in commands){ switch(command.type){ case CommandType.Open: Console.WriteLine("[*] Opening subtitles from " + command.obj1); subtitles = subtitleFactory.Open(command.obj1); incompleteSubtitles = subtitleFactory.IncompleteSubtitles; Console.WriteLine(); break; case CommandType.Save: Console.WriteLine("[*] Saving subtitles to " + command.obj1 + " using format " + command.subType); FileProperties fileProperties = new FileProperties(command.obj1, Encoding.UTF8, command.subType, TimingMode.Times); SubtitleSaver saver = new SubtitleSaver(); saver.Save(subtitles, fileProperties, SubtitleTextType.Text); break; case CommandType.Display: Console.WriteLine("[*] Showing subtitles"); Console.WriteLine("-------------------------- SUBTITLES ------------------------"); Console.WriteLine(subtitles.Collection.ToString()); Console.WriteLine("-------------------------- PROPERTIES -----------------------"); Console.WriteLine(subtitles.Properties.ToString()); break; case CommandType.DisplayIncomplete: Console.WriteLine("[*] Showing incomplete subtitles"); Console.WriteLine(incompleteSubtitles.ToString()); break; case CommandType.Stats: Console.WriteLine("[*] Showing statistics"); TimeSpan maxDuration = new TimeSpan(0); TimeSpan minDuration = TimeSpan.FromDays(300); TimeSpan totalDuration = new TimeSpan(0); long maxDurationFrames = 0; long minDurationFrames = Int64.MaxValue; long totalDurationFrames = 0; foreach (Subtitle subtitle in subtitles.Collection) { TimeSpan duration = subtitle.Times.End - subtitle.Times.Start; long durationFrames = (long)(subtitle.Frames.End - subtitle.Frames.Start); if (duration > maxDuration) maxDuration = duration; if (durationFrames > maxDurationFrames) maxDurationFrames = durationFrames; if (duration < minDuration) minDuration = duration; if (durationFrames < minDurationFrames) minDurationFrames = durationFrames; totalDuration += duration; totalDurationFrames += durationFrames; } int numberOfSubtitles = subtitles.Collection.Count; long ticks = totalDuration.Ticks; long averageTicks = ticks / numberOfSubtitles; TimeSpan averageDuration = TimeSpan.FromTicks(averageTicks); long averageDurationFrames = totalDurationFrames / numberOfSubtitles; Console.WriteLine("Number of subtitles: " + numberOfSubtitles); Console.WriteLine("Total duration: " + totalDuration + " (" + totalDurationFrames + ")"); Console.WriteLine("Maximum duration: " + maxDuration + " (" + maxDurationFrames + ")"); Console.WriteLine("Minimum duration: " + minDuration + " (" + minDurationFrames + ")"); Console.WriteLine("Average Duration: " + averageDuration + " (" + averageDurationFrames + ")"); break; case CommandType.ChangeFrameRate: Console.WriteLine("[*] Changing FPS from " + subtitles.Properties.CurrentFrameRate + " to " + command.obj1); float newFrameRate = (float)Convert.ToDouble(command.obj1); subtitles.ChangeFrameRate(newFrameRate); break; case CommandType.ChangeInputFrameRate: Console.WriteLine("[*] Changing input FPS from " + subtitles.Properties.OriginalFrameRate + " to " + command.obj1); float newOriginalFrameRate = (float)Convert.ToDouble(command.obj1); subtitles.ChangeOriginalFrameRate(newOriginalFrameRate); break; case CommandType.FindWithTime: Console.WriteLine("[*] Finding time " + command.obj1 + " in " + subtitles.Collection.Count + " subtitles."); float time = (float)Convert.ToDouble(command.obj1); int foundSubtitle = subtitles.FindWithTime(time); if (foundSubtitle == -1) System.Console.WriteLine("Subtitle not found"); else System.Console.WriteLine("Found subtitle " + foundSubtitle); break; default: Console.WriteLine("[!] Unknown Command. Terminating."); return; } } } private bool UsingWindows() { OperatingSystem os = Environment.OSVersion; string osName = os.ToString(); osName = osName.ToLower(); return (osName.IndexOf("micros") != -1) || (osName.IndexOf("win") != -1); } public void ShowUsage() { string osBit = ""; if (!UsingWindows()) osBit = "mono"; Console.WriteLine("Usage: " + osBit + " SubLib.exe "); Console.WriteLine(); Console.WriteLine("Commands:"); Console.WriteLine("\t -open "); Console.WriteLine("\t -save "); Console.WriteLine("\t\t (supported formats: microdvd, subrip, advancedsubstationalpha, mplayer, mplayer2, mpsub, substationalpha, subviewer1, subviewer2, karaokelyricslrc, karaokelyricsvkt, adobeencoredvd)"); Console.WriteLine("\t -display"); Console.WriteLine("\t -displayincomplete"); Console.WriteLine("\t -stats"); Console.WriteLine("\t -changefps "); Console.WriteLine("\t -findwithtime "); Console.WriteLine(); Console.WriteLine("Examples:"); Console.WriteLine("\t " + osBit + " SubLib.exe -open subtitle.sub -display"); Console.WriteLine("\t " + osBit + " SubLib.exe -open subtitle.sub -save subtitle.srt subrip"); Console.WriteLine("\t " + osBit + " SubLib.exe -open subtitle.srt -stats"); Console.WriteLine("\t " + osBit + " SubLib.exe -open subtitle.sub 25 -changefps 30 -display"); } public static int Main(string[] args) { Executable executable = new Executable(); if (args.Length == 0) { executable.ShowUsage(); return 0; } ArrayList commands = executable.GetCommands(args); executable.ExecuteCommands(commands); return 0; } } sublib-0.9/src/SubLib/0000755000175000017500000000000011011375150014101 5ustar meebeymeebeysublib-0.9/src/SubLib/AssemblyInfo.cs0000644000175000017500000000214611011375141017026 0ustar meebeymeebey/* * This file is part of SubLib, a library for managing movie subtitles. * Copyright (C) 2006-2008 Pedro Castro * * Gnome Subtitles is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Gnome Subtitles is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyVersion("0.9")] [assembly: AssemblyTitle ("a library for managing movie subtitles")] [assembly: AssemblyDescription ("SubLib")] [assembly: AssemblyCopyright ("Copyright (c) 2006-2008 Pedro Castro")] sublib-0.9/src/SubLib/Application/0000755000175000017500000000000011011375150016344 5ustar meebeymeebeysublib-0.9/src/SubLib/Application/Translations.cs0000644000175000017500000000551610640336367021401 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ namespace SubLib { /// Allows to import translation subtitles into existing subtitles. public class Translations { /// Creates a new instance of the class. public Translations () { } /* Public methods */ //TODO have more elaborate heuristics, taking the times into account and reporting errors /// Imports translated subtitles into existing subtitles. /// The subtitles to import the translation to. /// The translated subtitles. public void Import (Subtitles subtitles, Subtitles translation) { AddExtraSubtitles(subtitles, translation); CopyTranslation(subtitles, translation); } /// Removes the entire translation from existing subtitles. /// The subtitles to remove the translation from. public void Clear (Subtitles subtitles) { foreach (Subtitle subtitle in subtitles.Collection) subtitle.ClearTranslation(); } /* Private methods */ /// Adds the number of subtitles that the translation has more than the original subtitles. private void AddExtraSubtitles (Subtitles subtitles, Subtitles translation) { int translationCount = translation.Collection.Count; int subtitlesCount = subtitles.Collection.Count; int extraCount = translationCount - subtitlesCount; if (extraCount <= 0) return; for (int position = subtitlesCount - 1 ; position < translationCount - 1 ; position++) { subtitles.Collection.AddNewAfter(position, subtitles.Properties); } } /// Copies the translation to the subtitles. private void CopyTranslation (Subtitles subtitles, Subtitles translation) { for (int subtitleNumber = 0 ; subtitleNumber < translation.Collection.Count ; subtitleNumber++) { Subtitle translated = translation.Collection[subtitleNumber]; Subtitle original = subtitles.Collection[subtitleNumber]; string translatedText = translated.Text.Get(); original.Translation.Set(translatedText); } } } } sublib-0.9/src/SubLib/Application/SubtitleSearchResults.cs0000644000175000017500000000414510640336367023220 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; namespace SubLib { /// Represents the results of a search operation. public class SubtitleSearchResults { private int subtitle = -1; private SubtitleTextType textType = SubtitleTextType.Text; private int index = -1; private int length = -1; /// Creates a new instance of the class. /// The zero-based number of the subtitle where the text was found. /// The type of text content where the text was found. /// The zero-based position where the text was found, within a subtitle. /// The length of the found text. public SubtitleSearchResults (int subtitle, SubtitleTextType textType, int index, int length) { this.subtitle = subtitle; this.textType = textType; this.index = index; this.length = length; } /* Public properties */ /// The subtitle number. public int Subtitle { get { return subtitle; } } /// The type of the text content. public SubtitleTextType TextType { get { return textType; } } /// The text index. public int Index { get { return index; } } /// The text length. public int Length { get { return length; } } } } sublib-0.9/src/SubLib/Application/IncompleteSubtitle.cs0000644000175000017500000000360210640336367022525 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2005-2006 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; namespace SubLib { /// Represents an incomplete subtitle. /// An incomplete subtitle is characterized by its incomplete text and /// the valid subtitle that precedes it. public class IncompleteSubtitle { private int previous = 0; private string text = String.Empty; /// Initializes a new instance of the class, /// given the index of its preceding valid subtitle and the incomplete text. /// The index of the preceding valid subtitle. /// The subtitle's incomplete text. public IncompleteSubtitle (int previous, string text) { this.previous = previous; this.text = text; } /// The index of the preceding valid subtitle. public int Previous { get { return previous; } set { previous = value; } } /// The incomplete subtitle's text. public string Text { get { return text; } set { text = value; } } public override string ToString(){ return "* After " + previous + ": " + text + "\n"; } } } sublib-0.9/src/SubLib/Application/Subtitle.cs0000644000175000017500000001276310640336367020515 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2005-2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; namespace SubLib { /// Represents a subtitle, including its time settings, text and text style. public class Subtitle { private SubtitleProperties properties = null; private Times times = null; private Frames frames = null; private SubtitleText text = null; private SubtitleText translation = null; private Style style = null; /// Initializes a new instance of the class, given the /// global subtitles' properties and the subtitle's text and style. /// The subtitles' properties. /// The subtitle's text. /// The subtitle's style. public Subtitle (SubtitleProperties properties, SubtitleText text, Style style) { this.properties = properties; this.text = text; this.style = style; times = new Times(this); frames = new Frames(this); } /// Initializes a new instance of the class, given the /// global subtitles' properties and its start and end times. /// The subtitles' properties. /// The subtitle's start time. /// The subtitle's end time. public Subtitle (SubtitleProperties properties, TimeSpan startTime, TimeSpan endTime) : this(properties, new SubtitleText(), new Style()) { times.Start = startTime; times.End = endTime; } /// Initializes a new instance of the class, given the /// global subtitles' properties and its start and end frames. /// The subtitles' properties. /// The subtitle's start frame. /// The subtitle's end frame. public Subtitle (SubtitleProperties properties, int startFrame, int endFrame) : this(properties, new SubtitleText(), new Style()) { frames.Start = startFrame; frames.End = endFrame; } /// Initializes a new instance of the class, given the /// global subtitles' properties. /// The subtitles' properties. public Subtitle (SubtitleProperties properties) : this(properties, new SubtitleText(), new Style()){ } /// The subtitle's text. public SubtitleText Text { get { return text; } set { text = value; } } /// The subtitle's translated text. public SubtitleText Translation { get { if (translation == null) translation = new SubtitleText(); return translation; } } /// The subtitle's text style. public Style Style { get { return style; } set { style = value; } } /// The subtitle's times. public Times Times { get { return times; } } /// The subtitle's frames. public Frames Frames { get { return frames; } } public override string ToString () { return "* " + Times + " (" + Frames + ") " + Style + "\n" + Text.ToString(); } /* Internal properties */ internal SubtitleProperties Properties { set { properties = value; } } /* Internal methods */ internal void UpdateFramesFromTimes (float frameRate) { UpdateStartFrameFromTimes(frameRate); UpdateEndFrameFromTimes(frameRate); } internal void UpdateFramesFromTimes () { UpdateStartFrameFromTimes(); UpdateEndFrameFromTimes(); } internal void UpdateTimesFromFrames (float frameRate) { UpdateStartTimeFromFrames(frameRate); UpdateEndTimeFromFrames(frameRate); } internal void UpdateTimesFromFrames () { UpdateStartTimeFromFrames(); UpdateEndTimeFromFrames(); } internal void UpdateStartFrameFromTimes (float frameRate) { frames.PreciseStart = Synchronization.TimeToFrames(times.PreciseStart, frameRate); } internal void UpdateStartFrameFromTimes () { UpdateStartFrameFromTimes(properties.CurrentFrameRate); } internal void UpdateEndFrameFromTimes (float frameRate) { frames.PreciseEnd = Synchronization.TimeToFrames(times.PreciseEnd, frameRate); } internal void UpdateEndFrameFromTimes () { UpdateEndFrameFromTimes(properties.CurrentFrameRate); } internal void UpdateStartTimeFromFrames (float frameRate) { times.PreciseStart = Synchronization.FramesToTime(frames.PreciseStart, frameRate); } internal void UpdateStartTimeFromFrames () { UpdateStartTimeFromFrames(properties.CurrentFrameRate); } internal void UpdateEndTimeFromFrames (float frameRate) { times.PreciseEnd = Synchronization.FramesToTime(frames.PreciseEnd, frameRate); } internal void UpdateEndTimeFromFrames () { UpdateEndTimeFromFrames(properties.CurrentFrameRate); } internal void ClearTranslation () { translation = null; } } } sublib-0.9/src/SubLib/Application/SubtitleSaver.cs0000644000175000017500000000575310640336367021517 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2005-2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ namespace SubLib { /// Represents the main mechanism for saving . public class SubtitleSaver { private FileProperties fileProperties = null; /* Public properties */ /// The new properties of the file after saving. /// This includes the updated for the subtitles after saving. When saving to /// a subtitle format that supports only time or frame timing modes, this is updated to reflect that. public FileProperties FileProperties { get { return fileProperties; } } /* Public methods */ /// Saves subtitles to the file with the specified properties. /// The subtitles to save. /// The properties of the file to save the subtitles to. Its property is used to /// choose the timing mode for subtitle formats that support both time and frame modes. /// The type of text content to save. /// An updated object can be accessed with after saving. public void Save (Subtitles subtitles, FileProperties properties, SubtitleTextType textType) { SubtitleFormat format = BuiltInSubtitleFormats.GetFormat(properties.SubtitleType); SubtitleOutput output = new SubtitleOutput(format, textType); string text = output.Build(subtitles.Collection, subtitles.Properties, properties); FileInputOutput.WriteFile(properties.Path, text, properties.Encoding); fileProperties = GetUpdatedFileProperties(properties); VerboseConsole.WriteLine("[*] Saved " + textType + " " + properties.Path + " with encoding " + properties.Encoding + " and format " + format.Name); } /* Private methods */ private FileProperties GetUpdatedFileProperties (FileProperties properties) { SubtitleFormat format = BuiltInSubtitleFormats.GetFormat(properties.SubtitleType); TimingMode newTimingMode = (format.Mode == SubtitleMode.Both) ? properties.TimingMode : format.ModeAsTimingMode; return new FileProperties(properties.Path, properties.Encoding, properties.SubtitleType, newTimingMode, properties.NewlineType); } } }sublib-0.9/src/SubLib/Application/SubtitleFactory.cs0000644000175000017500000002116711000453207022023 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2005-2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text; using System.Text.RegularExpressions; namespace SubLib { /// Represents the main mechanism for creating new . /// A is no longer needed after the subtitles have been created. public class SubtitleFactory { private IncompleteSubtitleCollection incompleteSubtitles = null; private FileProperties fileProperties = null; private bool includeIncompleteSubtitles = false; private Encoding encoding = null; //The encoding to be used to open a file private Encoding fallbackEncoding = Encoding.GetEncoding(1252); //The encoding to fall back to when no encoding is detected private SubtitleType subtitleType = SubtitleType.Unknown; /// The incomplete subtitles that were found when opening a file. /// This is only used when is set. public IncompleteSubtitleCollection IncompleteSubtitles { get { return incompleteSubtitles; } } /// The properties of an opened file, after opening. public FileProperties FileProperties { get { return fileProperties; } } /// Whether to enable the library to print messages to the console. /// Messages will be shown along with the main methods of /// and . The default value is false. public bool Verbose { get { return VerboseConsole.Verbose; } set { VerboseConsole.Verbose = value; } } /// Whether to detect and store incomplete subtitles found upon open. /// The default value is false. public bool IncludeIncompleteSubtitles { get { return includeIncompleteSubtitles; } set { includeIncompleteSubtitles = value; } } /// The encoding to be used upon open. /// When set to null, encoding auto-detection is used. The default value is null (use auto-detection). public Encoding Encoding { get { return encoding; } set { encoding = value; } } /// The encoding to fallback to when using encoding auto-detection. /// When using encoding auto-detection, this encoding will be used if no encoding could be auto-detected. /// Defaults to Windows-1252. public Encoding FallbackEncoding { get { return fallbackEncoding; } set { fallbackEncoding = value; } } /// The type of the subtitle being opened. /// When set to , subtitle type auto-detection is used. /// The default value is (auto-detection). public SubtitleType SubtitleType { get { return subtitleType; } set { subtitleType = value; } } /// Creates new empty . /// The newly created subtitles. public Subtitles New () { SubtitleCollection collection = new SubtitleCollection(); SubtitleProperties properties = new SubtitleProperties(); return new Subtitles(collection, properties); } /// Creates by opening the file at the specified path. /// The properties of the opened file are accessible with , after opening. /// The opened subtitles. /// Thrown if a detected encoding is not supported by the platform. /// Thrown if a subtitle format could not be detected. public Subtitles Open (string path){ SubtitleFormat format = null; string text = String.Empty; Encoding fileEncoding = null; SubtitleInput input = new SubtitleInput(fallbackEncoding, subtitleType); if (encoding == null) { text = input.Read(path, out fileEncoding, out format); } else { text = input.Read(path, encoding, out format); fileEncoding = encoding; } if (IsTextEmpty(text)) return EmptySubtitles(path); else return ParsedSubtitles(path, fileEncoding, format, text); } /// Creates by opening the plain text file at the specified path. /// The properties of the opened file are accessible with , after opening. /// The opened lines turned into subtitles. /// Thrown if a detected encoding is not supported by the platform. /// Thrown if a subtitle format could not be detected. public Subtitles OpenPlain (string path, bool withCharacterNames, TimingMode timingMode, string lineSeparator) { string text = String.Empty; Encoding fileEncoding = null; SubtitleInput input = new SubtitleInput(fallbackEncoding, subtitleType); if (encoding == null) { text = input.ReadPlain(path, out fileEncoding); } else { text = input.ReadPlain(path, encoding); fileEncoding = encoding; } if (IsTextEmpty(text)) return EmptySubtitles(path); else return ParsedSubtitlesPlain(path, fileEncoding, text, withCharacterNames, timingMode, lineSeparator); } /* Private members */ private Subtitles ParsedSubtitles (string path, Encoding fileEncoding, SubtitleFormat format, string text) { SubtitleCollection collection = null; SubtitleParser subtitleParser = new SubtitleParser(includeIncompleteSubtitles); ParsingProperties parsingProperties = subtitleParser.Parse(text, format, out collection, out incompleteSubtitles); SubtitleProperties subtitleProperties = new SubtitleProperties(parsingProperties); collection.SetPropertiesForAll(subtitleProperties); Subtitles subtitles = new Subtitles(collection, subtitleProperties); CompleteTimingsAfterParsing(subtitles, parsingProperties); fileProperties = new FileProperties(path, fileEncoding, format.Type , parsingProperties.TimingMode); VerboseConsole.WriteLine("[*] opened " + path + " with encoding " + fileEncoding + " and format " + format.Name); return subtitles; } private Subtitles ParsedSubtitlesPlain (string path, Encoding fileEncoding, string text, bool withCharacterNames, TimingMode timingMode, string lineSeparator) { SubtitleCollection collection = null; PlainTextParser plainParser = new PlainTextParser(withCharacterNames, lineSeparator); ParsingProperties parsingProperties = plainParser.Parse(text, timingMode, fileEncoding, out collection); SubtitleProperties subtitleProperties = new SubtitleProperties(parsingProperties); collection.SetPropertiesForAll(subtitleProperties); Subtitles subtitles = new Subtitles(collection, subtitleProperties); CompleteTimingsAfterParsing(subtitles, parsingProperties); fileProperties = new FileProperties(path, fileEncoding, parsingProperties.TimingMode); VerboseConsole.WriteLine("[*] opened " + path + " with encoding " + fileEncoding); return subtitles; } private Subtitles EmptySubtitles (string path) { Subtitles subtitles = New(); fileProperties = new FileProperties(path, Encoding.UTF8, SubtitleType.Unknown, TimingMode.Times); return subtitles; } private bool IsTextEmpty (string text) { Regex regex = new Regex(@"\s*"); Match match = regex.Match(text); return (match.Length == text.Length); } private void CompleteTimingsAfterParsing(Subtitles subtitles, ParsingProperties parsingProperties){ float originalFrameRate = subtitles.Properties.OriginalFrameRate; subtitles.Properties.SetCurrentFrameRate(originalFrameRate); if (parsingProperties.TimingMode == TimingMode.Times) subtitles.UpdateFramesFromTimes(originalFrameRate); else subtitles.UpdateTimesFromFrames(originalFrameRate); } } } sublib-0.9/src/SubLib/Application/SubtitleCollection.cs0000644000175000017500000001566210640336367022532 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2005-2006 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Collections; namespace SubLib { /// A container that represents all the subtitles. public class SubtitleCollection { private ArrayList subtitles = new ArrayList(); /// The number of subtitles in the collection. public int Count { get { return subtitles.Count; } } /// Returns an enumerator that can iterate through the collection. /// An for the entire . public IEnumerator GetEnumerator () { return subtitles.GetEnumerator(); } public Subtitle this [int index] { get { try { return subtitles[index] as Subtitle; } catch (ArgumentOutOfRangeException) { return null; } } } /// Returns the subtitle at the specified index. /// The zero-based subtitle's index. /// The subtitle at the specified index, or null in case the index is invalid. public Subtitle Get (int index) { if ((index >= 0) && (index < Count)) return (Subtitle)subtitles[index]; else return null; } /// Adds a subtitle to the end of the collection. /// The subtitle to add. public void Add (Subtitle subtitle){ subtitles.Add(subtitle); } /// Adds a subtitle to the collection, inserting it at the specified index. /// The subtitle to add. /// The zero-based index at which the subtitle should be inserted. public void Add (Subtitle subtitle, int index){ subtitles.Insert(index, subtitle); } /// Creates a subtitle based on the subtitle at the specified index and adds it to the /// collection, inserting it right before that index. /// The newly created subtitle's times will be based on the specified subtitle. Its end /// time will be the start time of the existing subtitle minus . /// Its duration will be . Both times will be wrapped to /// zero if they are less than zero. /// The zero-based index before which the subtitle should be inserted. /// The SubtitleProperties of the subtitles. /// True if the subtitle could be added, false otherwise. public bool AddNewBefore (int index, SubtitleProperties subtitleProperties) { Subtitle existing = Get(index); if (existing == null) return false; TimeSpan subtitleEnd = existing.Times.Start - TimeSpan.FromSeconds(SubtitleConstants.MinTimeBetweenSubtitles); if (subtitleEnd < TimeSpan.Zero) subtitleEnd = TimeSpan.FromSeconds(0); TimeSpan subtitleStart = subtitleEnd - TimeSpan.FromSeconds(SubtitleConstants.MaxSingleLineSubtitleDuration); if (subtitleStart < TimeSpan.Zero) subtitleStart = TimeSpan.FromSeconds(0); Subtitle subtitle = new Subtitle(subtitleProperties, subtitleStart, subtitleEnd); Add(subtitle, index); return true; } /// Creates a subtitle based on the subtitle at the specified index and adds it to the /// collection, inserting it right after that index. /// The newly created subtitle's times will be based on the specified subtitle. Its start /// time will be the start time of the existing subtitle plus . /// Its duration will be . /// The zero-based index after which the subtitle should be inserted. /// The SubtitleProperties of the subtitles. /// True if the subtitle could be added, false otherwise. public bool AddNewAfter (int index, SubtitleProperties subtitleProperties) { Subtitle existing = Get(index); if (existing == null) return false; TimeSpan subtitleStart = existing.Times.End + TimeSpan.FromSeconds(SubtitleConstants.MinTimeBetweenSubtitles); TimeSpan subtitleEnd = subtitleStart + TimeSpan.FromSeconds(SubtitleConstants.MaxSingleLineSubtitleDuration); Subtitle subtitle = new Subtitle(subtitleProperties, subtitleStart, subtitleEnd); Add(subtitle, index + 1); return true; } /// Creates a subtitle and adds it to the collection, inserting it at the specified index. /// The newly created subtitle's start time will be zero and its duration will be /// . /// The zero-based index at which the subtitle should be inserted. /// The SubtitleProperties of the subtitles. /// True if the subtitle could be added, false otherwise. public bool AddNewAt (int index, SubtitleProperties subtitleProperties) { if ((index < 0) || (index > Count)) return false; TimeSpan subtitleStart = TimeSpan.FromSeconds(0); TimeSpan subtitleEnd = TimeSpan.FromSeconds(SubtitleConstants.MaxSingleLineSubtitleDuration); Subtitle subtitle = new Subtitle(subtitleProperties, subtitleStart, subtitleEnd); Add(subtitle, index); return true; } /// Checks whether a subtitle with the specified index exists in the collection. /// The zero-based index. /// Whether the index is contained within the collection. public bool Contains (int index) { return (index >= 0) && (index < Count); } /// Removes a subtitle from the collection, given its index. /// The zero-based index of the subtitle to be removed. public void Remove (int index) { subtitles.RemoveAt(index); } public override string ToString(){ string result = "\t* SUBTITLE LIST *\n"; foreach(Subtitle subtitle in subtitles){ result += subtitle.ToString(); } return result; } /* Internal methods */ internal void SetPropertiesForAll (SubtitleProperties properties) { foreach (Subtitle subtitle in subtitles) subtitle.Properties = properties; } } } sublib-0.9/src/SubLib/Application/SubtitleSearchOptions.cs0000644000175000017500000001117010640336367023206 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { /// Represents the options used during a search operation. public class SubtitleSearchOptions { private Regex regex = null; private string lineBreak = String.Empty; private SubtitleTextType textType = SubtitleTextType.Text; private int startSubtitle = 0; private int startIndex = 0; private bool wrap = false; private bool backwards = false; /// Creates a new instance of the class. /// The regular expression to use when searching. It must be created with /// to perform a case-insensitive search. /// The type of text content the search is started at. /// The line break to use between multiple lines of text in each subtitle. /// The zero-based number of the subtitle to start the search at. /// The zero-based position within the startSubtitle to start the search at. /// Whether to continue the search from the beginning when it reaches the end of the subtitles. /// Whether to search backwards. Note that regex must be constructed with the /// option for backwards search to work. public SubtitleSearchOptions (Regex regex, SubtitleTextType textType, string lineBreak, int startSubtitle, int startIndex, bool wrap, bool backwards) { this.regex = regex; this.textType = textType; this.lineBreak = lineBreak; this.startSubtitle = startSubtitle; this.startIndex = startIndex; this.wrap = wrap; this.backwards = backwards; } /// Creates a new instance of the class. /// The regular expression to use when searching. It must be created with /// to perform a case-insensitive search. /// The type of text content the search is started at. /// The zero-based number of the subtitle to start the search at. /// The zero-based position within the startSubtitle to start the search at. /// Whether to continue the search from the beginning when it reaches the end of the subtitles. /// Whether to search backwards. Note that regex must be constructed with the /// option for backwards search to work. /// The newline character (\n) is used as lineBreak. public SubtitleSearchOptions (Regex regex, SubtitleTextType textType, int startSubtitle, int startIndex, bool wrap, bool backwards) : this(regex, textType, "\n", startSubtitle, startIndex, wrap, backwards) { } /* Public properties */ /// The regular expression. public Regex Regex { get { return regex; } } /// The linebreak used to use between multiple lines of text. public string LineBreak { get { return lineBreak; } } /// The type of text content to start the search with. public SubtitleTextType TextType { get { return textType; } } /// The subtitle to start the search with. public int StartSubtitle { get { return startSubtitle; } } /// The index of the text to start the search with. public int StartIndex { get { return startIndex; } } /// Whether to continue the search from the beginning when it reaches the end of the subtitles. public bool Wrap { get { return wrap; } } /// Whether to search backwards. public bool Backwards { get { return backwards; } } } } sublib-0.9/src/SubLib/Application/SubtitleHeaders.cs0000644000175000017500000003502110662177773022011 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2006-2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.IO; using System.Text; namespace SubLib { /// Represents the headers of the supported subtitle formats. public class SubtitleHeaders { private SubtitleHeadersSubViewer1 subViewer1 = null; private SubtitleHeadersSubViewer2 subViewer2 = null; private SubtitleHeadersMPSub mPSub = null; private SubtitleHeadersSubStationAlphaASS subStationAlphaASS = null; private SubtitleHeadersKaraokeLyricsLRC karaokeLyricsLRC = null; private SubtitleHeadersKaraokeLyricsVKT karaokeLyricsVKT = null; /* Headers are initialized only if and when they're accessed */ /// The headers for the SubViewer 1.0 subtitle type. public SubtitleHeadersSubViewer1 SubViewer1 { get { if (subViewer1 == null) subViewer1 = new SubtitleHeadersSubViewer1(); return subViewer1; } } /// The headers for the SubViewer 2.0 subtitle type. public SubtitleHeadersSubViewer2 SubViewer2 { get { if (subViewer2 == null) subViewer2 = new SubtitleHeadersSubViewer2(); return subViewer2; } } /// The headers for the MPSub subtitle type. public SubtitleHeadersMPSub MPSub { get { if (mPSub == null) mPSub = new SubtitleHeadersMPSub(); return mPSub; } } /// The headers for the Sub Station Alpha and Advanced Sub Station Alpha subtitle types. public SubtitleHeadersSubStationAlphaASS SubStationAlphaASS { get { if (subStationAlphaASS == null) subStationAlphaASS = new SubtitleHeadersSubStationAlphaASS(); return subStationAlphaASS; } } /// The headers for the Karaoke Lyrics LRC subtitle type. public SubtitleHeadersKaraokeLyricsLRC KaraokeLyricsLRC { get { if (karaokeLyricsLRC == null) karaokeLyricsLRC = new SubtitleHeadersKaraokeLyricsLRC(); return karaokeLyricsLRC; } } /// The headers for the Karaoke Lyrics VKT subtitle type. public SubtitleHeadersKaraokeLyricsVKT KaraokeLyricsVKT { get { if (karaokeLyricsVKT == null) karaokeLyricsVKT = new SubtitleHeadersKaraokeLyricsVKT(); return karaokeLyricsVKT; } } public override string ToString() { return "\t**** SUBTITLE HEADERS ****\t\n" + (subViewer1 != null ? subViewer1.ToString() : "! SubViewer 1.0 not used") + "\n" + (subViewer2 != null ? subViewer2.ToString() : "! SubViewer 2.0 not used") + "\n" + (mPSub != null ? mPSub.ToString() : "! MPSub not used") + "\n" + (subStationAlphaASS != null ? subStationAlphaASS.ToString() : "! SubStationAlpha and ASS not used") + "\n" + (karaokeLyricsLRC != null ? karaokeLyricsLRC.ToString() : "! Karaoke Lyrics LRC not used") + "\n" + (karaokeLyricsVKT != null ? karaokeLyricsVKT.ToString() : "! Karaoke Lyrics VKT not used"); } } /// Represents the headers of the SubViewer 1.0 subtitle format. public class SubtitleHeadersSubViewer1 { private string title = String.Empty; private string author = String.Empty; private string source = String.Empty; private string program = String.Empty; private string filePath = String.Empty; private int delay = 0; private int cdTrack = 0; /// The movie's title. public string Title { get { return title; } set { title = value; } } /// The subtitles' author. public string Author { get { return author; } set { author = value; } } /// The subtitles' source. public string Source { get { return source; } set { source = value; } } /// The name of the subtitles' program. public string Program { get { return program; } set { program = value; } } /// The subtitles' file path. public string FilePath { get { return filePath; } set { filePath = value; } } /// The delay of the subtitles. public int Delay { get { return delay; } set { delay = value; } } /// The delay of the subtitles as text. public string DelayAsText { get { return delay.ToString(); } set { try { delay = Convert.ToInt32(value); } catch (Exception) { } } } /// The CD track of the subtitles. public int CDTrack { get { return cdTrack; } set { cdTrack = value; } } /// The CD track of the subtitles as text. public string CDTrackAsText { get { return cdTrack.ToString(); } set { try { cdTrack = Convert.ToInt32(value); } catch (Exception) { } } } public override string ToString() { return "\t** SubViewer 1.0 Headers **\n" + "Title: " + title + ", Author: " + author + ", Source: " + source + ", Program: " + program + ", FilePath: " + filePath + ", Delay: " + delay + ", CD Track: " + cdTrack; } } /// Represents the headers of the SubViewer 2.0 subtitle format. public class SubtitleHeadersSubViewer2 : SubtitleHeadersSubViewer1 { private string comment = String.Empty; private string fontColor = "&HFFFFFF"; private string fontStyle = "bd"; private int fontSize = 24; private string fontName = "Tahoma"; /// A comment on the subtitles. public string Comment { get { return comment; } set { comment = value; } } /// The subtitles' font color. public string FontColor { get { return fontColor; } set { fontColor = value; } } /// The subtitles' font style. public string FontStyle { get { return fontStyle; } set { fontStyle = value; } } /// The subtitles' font size. public int FontSize { get { return fontSize; } set { fontSize = value; } } /// The subtitles' font size as text. public string FontSizeAsText { get { return fontSize.ToString(); } set { try { fontSize = Convert.ToInt32(value); } catch (Exception) { } } } /// The subtitles' font name. public string FontName { get { return fontName; } set { fontName = value; } } public override string ToString() { return "\t** SubViewer 2.0 Headers **\n" + "Base " + base.ToString() + "\n" + "FontColor: " + fontColor + ", FontStyle: " + fontStyle + ", FontSize: " + fontSize + ", FontName: " + fontName; } } /// Represents the headers of the MPSub subtitle format. public class SubtitleHeadersMPSub { private string title = String.Empty; private string file = String.Empty; private string author = String.Empty; private string mediaType = "VIDEO"; private string note = String.Empty; /// The movie's title. public string Title { get { return title; } set { title = value; } } /// The File properties, in the format 'size,md5'. public string File { get { return file; } set { file = value; } } /// The subtitles' author. public string Author { get { return author; } set { author = value; } } /// The Media Type of the subtitles, which can be 'VIDEO' or 'AUDIO'. /// This property is only set if the value is 'VIDEO' or 'AUDIO'. It's case insensitive. public string MediaType { get { return mediaType; } set { string type = value.ToUpper(); if (type.Equals("VIDEO") || type.Equals("AUDIO")) mediaType = type; } } /// A note on the subtitles. public string Note { get { return note; } set { note = value; } } public override string ToString() { return "\t** MPSub Headers **\n" + "Title: " + title + ", File: " + file + ", Author: " + author + ", MediaType: " + mediaType + ", Note: " + note; } } /// Represents the headers of the Sub Station Alpha and Advanced Sub Station Alpha subtitle formats. public class SubtitleHeadersSubStationAlphaASS { private string title = String.Empty; private string originalScript = ""; private string originalTranslation = String.Empty; private string originalEditing = String.Empty; private string originalTiming = String.Empty; private string originalScriptChecking = String.Empty; private string scriptUpdatedBy = String.Empty; private string collisions = String.Empty; private int playResX = 0; private int playResY = 0; private int playDepth = 0; private string timer = String.Empty; /// The movie's title. public string Title { get { return title; } set { title = value; } } /// The Original Script of the subtitles. public string OriginalScript { get { return originalScript; } set { originalScript = value; } } /// The Original Translation of the subtitles. public string OriginalTranslation { get { return originalTranslation; } set { originalTranslation = value; } } /// The Original Editing of the subtitles. public string OriginalEditing { get { return originalEditing; } set { originalEditing = value; } } /// The Original Timing of the subtitles. public string OriginalTiming { get { return originalTiming; } set { originalTiming = value; } } /// The Original Script Checking of the subtitles. public string OriginalScriptChecking { get { return originalScriptChecking; } set { originalScriptChecking = value; } } /// The Script Updated By of the subtitles. public string ScriptUpdatedBy { get { return scriptUpdatedBy; } set { scriptUpdatedBy = value; } } /// The Collisions of the subtitles. public string Collisions { get { return collisions; } set { collisions = value; } } /// The PlayResX of the subtitles. public int PlayResX { get { return playResX; } set { playResX = value; } } /// The PlayResX of the subtitles as text. public string PlayResXAsText { get { return playResX.ToString(); } set { try { playResX = Convert.ToInt32(value); } catch (Exception) { } } } /// The PlayResY of the subtitles. public int PlayResY { get { return playResY; } set { playResY = value; } } /// The PlayResY of the subtitles as text. public string PlayResYAsText { get { return playResY.ToString(); } set { try { playResY = Convert.ToInt32(value); } catch (Exception) { } } } /// The PlayDepth of the subtitles. public int PlayDepth { get { return playDepth; } set { playDepth = value; } } /// The PlayResY of the subtitles as text. public string PlayDepthAsText { get { return playDepth.ToString(); } set { try { playDepth = Convert.ToInt32(value); } catch (Exception) { } } } /// The Timer of the subtitles. public string Timer { get { return timer; } set { timer = value; } } public override string ToString() { return "\t** SubStationAlpha and Advanced SubStationAlpha Headers **\n" + "Title: " + title + ", Original Script: " + originalScript + ", Original Translation: " + originalTranslation + ", Original Editing: " + originalEditing + ", Original Timing: " + originalTiming + ", Original Script Checking: " + originalScriptChecking + ", Script Updated By: " + scriptUpdatedBy + ", Collisions: " + collisions + ", PlayResX: " + playResX + ", PlayResY: " + playResY + ", PlayDepth: " + playDepth + ", Timer: " + timer; } } /// Represents the headers of the Karaoke Lyrics LRC subtitle format. public class SubtitleHeadersKaraokeLyricsLRC { private string title = String.Empty; private string author = String.Empty; private string artist = String.Empty; private string album = String.Empty; private string maker = String.Empty; private string version = String.Empty; private string program = String.Empty; /// The movie's title. public string Title { get { return title; } set { title = value; } } /// The subtitles' author. public string Author { get { return author; } set { author = value; } } /// The subtitles' artist. public string Artist { get { return artist; } set { artist = value; } } /// The subtitles' album. public string Album { get { return album; } set { album = value; } } /// The subtitles' file maker. public string Maker { get { return maker; } set { maker = value; } } /// The version of the subtitles. public string Version { get { return version; } set { version = value; } } /// The name of the subtitles' program. public string Program { get { return program; } set { program = value; } } public override string ToString() { return "\t** Karaoke Lyrics LRC Headers **\n" + "Title: " + title + ", Author: " + author + ", Artist: " + artist + ", Maker: " + maker + ", Version: " + version + ", Program: " + program; } } /// Represents the headers of the Karaoke Lyrics VKT subtitle format. public class SubtitleHeadersKaraokeLyricsVKT { private string author = String.Empty; private string frameRate = String.Empty; private string source = String.Empty; private string date = DateTime.Today.ToString("yyyy-MM-dd"); /// The subtitles' author. public string Author { get { return author; } set { author = value; } } /// The movie's frame rate. public string FrameRate { get { return frameRate; } set { frameRate = value; } } /// The video file path. public string Source { get { return source; } set { source = value; } } /// The subtitles' date. public string Date { get { return date; } set { date = value; } } public override string ToString() { return "\t** Karaoke Lyrics VKT Headers **\n" + "Author: " + author + ", FrameRate: " + frameRate + ", Source: " + source + ", Date: " + date; } } } sublib-0.9/src/SubLib/Application/SubtitleText.cs0000644000175000017500000001567710673734342021372 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2005-2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Collections; using System.Text; using System.Text.RegularExpressions; namespace SubLib { //TODO this can be optimized /// Represents the text of a subtitle. public class SubtitleText { private ArrayList lines = new ArrayList(); /// Initializes a new instance of the class /// with the specified text, line break and trimming option. /// The subtitle text. /// The text substring that marks the end of lines. /// Whether to trim every text line. public SubtitleText (string text, string lineBreak, bool toTrimLines) { Set(text, lineBreak, toTrimLines); } /// Initializes a new instance of the class /// with the specified text. /// Newline (\n) is used as the line break. The text lines are not trimmed. /// The subtitle text. public SubtitleText (string text) : this(text, "\n", false) { } /// Initializes a new instance of the class, with empty text. public SubtitleText() { } /// Whether there is no text. public bool IsEmpty { get { return (lines.Count == 0); } } /// Gets the specified text line. /// The zero-based line number index. /// The specified text line. public string GetLine (int index) { if ((index >= 0) && (index < lines.Count)) return lines[index] as string; else return String.Empty; } /// Gets the text lines merged with the specified line break. /// The line break used to merge the text. /// The subtitle text. public string Get (string lineBreak) { string text = String.Empty; IEnumerator textLines = lines.GetEnumerator(); if (textLines.MoveNext()){ text = (textLines.Current as string); while (textLines.MoveNext()) text += lineBreak + (textLines.Current as string); } return text; } /// Gets the subtitle text. /// The text lines end with the new line (\n) char. /// The subtitle text. public string Get () { return Get("\n"); } /// Gets the text lines merged with the specified line break and replaces those that are empty. /// The text to replace empty lines with. /// The line break used to merge the text. /// A subtitle line is considered empty if it has no characters. /// The subtitle text, after replacement. public string GetReplaceEmptyLines (string replacement, string lineBreak) { if (this.IsEmpty) return replacement; string text = String.Empty; IEnumerator textLines = lines.GetEnumerator(); if (textLines.MoveNext()){ string line = (textLines.Current as string); text = ReplaceLineIfEmpty(line, replacement); while (textLines.MoveNext()) { line = (textLines.Current as string); text += lineBreak + ReplaceLineIfEmpty(line, replacement); } } return text; } /// Gets the text lines and replaces those that are empty. /// The text to replace empty lines with. /// The text lines are merged by the newline (\n) char. A subtitle line is considered empty /// if it has no characters. /// The subtitle text, after replacement. public string GetReplaceEmptyLines (string replacement) { return GetReplaceEmptyLines(replacement, "\n"); } /// Gets and trims the text lines merged with the specified line break. /// The line break used to merge the text. /// A subtitle line is considered blank if it has only white spaces. /// The subtitle text, after trimming. public string GetTrimLines (string lineBreak) { string text = String.Empty; IEnumerator textLines = lines.GetEnumerator(); if (textLines.MoveNext()){ string line = (textLines.Current as string); line = line.Trim(); if (line != String.Empty) text += line; while (textLines.MoveNext()) { line = (textLines.Current as string); line = line.Trim(); if (line != String.Empty) text += lineBreak + line; } } return text; } /// Gets and trims the text lines. /// The text lines are merged by the newline (\n) char. A subtitle line is /// considered blank ifit has only white spaces. /// The subtitle text, after trimming. public string GetTrimLines () { return GetTrimLines("\n"); } /// Sets the subtitle text using the specified line break and trimming option. /// The subtitle text. /// The text substring used to split the text in lines. /// Whether to trim every text line. public void Set (string text, string lineBreak, bool toTrimLines) { if (toTrimLines) text = text.Trim(); string escapedLineBreak = Regex.Escape(lineBreak); string spaceDelimiter = (toTrimLines ? @"\s*" : String.Empty); string regexPattern = spaceDelimiter + @escapedLineBreak + spaceDelimiter; string[] textLines = Regex.Split(text, regexPattern); lines.Clear(); foreach (string textLine in textLines) lines.Add(textLine); } /// Sets the subtitle text. /// Newline (\n) is used as the line break. The text lines are not trimmed. /// The subtitle text. public void Set (string text) { Set(text, "\n", false); } public override string ToString() { string result = String.Empty; int lineNumber = 1; foreach (string line in lines){ result += "\t" + lineNumber + ". " + line + "\n"; lineNumber++; } return result; } /* Private Methods */ private string ReplaceLineIfEmpty (string textLine, string replacement) { if (textLine == String.Empty) return replacement; else return textLine; } } } sublib-0.9/src/SubLib/Application/Subtitles.cs0000644000175000017500000006050610640336367020676 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2005-2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Collections; using System.Globalization; using System.Text; using System.Text.RegularExpressions; namespace SubLib { /// Represents the root class of all the subtitles. /// A class is created using the . public class Subtitles { private SubtitleCollection collection = null; private SubtitleProperties properties = null; /// A collection which contains the subtitles. public SubtitleCollection Collection { get { return collection; } set { collection = value; } } /// The properties of the subtitles. public SubtitleProperties Properties { get { return properties; } set { properties = value; } } /// Information about the available subtitle types. public static SubtitleTypeInfo[] AvailableTypes { get { SubtitleFormat[] formats = BuiltInSubtitleFormats.SubtitleFormats; SubtitleTypeInfo[] types = new SubtitleTypeInfo[formats.Length]; for (int count = 0 ; count < formats.Length ; count++) types[count] = new SubtitleTypeInfo(formats[count]); return types; } } /// Information about the available subtitle types, sorted by their names. public static SubtitleTypeInfo[] AvailableTypesSorted { get { SubtitleTypeInfo[] types = AvailableTypes; Array.Sort(types); return types; } } /// Get information about an available subtitle type. /// The subtitle type. /// The information about the specified subtitle type. public static SubtitleTypeInfo GetAvailableType (SubtitleType type) { SubtitleFormat format = BuiltInSubtitleFormats.GetFormat(type); return new SubtitleTypeInfo(format); } /// Changes the current frame rate of the subtitles. /// The new frame rate to be used. /// This changes the frame rate currently being used with the subtitles, which is sometimes /// refered to as the output frame rate. public void ChangeFrameRate (float frameRate) { float currentFrameRate = properties.CurrentFrameRate; if (currentFrameRate != frameRate) { properties.SetCurrentFrameRate(frameRate); UpdateFramesFromTimes(frameRate); } } /// Updates the subtitles' frames using the specified frame rate as the one they had when they were opened. /// The original subtitles' frame rate. /// This results on having the subtitles with the frames they would have if they had been opened with this frame rate. /// The original frame rate is sometimes refered to as the input frame rate. public void ChangeOriginalFrameRate (float frameRate) { float originalFrameRate = properties.OriginalFrameRate; float currentFrameRate = properties.CurrentFrameRate; if (originalFrameRate != frameRate) { float conversionFrameRate = currentFrameRate * originalFrameRate / frameRate; UpdateFramesFromTimes(conversionFrameRate); UpdateTimesFromFrames(currentFrameRate); properties.SetOriginalFrameRate(frameRate); } } /// Shifts the subtitles a specified amount of time. /// The time to use, which can be positive or negative. public void ShiftTimings (TimeSpan time) { foreach (Subtitle subtitle in collection) subtitle.Times.Shift(time); } /// Shifts a range of subtitles a specified amount of time. /// The time to use, which can be positive or negative. /// The subtitle index the range begins with. /// The subtitle index the range ends with. public void ShiftTimings (TimeSpan time, int startIndex, int endIndex) { if (!AreShiftTimingsArgsValid(startIndex, endIndex)) return; for (int index = startIndex ; index <= endIndex ; index++) { Subtitle subtitle = collection.Get(index); subtitle.Times.Shift(time); } } /// Shifts the subtitles a specified amount of frames. /// The frames to use, which can be positive or negative. public void ShiftTimings (int frames) { foreach (Subtitle subtitle in collection) subtitle.Frames.Shift(frames); } /// Shifts a range of subtitles a specified amount of frames. /// The frames to use, which can be positive or negative. /// The subtitle index the range begins with. /// The subtitle index the range ends with. public void ShiftTimings (int frames, int startIndex, int endIndex) { if (!AreShiftTimingsArgsValid(startIndex, endIndex)) return; for (int index = startIndex ; index <= endIndex ; index++) { Subtitle subtitle = collection.Get(index); subtitle.Frames.Shift(frames); } } /// Auto adjusts the subtitles given the correct times for the first and last subtitle. /// The subtitles are first shifted to the first subtitle's correct time, and then proportionally /// adjusted using the last subtitle's correct time. /// The correct start time for the first subtitle. /// The correct start time for the last subtitle. /// Whether the subtitles could be adjusted. public bool AdjustTimings (TimeSpan startTime, TimeSpan endTime) { int startIndex = 0; int endIndex = collection.Count - 1; return AdjustTimings(startIndex, startTime, endIndex, endTime); } /// Auto adjusts a range of subtitles given their first and last correct times. /// The subtitles are first shifted to the first subtitle's correct time, and then proportionally /// adjusted using the last subtitle's correct time. /// The subtitle index to start the adjustment with. /// The correct start time for the first subtitle. /// The subtitle index to end the adjustment with. /// The correct start time for the last subtitle. /// Whether the subtitles could be adjusted. public bool AdjustTimings (int startIndex, TimeSpan startTime, int endIndex, TimeSpan endTime) { if (!AreAdjustTimingsArgsValid(startIndex, startTime, endIndex, endTime)) return false; /* Shift subtitles to the start point */ Subtitle startSubtitle = collection.Get(startIndex); TimeSpan shift = startTime - startSubtitle.Times.PreciseStart; if (shift != TimeSpan.Zero) ShiftTimings(shift, startIndex, endIndex); /* Auto adjust timings with proportion */ Subtitle endSubtitle = collection.Get(endIndex); double factor = (endTime - startTime).TotalMilliseconds / (endSubtitle.Times.PreciseStart - startTime).TotalMilliseconds; for (int index = startIndex ; index <= endIndex ; index++) { Subtitle subtitle = collection.Get(index); subtitle.Times.Scale(factor, startTime); } return true; } /// Auto adjusts the subtitles given the correct frames for the first and last subtitle. /// The subtitles are first shifted to the first subtitle's correct frame, and then proportionally /// adjusted using the last subtitle's correct frame. /// The correct start frame for the first subtitle. /// The correct start frame for the last subtitle. /// Whether the subtitles could be adjusted. public bool AdjustTimings (int startFrame, int endFrame) { int startIndex = 0; int endIndex = collection.Count - 1; return AdjustTimings(startIndex, startFrame, endIndex, endFrame); } /// Auto adjusts a range of subtitles given their first and last correct frames. /// The subtitles are first shifted to the first subtitle's correct frame, and then proportionally /// adjusted using the last subtitle's correct frame. /// The subtitle index to start the adjustment with. /// The correct start frame for the first subtitle. /// The subtitle index to end the adjustment with. /// The correct start frame for the last subtitle. /// Whether the subtitles could be adjusted. public bool AdjustTimings (int startIndex, int startFrame, int endIndex, int endFrame) { if (!AreAdjustTimingsArgsValid(startIndex, startFrame, endIndex, endFrame)) return false; /* Shift subtitles to the start point */ Subtitle startSubtitle = collection.Get(startIndex); int shift = (int)(startFrame - startSubtitle.Frames.PreciseStart); if (shift != 0) ShiftTimings(shift, startIndex, endIndex); /* Auto adjust timings with proportion */ Subtitle endSubtitle = collection.Get(endIndex); double factor = (endFrame - startFrame) / (endSubtitle.Frames.PreciseStart - startFrame); for (int index = startIndex ; index <= endIndex ; index++) { Subtitle subtitle = collection.Get(index); subtitle.Frames.Scale(factor, startFrame); } return true; } /// Searches for text using the specified search options. /// The search options. /// The search results, or null in case no results were found. public SubtitleSearchResults Find (SubtitleSearchOptions options) { System.Console.WriteLine("Finding " + options.Regex.ToString() + " from subtitle " + options.StartSubtitle + ", index " + options.StartIndex + ", type " + options.TextType); if (options.Backwards) return FindBackward(options); else return FindForward(options); } /// Replaces all occurences of some text with the specified replacement. /// A regular expression used to find the text to be replaced. /// The text that will be used as a replacement. /// The numbers of the subtitles that were replaced. /// The texts of the subtitles that were replaced, before replacement was done. /// The newline (\n) char is used as the line break. /// The number of replaced subtitles. public int ReplaceAll (Regex regex, string replacement, out int[] replacedSubtitles, out string[] oldTexts) { return ReplaceAll(regex, replacement, "\n", out replacedSubtitles, out oldTexts); } /// Replaces all occurences of some text with the specified replacement. /// A regular expression used to find the text to be replaced. /// The text that will be used as a replacement. /// The line break to use between multiple lines of text in each subtitle. /// The numbers of the subtitles that were replaced. /// The texts of the subtitles that were replaced, before replacement was done. /// The newline (\n) char is used as the line break. /// The number of replaced subtitles. public int ReplaceAll (Regex regex, string replacement, string lineBreak, out int[] replacedSubtitles, out string[] oldTexts) { ArrayList subtitles = new ArrayList(); ArrayList texts = new ArrayList(); MatchEvaluationCounter counter = new MatchEvaluationCounter(replacement); int subtitleNumber = 0; foreach (Subtitle subtitle in collection) { string oldText = subtitle.Text.Get(lineBreak); counter.EvaluationOccured = false; string newText = regex.Replace(oldText, counter.Evaluator); if (counter.EvaluationOccured) { subtitles.Add(subtitleNumber); texts.Add(oldText); subtitle.Text.Set(newText, lineBreak, false); counter.EvaluationOccured = false; } subtitleNumber++; } replacedSubtitles = (int[])subtitles.ToArray(typeof(int)); oldTexts = (string[])texts.ToArray(typeof(string)); return counter.Count; } /// Finds the subtitle that contains the specified time position. /// The time position, in seconds. /// The found subtitle number, or -1 if no subtitle was found. public int FindWithTime (float time) { if (collection.Count == 0) return -1; for (int subtitleNumber = 0 ; subtitleNumber < collection.Count ; subtitleNumber++) { Subtitle subtitle = collection[subtitleNumber]; double start = subtitle.Times.Start.TotalSeconds; if (time < start) continue; double end = subtitle.Times.End.TotalSeconds; if (time <= end) return subtitleNumber; } return -1; // No subtitles were found } public override string ToString(){ return Collection.ToString() + "\n-------------------------------------------\n" + Properties.ToString(); } /* Internal members */ /// Initializes a new instance of the class. /// A collection of subtitles. /// The subtitles' properties. internal protected Subtitles (SubtitleCollection collection, SubtitleProperties properties) { this.collection = collection; this.properties = properties; } internal void UpdateFramesFromTimes (float frameRate) { foreach (Subtitle subtitle in collection) { subtitle.UpdateFramesFromTimes(frameRate); } } internal void UpdateTimesFromFrames (float frameRate) { foreach (Subtitle subtitle in collection) { subtitle.UpdateTimesFromFrames(frameRate); } } /* Private members */ private bool AreAdjustTimingsArgsValid (int startIndex, TimeSpan startTime, int endIndex, TimeSpan endTime) { if (!AreAdjustTimingsIndexesValid(startIndex, endIndex)) return false; else if (!(startTime < endTime)) return false; else return true; } private bool AreAdjustTimingsArgsValid (int startIndex, int startTime, int endIndex, int endTime) { if (!AreAdjustTimingsIndexesValid(startIndex, endIndex)) return false; else if (!(startTime < endTime)) return false; else return true; } private bool AreAdjustTimingsIndexesValid (int startIndex, int endIndex) { int subtitleCount = collection.Count; if (subtitleCount < 2) return false; else if (!(startIndex < endIndex)) return false; else if ((startIndex < 0) || (startIndex >= (subtitleCount - 1))) return false; else if (endIndex >= subtitleCount) return false; else return true; } private bool AreShiftTimingsArgsValid (int startIndex, int endIndex) { int subtitleCount = collection.Count; if (subtitleCount == 0) return false; else if (!(startIndex <= endIndex)) return false; else if ((startIndex < 0) || (startIndex >= subtitleCount)) return false; else if (endIndex >= subtitleCount) return false; else return true; } /// Searches forward for text using the specified search options. /// The search options. /// The search results, or null in case no results were found. private SubtitleSearchResults FindForward (SubtitleSearchOptions options) { if (collection.Count == 0) return null; /* Search the startSubtitle subtitle starting at the startIndex */ SubtitleSearchResults results = FindInSubtitleFromIndex(options.StartSubtitle, options.LineBreak, options.Regex, options.StartIndex, options.TextType, options.Backwards); if (results != null) return results; /* Iterate through the rest of the collection */ for (int subtitleNumber = options.StartSubtitle + 1 ; subtitleNumber < collection.Count ; subtitleNumber++) { results = FindInSubtitle(subtitleNumber, options.LineBreak, options.Regex, options.Backwards); if (results != null) return results; } if (options.Wrap) { /* Iterate from the beginning back to the subtitle */ for (int subtitleNumber = 0 ; subtitleNumber < options.StartSubtitle ; subtitleNumber++) { results = FindInSubtitle(subtitleNumber, options.LineBreak, options.Regex, options.Backwards); if (results != null) return results; } /* Search the startSubtitle ending at the startIndex */ results = FindInSubtitleTillIndex(options.StartSubtitle, options.LineBreak, options.Regex, options.StartIndex, options.TextType, options.Backwards); if (results != null) return results; } /* Text not found */ return null; } /// Searches backward for text using the specified search options. /// The search options. /// The search results, or null in case no results were found. private SubtitleSearchResults FindBackward (SubtitleSearchOptions options) { if (collection.Count == 0) return null; /* Search the subtitle starting at the startIndex */ SubtitleSearchResults results = FindInSubtitleFromIndex(options.StartSubtitle, options.LineBreak, options.Regex, options.StartIndex, options.TextType, options.Backwards); if (results != null) return results; /* Iterate through the start of the collection */ for (int subtitleNumber = options.StartSubtitle - 1 ; subtitleNumber > 0 ; subtitleNumber--) { results = FindInSubtitle(subtitleNumber, options.LineBreak, options.Regex, options.Backwards); if (results != null) return results; } if (options.Wrap) { /* Iterate from the end back to the subtitle */ for (int subtitleNumber = collection.Count - 1 ; subtitleNumber > options.StartSubtitle ; subtitleNumber--) { results = FindInSubtitle(subtitleNumber, options.LineBreak, options.Regex, options.Backwards); if (results != null) return results; } /* Search the subtitle ending at the startIndex */ results = FindInSubtitleTillIndex(options.StartSubtitle, options.LineBreak, options.Regex, options.StartIndex, options.TextType, options.Backwards); if (results != null) return results; } /* Text not found */ return null; } /// The , or null if the text was not found. private SubtitleSearchResults FindInSubtitle (int subtitleNumber, string lineBreak, Regex regex, bool backwards) { if (backwards) { /* Find first in the translation */ SubtitleSearchResults results = FindInTextContent(subtitleNumber, lineBreak, regex, SubtitleTextType.Translation); if (results != null) return results; /* Not found in the translation, finding in the text */ return FindInTextContent(subtitleNumber, lineBreak, regex, SubtitleTextType.Text); } else { /* Find first in the text */ SubtitleSearchResults results = FindInTextContent(subtitleNumber, lineBreak, regex, SubtitleTextType.Text); if (results != null) return results; /* Not found in the text, finding in the translation */ return FindInTextContent(subtitleNumber, lineBreak, regex, SubtitleTextType.Translation); } } /// The , or null if the text was not found. private SubtitleSearchResults FindInSubtitleFromIndex (int subtitleNumber, string lineBreak, Regex regex, int startIndex, SubtitleTextType textType, bool backwards) { if (backwards) { if (textType == SubtitleTextType.Text) { /* Find in the text starting at the specified index */ return FindInTextContentFromIndex(subtitleNumber, lineBreak, regex, startIndex, SubtitleTextType.Text); } else { /* Find first in the translation starting at the specified index */ SubtitleSearchResults results = FindInTextContentFromIndex(subtitleNumber, lineBreak, regex, startIndex, SubtitleTextType.Translation); if (results != null) return results; /* Not found in the translation, finding in the text */ return FindInTextContent(subtitleNumber, lineBreak, regex, SubtitleTextType.Text); } } else { if (textType == SubtitleTextType.Text) { /* Find first in the text starting at the specified index */ SubtitleSearchResults results = FindInTextContentFromIndex(subtitleNumber, lineBreak, regex, startIndex, SubtitleTextType.Text); if (results != null) return results; /* Not found in the text, finding in the translation */ return FindInTextContent(subtitleNumber, lineBreak, regex, SubtitleTextType.Translation); } else { /* Find in the translation starting at the specified index */ return FindInTextContentFromIndex(subtitleNumber, lineBreak, regex, startIndex, SubtitleTextType.Translation); } } } /// The , or null if the text was not found. private SubtitleSearchResults FindInSubtitleTillIndex (int subtitleNumber, string lineBreak, Regex regex, int endIndex, SubtitleTextType textType, bool backwards) { if (backwards) { if (textType == SubtitleTextType.Text) { /* Find first in the translation */ SubtitleSearchResults results = FindInTextContent(subtitleNumber, lineBreak, regex, SubtitleTextType.Translation); if (results != null) return results; /* Not found in the text, finding in the text till the specified index */ return FindInTextContentTillIndex(subtitleNumber, lineBreak, regex, endIndex, SubtitleTextType.Text, backwards); } else { /* Find in the translation till specified index */ return FindInTextContentTillIndex(subtitleNumber, lineBreak, regex, endIndex, SubtitleTextType.Translation, backwards); } } else { if (textType == SubtitleTextType.Text) { /* Find in the text ending at the specified index */ return FindInTextContentTillIndex(subtitleNumber, lineBreak, regex, endIndex, SubtitleTextType.Text, backwards); } else { /* Find first in the text */ SubtitleSearchResults results = FindInTextContent(subtitleNumber, lineBreak, regex, SubtitleTextType.Text); if (results != null) return results; /* Not found in the text, finding in the translation till the specified index */ return FindInTextContentTillIndex(subtitleNumber, lineBreak, regex, endIndex, SubtitleTextType.Translation, backwards); } } } private SubtitleSearchResults FindInTextContent (int subtitleNumber, string lineBreak, Regex regex, SubtitleTextType textType) { SubtitleText text = GetSubtitleText(subtitleNumber, textType); return MatchValues(regex.Match(text.Get(lineBreak)), subtitleNumber, textType); } private SubtitleSearchResults FindInTextContentFromIndex (int subtitleNumber, string lineBreak, Regex regex, int startIndex, SubtitleTextType textType) { SubtitleText text = GetSubtitleText(subtitleNumber, textType); return MatchValues(regex.Match(text.Get(lineBreak), startIndex), subtitleNumber, textType); } private SubtitleSearchResults FindInTextContentTillIndex (int subtitleNumber, string lineBreak, Regex regex, int endIndex, SubtitleTextType textType, bool backwards) { SubtitleText text = GetSubtitleText(subtitleNumber, textType); string matchText = text.Get(lineBreak); int startIndex = (backwards ? matchText.Length : 0); int length = (backwards ? matchText.Length - endIndex : endIndex); return MatchValues(regex.Match(text.Get(lineBreak), startIndex, length), subtitleNumber, textType); } private SubtitleSearchResults MatchValues (Match match, int subtitleNumber, SubtitleTextType textType) { if (match.Success) return new SubtitleSearchResults(subtitleNumber, textType, match.Index, match.Length); else return null; } private SubtitleText GetSubtitleText (int subtitleNumber, SubtitleTextType textType) { Subtitle subtitle = collection[subtitleNumber]; if (textType == SubtitleTextType.Text) return subtitle.Text; else return subtitle.Translation; } } } sublib-0.9/src/SubLib/Application/SubtitleProperties.cs0000644000175000017500000000563510673235451022570 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2005-2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.IO; using System.Text; namespace SubLib { /// Represents the properties of subtitles. /// This class acts as a container which allows you to get and set a /// variety of properties. Some of these properties are used in syncronization /// and timing calculations. public class SubtitleProperties { private Headers headers = new Headers(); private float originalFrameRate = 25; private float currentFrameRate = 25; public SubtitleProperties () { } public SubtitleProperties (Headers headers, float originalFrameRate, float currentFrameRate) { this.headers = headers; this.originalFrameRate = originalFrameRate; this.currentFrameRate = currentFrameRate; } /// Initializes a new instance of the /// class, with defaults for all properties. internal SubtitleProperties (ParsingProperties properties) { headers = properties.Headers; originalFrameRate = properties.OriginalFrameRate; } /// The headers used in some subtitle formats. public Headers Headers { get { return headers; } } /// The frame rate originally applied to the subtitles. /// When converting between frame rates, this is the frame rate of the subtitles /// when they are opened. This is sometimes refered to as the input frame rate. public float OriginalFrameRate { get { return originalFrameRate; } } /// The frame rate currently being used in the subtitles. /// When converting between frame rates, this is the target frame rate of the /// subtitles. This is sometimes refered to as the output frame rate. public float CurrentFrameRate { get { return currentFrameRate; } } public override string ToString () { return "Original FPS = " + originalFrameRate + ", Current FPS = " + currentFrameRate + "\n" + headers.ToString(); } /* Internal members */ internal void SetCurrentFrameRate (float frameRate) { currentFrameRate = frameRate; } internal void SetOriginalFrameRate (float frameRate) { originalFrameRate = frameRate; } } } sublib-0.9/src/SubLib/Application/Enumerations.cs0000644000175000017500000000673011000453207021350 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2005-2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ namespace SubLib { /// /// Represents a timing mode, which can be frame or time based. /// public enum TimingMode { /// Time based timing mode. Times, /// Frame based timing mode. Frames }; /// /// Represents a supported subtitle file type. /// public enum SubtitleType { /// Unknown subtitle type. Unknown , /// Micro DVD subtitle type. MicroDVD, /// SubRip subtitle type. SubRip, /// Sub Station Alpha subtitle type. SubStationAlpha, /// Advanced Sub Station Alpha subtitle type. AdvancedSubStationAlpha, /// MPlayer subtitle type. MPlayer, /// MPlayer2 subtitle type. MPlayer2, /// MPSub subtitle type. MPSub, /// SubViewer 1.0 subtitle type. SubViewer1, /// SubViewer 2.0 subtitle type. SubViewer2, /// AQ Title subtitle type. AQTitle, /// MacSUB subtitle type. MacSUB, /// Phoenix Japanimation Society subtitle type. PhoenixJapanimationSociety, /// Panimator subtitle type. Panimator, /// Sofni subtitle type. Sofni, /// SubCreator 1.x subtitle type. SubCreator1x, /// ViPlay Subtitle File subtitle type. ViPlaySubtitleFile, /// DKS Subtitle Format subtitle type. DKSSubtitleFormat, /// Power DivX subtitle type. PowerDivX, /// Karaoke Lyrics LRC subtitle type. KaraokeLyricsVKT, /// Karaoke Lyrics LRC subtitle type. KaraokeLyricsLRC, /// Adobe Encore DVD subtitle type. AdobeEncoreDVD }; /// /// Represents a type of newline. /// public enum NewlineType { /// Unknown newline type. Unknown , /// Unix newline type. Unix, /// Windows newline type. Windows, /// Macintosh newline type. Macintosh, }; /// /// Represents the type of text content. /// public enum SubtitleTextType { /// The text. Text, /// The translation. Translation }; /// /// Represents the timing mode used by a subtitle format. /// internal enum SubtitleMode { /// Time based timing mode. Times, /// Frame based timing mode. Frames, /// Time and Frame based timing mode. Both }; } sublib-0.9/src/SubLib/Application/FileProperties.cs0000644000175000017500000001253010673734342021647 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text; namespace SubLib { /// Represents the properties of a file. /// This includes all that's necessary to work with files, in relation to . public class FileProperties { /* Used for reading and writing */ private string path = String.Empty; //The path of the file private Encoding encoding = null; //The character coding of the file private SubtitleType subtitleType = SubtitleType.Unknown; //The subtitle type of the file private TimingMode timingMode = TimingMode.Times; //The timing mode used in the file (some subtitle types support both) /* Used for writing only */ private NewlineType newlineType = NewlineType.Unknown; /// Creates a new instance of the class. /// All properties are initialized to defaults. public FileProperties () { } /// Creates a new instance of the class, given its properties. /// The file's path. /// The file's character coding. /// The file's subtitle type. /// The file's timing mode. This is more useful for the subtitle types that support both the time and frame modes. /// The file's newline type. public FileProperties (string path, Encoding encoding, SubtitleType subtitleType, TimingMode timingMode, NewlineType newlineType) { this.path = path; this.encoding = encoding; this.subtitleType = subtitleType; this.timingMode = timingMode; this.newlineType = newlineType; } /// Creates a new instance of the class, given its properties. /// The file's path. /// The file's character coding. /// The file's subtitle type. /// The file's timing mode. This is more useful for the subtitle types that support both the time and frame modes. public FileProperties (string path, Encoding encoding, SubtitleType subtitleType, TimingMode timingMode) : this(path, encoding, subtitleType, timingMode, NewlineType.Unknown) { } /// Creates a new instance of the class, given its properties. /// The file's path. /// The file's character coding. /// The file's timing mode. This is more useful for the subtitle types that support both the time and frame modes. public FileProperties(string path, Encoding encoding, TimingMode timingMode) : this(path, encoding, SubtitleType.Unknown, timingMode) { } /// Creates a new instance of the class, given the file's path. /// The file's path. public FileProperties (string path) : this(path, null, SubtitleType.Unknown, TimingMode.Times) { } /// The file's path. public string Path { get { return path; } set { path = System.IO.Path.GetFullPath(value); } } /// The file's filename. /// See for more information. public string Filename { get { return System.IO.Path.GetFileName(path); } } /// The file's directory. /// See for more information. public string Directory { get { return System.IO.Path.GetDirectoryName(path); } } /// Whether the path is rooted. /// See for more information. public bool IsPathRooted { get { return System.IO.Path.IsPathRooted(path); } } /// The character coding used in the file. public Encoding Encoding { get { return encoding; } set { encoding = value; } } /// The timing mode used in the file. /// This is more useful for the subtitle types that support both the time and frame modes. public TimingMode TimingMode { get { return timingMode; } set { timingMode = value; } } /// The type of the subtitles. public SubtitleType SubtitleType { get { return subtitleType; } set { subtitleType = value; } } /// The type of newline used in the file. public NewlineType NewlineType { get { return newlineType; } set { newlineType = value; } } } }sublib-0.9/src/SubLib/Application/MatchEvaluationCounter.cs0000644000175000017500000000264010640336367023337 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2006 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { internal class MatchEvaluationCounter { int count = 0; //The number of matches or times the evaluator was called bool evaluationOccured = false; //Whether an evaluation occured string replacement = String.Empty; internal MatchEvaluationCounter (string replacement) { this.replacement = replacement; } internal int Count { get { return count; } } internal bool EvaluationOccured { get { return evaluationOccured; } set { evaluationOccured = value; } } internal string Evaluator (Match match) { count++; evaluationOccured = true; return replacement; } } }sublib-0.9/src/SubLib/Application/Style.cs0000644000175000017500000000451710640336367020020 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2005-2006 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Collections; namespace SubLib { /// Represents a text style, including Bold, Italic and Underline. public class Style { private bool bold = false; private bool italic = false; private bool underline = false; /// Initializes a new instance of the class. public Style () {} /// /// Initializes a new instance of the class, given the /// specified style values. /// Whether the text is bold. /// Whether the text is italic. /// Whether the text is underlined. public Style (bool bold, bool italic, bool underline) { this.bold = bold; this.italic = italic; this.underline = underline; } /// Whether the style is bold. public bool Bold { get { return bold; } set { bold = value; } } /// Whether the style is italic. public bool Italic { get { return italic; } set { italic = value; } } /// Whether the style is underlined. public bool Underline { get { return underline; } set { underline = value; } } /// Whether any of the style values is enabled. public bool Enabled { get { return Bold || Italic || Underline; } } public override string ToString() { string result = String.Empty; if (Bold) result += " bold"; if (Italic) result += " italic"; if (Underline) result += " underline"; return result; } } } sublib-0.9/src/SubLib/Application/SubtitleConstants.cs0000644000175000017500000001035510640336367022405 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2006 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ namespace SubLib { /// Contains constants for a set of subtitling parameters. public class SubtitleConstants { /// The distance of the subtitles to the sides of the screen, in percent of screen dimensions. /// The value of this property is 1/12. public const float DistanceFromBottomFactor = 1/12; /// The maximum number of lines that should be allowed. /// The value of this property is 2. public const int MaxLineCount = 2; /// The maximum number of characters per line. /// The value of this property is 35. public const int MaxCharactersPerLine = 35; /// The maximum number of words per line. /// The value of this property is 7. public const int MaxWordsPerLine = 7; /// The lower bound on the average reading speed, in words per minute. /// The value of this property is 150. public const int MinAverageReadingWordsPerMinute = 150; /// The upper bound on the average reading speed, in words per minute. /// The value of this property is 180. public const int MaxAverageReadingWordsPerMinute = 180; /// The average reading speed, in words per minute. /// The value of this property is 150. public const int AverageReadingWordsPerMinute = 165; /// The lower bound on the average reading speed, in words per second. /// The value of this property is 2.5. public const float MinAverageReadingWordsPerSecond = 2.5f; /// The upper bound on the average reading speed, in words per second. /// The value of this property is 3. public const float MaxAverageReadingWordsPerSecond = 3; /// The average reading speed, in words per second. /// The value of this property is 2.75. public const float AverageReadingWordsPerSecond = 2.75f; /// The maximum duration of a full single-line subtitle, in seconds. /// The value of this property is 3.5. public const float MaxSingleLineSubtitleDuration = 3.5f; /// The maximum duration of a full two-line subtitle, in seconds. /// The value of this property is 6. public const float MaxTwoLineSubtitleDuration = 6; /// The duration of a single-word subtitle, in seconds. /// The value of this property is 1.5. public const float SingleWordSubtitleDuration = 1.5f; /// The amount of time the subtitle should appear after the initiation of the utterance, in seconds. /// The value of this property is 0.25. public const float LeadingInTime = 0.25f; /// The maximum amount of time the subtitle should be left on the screen after the end of the utterance, in seconds. /// The value of this property is 2. public const float LaggingOutTime = 2; /// The minimum amount of time between two consecutive subtitles, in seconds. /// The value of this property is 0.25. public const float MinTimeBetweenSubtitles = 0.25f; /// The maximum number of sentences that should be allowed per subtitle. /// The value of this property is 2. public const int MaxSentencesPerSubtitle = 2; } }sublib-0.9/src/SubLib/Application/Synchronization.cs0000644000175000017500000000576210657204172022120 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2005-2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; namespace SubLib { /// Contains a base for synchronization operations. /// This contains only the basic synchronization operations. To synchronize /// , use its synchronization methods directly. public class Synchronization { /// Converts the specified frames to time, given a frame rate. /// The frames to convert to time. /// The frame rate to be used in the conversion. /// The time corresponding to the specified frames at the specified frame rate. public static TimeSpan FramesToTime (double frames, float frameRate) { double seconds = frames / frameRate; TimeSpan time = TimeSpan.FromSeconds(seconds); return time; } /// Converts the specified time to frames, given a frame rate. /// The time to convert to frames. /// The frame rate to be used in the conversion. /// The frames corresponding to the specified time at the specified frame rate. public static double TimeToFrames (TimeSpan time, float frameRate) { double seconds = time.TotalSeconds; double frames = seconds * frameRate; return frames; } /// Converts the specified time to frames, given a frame rate. /// The time, in seconds, to convert to frames. /// The frame rate to be used in the conversion. /// The frames corresponding to the specified time at the specified frame rate. public static double TimeToFrames (float time, float frameRate) { double frames = time * frameRate; return frames; } /// Converts the specified time to frames, given a frame rate. /// The time, in milliseconds, to convert to frames. /// The frame rate to be used in the conversion. /// The frames corresponding to the specified time at the specified frame rate. public static double TimeMillisecondsToFrames (float time, float frameRate) { double frames = (time / 1000) * frameRate; return frames; } } } sublib-0.9/src/SubLib/Application/Times.cs0000644000175000017500000000751610640336367020003 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2005-2006 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; namespace SubLib { /// Represents the times of a subtitle. /// and always exist for any . /// This class is automatically constructed when constructing a . public class Times { private TimeSpan start = TimeSpan.Zero; private TimeSpan end = TimeSpan.Zero; private Subtitle subtitle = null; /// The start time. /// Upon setting the start time, the start frame (Frames.Start) is also updated based on /// the . public TimeSpan Start { get { return PreciseStart; } set { PreciseStart = value; subtitle.UpdateStartFrameFromTimes(); } } /// The end time. /// Upon setting the end time, the end frame (Frames.End) is also updated based on /// the . public TimeSpan End { get { return PreciseEnd; } set { PreciseEnd = value; subtitle.UpdateEndFrameFromTimes(); } } /// The time duration. /// Setting the duration maintains the start time and changes the end time. /// Upon setting the duration, the end frame (Frames.End) is also updated based on /// the . public TimeSpan Duration { get { return End - Start; } set { End = Start + value; } } /// Shifts the subtitle with a specified time span. /// The time span to shift the subtitle with, which can be positive or negative. public void Shift (TimeSpan time) { PreciseStart += time; PreciseEnd += time; subtitle.UpdateFramesFromTimes(); } public override string ToString() { return Start + "->" + End; } /* Internal members */ internal Times (Subtitle subtitle) { this.subtitle = subtitle; } internal Times (Subtitle subtitle, TimeSpan start, TimeSpan end) { this.start = start; this.end = end; this.subtitle = subtitle; } /// Doesn't update frames. internal TimeSpan PreciseStart { get { return start; } set { start = value; } } /// Doesn't update frames. internal TimeSpan PreciseEnd { get { return end; } set { end = value; } } /// Doesn't update frames. internal TimeSpan PreciseDuration { get { return end - start; } set { end = start + value; } } internal void Scale (double factor, TimeSpan baseTime) { double baseMilliseconds = baseTime.TotalMilliseconds; double start = PreciseStart.TotalMilliseconds; double newStart = baseMilliseconds + ((start - baseMilliseconds) * factor); PreciseStart = TimeSpan.FromMilliseconds(newStart); double end = PreciseEnd.TotalMilliseconds; double newEnd = baseMilliseconds + ((end - baseMilliseconds) * factor); PreciseEnd = TimeSpan.FromMilliseconds(newEnd); subtitle.UpdateFramesFromTimes(); } } } sublib-0.9/src/SubLib/Application/Frames.cs0000644000175000017500000000706710640336367020140 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2005-2006 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; namespace SubLib { /// Represents the frames of a subtitle. /// and always exist for any . /// This class is automatically constructed when constructing a . public class Frames { private double start = 0; private double end = 0; private Subtitle subtitle = null; /// The start frame. /// Upon setting the start frame, the start time (Times.Start) is also updated based on /// the . public int Start { get { return (int)Math.Round(PreciseStart); } set { PreciseStart = value; subtitle.UpdateStartTimeFromFrames(); } } /// The end frame. /// Upon setting the end frame, the end time (Times.End) is also updated based on /// the . public int End { get { return (int)Math.Round(PreciseEnd); } set { PreciseEnd = value; subtitle.UpdateEndTimeFromFrames(); } } /// The duration, in frames. /// Setting the duration maintains the start frame and changes the end frame. /// Upon setting the duration, the end time (Times.End) is also updated based on /// the . public int Duration { get { return End - Start; } set { End = Start + value; } } /// Shifts the subtitle with a specified amount of frames. /// The number of frames to shift the subtitle with, which can be positive or negative. public void Shift (int frames) { PreciseStart += frames; PreciseEnd += frames; subtitle.UpdateTimesFromFrames(); } public override string ToString() { return Start + "->" + End; } /* Internal members */ internal Frames (Subtitle subtitle) { this.subtitle = subtitle; } internal Frames (Subtitle subtitle, int start, int end) { this.start = start; this.end = end; this.subtitle = subtitle; } /// Doesn't update times. internal double PreciseStart { get { return start; } set { start = value; } } /// Doesn't update times. internal double PreciseEnd { get { return end; } set { end = value; } } /// Doesn't update times. internal double PreciseDuration { get { return end - start; } set { end = start + value; } } internal void Scale (double factor, int baseFrame) { PreciseStart = baseFrame + ((PreciseStart - baseFrame) * factor); PreciseEnd = baseFrame + ((PreciseEnd - baseFrame) * factor); subtitle.UpdateTimesFromFrames(); } } } sublib-0.9/src/SubLib/Application/SubtitleTypeInfo.cs0000644000175000017500000000761010640336367022166 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2006 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; namespace SubLib { /// Contains information about a subtitle file type. public class SubtitleTypeInfo : IComparable { private string name; private SubtitleType type; private string[] extensions; /// Initializes a new instance of the class. /// The name of the subtitle type. /// The subtitle type. /// The extensions the subtitle type uses. public SubtitleTypeInfo (string name, SubtitleType type, string[] extensions) { this.name = name; this.type = type; this.extensions = extensions; } /// The name of the subtitle type. public string Name { get { return name; } } /// The subtitle type. public SubtitleType Type { get { return type; } } /// The extensions the subtitle type uses. public string[] Extensions { get { return extensions; } } /// A comma-separated list of the extensions the subtitle type uses. /// The prefix "*." is added to every extension. public string ExtensionsAsText { get { return ExtensionsToText(); } } /// The preferred extension, which is the first on the list. public string PreferredExtension { get { return extensions[0]; } } /// Checks whether the specified extension is one of the extensions of the /// The extension to search for. /// True if the extension was found, False otherwise. public bool HasExtension (string extension) { foreach (string typeExtension in extensions) { if (typeExtension == extension) return true; } return false; } /// Compares this instance with a specified object, based on the object names. /// See for more information. /// The object to compare this class to. /// /// /// ValueCondition /// Less than zeroThis instance is less than obj. /// ZeroThis instance is equal to obj. /// Greater than zeroThis instance is greater than obj, or obj is a /// null reference. /// /// public int CompareTo (object obj) { return Name.CompareTo((obj as SubtitleTypeInfo).Name); } /* Internal members */ internal SubtitleTypeInfo (SubtitleFormat format) : this(format.Name, format.Type, format.Extensions) { } /* Private members */ private string ExtensionsToText () { if (extensions == null) return String.Empty; string text = ExtensionToText(extensions[0]); for (int count = 1 ; count < extensions.Length ; count++) text += ", " + ExtensionToText(extensions[count]); return text; } private string ExtensionToText (string extension) { return "*." + extension; } } } sublib-0.9/src/SubLib/Application/Headers.cs0000644000175000017500000002017110673235451020263 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2006-2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.IO; using System.Text; namespace SubLib { /// Represents the headers of the supported subtitle formats. public class Headers { private string title = String.Empty; private string author = String.Empty; private string movieAuthor = String.Empty; private string artist = String.Empty; private string album = String.Empty; private string videoSource = String.Empty; private string subtitlesSource = String.Empty; private string program = String.Empty; private string version = String.Empty; private string comment = String.Empty; private string fontColor = "&HFFFFFF"; private string fontStyle = "bd"; private string fontName = "Tahoma"; private string fileProperties = String.Empty; private string mediaType = "VIDEO"; private string originalScript = ""; private string originalTranslation = String.Empty; private string originalEditing = String.Empty; private string originalTiming = String.Empty; private string originalScriptChecking = String.Empty; private string scriptUpdatedBy = String.Empty; private string collisions = String.Empty; private string timer = String.Empty; private string frameRate = String.Empty; private string date = DateTime.Today.ToString("yyyy-MM-dd"); private int playResX = 0; private int playResY = 0; private int playDepth = 0; private int fontSize = 24; private int delay = 0; private int cdTrack = 0; /// The movie's title. public string Title { get { return title; } set { title = value; } } /// The subtitles' author. public string Author { get { return author; } set { author = value; } } /// The movie's author. public string MovieAuthor { get { return movieAuthor; } set { movieAuthor = value; } } /// The subtitles' artist. public string Artist { get { return artist; } set { artist = value; } } /// The subtitles' album. public string Album { get { return album; } set { album = value; } } /// The video' source. public string VideoSource { get { return videoSource; } set { videoSource = value; } } /// The subtitles' source. public string SubtitlesSource { get { return subtitlesSource; } set { subtitlesSource = value; } } /// The name of the subtitles' program. public string Program { get { return program; } set { program = value; } } /// The version of the subtitles. public string Version { get { return version; } set { version = value; } } /// A comment or note on the subtitles. public string Comment { get { return comment; } set { comment = value; } } /// The subtitles' font color. public string FontColor { get { return fontColor; } set { fontColor = value; } } /// The subtitles' font style. public string FontStyle { get { return fontStyle; } set { fontStyle = value; } } /// The subtitles' font name. public string FontName { get { return fontName; } set { fontName = value; } } /// The File properties, in the format 'size,md5'. public string FileProperties { get { return fileProperties; } set { fileProperties = value; } } /// The Media Type of the subtitles, which can be 'VIDEO' or 'AUDIO'. /// This property is only set if the value is 'VIDEO' or 'AUDIO'. It's case insensitive. public string MediaType { get { return mediaType; } set { string type = value.ToUpper(); if (type.Equals("VIDEO") || type.Equals("AUDIO")) mediaType = type; } } /// The Original Script of the subtitles. public string OriginalScript { get { return originalScript; } set { originalScript = value; } } /// The Original Translation of the subtitles. public string OriginalTranslation { get { return originalTranslation; } set { originalTranslation = value; } } /// The Original Editing of the subtitles. public string OriginalEditing { get { return originalEditing; } set { originalEditing = value; } } /// The Original Timing of the subtitles. public string OriginalTiming { get { return originalTiming; } set { originalTiming = value; } } /// The Original Script Checking of the subtitles. public string OriginalScriptChecking { get { return originalScriptChecking; } set { originalScriptChecking = value; } } /// The Script Updated By of the subtitles. public string ScriptUpdatedBy { get { return scriptUpdatedBy; } set { scriptUpdatedBy = value; } } /// The Collisions of the subtitles. public string Collisions { get { return collisions; } set { collisions = value; } } /// The Timer of the subtitles. public string Timer { get { return timer; } set { timer = value; } } /// The movie's frame rate. public string FrameRate { get { return frameRate; } set { frameRate = value; } } /// The subtitles' date. public string Date { get { return date; } set { date = value; } } /// The PlayResX of the subtitles. public int PlayResX { get { return playResX; } set { playResX = value; } } /// The PlayResX of the subtitles as text. public string PlayResXAsText { get { return playResX.ToString(); } set { try { playResX = Convert.ToInt32(value); } catch (Exception) { } } } /// The PlayResY of the subtitles. public int PlayResY { get { return playResY; } set { playResY = value; } } /// The PlayResY of the subtitles as text. public string PlayResYAsText { get { return playResY.ToString(); } set { try { playResY = Convert.ToInt32(value); } catch (Exception) { } } } /// The PlayDepth of the subtitles. public int PlayDepth { get { return playDepth; } set { playDepth = value; } } /// The PlayResY of the subtitles as text. public string PlayDepthAsText { get { return playDepth.ToString(); } set { try { playDepth = Convert.ToInt32(value); } catch (Exception) { } } } /// The subtitles' font size. public int FontSize { get { return fontSize; } set { fontSize = value; } } /// The subtitles' font size as text. public string FontSizeAsText { get { return fontSize.ToString(); } set { try { fontSize = Convert.ToInt32(value); } catch (Exception) { } } } /// The delay of the subtitles. public int Delay { get { return delay; } set { delay = value; } } /// The delay of the subtitles as text. public string DelayAsText { get { return delay.ToString(); } set { try { delay = Convert.ToInt32(value); } catch (Exception) { } } } /// The CD track of the subtitles. public int CDTrack { get { return cdTrack; } set { cdTrack = value; } } /// The CD track of the subtitles as text. public string CDTrackAsText { get { return cdTrack.ToString(); } set { try { cdTrack = Convert.ToInt32(value); } catch (Exception) { } } } } }sublib-0.9/src/SubLib/Application/IncompleteSubtitleCollection.cs0000644000175000017500000000467410640336367024553 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2005-2006 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System.Collections; namespace SubLib { /// A container that represents a collection of incomplete subtitles. public class IncompleteSubtitleCollection { private ArrayList subtitles = new ArrayList(); /// The number of subtitles in the collection. public int Count { get { return subtitles.Count; } } /// Returns an enumerator that can iterate through the collection. /// An for the entire . public IEnumerator GetEnumerator () { return subtitles.GetEnumerator(); } /// Returns the subtitle at the specified index. /// The zero-based subtitle's index. /// The subtitle at the specified index. public IncompleteSubtitle Get (int index){ return (IncompleteSubtitle)subtitles[index]; } /// Adds an incomplete subtitle to the end of the collection. /// The subtitle to add. public void Add (IncompleteSubtitle subtitle){ subtitles.Add(subtitle); } /// Adds an incomplete subtitle to the collection, inserting it at the specified index. /// The subtitle to add. /// The zero-based index at which the subtitle should be inserted. public void Add (IncompleteSubtitle subtitle, int index){ subtitles.Insert(index, subtitle); } public override string ToString(){ string result = "\t* SUBTITLE LIST *\n"; foreach(IncompleteSubtitle subtitle in subtitles){ result += subtitle.ToString(); } return result; } } } sublib-0.9/src/SubLib/Persistency/0000755000175000017500000000000011011375151016412 5ustar meebeymeebeysublib-0.9/src/SubLib/Persistency/SubtitleFormatMPlayer2.cs0000644000175000017500000000240410640336417023272 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2006 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; namespace SubLib { internal class SubtitleFormatMPlayer2 : SubtitleFormat { internal SubtitleFormatMPlayer2 () { name = "MPlayer2"; type = SubtitleType.MPlayer2; mode = SubtitleMode.Times; extensions = new string[] { "mpl" }; lineBreak = "|"; format = @"\[\d+\]\[\d+\]"; subtitleIn = @"\[\s*(?\d+)\s*\]\[\s*(?\d+)\s*\](?.*)"; subtitleOut = "[<>][<>]<>"; } } } sublib-0.9/src/SubLib/Persistency/SubtitleParser.cs0000644000175000017500000004736210673734342021743 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2005-2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text; using System.Text.RegularExpressions; namespace SubLib { internal class SubtitleParser { private bool includeIncompleteSubtitles = false; /* Delegate to use when parsing headers */ private delegate bool ParseHeaderDelegate (Match match, ParsingProperties properties); internal SubtitleParser(bool includeIncompleteSubtitles) { this.includeIncompleteSubtitles = includeIncompleteSubtitles; } private string ClearComments (string text, SubtitleFormat format) { if (format.HasComments) { Regex regex = new Regex(format.Comments); string clearText = regex.Replace(text, String.Empty); return clearText; } else return text; } /// Parses the specified text, using the specified format. /// The created will have its property set to null. /// It is mandatory to use after. internal ParsingProperties Parse (string text, SubtitleFormat format, out SubtitleCollection collection, out IncompleteSubtitleCollection incompleteSubtitles){ collection = new SubtitleCollection(); incompleteSubtitles = new IncompleteSubtitleCollection(); ParsingProperties properties = new ParsingProperties(); Regex subtitleRegex = null; int bodyIndex = 0; text = ClearComments(text, format); /* Read the headers if available */ if (format.Mode == SubtitleMode.Both) { //Read headers to know if format is using Times or Frames bodyIndex = text.Length; int lastIndex = ReadHeaders(text, bodyIndex, format, properties); subtitleRegex = CreateSubtitleRegex(format, properties.TimingMode); /* Detect body index from matching the first subtitle or the end of headers */ bodyIndex = FindBodyIndex(text, format, subtitleRegex); if (lastIndex > bodyIndex) bodyIndex = lastIndex; } else { //End of headers is detected by start of subtitles' body properties.TimingMode = format.ModeAsTimingMode; subtitleRegex = CreateSubtitleRegex(format); bodyIndex = FindBodyIndex(text, format, subtitleRegex); ReadHeaders(text, bodyIndex, format, properties); } /* Get properties from the whole input, if available */ format.GlobalInputGetProperties(text, properties); int textLength = text.Length; /* Read the subtitles */ bodyIndex = ReadSubtitles(text, bodyIndex, textLength, subtitleRegex, format, properties, collection, incompleteSubtitles); /* Read the end text of the subtitles */ bodyIndex = ReadBodyEnd(text, bodyIndex, format, collection, incompleteSubtitles); /* Check if there's still text remaining */ if ((bodyIndex < textLength) && includeIncompleteSubtitles) AddIncompleteSubtitle(incompleteSubtitles, text.Substring(bodyIndex), collection.Count); return properties; } /* Private members */ private ParseHeaderDelegate GetHeaderParser (SubtitleType subtitleType) { switch (subtitleType) { case SubtitleType.SubViewer1: return new ParseHeaderDelegate(ParseHeaderSubViewer1); case SubtitleType.SubViewer2: return new ParseHeaderDelegate(ParseHeaderSubViewer2); case SubtitleType.KaraokeLyricsLRC: return new ParseHeaderDelegate(ParseHeaderKaraokeLyricsLRC); case SubtitleType.KaraokeLyricsVKT: return new ParseHeaderDelegate(ParseHeaderKaraokeLyricsVKT); case SubtitleType.MPSub: return new ParseHeaderDelegate(ParseHeaderMPSub); case SubtitleType.SubStationAlpha: return new ParseHeaderDelegate(ParseHeaderSubStationAlphaAAS); case SubtitleType.AdvancedSubStationAlpha: return new ParseHeaderDelegate(ParseHeaderSubStationAlphaAAS); default: return null; } } /// The index where subtitles start. private int ReadHeaders (string text, int bodyIndex, SubtitleFormat format, ParsingProperties properties) { if (!(format.HasHeaders && (bodyIndex > 0))) return 0; ParseHeaderDelegate headerParser = GetHeaderParser(format.Type); int lastIndex = 0; //the last index with header text string headerText = text.Substring(0, bodyIndex); foreach (string headerExpression in format.Headers) { Regex expression = new Regex(headerExpression, RegexOptions.IgnoreCase); Match match = expression.Match(headerText, 0, bodyIndex); if (match.Success) { /* Update the last index based on the header match */ int matchLastIndex = match.Index + match.Length; if (matchLastIndex > lastIndex) lastIndex = matchLastIndex; headerParser(match, properties); } } return lastIndex; } private bool ParseHeaderSubViewer1 (Match match, ParsingProperties properties) { return ParseHeaderSubViewer1(match, properties, properties.Headers); } private bool ParseHeaderSubViewer1 (Match match, ParsingProperties properties, Headers headers) { string result = String.Empty; if (ParseGroup(match, "Title", ref result)) headers.Title = result; else if (ParseGroup(match, "Author", ref result)) headers.Author = result; else if (ParseGroup(match, "Source", ref result)) headers.VideoSource = result; else if (ParseGroup(match, "Program", ref result)) headers.Program = result; else if (ParseGroup(match, "FilePath", ref result)) headers.SubtitlesSource = result; else if (ParseGroup(match, "Delay", ref result)) headers.DelayAsText = result; else if (ParseGroup(match, "CdTrack", ref result)) headers.CDTrackAsText = result; else { return false; } return true; } private bool ParseHeaderSubViewer2 (Match match, ParsingProperties properties) { Headers headers = properties.Headers; string result = String.Empty; if (!ParseHeaderSubViewer1(match, properties, headers)) { if (ParseGroup(match, "Comment", ref result)) headers.Comment = result; else if (ParseGroup(match, "FontName", ref result)) headers.FontName = result; else if (ParseGroup(match, "FontColor", ref result)) headers.FontColor = result; else if (ParseGroup(match, "FontStyle", ref result)) headers.FontStyle = result; else if (ParseGroup(match, "FontSize", ref result)) headers.FontSizeAsText = result; else return false; } return true; } private bool ParseHeaderKaraokeLyricsVKT (Match match, ParsingProperties properties) { Headers headers = properties.Headers; string result = String.Empty; if (ParseGroup(match, "FrameRate", ref result)) headers.FrameRate = result; else if (ParseGroup(match, "Author", ref result)) headers.Author = result; else if (ParseGroup(match, "Source", ref result)) headers.VideoSource = result; else if (ParseGroup(match, "Date", ref result)) headers.Date = result; else { return false; } return true; } private bool ParseHeaderKaraokeLyricsLRC (Match match, ParsingProperties properties) { Headers headers = properties.Headers; string result = String.Empty; if (ParseGroup(match, "Title", ref result)) headers.Title = result; else if (ParseGroup(match, "Author", ref result)) headers.MovieAuthor = result; else if (ParseGroup(match, "Artist", ref result)) headers.Artist = result; else if (ParseGroup(match, "Album", ref result)) headers.Album = result; else if (ParseGroup(match, "Maker", ref result)) headers.Author = result; else if (ParseGroup(match, "Version", ref result)) headers.Version = result; else if (ParseGroup(match, "Program", ref result)) headers.Program = result; else { return false; } return true; } private bool ParseHeaderMPSub (Match match, ParsingProperties properties) { Headers headers = properties.Headers; string result = String.Empty; float floatResult = 0; if (ParseGroup(match, "Title", ref result)) headers.Title = result; else if (ParseGroup(match, "File", ref result)) headers.FileProperties = result; else if (ParseGroup(match, "Author", ref result)) headers.Author = result; else if (ParseGroup(match, "MediaType", ref result)) headers.MediaType = result; else if (ParseGroup(match, "Note", ref result)) headers.Comment = result; //Used to detect if a subtitles' timing mode is Times in the case of a format that supports both else if (ParseGroup(match, "TimingModeTimes", ref result)) properties.TimingMode = TimingMode.Times; //Used to detect if a subtitles' timing mode is Frames in the case of a format that supports both else if (ParseGroup(match, "TimingModeFrames", ref floatResult)) { properties.TimingMode = TimingMode.Frames; properties.OriginalFrameRate = floatResult; } else { return false; } return true; } private bool ParseHeaderSubStationAlphaAAS (Match match, ParsingProperties properties) { Headers headers = properties.Headers; string result = String.Empty; int intResult = 0; if (ParseGroup(match, "Title", ref result)) headers.Title = result; else if (ParseGroup(match, "OriginalScript", ref result)) headers.OriginalScript = result; else if (ParseGroup(match, "OriginalTranslation", ref result)) headers.OriginalTranslation = result; else if (ParseGroup(match, "OriginalEditing", ref result)) headers.OriginalEditing = result; else if (ParseGroup(match, "OriginalTiming", ref result)) headers.OriginalTiming = result; else if (ParseGroup(match, "OriginalScriptChecking", ref result)) headers.OriginalScriptChecking = result; else if (ParseGroup(match, "ScriptUpdatedBy", ref result)) headers.ScriptUpdatedBy = result; else if (ParseGroup(match, "Collisions", ref result)) headers.Collisions = result; else if (ParseGroup(match, "PlayResX", ref intResult)) headers.PlayResX = intResult; else if (ParseGroup(match, "PlayResY", ref intResult)) headers.PlayResY = intResult; else if (ParseGroup(match, "PlayDepth", ref intResult)) headers.PlayDepth = intResult; else if (ParseGroup(match, "Timer", ref result)) headers.Timer = result; else { return false; } return true; } private int ReadSubtitles (string text, int bodyIndex, int textLength, Regex subtitleRegex, SubtitleFormat format, ParsingProperties properties, SubtitleCollection collection, IncompleteSubtitleCollection incompleteSubtitles) { Subtitle previousSubtitle = null; /* Read the subtitles. BodyIndex points to the start of the subtitles, skipping its possible beginning text*/ while (bodyIndex < textLength) { Match match = subtitleRegex.Match(text, bodyIndex); if (match.Success) { Subtitle subtitle = ParseSubtitle(match, format, properties, previousSubtitle); collection.Add(subtitle); AddIncompleteSubtitleIfExists(text, match, bodyIndex, collection.Count, incompleteSubtitles); bodyIndex = match.Index + match.Length; previousSubtitle = subtitle; } else break; } return bodyIndex; } private Subtitle ParseSubtitle (Match match, SubtitleFormat format, ParsingProperties properties, Subtitle previousSubtitle){ SubtitleText text = ParseSubtitleText(match, format); Style style = ParseStyle(match, format); Subtitle subtitle = new Subtitle(null, text, style); if (properties.TimingMode == TimingMode.Frames) { Frames previousFrames = (previousSubtitle == null ? null : previousSubtitle.Frames); ParseFrames(match, subtitle.Frames, previousFrames); } else { Times previousTimes = (previousSubtitle == null ? null : previousSubtitle.Times); ParseTimes(match, subtitle.Times, previousTimes, properties); } format.SubtitleInputPostProcess(subtitle); return subtitle; } private void ParseTimes (Match match, Times times, Times previousTimes, ParsingProperties properties) { ParseStartTime(match, times, previousTimes, properties); ParseEndTime(match, times, previousTimes, properties); } private void ParseStartTime (Match match, Times times, Times previousTimes, ParsingProperties properties) { bool isTimeDefined = false; TimeSpan startTime = new TimeSpan(0); int result = 0; float floatResult = 0; if (ParseGroup(match, "StartHours", ref result)) { startTime += TimeSpan.FromHours(result); isTimeDefined = true; } if (ParseGroup(match, "StartMinutes", ref result)) { startTime += TimeSpan.FromMinutes(result); isTimeDefined = true; } if (ParseGroup(match, "StartSeconds", ref result)) { startTime += TimeSpan.FromSeconds(result); isTimeDefined = true; } if (ParseGroup(match, "StartDeciseconds", ref result)) { startTime += TimeSpan.FromMilliseconds(result * 100); isTimeDefined = true; } if (ParseGroup(match, "StartCentiseconds", ref result)) { startTime += TimeSpan.FromMilliseconds(result * 10); isTimeDefined = true; } if (ParseGroup(match, "StartMilliseconds", ref result)) { startTime += TimeSpan.FromMilliseconds(result); isTimeDefined = true; } if (ParseGroup(match, "StartMillisecondsAsFrames", ref result)) { startTime += Synchronization.FramesToTime(result, properties.OriginalFrameRate); isTimeDefined = true; } if (ParseGroup(match, "StartElapsedTime", ref floatResult)) { if (previousTimes != null) startTime += previousTimes.PreciseEnd; startTime += TimeSpan.FromSeconds(floatResult); isTimeDefined = true; } if (isTimeDefined) times.PreciseStart = startTime; } private void ParseEndTime (Match match, Times times, Times previousTimes, ParsingProperties properties) { bool isTimeDefined = false; TimeSpan endTime = new TimeSpan(0); int result = 0; float floatResult = 0; if (ParseGroup(match, "EndHours", ref result)) { endTime += TimeSpan.FromHours(result); isTimeDefined = true; } if (ParseGroup(match, "EndMinutes", ref result)) { endTime += TimeSpan.FromMinutes(result); isTimeDefined = true; } if (ParseGroup(match, "EndSeconds", ref result)) { endTime += TimeSpan.FromSeconds(result); isTimeDefined = true; } if (ParseGroup(match, "EndDeciseconds", ref result)) { endTime += TimeSpan.FromMilliseconds(result * 100); isTimeDefined = true; } if (ParseGroup(match, "EndCentiseconds", ref result)) { endTime += TimeSpan.FromMilliseconds(result * 10); isTimeDefined = true; } if (ParseGroup(match, "EndMilliseconds", ref result)) { endTime += TimeSpan.FromMilliseconds(result); isTimeDefined = true; } if (ParseGroup(match, "EndMillisecondsAsFrames", ref result)) { endTime += Synchronization.FramesToTime(result, properties.OriginalFrameRate); isTimeDefined = true; } if (ParseGroup(match, "EndElapsedTime", ref floatResult)) { endTime += times.PreciseStart + TimeSpan.FromSeconds(floatResult); isTimeDefined = true; } if (isTimeDefined) times.PreciseEnd = endTime; } private void ParseFrames (Match match, Frames frames, Frames previousFrames) { int result = 0; if (ParseGroup(match, "StartFrame", ref result)) frames.PreciseStart = result; else if (ParseGroup(match, "StartElapsedFrames", ref result)) { double lastFrames = (previousFrames == null ? 0 : previousFrames.PreciseEnd); frames.PreciseStart = lastFrames + result; } if (ParseGroup(match, "EndFrame", ref result)) frames.PreciseEnd = result; else if (ParseGroup(match, "EndElapsedFrames", ref result)) { frames.PreciseDuration = result; } } private SubtitleText ParseSubtitleText (Match match, SubtitleFormat subtitleFormat) { string text = String.Empty; if (ParseGroup(match, "Text", ref text)) return new SubtitleText(text, subtitleFormat.LineBreak, true); else return new SubtitleText(); } private Style ParseStyle (Match match, SubtitleFormat subtitleFormat) { string styleText = String.Empty; if (ParseGroup(match, "Style", ref styleText)) return subtitleFormat.StringToStyle(styleText); else return new Style(); } private bool ParseGroup (Match match, string groupName, ref string result) { Group group = match.Groups[groupName]; if (group.Success) { result = group.Value.Trim(); return true; } else return false; } private bool ParseGroup (Match match, string groupName, ref int result) { string textResult = String.Empty; bool returnValue = ParseGroup(match, groupName, ref textResult); if (returnValue) { try { result = Convert.ToInt32(textResult); } catch (Exception) { return false; } } return returnValue; } private bool ParseGroup (Match match, string groupName, ref float result) { string textResult = String.Empty; bool returnValue = ParseGroup(match, groupName, ref textResult); if (returnValue) { try { result = (float)Convert.ToDouble(textResult); } catch (Exception) { return false; } } return returnValue; } private int ReadBodyEnd (string text, int bodyIndex, SubtitleFormat format, SubtitleCollection collection, IncompleteSubtitleCollection incompleteSubtitles) { Regex bodyEnd = new Regex(format.BodyEndIn + @"\s*", RegexOptions.IgnoreCase); Match bodyEndMatch = bodyEnd.Match(text, bodyIndex); if (bodyEndMatch.Success) { AddIncompleteSubtitleIfExists(text, bodyEndMatch, bodyIndex, collection.Count, incompleteSubtitles); bodyIndex = bodyEndMatch.Index + bodyEndMatch.Length; } return bodyIndex; } private bool IsThereIncompleteText (Match match, int bodyIndex) { return (match.Index > bodyIndex); } private void AddIncompleteSubtitle (IncompleteSubtitleCollection incompleteSubtitles, string incompleteText, int previousSubtitle) { if (!HasOnlyWhiteSpaces(incompleteText)) { IncompleteSubtitle incompleteSubtitle = new IncompleteSubtitle(previousSubtitle, incompleteText); incompleteSubtitles.Add(incompleteSubtitle); } } private bool HasOnlyWhiteSpaces (string text) { Regex emptyStringExpression = new Regex(@"\s*"); Match emptyStringMatch = emptyStringExpression.Match(text); return (emptyStringMatch.Length == text.Length); } private int FindBodyIndex (string text, SubtitleFormat format, Regex subtitleRegex) { if (format.HasHeaders || format.HasBodyBegin) { Match subtitleMatch = subtitleRegex.Match(text); if (subtitleMatch.Success) { return subtitleMatch.Index; } } return 0; } private Regex CreateSubtitleRegex(SubtitleFormat format) { string subtitleInExpression = format.SubtitleIn + @"\s*"; //Ignore spaces between subtitles return new Regex(subtitleInExpression, RegexOptions.IgnoreCase); } // Used when a subtitle format suppports both times and frames private Regex CreateSubtitleRegex(SubtitleFormat format, TimingMode timingMode) { string subtitleInExpression; if (timingMode == TimingMode.Times) subtitleInExpression = format.SubtitleInTimesMode + @"\s*"; //Ignore spaces between subtitles else subtitleInExpression = format.SubtitleInFramesMode + @"\s*"; //Ignore spaces between subtitles return new Regex(subtitleInExpression, RegexOptions.IgnoreCase); } private void AddIncompleteSubtitleIfExists (string text, Match match, int bodyIndex, int subtitleCount, IncompleteSubtitleCollection incompleteSubtitles) { if (includeIncompleteSubtitles && IsThereIncompleteText(match, bodyIndex)) { int length = match.Index - bodyIndex; string incompleteText = text.Substring(bodyIndex, length); AddIncompleteSubtitle(incompleteSubtitles, incompleteText, subtitleCount); } } } } sublib-0.9/src/SubLib/Persistency/SubtitleFormatSubViewer1.cs0000644000175000017500000000503210673235452023636 0ustar meebeymeebey/* * This file is part of SubLib. * Copyright (C) 2006-2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { internal class SubtitleFormatSubViewer1 : SubtitleFormat { internal SubtitleFormatSubViewer1 () { name = "SubViewer 1.0"; type = SubtitleType.SubViewer1; mode = SubtitleMode.Times; extensions = new string[] { "sub" }; lineBreak = "|"; format = @"\**\s*START\s*SCRIPT\s*\**[^\[]*\[\d+:\d+:\d+\]\s*.*\s*\[\d+:\d+:\d+\]"; subtitleIn = @"\[\s*(?\d+)\s*:\s*(?\d+)\s*:\s*(?\d+)\s*\]\s*(?.*)\s*\[\s*(?\d+)\s*:\s*(?\d+)\s*:\s*(?\d+)\s*\]"; subtitleOut = "[<>:<>:<>]\n" + "<>\n" + "[<>:<>:<>]\n"; bodyEndIn = @"\[\s*end\s*\]\s*\**\s*END\s*SCRIPT\s*\**"; bodyBeginOut = "[BEGIN]\n******** START SCRIPT ********\n"; bodyEndOut = "[end]\n******** END SCRIPT ********\n"; headers = new string[] { @"\[\s*TITLE\s*\].*\n(?.*)" , @"\[\s*AUTHOR\s*\].*\n(?<Author>.*)" , @"\[\s*SOURCE\s*\].*\n(?<Source>.*)" , @"\[\s*PRG\s*\].*\n(?<Program>.*)" , @"\[\s*FILEPATH\s*\].*\n(?<FilePath>.*)" , @"\[\s*DELAY\s*\].*\n(?<Delay>.*)" , @"\[\s*CD\s*TRACK\s*\].*\n(?<CdTrack>.*)" }; } internal override string HeadersToString (SubtitleProperties subtitleProperties, FileProperties fileProperties) { Headers headers = subtitleProperties.Headers; return "[TITLE]\n" + headers.Title + "\n" + "[AUTHOR]\n" + headers.Author + "\n" + "[SOURCE]\n" + headers.VideoSource + "\n" + "[PRG]\n" + headers.Program + "\n" + "[FILEPATH]\n" + headers.SubtitlesSource + "\n" + "[DELAY]\n" + headers.Delay + "\n" + "[CD TRACK]\n" + headers.CDTrack + "\n"; } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/SubtitleFormatDKSSubtitleFormat.cs��������������������������������0000644�0001750�0001750�00000002777�10677301203�025155� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { internal class SubtitleFormatDKSSubtitleFormat : SubtitleFormat { internal SubtitleFormatDKSSubtitleFormat () { name = "DKS Subtitle Format"; type = SubtitleType.DKSSubtitleFormat; mode = SubtitleMode.Times; extensions = new string[] { "dks" }; lineBreak = "[br]"; format = @"\[\d+:\d+:\d+\]\s*.*\s*\[\d+:\d+:\d+\]"; subtitleIn = @"\[\s*(?<StartHours>\d+)\s*:\s*(?<StartMinutes>\d+)\s*:\s*(?<StartSeconds>\d+)\s*\]\s*(?<Text>.*)\s*\[\s*(?<EndHours>\d+)\s*:\s*(?<EndMinutes>\d+)\s*:\s*(?<EndSeconds>\d+)\s*\]"; subtitleOut = "[<<StartHours>>:<<StartMinutes>>:<<StartSeconds>>]<<Text>>\n" + "[<<EndHours>>:<<EndMinutes>>:<<EndSeconds>>]\n"; } } } �sublib-0.9/src/SubLib/Persistency/SubtitleFormatViPlaySubtitleFile.cs�������������������������������0000644�0001750�0001750�00000005034�11000453207�025345� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { internal class SubtitleFormatViPlaySubtitleFile : SubtitleFormat { private static Regex styleExpression = new Regex(@"<[ubi]\w*>", RegexOptions.IgnoreCase); internal SubtitleFormatViPlaySubtitleFile () { name = "ViPlay Subtitle File"; type = SubtitleType.ViPlaySubtitleFile; mode = SubtitleMode.Times; extensions = new string[] { "vsf" }; lineBreak = "|"; format = @"\{\* VIPLAY SUBTITLE FILE \*\}\s*\d+:\d+:\d+,\d+\s*-\s*\d+:\d+:\d+,\d+=.+"; subtitleIn = @"(?<StartHours>\d+)\s*:\s*(?<StartMinutes>\d+)\s*:\s*(?<StartSeconds>\d+)\s*,\s*(?<StartMilliseconds>\d+)\s*-\s*(?<EndHours>\d+)\s*:\s*(?<EndMinutes>\d+)\s*:\s*(?<EndSeconds>\d+)\s*,\s*(?<EndMilliseconds>\d+)\s*=\s*(?<Text>.*)"; subtitleOut = "<<StartHours>>:<<StartMinutes>>:<<StartSeconds>>,<<StartMilliseconds>>-" + "<<EndHours>>:<<EndMinutes>>:<<EndSeconds>>,<<EndMilliseconds>>=<<Text>>\n"; bodyBeginOut = "{* VIPLAY SUBTITLE FILE *}"; } internal override string StyleToString (Style style) { string styleText = String.Empty; if (style.Underline) styleText += "<u>"; if (style.Bold) styleText += "<b>"; if (style.Italic) styleText += "<i>"; return styleText; } // can be optimized internal override void SubtitleInputPostProcess (Subtitle subtitle) { string subtitleText = subtitle.Text.Get(lineBreak); string styleText = String.Empty; MatchCollection matches = styleExpression.Matches(subtitleText); foreach (Match match in matches) { styleText += match.Value; } Style style = StringToStyle(styleText); subtitle.Style = style; subtitleText = styleExpression.Replace(subtitleText, String.Empty); subtitle.Text.Set(subtitleText, lineBreak, true); } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/SubtitleFormatSubRip.cs�������������������������������������������0000644�0001750�0001750�00000005463�10657306502�023053� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2005-2006 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { internal class SubtitleFormatSubRip : SubtitleFormat { private static Regex styleExpression = new Regex(@"</?[^ubi\n]*[ubi]\w*>", RegexOptions.IgnoreCase); internal SubtitleFormatSubRip () { name = "SubRip"; type = SubtitleType.SubRip; mode = SubtitleMode.Times; extensions = new string[] { "srt" }; lineBreak = "\n"; format = @"\d+[ \f\r\t\v]*\n\d+(\s*:\s*\d+){2}\s*,\s*\d+\s*-->\s*\d+(\s*:\s*\d+){2}\s*,\d+[ \f\r\t\v]*\n.+"; subtitleIn = @"(\d*[^\n]*\n)?((?<StartHours>\d+)[^\d\n]+)?(?<StartMinutes>\d+)[^\d\n]+(?<StartSeconds>\d+)([^\d\n](?<StartMilliseconds>\d+))?[^\d\n]+((?<EndHours>\d+)[^\d\n]+)?(?<EndMinutes>\d+)[^\d\n]+(?<EndSeconds>\d+)([^\d\n](?<EndMilliseconds>\d+))?.*(?<Text>(\n?.*(?!\n[ \f\r\t\v]*\n))*.)"; subtitleOut = "<<SubtitleNumber>>\n" + "<<StartHours>>:<<StartMinutes>>:<<StartSeconds>>,<<StartMilliseconds>> --> <<EndHours>>:<<EndMinutes>>:<<EndSeconds>>,<<EndMilliseconds>>\n" + "<<Style>><<Text>><<EndOfStyle>>\n"; } internal override string StyleToString (Style style) { string styleText = String.Empty; if (style.Underline) styleText += "<u>"; if (style.Bold) styleText += "<b>"; if (style.Italic) styleText += "<i>"; return styleText; } internal override string EndOfStyleToString (Style style) { string styleText = String.Empty; if (style.Underline) styleText += "</u>"; if (style.Bold) styleText += "</b>"; if (style.Italic) styleText += "</i>"; return styleText; } // can be optimized internal override void SubtitleInputPostProcess (Subtitle subtitle) { string subtitleText = subtitle.Text.Get(lineBreak); string styleText = String.Empty; MatchCollection matches = styleExpression.Matches(subtitleText); foreach (Match match in matches) { styleText += match.Value; } Style style = StringToStyle(styleText); subtitle.Style = style; subtitleText = styleExpression.Replace(subtitleText, String.Empty); subtitle.Text.Set(subtitleText, lineBreak, true); } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/SubtitleFormatSubCreator1x.cs�������������������������������������0000644�0001750�0001750�00000003077�11000453207�024154� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { internal class SubtitleFormatSubCreator1x : SubtitleFormat { internal SubtitleFormatSubCreator1x () { name = "SubCreator 1.x"; type = SubtitleType.SubCreator1x; mode = SubtitleMode.Times; extensions = new string[] { "txt" }; lineBreak = "|"; format = @"\d+:\d+:\d+.\d:\s*.+\s+\d+:\d+:\d+.\d:"; subtitleIn = @"(?<StartHours>\d+):(?<StartMinutes>\d+):(?<StartSeconds>\d+).(?<StartDeciseconds>\d+):\s*(?<Text>.+)\s+(?<EndHours>\d+):(?<EndMinutes>\d+):(?<EndSeconds>\d+).(?<EndDeciseconds>\d+)"; subtitleOut = "<<StartHours>>:<<StartMinutes>>:<<StartSeconds>>.<<StartDeciseconds>>:" + "<<Text>>\n<<EndHours>>:<<EndMinutes>>:<<EndSeconds>>.<<EndDeciseconds>>:\n"; } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/SubtitleFormatPhoenixJapanimationSociety.cs�����������������������0000644�0001750�0001750�00000002533�11000453207�027133� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { internal class SubtitleFormatPhoenixJapanimationSociety : SubtitleFormat { internal SubtitleFormatPhoenixJapanimationSociety() { name = "Phoenix Japanimation Society"; type = SubtitleType.PhoenixJapanimationSociety; mode = SubtitleMode.Frames; extensions = new string[] { "pjs" }; lineBreak = "|"; format = @"\s*\d+,\s*\d+,\s*"".+"""; subtitleIn = @"\s*(?<StartFrame>\d+),\s*(?<EndFrame>\d+),\s*""(?<Text>.+)"""; subtitleOut = "\t<<StartFrame>>,\t<<EndFrame>>, <<Text>>\n"; } } }���������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/VerboseConsole.cs�������������������������������������������������0000644�0001750�0001750�00000002215�10640336417�021702� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2006 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; namespace SubLib { internal class VerboseConsole { private static bool verbose = false; internal static bool Verbose { get { return verbose; } set { verbose = value; } } internal static void Write (string text) { if (verbose) Console.Write(text); } internal static void WriteLine (string text) { if (verbose) Console.WriteLine(text); } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/SubtitleFormatAdobeEncoreDVD.cs�����������������������������������0000644�0001750�0001750�00000005701�10657311250�024342� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { internal class SubtitleFormatAdobeEncoreDVD : SubtitleFormat { private Regex inputRegexPAL = new Regex(@"\d+(\s*:\s*\d+){3}\s+\d+(\s*:\s*\d+){3}\s*.+"); internal SubtitleFormatAdobeEncoreDVD () { name = "Adobe Encore DVD"; type = SubtitleType.AdobeEncoreDVD; mode = SubtitleMode.Times; extensions = new string[] { "txt" }; lineBreak = "\n"; format = @"(\d+\s+)?\d+(\s*[:;]\s*\d+){3}\s+\d+(\s*[:;]\s*\d+){3}\s*.+"; subtitleIn = @"(\d+\s+)?(?<StartHours>\d+)\s*[:;]\s*(?<StartMinutes>\d+)\s*[:;]\s*(?<StartSeconds>\d+)\s*[:;]\s*(?<StartMillisecondsAsFrames>\d+)\s+(?<EndHours>\d+)\s*[:;]\s*(?<EndMinutes>\d+)\s*[:;]\s*(?<EndSeconds>\d+)\s*[:;]\s*(?<EndMillisecondsAsFrames>\d+)\s+(?<Text>((.(?!(\d+\s+)?\d+(\s*[:;]\s*\d+){3}))*\n)+)"; subtitleOut = null; } internal override string GetDynamicSubtitleOut (SubtitleProperties properties) { bool isFrameRatePAL = IsFrameRatePAL(properties.CurrentFrameRate); char sep = GetTimingSeparator(isFrameRatePAL); string suf = GetFrameRateSuffix(isFrameRatePAL); return "<<SubtitleNumber>> <<StartHours>>" + sep + "<<StartMinutes>>" + sep + "<<StartSeconds>>" + sep + "<<StartMillisecondsAsFrames" + suf + ">> <<EndHours>>" + sep + "<<EndMinutes>>" + sep + "<<EndSeconds>>" + sep + "<<EndMillisecondsAsFrames" + suf + ">> <<Text>>"; } internal override void GlobalInputGetProperties (string text, ParsingProperties properties) { bool isFrameRatePAL = inputRegexPAL.Match(text).Success; float frameRate = (isFrameRatePAL ? 25 : 29.97F); properties.OriginalFrameRate = frameRate; } /* Private members */ /// <summary>Returns the PAL (25) or NTSC (29.97) timing separator char, according to whether the frame rate is PAL or NTSC.</summary> private char GetTimingSeparator (bool isFrameRatePAL) { return (isFrameRatePAL ? ':' : ';'); } private string GetFrameRateSuffix (bool isFrameRatePAL) { return (isFrameRatePAL ? "PAL" : "NTSC"); } /// <summary>Returns whether the frame rate is closer to PAL (25) or to NTSC (29.97).</summary> private bool IsFrameRatePAL (float frameRate) { return (Math.Abs(frameRate - 25) <= Math.Abs(frameRate - 29.97)); } } }���������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/SubtitleFormatMicroDVD.cs�����������������������������������������0000644�0001750�0001750�00000004324�10657306502�023251� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2005-2006 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { internal class SubtitleFormatMicroDVD : SubtitleFormat { internal SubtitleFormatMicroDVD () { name = "Micro DVD"; type = SubtitleType.MicroDVD; mode = SubtitleMode.Frames; extensions = new string[] { "sub" }; lineBreak = "|"; format = @"\{\s*\d+\s*\}\s*\{\s*\d+\s*\}\s*.+"; subtitleIn = @"\{[^\d\n]*(?<StartFrame>\d+)[^\}\n]*\}([^\{\n]*\{[^\d\n]*(?<EndFrame>\d+)[^\}\n]*\})?(?<Text>.*)"; subtitleOut = "{<<StartFrame>>}{<<EndFrame>>}<<Style>><<Text>>"; } private static Regex styleExpression = new Regex(@"\{[^Y]*Y[^:]*:\w*\}", RegexOptions.IgnoreCase); internal override string StyleToString(Style style) { string styleText = String.Empty; if (style.Enabled) { styleText += "{Y:"; if (style.Underline) styleText += 'u'; if (style.Bold) styleText += 'b'; if (style.Italic) styleText += 'i'; styleText += '}'; } return styleText; } internal override void SubtitleInputPostProcess (Subtitle subtitle) { string subtitleText = subtitle.Text.Get(lineBreak); string styleText = String.Empty; MatchCollection matches = styleExpression.Matches(subtitleText); foreach (Match match in matches) { styleText += match.Value; } Style style = StringToStyle(styleText); subtitle.Style = style; subtitleText = styleExpression.Replace(subtitleText, String.Empty); subtitle.Text.Set(subtitleText, lineBreak, true); } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/SubtitleFormatMPlayer.cs������������������������������������������0000644�0001750�0001750�00000002341�10640336417�023210� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2006 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; namespace SubLib { internal class SubtitleFormatMPlayer : SubtitleFormat { internal SubtitleFormatMPlayer () { name = "MPlayer"; type = SubtitleType.MPlayer; mode = SubtitleMode.Frames; extensions = new string[] { "mpl" }; lineBreak = "|"; format = @"\d+,\d+,\d+,"; subtitleIn = @"(?<StartFrame>\d+)\s*,[^\d\n]*(?<EndFrame>\d+)\s*,[^\d\n]*\d+\s*,(?<Text>.*)"; subtitleOut = "<<StartFrame>>,<<EndFrame>>,0,<<Text>>"; } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/SubtitleOutput.cs�������������������������������������������������0000644�0001750�0001750�00000020666�10657204003�021771� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2005-2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Collections; using System.Text; using System.Text.RegularExpressions; namespace SubLib { internal class SubtitleOutput { private SubtitleFormat format = null; private SubtitleTextType textType = SubtitleTextType.Text; private Subtitle subtitle = null; private Subtitle previousSubtitle = null; private int subtitleNumber = 1; internal SubtitleOutput (SubtitleFormat format, SubtitleTextType textType) { this.format = format; this.textType = textType; } internal string Build (SubtitleCollection collection, SubtitleProperties subtitleProperties, FileProperties fileProperties) { StringBuilder output = new StringBuilder(); if (format.HasHeaders) output.Append(format.HeadersToString(subtitleProperties, fileProperties)); if (format.HasBodyBegin) output.Append(format.BodyBeginOut); string subtitleExpression = GetSubtitleExpression(format, subtitleProperties, fileProperties); Regex fieldExpression = new Regex(@"<<(?<Field>\w+)(,(?<Width>\d+))?>>"); MatchEvaluator matchEvaluator = new MatchEvaluator(this.FieldEvaluator); foreach (Subtitle currentSubtitle in collection) { subtitle = currentSubtitle; string outputSubtitle = fieldExpression.Replace(subtitleExpression, matchEvaluator); output.Append(outputSubtitle); output.Append("\n"); subtitleNumber++; previousSubtitle = subtitle; } if (format.HasBodyEnd) output.Append(format.BodyEndOut); subtitle = null; previousSubtitle = null; subtitleNumber = 1; ConvertNewlines(output, fileProperties); return output.ToString(); } /* Private members */ private string FieldEvaluator (Match match) { Group fieldGroup = match.Groups["Field"]; string field = fieldGroup.Value; switch (field) { case "StartFrame": int startFrame = subtitle.Frames.Start; return FormatedField(startFrame, match); case "StartElapsedFrames": int previousFrames = (previousSubtitle == null ? 0 : previousSubtitle.Frames.End); int startElapsedFrames = subtitle.Frames.Start - previousFrames; return FormatedField(startElapsedFrames, match); case "EndFrame": int endFrame = subtitle.Frames.End; return FormatedField(endFrame, match); case "EndElapsedFrames": int endElapsedFrames = subtitle.Frames.Duration; return FormatedField(endElapsedFrames, match); case "StartHours": int startHours = subtitle.Times.Start.Hours; return FormatedField(startHours, 2, match); case "StartMinutes": int startMinutes = subtitle.Times.Start.Minutes; return FormatedField(startMinutes, 2, match); case "StartSeconds": int startSeconds = subtitle.Times.Start.Seconds; return FormatedField(startSeconds, 2, match); case "StartDeciseconds": int startDeciseconds = DivideAndRound(subtitle.Times.Start.Milliseconds, 100); return FormatedField(startDeciseconds, 2, match); case "StartTotalDeciseconds": int startTotalDeciseconds = DivideAndRound((int)subtitle.Times.Start.TotalMilliseconds, 100); return startTotalDeciseconds.ToString(); case "StartCentiseconds": int startCentiseconds = DivideAndRound(subtitle.Times.Start.Milliseconds, 10); return FormatedField(startCentiseconds, 2, match); case "StartMilliseconds": int startMilliseconds = subtitle.Times.Start.Milliseconds; return FormatedField(startMilliseconds, 3, match); case "StartMillisecondsAsFramesPAL": int startMillisecondsAsFramesPAL = (int)Synchronization.TimeMillisecondsToFrames(subtitle.Times.Start.Milliseconds, 25); return FormatedField(startMillisecondsAsFramesPAL, match); case "StartMillisecondsAsFramesNTSC": int startMillisecondsAsFramesNTSC = (int)Synchronization.TimeMillisecondsToFrames(subtitle.Times.Start.Milliseconds, 29.97F); return FormatedField(startMillisecondsAsFramesNTSC, match); case "EndMillisecondsAsFramesPAL": int endMillisecondsAsFramesPAL = (int)Synchronization.TimeMillisecondsToFrames(subtitle.Times.End.Milliseconds, 25); return FormatedField(endMillisecondsAsFramesPAL, match); case "EndMillisecondsAsFramesNTSC": int endMillisecondsAsFramesNTSC = (int)Synchronization.TimeMillisecondsToFrames(subtitle.Times.End.Milliseconds, 29.97F); return FormatedField(endMillisecondsAsFramesNTSC, match); case "StartElapsedTime": TimeSpan previousTime = (previousSubtitle == null ? TimeSpan.Zero : previousSubtitle.Times.End); TimeSpan startElapsedTime = subtitle.Times.Start - previousTime; return FormatedField(startElapsedTime.TotalSeconds); case "EndHours": int endHours = subtitle.Times.End.Hours; return FormatedField(endHours, 2, match); case "EndMinutes": int endMinutes = subtitle.Times.End.Minutes; return FormatedField(endMinutes, 2, match); case "EndSeconds": int endSeconds = subtitle.Times.End.Seconds; return FormatedField(endSeconds, 2, match); case "EndDeciseconds": int endDeciseconds = DivideAndRound(subtitle.Times.End.Milliseconds, 100); return FormatedField(endDeciseconds, 2, match); case "EndTotalDeciseconds": int endTotalDeciseconds = DivideAndRound((int)subtitle.Times.End.TotalMilliseconds, 100); return endTotalDeciseconds.ToString(); case "EndCentiseconds": int endCentiseconds = DivideAndRound(subtitle.Times.End.Milliseconds, 10); return FormatedField(endCentiseconds, 2, match); case "EndMilliseconds": int endMilliseconds = subtitle.Times.End.Milliseconds; return FormatedField(endMilliseconds, 3, match); case "EndElapsedTime": TimeSpan endElapsedTime = subtitle.Times.Duration; return FormatedField(endElapsedTime.TotalSeconds); case "Text": SubtitleText subtitleText = (textType == SubtitleTextType.Text ? subtitle.Text : subtitle.Translation); string text = subtitleText.GetTrimLines(format.LineBreak); return text.ToString(); case "Style": string style = format.StyleToString(subtitle.Style); return style.ToString(); case "EndOfStyle": string endOfStyle = format.EndOfStyleToString(subtitle.Style); return endOfStyle.ToString(); case "SubtitleNumber": return FormatedField(subtitleNumber, match); default: return match.Value; } } private string FormatedField (int field, int defaultWidth, Match match) { Group group = match.Groups["Width"]; int width = (group.Success ? Convert.ToInt32(group.Value) : defaultWidth); return DimensionField(field, width); } private string FormatedField (int field, Match match) { Group group = match.Groups["Width"]; if (group.Success) { int width = Convert.ToInt32(group.Value); return DimensionField(field, width); } else return field.ToString(); } private string FormatedField (double field) { return field.ToString("0.###"); } private string DimensionField (int field, int width) { return field.ToString("D" + width).Substring(0, width); } private int DivideAndRound (int number, int denominator) { return (int)Math.Round((double)number / denominator); } private void ConvertNewlines (StringBuilder builder, FileProperties properties) { NewlineType type = properties.NewlineType; if ((type == NewlineType.Unknown) || (type == NewlineType.Unix)) return; string newline = (type == NewlineType.Windows ? "\r\n" : "\r"); //Windows : Macintosh builder.Replace("\n", newline); } private string GetSubtitleExpression (SubtitleFormat format, SubtitleProperties subtitleProperties, FileProperties fileProperties) { if (format.Mode == SubtitleMode.Both) { if (fileProperties.TimingMode == TimingMode.Times) return format.SubtitleOutTimesMode; else return format.SubtitleOutFramesMode; } else { if (format.SubtitleOut != null) return format.SubtitleOut; else return format.GetDynamicSubtitleOut(subtitleProperties); } } } } ��������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/SubtitleFormatKaraokeLyricsVKT.cs���������������������������������0000644�0001750�0001750�00000004033�11000453207�024753� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { internal class SubtitleFormatKaraokeLyricsVKT : SubtitleFormat { internal SubtitleFormatKaraokeLyricsVKT() { name = "Karaoke Lyrics VKT"; type = SubtitleType.KaraokeLyricsVKT; mode = SubtitleMode.Frames; extensions = new string[] { "vkt" }; lineBreak = "|"; // It does not manage line breaks, but still using this char as a separator format = @"\{\s*\d+\s*.+\s*\}\n+\{\s*\d+\s*\}"; subtitleIn = @"\{\s*(?<StartFrame>\d+)\s*(?<Text>.+)\}\n+\{\s*(?<EndFrame>\d+)\s*\}"; subtitleOut = "{<<StartFrame>> <<Text>>}\n{<<EndFrame>> }"; bodyEndIn = @"#\s*[\n#]+\s+THE END."; bodyEndOut = "#\n# THE END.\n"; headers = new string[] { @"FRAME RATE=(?<FrameRate>.*)" , @"CREATOR=(?<Author>.*)" , @"VIDEO SOURCE=(?<Source>.*)" , @"DATE=(?<Date>.*)" }; } internal override string HeadersToString(SubtitleProperties subtitleProperties, FileProperties fileProperties) { Headers headers = subtitleProperties.Headers; return "# <HEAD>\n" + "# FRAME RATE=" + headers.FrameRate + "\n" + "# CREATOR=" + headers.Author + "\n" + "# VIDEO SOURCE=" + headers.VideoSource + "\n" + "# DATE=" + headers.Date + "\n" + "# </HEAD>\n#\n"; } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/ParsingProperties.cs����������������������������������������������0000644�0001750�0001750�00000002324�10673235452�022436� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ namespace SubLib { internal class ParsingProperties { private Headers headers = new Headers(); private TimingMode timingMode = TimingMode.Times; private float originalFrameRate = 25; public Headers Headers { get { return headers; } } public TimingMode TimingMode { get { return timingMode; } set { timingMode = value; } } public float OriginalFrameRate { get { return originalFrameRate; } set { originalFrameRate = value; } } } }������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/SubtitleFormatPowerDivX.cs����������������������������������������0000644�0001750�0001750�00000002734�10677301216�023533� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { internal class SubtitleFormatPowerDivX : SubtitleFormat { internal SubtitleFormatPowerDivX () { name = "Power DivX"; type = SubtitleType.PowerDivX; mode = SubtitleMode.Times; extensions = new string[] { "psb" }; lineBreak = "|"; format = @"\{\s*\d+:\d+:\d+\s*\}\{\s*\d+:\d+:\d+\s*\}\s*.+"; subtitleIn = @"\{\s*(?<StartHours>\d+)\s*:\s*(?<StartMinutes>\d+)\s*:\s*(?<StartSeconds>\d+)\s*\}\s*\{\s*(?<EndHours>\d+)\s*:\s*(?<EndMinutes>\d+)\s*:\s*(?<EndSeconds>\d+)\s*\}\s*(?<Text>.*)"; subtitleOut = "{<<StartHours>>:<<StartMinutes>>:<<StartSeconds>>}" + "{<<EndHours>>:<<EndMinutes>>:<<EndSeconds>>}<<Text>>"; } } }������������������������������������sublib-0.9/src/SubLib/Persistency/SubtitleFormatSubStationAlpha.cs����������������������������������0000644�0001750�0001750�00000013757�10673235452�024720� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2006-2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { internal class SubtitleFormatSubStationAlpha : SubtitleFormat { private static Regex styleExpression = new Regex(@"\{\\[ubi]\d\}", RegexOptions.IgnoreCase); internal SubtitleFormatSubStationAlpha () { name = FormatName; type = FormatType; extensions = FormatExtensions; mode = SubtitleMode.Times; lineBreak = @"\N"; format = @"\[\s*" + StyleTypeIn + @"\s*Styles\s*\][^\[]*\[\s*Events\s*\]\s*Format:\s*[^,\n]*(,[^,\n]*){9}"; subtitleIn = @"Dialogue:[^,]*,(?<StartHours>\d+):(?<StartMinutes>\d+):(?<StartSeconds>\d+)\.(?<StartCentiseconds>\d+),(?<EndHours>\d+):(?<EndMinutes>\d+):(?<EndSeconds>\d+)\.(?<EndCentiseconds>\d+)(,[^,]*){6},(?<Text>.*)"; subtitleOut = FormatSubtitleOut; bodyBeginOut = FormatBodyBeginOut; headers = new string[] { @"Title:(?<Title>.*)" , @"Original\s*Script:(?<OriginalScript>.*)" , @"Original\s*Translation:(?<OriginalTranslation>.*)" , @"Original\s*Editing:(?<OriginalEditing>.*)" , @"Original\s*Timing:(?<OriginalTiming>.*)" , @"Original\s*Script\s*Checking:(?<OriginalScriptChecking>.*)" , @"Script\s*Updated\s*By:(?<ScriptUpdatedBy>.*)" , @"Collisions:(?<Collisions>.*)" , @"PlayResX:\s*(?<PlayResX>\d*)" , @"PlayResY:\s*(?<PlayResY>\d*)" , @"PlayDepth:\s*(?<PlayDepth>\d*)" , @"Timer:(?<Timer>.*)" }; } internal override string StyleToString (Style style) { return StyleToString(style, "1"); } internal override string EndOfStyleToString (Style style) { return StyleToString(style, "0"); } internal override void SubtitleInputPostProcess (Subtitle subtitle) { string subtitleText = subtitle.Text.Get(lineBreak); string styleText = String.Empty; MatchCollection matches = styleExpression.Matches(subtitleText); foreach (Match match in matches) { styleText += match.Value; } Style style = StringToStyle(styleText); subtitle.Style = style; subtitleText = styleExpression.Replace(subtitleText, String.Empty); subtitle.Text.Set(subtitleText, lineBreak, true); } internal override string HeadersToString (SubtitleProperties subtitleProperties, FileProperties fileProperties) { Headers headers = subtitleProperties.Headers; return "[Script Info]\n" + Header("Title:", headers.Title, "<untitled>") + Header("Original Script:", headers.OriginalScript, "<unknown>") + "Script Type: " + ScriptType + "\n" + Header("Original Translation:", headers.OriginalTranslation) + Header("Original Editing:", headers.OriginalEditing) + Header("Original Timing:", headers.OriginalTiming) + Header("Original Script Checking:", headers.OriginalScriptChecking) + Header("Script Updated By:", headers.ScriptUpdatedBy) + Header("Collisions:", headers.Collisions) + Header("PlayResX:", headers.PlayResX) + Header("PlayResY:", headers.PlayResY) + Header("PlayDepth:", headers.PlayDepth) + Header("Timer:", headers.Timer) + "\n" + StyleSection; } /* Protected members */ protected virtual string FormatName { get { return "Sub Station Alpha"; } } protected virtual SubtitleType FormatType { get { return SubtitleType.SubStationAlpha; } } protected virtual string[] FormatExtensions { get { return new string[] { "ssa" }; } } protected virtual string FormatBodyBeginOut { get { return "[Events]\nFormat: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\n"; } } protected virtual string FormatSubtitleOut { get { return "Dialogue: Marked=0,<<StartHours,1>>:<<StartMinutes>>:<<StartSeconds>>.<<StartCentiseconds>>,<<EndHours,1>>:<<EndMinutes>>:<<EndSeconds>>.<<EndCentiseconds>>,Default,NTP,0000,0000,0000,!Effect,<<Style>><<Text>><<EndOfStyle>>"; } } protected virtual string ScriptType { get { return "v4.00"; } } protected virtual string StyleTypeIn { get { return "V4"; } } protected virtual string StyleSection { get { return "[V4 Styles]\nFormat: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding\n" + "Style: Default,Tahoma,24,16777215,16777215,16777215,0,-1,0,1,1,1,2,10,10,30,0,0\n\n"; } } /* Private members */ private string Header (string headerIntro, string headerValue, string defaultValue) { if (headerValue == String.Empty) return headerIntro + " " + defaultValue + "\n"; else return headerIntro + " " + headerValue + "\n"; } private string Header (string headerIntro, string headerValue) { if (headerValue == String.Empty) return String.Empty; else return headerIntro + " " + headerValue + "\n"; } private string Header (string headerIntro, int headerValue) { if (headerValue == -1) return String.Empty; else return headerIntro + " " + headerValue + "\n"; } protected string StyleToString (Style style, string suffix) { string styleText = String.Empty; if (style.Underline) styleText += @"{\u" + suffix + "}"; if (style.Bold) styleText += @"{\b" + suffix + "}"; if (style.Italic) styleText += @"{\i" + suffix + "}"; return styleText; } } } �����������������sublib-0.9/src/SubLib/Persistency/FileInputOutput.cs������������������������������������������������0000644�0001750�0001750�00000012302�10640336417�022070� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2005-2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Collections; using System.IO; using System.Text; using org.mozilla.intl.chardet; namespace SubLib { internal class FileInputOutput { /// <summary>Opens a file for reading.</summary> internal static FileStream OpenFileForReading (string fileName) { return new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); } /// <summary>Detects the possible code pages by reading a specified stream.</summary> /// <remarks>The stream reader position is reset after reading.</remarks> /// <returns>The detected code pages, which will have zero length if none was detected.</returns> internal static int[] DetectCodePages (Stream stream){ const int BUFFERSIZE = 1024; nsDetector detector = new nsDetector(nsPSMDetector.ALL); detector.Init(null); byte[] buffer = new byte[BUFFERSIZE] ; int readLength = 0; bool finished = false; while (!finished) { readLength = stream.Read(buffer, 0, buffer.Length); if (readLength == 0) break; finished = detector.DoIt(buffer, readLength, false); } detector.Done(); stream.Seek(0, SeekOrigin.Begin); string[] detectedEncodings = detector.getProbableCharsets(); VerboseConsole.WriteLine(DetectedEncodingsToString(detectedEncodings)); /* Check if no encoding was detected */ if (detectedEncodings[0] == "nomatch") return new int[0]; return GetCodePages(detectedEncodings); } /// <summary>Reads a file, given its <see cref="FileStream" /> and <see cref="Encoding" />.</summary> /// <param name="file">The <see cref="FileStream" />.</param> /// <param name="encoding">The <see cref="Encoding" />.</param> /// <param name="reposition">Whether to reposition the stream position to the beginning after reading.</param> /// <remarks>The newlines are converted to unix type.</remarks> /// <returns> The read text.</returns> internal static string ReadFile (FileStream file, Encoding encoding, bool reposition) { StreamReader reader = new StreamReader(file, encoding, false); string text = reader.ReadToEnd(); if (reposition) file.Seek(0, SeekOrigin.Begin); return ConvertNewLinesToUnix(text); } internal static void WriteFile (string fileName, string text){ StreamWriter writer = OpenFileForWriting(fileName); try { writer.Write(text); } finally { writer.Close(); } } internal static void WriteFile (string fileName, string text, Encoding encoding) { StreamWriter writer = OpenFileForWriting(fileName, encoding); try { writer.Write(text); } finally { writer.Close(); } } /* Private members */ private static StreamWriter OpenFileForWriting (string fileName) { FileStream file = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None); StreamWriter fileWriter = new StreamWriter(file); return fileWriter; } private static StreamWriter OpenFileForWriting (string fileName, Encoding encoding) { FileStream file = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None); StreamWriter fileWriter = new StreamWriter(file, encoding); return fileWriter; } private static int[] GetCodePages (string[] encodings) { ArrayList codePages = new ArrayList(); foreach (string encoding in encodings) { int codePage = GetCodePage(encoding); if (codePage != -1) codePages.Add(codePage); } return (int[])codePages.ToArray(typeof(int)); } // Note: ISO-2022-CN, HZ-GB-2312 and x-euc-tw are not defined as their code pages were not found private static int GetCodePage (string encoding) { switch (encoding) { case "UTF-8": return 65001; case "windows-1252": return 1252; case "UTF-16LE": return 1200; case "UTF-16BE": return 1201; case "Shift_JIS": return 932; case "Big5": return 950; case "ISO-2022-KR": return 50225; case "ISO-2022-JP": return 50221; case "GB2312": return 936; case "GB18030": return 54936; case "EUC-KR": return 51949; case "EUC-JP": return 51932; default: return -1; } } private static string DetectedEncodingsToString (string[] detectedEncodings) { string result = "Detected encodings:"; foreach (string encoding in detectedEncodings) { result += " " + encoding; } return result; } /// <summary>Replaces the occurrences of Windows and Mac newline chars with unix newline.</summary> private static string ConvertNewLinesToUnix (string text) { text = text.Replace("\r\n", "\n"); //Replace Windows newline text = text.Replace("\r", "\n"); //Replace Mac newline return text; } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/BuiltInSubtitleFormats.cs�����������������������������������������0000644�0001750�0001750�00000005514�11000453207�023361� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2005-2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { internal static class BuiltInSubtitleFormats { /* Must be ordered with more precise subtitle formats first, so simple formats don't match other formats * Must conform to the order in SubtitleType Enum */ private static SubtitleFormat[] subtitleFormats = { new SubtitleFormatMicroDVD(), new SubtitleFormatSubRip(), new SubtitleFormatSubStationAlpha(), new SubtitleFormatAdvancedSubStationAlpha(), new SubtitleFormatMPlayer(), new SubtitleFormatMPlayer2(), new SubtitleFormatMPSub(), new SubtitleFormatSubViewer1(), new SubtitleFormatSubViewer2(), new SubtitleFormatAQTitle(), new SubtitleFormatMacSUB(), new SubtitleFormatPhoenixJapanimationSociety(), new SubtitleFormatPanimator(), new SubtitleFormatSofni(), new SubtitleFormatSubCreator1x(), new SubtitleFormatViPlaySubtitleFile(), new SubtitleFormatDKSSubtitleFormat(), new SubtitleFormatPowerDivX(), new SubtitleFormatKaraokeLyricsVKT(), new SubtitleFormatKaraokeLyricsLRC(), new SubtitleFormatAdobeEncoreDVD() }; internal static SubtitleFormat[] SubtitleFormats { get { return subtitleFormats; } } internal static SubtitleFormat GetFormat (SubtitleType subtitleType) { if (subtitleType == SubtitleType.Unknown) return null; else return subtitleFormats[(int)subtitleType - 1]; } internal static SubtitleFormat Detect (string subtitleText) { int lengthToTest = Math.Min(subtitleText.Length, 2000); //only use the first 2000 chars foreach (SubtitleFormat format in BuiltInSubtitleFormats.SubtitleFormats) { bool matchSuccess = TrySubtitleFormat(format, subtitleText, lengthToTest); if (matchSuccess) return format; } throw new UnknownSubtitleFormatException(); } private static bool TrySubtitleFormat (SubtitleFormat format, string subtitleText, int length) { Regex expression = new Regex(format.Format, RegexOptions.IgnoreCase); Match match = expression.Match(subtitleText, 0, length); return match.Success; } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/SubtitleFormatSubViewer2.cs���������������������������������������0000644�0001750�0001750�00000005532�10673235452�023644� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2006-2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { internal class SubtitleFormatSubViewer2 : SubtitleFormat { internal SubtitleFormatSubViewer2 () { name = "SubViewer 2.0"; type = SubtitleType.SubViewer2; mode = SubtitleMode.Times; extensions = new string[] { "sub" }; lineBreak = "[br]"; format = @"\d\d:\d\d:\d\d.\d\d,\d\d:\d\d:\d\d.\d\d"; subtitleIn = @"(?<StartHours>\d+)\s*:\s*(?<StartMinutes>\d+)\s*:\s*(?<StartSeconds>\d+)\s*\.\s*(?<StartCentiseconds>\d+)\s*,\s*(?<EndHours>\d+)\s*:\s*(?<EndMinutes>\d+)\s*:\s*(?<EndSeconds>\d+)\s*\.\s*(?<EndCentiseconds>\d+).*\n(?<Text>.*)"; subtitleOut = "<<StartHours>>:<<StartMinutes>>:<<StartSeconds>>.<<StartCentiseconds>>,<<EndHours>>:<<EndMinutes>>:<<EndSeconds>>.<<EndCentiseconds>>\n<<Text>>\n"; headers = new string[] { @"\[\s*TITLE\s*\](?<Title>.*)" , @"\[\s*AUTHOR\s*\](?<Author>.*)" , @"\[\s*SOURCE\s*\](?<Source>.*)" , @"\[\s*PRG\s*\](?<Program>.*)" , @"\[\s*FILEPATH\s*\](?<FilePath>.*)" , @"\[\s*DELAY\s*\](?<Delay>.*)" , @"\[\s*CD\s*TRACK\s*\](?<CdTrack>.*)" , @"\[\s*COMMENT\s*\](?<Comment>.*)" , @"\[\s*COLF\s*\](?<FontColor>[^,\[\n]*)" , @"\[\s*STYLE\s*\](?<FontStyle>[^,\[\n]*)" , @"\[\s*SIZE\s*\](?<FontSize>[^,\[\n]*)" , @"\[\s*FONT\s*\](?<FontName>[^,\[\n]*)" }; } internal override string HeadersToString (SubtitleProperties subtitleProperties, FileProperties fileProperties) { Headers headers = subtitleProperties.Headers; return "[INFORMATION]\n" + "[TITLE]" + headers.Title + "\n" + "[AUTHOR]" + headers.Author + "\n" + "[SOURCE]" + headers.VideoSource + "\n" + "[PRG]" + headers.Program + "\n" + "[FILEPATH]" + headers.SubtitlesSource + "\n" + "[DELAY]" + headers.Delay + "\n" + "[CD TRACK]" + headers.CDTrack + "\n" + "[COMMENT]" + headers.Comment + "\n" + "[END INFORMATION]\n" + "[SUBTITLE]\n" + "[COLF]" + headers.FontColor + ",[STYLE]" + headers.FontStyle + ",[SIZE]" + headers.FontSize + ",[FONT]" + headers.FontName + "\n"; } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/SubtitleInput.cs��������������������������������������������������0000644�0001750�0001750�00000017455�10676737220�021607� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2005-2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.IO; using System.Text; namespace SubLib { internal class SubtitleInput { private Encoding fallbackEncoding = null; private SubtitleType subtitleType = SubtitleType.Unknown; internal SubtitleInput (Encoding fallbackEncoding, SubtitleType subtitleType) { this.fallbackEncoding = fallbackEncoding; this.subtitleType = subtitleType; } /// <exception cref="EncodingNotSupportedException">Thrown if the encoding is not supported by the platform.</exception> /// <exception cref="UnknownSubtitleFormatException">Thrown if the subtitle format could not be detected.</exception> internal string Read (string path, out Encoding encoding, out SubtitleFormat format) { /* Open file */ FileStream fileStream = FileInputOutput.OpenFileForReading(path); return ReadSubtitleText(true, fileStream, out encoding, out format); } /// <exception cref="UnknownSubtitleFormatException">Thrown if the subtitle format could not be detected.</exception> internal string Read (string path, Encoding encoding, out SubtitleFormat format) { /* Open file */ FileStream fileStream = FileInputOutput.OpenFileForReading(path); /* Read the text */ return TestEncoding(fileStream, encoding, out format); } /// <exception cref="EncodingNotSupportedException">Thrown if the encoding is not supported by the platform.</exception> internal string ReadPlain (string path, out Encoding encoding) { /* Open file */ FileStream fileStream = FileInputOutput.OpenFileForReading(path); SubtitleFormat format = null; return ReadSubtitleText(false, fileStream, out encoding, out format); } /// <exception cref="EncodingNotSupportedException">Thrown if the encoding is not supported by the platform.</exception> internal string ReadPlain (string path, Encoding encoding) { /* Open file */ FileStream fileStream = FileInputOutput.OpenFileForReading(path); /* Read the text */ return TestEncoding(fileStream, encoding); } /* Private methods */ /// <summary>Checks the encoding of a file.</summary> /// <param name="isSubtitleFile">If it is a subtitle file or a plain text one.</param> /// <param name="fileStream">The stream for reading the file.</param> /// <param name="usedEncoding">The encoding supposedly used.</param> /// <param name="usedFormat">The subtitle format used.</param> /// <exception cref="EncodingNotSupportedException">Thrown if the encoding is not supported by the platform.</exception> /// <exception cref="UnknownSubtitleFormatException">Thrown if the subtitle format could not be detected.</exception> private string ReadSubtitleText (bool isSubtitleFile, FileStream fileStream, out Encoding usedEncoding, out SubtitleFormat usedFormat) { /* Init the out arguments */ usedEncoding = null; usedFormat = null; /* Detect code pages */ int[] codePages = FileInputOutput.DetectCodePages(fileStream); /* Check if no codepage was detected */ if (codePages.Length == 0) { VerboseConsole.WriteLine("No encoding was automatically detected. Using the fall-back encoding: " + fallbackEncoding.WebName); string text; if (isSubtitleFile) text = TestEncoding(fileStream, fallbackEncoding, out usedFormat); else text = TestEncoding(fileStream, fallbackEncoding); usedEncoding = fallbackEncoding; return text; } /* The first code page represents the most probable encoding. If any problem occurs when trying to use * that code page, this problem is registered. The remaining code pages are then tried, and if none works, * the first occuring error is the one to be reported. */ Exception firstEncodingException = null; Exception firstSubtitleFormatException = null; int firstCodePage = codePages[0]; try { string text; if (isSubtitleFile) text = TestCodePage(fileStream, firstCodePage, out usedEncoding, out usedFormat); else text = TestCodePagePlain(fileStream, firstCodePage, out usedEncoding); return text; } catch (EncodingNotSupportedException e) { firstEncodingException = e; } catch (UnknownSubtitleFormatException e) { firstSubtitleFormatException = e; } /* Problems were found, going to try additional code pages */ for (int count = 1 ; count < codePages.Length ; count++) { try { int codePage = codePages[count]; string text; if (isSubtitleFile) text = TestCodePage(fileStream, codePage, out usedEncoding, out usedFormat); else text = TestCodePagePlain(fileStream, codePage, out usedEncoding); return text; } catch (Exception) { //Don't do anything, will try the next code page } } /* No code page worked, throwing the exceptions caught for the first (more probable) code page */ if (firstEncodingException != null) throw firstEncodingException; else throw firstSubtitleFormatException; } /// <exception cref="EncodingNotSupportedException">Thrown if the encoding is not supported by the platform.</exception> /// <exception cref="UnknownSubtitleFormatException">Thrown if the subtitle format could not be detected.</exception> private string TestCodePage (FileStream fileStream, int codePage, out Encoding encoding, out SubtitleFormat format) { /* Check the encoding */ TestCodePageCommon(codePage, out encoding); return TestEncoding(fileStream, encoding, out format); } /// <exception cref="EncodingNotSupportedException">Thrown if the encoding is not supported by the platform.</exception> private string TestCodePagePlain (FileStream fileStream, int codePage, out Encoding encoding) { /* Check the encoding */ TestCodePageCommon(codePage, out encoding); return TestEncoding(fileStream, encoding); } private void TestCodePageCommon (int codePage, out Encoding encoding) { /* Check the encoding */ try { encoding = Encoding.GetEncoding(codePage); } catch (Exception) { throw new EncodingNotSupportedException(); } } /// <exception cref="UnknownSubtitleFormatException">Thrown if the subtitle format could not be detected.</exception> private string TestEncoding (FileStream fileStream, Encoding encoding, out SubtitleFormat format) { /* Get the text */ string text = TestEncoding(fileStream, encoding); /* Check the subtitle format */ format = GetSubtitleFormat(text); return text; } private string TestEncoding (FileStream fileStream, Encoding encoding) { VerboseConsole.WriteLine("Trying the encoding " + encoding.WebName); /* Get the text */ string text = FileInputOutput.ReadFile(fileStream, encoding, true); return text; } /// <exception cref="UnknownSubtitleFormatException">Thrown if the subtitle format could not be detected.</exception> private SubtitleFormat GetSubtitleFormat (string text) { if (subtitleType == SubtitleType.Unknown) VerboseConsole.WriteLine("Trying to autodetect the subtitle format."); else VerboseConsole.WriteLine("Trying the subtitle format " + subtitleType); SubtitleFormat subtitleFormat = null; if (subtitleType == SubtitleType.Unknown) subtitleFormat = BuiltInSubtitleFormats.Detect(text); else subtitleFormat = BuiltInSubtitleFormats.GetFormat(subtitleType); return subtitleFormat; } } }�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/SubtitleFormatMacSUB.cs�������������������������������������������0000644�0001750�0001750�00000002423�11000453207�022676� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { internal class SubtitleFormatMacSUB : SubtitleFormat { internal SubtitleFormatMacSUB() { name = "MacSUB"; type = SubtitleType.MacSUB; mode = SubtitleMode.Frames; extensions = new string[] { "scr" }; lineBreak = "\n"; format = @"/\s*\d+\s+.+\s+/\s*\d+"; subtitleIn = @"/\s*(?<StartFrame>\d+)\n+(?<Text>.+([^\d]\n.+)?)\n+/\s*(?<EndFrame>\d+)"; subtitleOut = "/<<StartFrame>>\n<<Text>>\n/<<EndFrame>>\n"; } } }���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/SubtitleFormatAQTitle.cs������������������������������������������0000644�0001750�0001750�00000004216�11000453207�023131� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { internal class SubtitleFormatAQTitle : SubtitleFormat { private static Regex styleExpression = new Regex(@"<[ubi]\w*>", RegexOptions.IgnoreCase); internal SubtitleFormatAQTitle() { name = "AQ Title"; type = SubtitleType.AQTitle; mode = SubtitleMode.Frames; extensions = new string[] { "aqt" }; lineBreak = "\n"; format = @"-->>\s*\d+\s+.+\s+-->>\s*\d+"; subtitleIn = @"-->>\s*(?<StartFrame>\d+)\s*(?<Text>.*\n.*)\n+-->>\s*(?<EndFrame>\d+)"; subtitleOut = "-->> <<StartFrame>>\n<<Text>>\n-->> <<EndFrame>>\n"; } internal override string StyleToString (Style style) { string styleText = String.Empty; if (style.Underline) styleText += "<u>"; if (style.Bold) styleText += "<b>"; if (style.Italic) styleText += "<i>"; return styleText; } // can be optimized internal override void SubtitleInputPostProcess (Subtitle subtitle) { string subtitleText = subtitle.Text.Get(lineBreak); string styleText = String.Empty; MatchCollection matches = styleExpression.Matches(subtitleText); foreach (Match match in matches) { styleText += match.Value; } Style style = StringToStyle(styleText); subtitle.Style = style; subtitleText = styleExpression.Replace(subtitleText, String.Empty); subtitle.Text.Set(subtitleText, lineBreak, true); } } }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/SubtitleFormatMPSub.cs��������������������������������������������0000644�0001750�0001750�00000004766�10673235452�022645� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2006-2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; namespace SubLib { internal class SubtitleFormatMPSub : SubtitleFormat { internal SubtitleFormatMPSub () { name = "MPSub"; type = SubtitleType.MPSub; mode = SubtitleMode.Both; extensions = new string[] { "sub" }; lineBreak = "\n"; format = @"TITLE\s*=(\n?(?!FORMAT).*(?!FORMAT))*[.\n]FORMAT\s*=\s*(TIME|\d+)\s*(\n?(?!\d+(.\d+)?[^\d\n]+\d+(.\d+)?).*(?!\d+(.\d+)?[^\d\n]+\d+(.\d+)?))*[.\n]\d+(.\d+)?[^\d\n]+\d+(.\d+)?"; subtitleInTimesMode = @"(?<StartElapsedTime>\d+(\.\d*)?)[^\d\n](?<EndElapsedTime>\d+(\.\d*)?).*(?<Text>(\n?.*(?!\n[ \f\r\t\v]*\n))*.)"; subtitleInFramesMode = @"(?<StartElapsedFrames>\d+)[^\d\n](?<EndElapsedFrames>\d+).*(?<Text>(\n?.*(?!\n[ \f\r\t\v]*\n))*.)"; subtitleOutTimesMode = "<<StartElapsedTime>> <<EndElapsedTime>>\n<<Text>>\n"; subtitleOutFramesMode = "<<StartElapsedFrames>> <<EndElapsedFrames>>\n<<Text>>\n"; comments = "#.*"; headers = new string[] { @"TITLE\s*=(?<Title>.*)" , @"FILE\s*=(?<File>.*)" , @"AUTHOR\s*=(?<Author>.*)" , @"TYPE\s*=(?<MediaType>.*)" , @"FORMAT\s*=(?<TimingModeTimes>TIME)" , @"FORMAT\s*=(?<TimingModeFrames>\d+(.\d+)?)" , @"NOTE\s*=(?<Note>.*)" }; } internal override string HeadersToString (SubtitleProperties subtitleProperties, FileProperties fileProperties) { Headers headers = subtitleProperties.Headers; string format = (fileProperties.TimingMode == TimingMode.Times ? "TIME" : subtitleProperties.CurrentFrameRate.ToString()); return "TITLE=" + headers.Title + "\n" + "FILE=" + headers.FileProperties + "\n" + "AUTHOR=" + headers.Author + "\n" + "TYPE=" + headers.MediaType + "\n" + "FORMAT=" + format + "\n" + "NOTE=" + headers.Comment + "\n\n"; } } } ����������sublib-0.9/src/SubLib/Persistency/PlainTextParser.cs������������������������������������������������0000644�0001750�0001750�00000005372�11000453207�022032� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.IO; using System.Text; using System.Text.RegularExpressions; namespace SubLib { internal class PlainTextParser { private bool withCharacterNames = false; private string lineSeparator = String.Empty; private string text = String.Empty; internal PlainTextParser(bool withCharacterNames, string lineSeparator) { this.withCharacterNames = withCharacterNames; this.lineSeparator = lineSeparator; } internal PlainTextParser(bool withCharacterNames) : this(withCharacterNames, @"\n") { } /// <summary>Parses the specified text.</summary> /// <remarks>The created <see cref="SubtitleCollection" /> will have its <see cref="SubtitleProperties" /> property set to null. /// It is mandatory to use <see cref="SubtitleCollection.SetPropertiesForAll" /> after.</remarks> internal ParsingProperties Parse (string text, TimingMode timingMode, Encoding encoding, out SubtitleCollection collection) { collection = new SubtitleCollection(); ParsingProperties properties = new ParsingProperties(); this.text = text; properties.TimingMode = timingMode; /* Read the subtitles */ ReadSubtitles(encoding, properties, collection); return properties; } private void ReadSubtitles (Encoding encoding, ParsingProperties properties, SubtitleCollection collection) { string[] lines = text.Split(new char[] {'\n'}); for (int i = 0; i < lines.Length; i++) { SubtitleText stext = ParseSubtitleText(lines[i]); Style style = new Style(); if(!stext.IsEmpty) { Subtitle subtitle = new Subtitle(null, stext, style); collection.Add(subtitle); } } } private SubtitleText ParseSubtitleText (string line) { string text = String.Empty; if (withCharacterNames) { string[] pieces = line.Split(new char[] { ':' }); if (pieces.Length > 1) text = pieces[1]; else text = pieces[0]; } else text = line; if (text.Length > 0) return new SubtitleText(text, lineSeparator, true); else return new SubtitleText(); } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/SubtitleFormatPanimator.cs����������������������������������������0000644�0001750�0001750�00000002655�11000453207�023565� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { internal class SubtitleFormatPanimator : SubtitleFormat { internal SubtitleFormatPanimator() { name = "Panimator"; type = SubtitleType.Panimator; mode = SubtitleMode.Times; extensions = new string[] { "pan" }; lineBreak = "\n"; format = @"/d\s+\d+\s+\d+\s+.+\s*/d\s+\d+\s+\d+\s+/c"; subtitleIn = @"/d\s+(?<StartSeconds>\d+)\s+(?<StartCentiseconds>\d+)\s+(?<Text>.+(\n.+)?)\s+/d\s+(?<EndSeconds>\d+)\s+(?<EndCentiseconds>\d+)\s+/c"; subtitleOut = "/d <<StartSeconds>> <<StartCentiseconds>>\n<<Text>>\n" + "/d <<EndSeconds>> <<EndCentiseconds>>\n/c\n"; } } }�����������������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/SubtitleFormatKaraokeLyricsLRC.cs���������������������������������0000644�0001750�0001750�00000004531�11000453207�024732� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { internal class SubtitleFormatKaraokeLyricsLRC : SubtitleFormat { internal SubtitleFormatKaraokeLyricsLRC() { name = "Karaoke Lyrics LRC"; type = SubtitleType.KaraokeLyricsLRC; mode = SubtitleMode.Times; extensions = new string[] { "lrc" }; lineBreak = "|"; // It does not manage line breaks, but still using this char as a separator format = @"\[\s*\d+:\d+.\d+\s*\].+\n+\[\s*\d+:\d+.\d+\s*\]"; subtitleIn = @"\[\s*(?<StartMinutes>\d+)\s*:\s*(?<StartSeconds>\d+)\s*.\s*(?<StartCentiseconds>\d+)\s*\]\s*(?<Text>.*)\n+\[\s*(?<EndMinutes>\d+)\s*:\s*(?<EndSeconds>\d+)\s*.\s*(?<EndCentiseconds>\d+)\s*\]"; subtitleOut = "[<<StartMinutes>>:<<StartSeconds>>.<<StartCentiseconds>>]<<Text>>\n" + "[<<EndMinutes>>:<<EndSeconds>>.<<EndCentiseconds>>]"; headers = new string[] { @"\[\s*ti:(?<Title>.*)\s*]" , @"\[\s*au:(?<Author>.*)\s*]" , @"\[\s*ar:(?<Artist>.*)\s*]" , @"\[\s*al:(?<Album>.*)\s*]" , @"\[\s*by:(?<Maker>.*)\s*]" , @"\[\s*ve:(?<Version>.*)\s*]" , @"\[\s*re:(?<Program>.*)\s*]" }; } internal override string HeadersToString (SubtitleProperties subtitleProperties, FileProperties fileProperties) { Headers headers = subtitleProperties.Headers; return "[ti: " + headers.Title + "]\n" + "[au:" + headers.MovieAuthor + "]\n" + "[ar:" + headers.Artist + "]\n" + "[al:" + headers.Album + "]\n" + "[by:" + headers.Author + "]\n" + "[ve:" + headers.Version + "]\n" + "[re:" + headers.Program + "]\n"; } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/SubtitleFormatSofni.cs��������������������������������������������0000644�0001750�0001750�00000003132�11000453207�022700� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { internal class SubtitleFormatSofni : SubtitleFormat { internal SubtitleFormatSofni () { name = "Sofni"; type = SubtitleType.Sofni; mode = SubtitleMode.Times; extensions = new string[] { "sub" }; lineBreak = "\n"; format = @".+\s+\d+:\d+:\d+.\d+\\\d+:\d+:\d+.\d+"; subtitleIn = @"(?<Text>.+(\n.+)?)\n+(?<StartHours>\d+)\s*:\s*(?<StartMinutes>\d+)\s*:\s*(?<StartSeconds>\d+)\s*.\s*(?<StartCentiseconds>\d+)\\(?<EndHours>\d+)\s*:\s*(?<EndMinutes>\d+)\s*:\s*(?<EndSeconds>\d+)\s*.\s*(?<EndCentiseconds>\d+)"; subtitleOut = "<<Text>>\n" + "<<StartHours>>:<<StartMinutes>>:<<StartSeconds>>.<<StartCentiseconds>>" + "\\ <<EndHours>>:<<EndMinutes>>:<<EndSeconds>>.<<EndCentiseconds>>\n"; } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/SubtitleFormat.cs�������������������������������������������������0000644�0001750�0001750�00000012460�10657311240�021714� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2005-2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { internal abstract class SubtitleFormat { /* Required members */ protected string name; //the name of the format. protected SubtitleType type; //the subtitle type protected SubtitleMode mode; //the subtitle mode protected string[] extensions; //the extensions used protected string lineBreak; //used to split the subtitle's text lines protected string format; //regex used to detect the file's format protected string subtitleIn; //regex used to read a subtitle protected string subtitleOut = null; //expression with tags used to write a subtitle; GetDynamicSubtitleOut can be used instead if the expression is dynamic /* Optional members */ protected string[] headers = null; //used to read the subtitles' headers protected string comments = String.Empty; //used to discard comments protected string bodyBeginOut = String.Empty; //used to write the beginning of the subtitles' body protected string bodyEndIn = String.Empty; //used to detect the end of the subtitles' body protected string bodyEndOut = String.Empty; //used to write the end of the subtitles' body /* Required members for subtitles that support both frames and times */ //The following two are used instead of subtitleIn protected string subtitleInTimesMode = String.Empty; //regex used to read a subtitle in times mode protected string subtitleInFramesMode = String.Empty; //regex used to read a subtitle in frames mode //The following two are used instead of subtitleOut protected string subtitleOutTimesMode = String.Empty; //regex used to output a subtitle in times mode protected string subtitleOutFramesMode = String.Empty; //regex used to output a subtitle in times mode internal string Name { get { return name; } } internal SubtitleType Type { get { return type; } } internal SubtitleMode Mode { get { return mode; } } /// <remarks>Only use this when the Mode is not Both. This is provided as a convenience /// for when the Mode is either Frames or Times.</remarks> internal TimingMode ModeAsTimingMode { get { if (mode == SubtitleMode.Frames) return TimingMode.Frames; else return TimingMode.Times; } } internal string[] Extensions { get { return extensions; } } internal string LineBreak { get { return lineBreak; } } internal string Format { get { return format; } } internal string SubtitleIn { get { return subtitleIn; } } internal string SubtitleOut { get { return subtitleOut; } } internal bool HasHeaders { get { return headers != null; } } internal string[] Headers { get { return headers; } } internal bool HasComments { get { return comments != String.Empty; } } internal string Comments { get { return comments; } } internal bool HasBodyBegin { get { return bodyBeginOut != String.Empty; } } internal string BodyBeginOut { get { return bodyBeginOut; } } internal bool HasBodyEnd { get { return bodyEndOut != String.Empty; } } internal string BodyEndIn { get { return bodyEndIn; } } internal string BodyEndOut { get { return bodyEndOut; } } internal string SubtitleInTimesMode { get { return subtitleInTimesMode; } } internal string SubtitleInFramesMode { get { return subtitleInFramesMode; } } internal string SubtitleOutTimesMode { get { return subtitleOutTimesMode; } } internal string SubtitleOutFramesMode { get { return subtitleOutFramesMode; } } internal virtual Style StringToStyle (string styleText) { Style style = new Style(); foreach (char character in styleText) { if ((character == 'u') || (character == 'U')) style.Underline = true; else if ((character == 'b') || (character == 'B')) style.Bold = true; else if ((character == 'i') || (character == 'I')) style.Italic = true; } return style; } internal virtual string StyleToString (Style style) { return String.Empty; } internal virtual string EndOfStyleToString (Style style) { return String.Empty; } internal virtual void SubtitleInputPostProcess (Subtitle subtitle) { return; } internal virtual void GlobalInputGetProperties (string text, ParsingProperties properties) { return; } internal virtual string GetDynamicSubtitleOut (SubtitleProperties properties) { return null; } internal virtual string HeadersToString (SubtitleProperties subtitleProperties, FileProperties fileProperties) { return String.Empty; } /* Public members */ public override string ToString(){ return Enum.GetName(typeof(SubtitleType), Type); } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Persistency/SubtitleFormatAdvancedSubStationAlpha.cs��������������������������0000644�0001750�0001750�00000004360�10640336417�026331� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2006 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Text.RegularExpressions; namespace SubLib { internal class SubtitleFormatAdvancedSubStationAlpha : SubtitleFormatSubStationAlpha { protected override string FormatName { get { return "Advanced Sub Station Alpha"; } } protected override SubtitleType FormatType { get { return SubtitleType.AdvancedSubStationAlpha; } } protected override string[] FormatExtensions { get { return new string[] { "ass" }; } } protected override string FormatBodyBeginOut { get { return "[Events]\nFormat: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text\n"; } } protected override string FormatSubtitleOut { get { return "Dialogue: 0,<<StartHours,1>>:<<StartMinutes>>:<<StartSeconds>>.<<StartCentiseconds>>,<<EndHours,1>>:<<EndMinutes>>:<<EndSeconds>>.<<EndCentiseconds>>,Default,,0000,0000,0000,,<<Style>><<Text>><<EndOfStyle>>"; } } protected override string ScriptType { get { return "v4.00+"; } } protected override string StyleTypeIn { get { return @"V4\+"; } } protected override string StyleSection { get { return "[V4+ Styles]\nFormat: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding\n" + "Style: Default,Tahoma,24,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H00C0C0C0,-1,0,0,0,100,100,0,0.00,1,2,3,2,20,20,20,1\n\n"; } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/AssemblyInfo.cs.in������������������������������������������������������������0000644�0001750�0001750�00000002154�11000751207�017431� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib, a library for managing movie subtitles. * Copyright (C) 2006-2008 Pedro Castro * * Gnome Subtitles is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Gnome Subtitles is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyVersion("@VERSION@")] [assembly: AssemblyTitle ("a library for managing movie subtitles")] [assembly: AssemblyDescription ("SubLib")] [assembly: AssemblyCopyright ("Copyright (c) 2006-2008 Pedro Castro")] ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Exception/��������������������������������������������������������������������0000755�0001750�0001750�00000000000�11011375150�016037� 5����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Exception/EncodingNotSupportedException.cs������������������������������������0000644�0001750�0001750�00000002350�10640336417�024374� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2007 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; namespace SubLib { /// <summary>The exception that is thrown when an <see cref="System.Text.Encoding" /> is not supported by the platform.</summary> public class EncodingNotSupportedException : ApplicationException { private static string defaultMessage = "The encoding is not supported by this platform."; public EncodingNotSupportedException (string message) : base(message) { } public EncodingNotSupportedException() : base(defaultMessage) { } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Exception/UnknownEncodingException.cs�����������������������������������������0000644�0001750�0001750�00000002310�10640336417�023361� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2005-2006 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; namespace SubLib { /// <summary>The exception that is thrown when the character encoding auto-detection failed.</summary> public class UnknownEncodingException : ApplicationException { private static string defaultMessage = "Unable to auto-detect the file's character encoding."; public UnknownEncodingException (string message) : base(message) { } public UnknownEncodingException() : base(defaultMessage) { } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/SubLib/Exception/UnknownSubtitleFormatException.cs�����������������������������������0000644�0001750�0001750�00000002316�10640336417�024605� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file is part of SubLib. * Copyright (C) 2005-2006 Pedro Castro * * SubLib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SubLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; namespace SubLib { /// <summary>The exception that is thrown when the subtitle format auto-detection failed.</summary> public class UnknownSubtitleFormatException : ApplicationException { private static string defaultMessage = "Unable to auto-detect the subtitle's format."; public UnknownSubtitleFormatException(string message) : base(message) { } public UnknownSubtitleFormatException() : base(defaultMessage) { } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/Makefile.in��������������������������������������������������������������������������0000644�0001750�0001750�00000022716�11011375136�015002� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(sublibdir)" sublibSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(sublib_SCRIPTS) SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CSC = @CSC@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MCS = @MCS@ MONO = @MONO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ sublibdir = $(pkglibdir) sublib_SCRIPTS = $(ASSEMBLY) sublib_BUILDDIR = $(srcdir)/../build ASSEMBLY = $(sublib_BUILDDIR)/sublib.dll sublib_SCRIPTSOURCES = \ $(srcdir)/SubLib/*.cs \ $(srcdir)/SubLib/Application/*.cs \ $(srcdir)/SubLib/Exception/*.cs \ $(srcdir)/SubLib/Persistency/*.cs \ $(srcdir)/External/NCharDet/*.cs CLEANFILES = $(ASSEMBLY) $(ASSEMBLY).mdb EXTRA_DIST = \ $(sublib_SCRIPTSOURCES) \ Executable/Executable.cs all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-sublibSCRIPTS: $(sublib_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(sublibdir)" || $(mkdir_p) "$(DESTDIR)$(sublibdir)" @list='$(sublib_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(sublibSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(sublibdir)/$$f'"; \ $(sublibSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(sublibdir)/$$f"; \ else :; fi; \ done uninstall-sublibSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(sublib_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(sublibdir)/$$f'"; \ rm -f "$(DESTDIR)$(sublibdir)/$$f"; \ done uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) $(mkdir_p) $(distdir)/$(srcdir)/External/NCharDet $(distdir)/$(srcdir)/SubLib $(distdir)/$(srcdir)/SubLib/Application $(distdir)/$(srcdir)/SubLib/Exception $(distdir)/$(srcdir)/SubLib/Persistency $(distdir)/Executable @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(sublibdir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-sublibSCRIPTS install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-sublibSCRIPTS .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip install-sublibSCRIPTS installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am uninstall-info-am \ uninstall-sublibSCRIPTS $(ASSEMBLY): $(sublib_SCRIPTSOURCES) $(MCS) $(MCS_FLAGS) -target:library -out:$(ASSEMBLY) $(sublib_SCRIPTSOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ��������������������������������������������������sublib-0.9/src/External/����������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11011375150�014503� 5����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/�������������������������������������������������������������������0000755�0001750�0001750�00000000000�11011375151�016134� 5����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/nsISO2022CNVerifier.cs���������������������������������������������0000644�0001750�0001750�00000026421�10640337027�021715� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* * DO NOT EDIT THIS DOCUMENT MANUALLY !!! * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER * AutoDetect/tools/ */ using System; namespace org.mozilla.intl.chardet { //import java.lang.* ; public class nsISO2022CNVerifier : nsVerifier { static int[] m_cclass ; static int[] m_states ; static int m_stFactor ; static String m_charset ; public override int[] cclass() { return m_cclass ; } public override int[] states() { return m_states ; } public override int stFactor() { return m_stFactor ; } public override String charset() { return m_charset ; } public nsISO2022CNVerifier() { m_cclass = new int[256/8] ; m_cclass[0] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (2))) )))))) ; m_cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[2] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[3] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[4] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[5] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((3) << 4) | (0))) )))))) ; m_cclass[6] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[7] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[8] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[9] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[10] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[11] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[12] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[13] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[14] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[15] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[16] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[17] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[18] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[19] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[20] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[21] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[22] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[23] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[24] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[25] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[26] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[27] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[28] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[29] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[30] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[31] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_states = new int[8] ; m_states[0] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eError))) ) << 8) | ( ((int)((( 3) << 4) | (eStart))) )))))) ; m_states[1] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eStart))) )))))) ; m_states[2] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eItsMe))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[3] = ((int)((( ((int)((( ((int)((( eError) << 4) | ( 4))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eItsMe))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ; m_states[4] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[5] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)((( 6) << 4) | ( 5))) )))))) ; m_states[6] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[7] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eError))) ) << 8) | (((int)(((eItsMe) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_charset = "ISO-2022-CN"; m_stFactor = 9; } public override bool isUCS2() { return false; } } } // namespace �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/EUCKRStatistics.cs�������������������������������������������������0000644�0001750�0001750�00000026217�10640337027�021426� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ namespace org.mozilla.intl.chardet { //import java.lang.* ; public class EUCKRStatistics : nsEUCStatistics { static float[] m_FirstByteFreq ; static float m_FirstByteStdDev; static float m_FirstByteMean; static float m_FirstByteWeight; static float[] m_SecondByteFreq; static float m_SecondByteStdDev; static float m_SecondByteMean; static float m_SecondByteWeight; public override float[] mFirstByteFreq() { return m_FirstByteFreq; } public override float mFirstByteStdDev() { return m_FirstByteStdDev; } public override float mFirstByteMean() { return m_FirstByteMean; } public override float mFirstByteWeight() { return m_FirstByteWeight; } public override float[] mSecondByteFreq() { return m_SecondByteFreq; } public override float mSecondByteStdDev() { return m_SecondByteStdDev; } public override float mSecondByteMean() { return m_SecondByteMean; } public override float mSecondByteWeight() { return m_SecondByteWeight; } public EUCKRStatistics() { m_FirstByteFreq = new float[] { 0.000000f, // FreqH[a1] 0.000000f, // FreqH[a2] 0.000000f, // FreqH[a3] 0.000000f, // FreqH[a4] 0.000000f, // FreqH[a5] 0.000000f, // FreqH[a6] 0.000000f, // FreqH[a7] 0.000412f, // FreqH[a8] 0.000000f, // FreqH[a9] 0.000000f, // FreqH[aa] 0.000000f, // FreqH[ab] 0.000000f, // FreqH[ac] 0.000000f, // FreqH[ad] 0.000000f, // FreqH[ae] 0.000000f, // FreqH[af] 0.057502f, // FreqH[b0] 0.033182f, // FreqH[b1] 0.002267f, // FreqH[b2] 0.016076f, // FreqH[b3] 0.014633f, // FreqH[b4] 0.032976f, // FreqH[b5] 0.004122f, // FreqH[b6] 0.011336f, // FreqH[b7] 0.058533f, // FreqH[b8] 0.024526f, // FreqH[b9] 0.025969f, // FreqH[ba] 0.054411f, // FreqH[bb] 0.019580f, // FreqH[bc] 0.063273f, // FreqH[bd] 0.113974f, // FreqH[be] 0.029885f, // FreqH[bf] 0.150041f, // FreqH[c0] 0.059151f, // FreqH[c1] 0.002679f, // FreqH[c2] 0.009893f, // FreqH[c3] 0.014839f, // FreqH[c4] 0.026381f, // FreqH[c5] 0.015045f, // FreqH[c6] 0.069456f, // FreqH[c7] 0.089860f, // FreqH[c8] 0.000000f, // FreqH[c9] 0.000000f, // FreqH[ca] 0.000000f, // FreqH[cb] 0.000000f, // FreqH[cc] 0.000000f, // FreqH[cd] 0.000000f, // FreqH[ce] 0.000000f, // FreqH[cf] 0.000000f, // FreqH[d0] 0.000000f, // FreqH[d1] 0.000000f, // FreqH[d2] 0.000000f, // FreqH[d3] 0.000000f, // FreqH[d4] 0.000000f, // FreqH[d5] 0.000000f, // FreqH[d6] 0.000000f, // FreqH[d7] 0.000000f, // FreqH[d8] 0.000000f, // FreqH[d9] 0.000000f, // FreqH[da] 0.000000f, // FreqH[db] 0.000000f, // FreqH[dc] 0.000000f, // FreqH[dd] 0.000000f, // FreqH[de] 0.000000f, // FreqH[df] 0.000000f, // FreqH[e0] 0.000000f, // FreqH[e1] 0.000000f, // FreqH[e2] 0.000000f, // FreqH[e3] 0.000000f, // FreqH[e4] 0.000000f, // FreqH[e5] 0.000000f, // FreqH[e6] 0.000000f, // FreqH[e7] 0.000000f, // FreqH[e8] 0.000000f, // FreqH[e9] 0.000000f, // FreqH[ea] 0.000000f, // FreqH[eb] 0.000000f, // FreqH[ec] 0.000000f, // FreqH[ed] 0.000000f, // FreqH[ee] 0.000000f, // FreqH[ef] 0.000000f, // FreqH[f0] 0.000000f, // FreqH[f1] 0.000000f, // FreqH[f2] 0.000000f, // FreqH[f3] 0.000000f, // FreqH[f4] 0.000000f, // FreqH[f5] 0.000000f, // FreqH[f6] 0.000000f, // FreqH[f7] 0.000000f, // FreqH[f8] 0.000000f, // FreqH[f9] 0.000000f, // FreqH[fa] 0.000000f, // FreqH[fb] 0.000000f, // FreqH[fc] 0.000000f, // FreqH[fd] 0.000000f // FreqH[fe] }; m_FirstByteStdDev = 0.025593f; // Lead Byte StdDev m_FirstByteMean = 0.010638f; // Lead Byte Mean m_FirstByteWeight = 0.647437f; // Lead Byte Weight m_SecondByteFreq = new float[] { 0.016694f, // FreqL[a1] 0.000000f, // FreqL[a2] 0.012778f, // FreqL[a3] 0.030091f, // FreqL[a4] 0.002679f, // FreqL[a5] 0.006595f, // FreqL[a6] 0.001855f, // FreqL[a7] 0.000824f, // FreqL[a8] 0.005977f, // FreqL[a9] 0.004740f, // FreqL[aa] 0.003092f, // FreqL[ab] 0.000824f, // FreqL[ac] 0.019580f, // FreqL[ad] 0.037304f, // FreqL[ae] 0.008244f, // FreqL[af] 0.014633f, // FreqL[b0] 0.001031f, // FreqL[b1] 0.000000f, // FreqL[b2] 0.003298f, // FreqL[b3] 0.002061f, // FreqL[b4] 0.006183f, // FreqL[b5] 0.005977f, // FreqL[b6] 0.000824f, // FreqL[b7] 0.021847f, // FreqL[b8] 0.014839f, // FreqL[b9] 0.052968f, // FreqL[ba] 0.017312f, // FreqL[bb] 0.007626f, // FreqL[bc] 0.000412f, // FreqL[bd] 0.000824f, // FreqL[be] 0.011129f, // FreqL[bf] 0.000000f, // FreqL[c0] 0.000412f, // FreqL[c1] 0.001649f, // FreqL[c2] 0.005977f, // FreqL[c3] 0.065746f, // FreqL[c4] 0.020198f, // FreqL[c5] 0.021434f, // FreqL[c6] 0.014633f, // FreqL[c7] 0.004122f, // FreqL[c8] 0.001649f, // FreqL[c9] 0.000824f, // FreqL[ca] 0.000824f, // FreqL[cb] 0.051937f, // FreqL[cc] 0.019580f, // FreqL[cd] 0.023289f, // FreqL[ce] 0.026381f, // FreqL[cf] 0.040396f, // FreqL[d0] 0.009068f, // FreqL[d1] 0.001443f, // FreqL[d2] 0.003710f, // FreqL[d3] 0.007420f, // FreqL[d4] 0.001443f, // FreqL[d5] 0.013190f, // FreqL[d6] 0.002885f, // FreqL[d7] 0.000412f, // FreqL[d8] 0.003298f, // FreqL[d9] 0.025969f, // FreqL[da] 0.000412f, // FreqL[db] 0.000412f, // FreqL[dc] 0.006183f, // FreqL[dd] 0.003298f, // FreqL[de] 0.066983f, // FreqL[df] 0.002679f, // FreqL[e0] 0.002267f, // FreqL[e1] 0.011129f, // FreqL[e2] 0.000412f, // FreqL[e3] 0.010099f, // FreqL[e4] 0.015251f, // FreqL[e5] 0.007626f, // FreqL[e6] 0.043899f, // FreqL[e7] 0.003710f, // FreqL[e8] 0.002679f, // FreqL[e9] 0.001443f, // FreqL[ea] 0.010923f, // FreqL[eb] 0.002885f, // FreqL[ec] 0.009068f, // FreqL[ed] 0.019992f, // FreqL[ee] 0.000412f, // FreqL[ef] 0.008450f, // FreqL[f0] 0.005153f, // FreqL[f1] 0.000000f, // FreqL[f2] 0.010099f, // FreqL[f3] 0.000000f, // FreqL[f4] 0.001649f, // FreqL[f5] 0.012160f, // FreqL[f6] 0.011542f, // FreqL[f7] 0.006595f, // FreqL[f8] 0.001855f, // FreqL[f9] 0.010923f, // FreqL[fa] 0.000412f, // FreqL[fb] 0.023702f, // FreqL[fc] 0.003710f, // FreqL[fd] 0.001855f // FreqL[fe] }; m_SecondByteStdDev = 0.013937f; // Trail Byte StdDev m_SecondByteMean = 0.010638f; // Trail Byte Mean m_SecondByteWeight = 0.352563f; // Trial Byte Weight } } } // namespace ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/EUCJPStatistics.cs�������������������������������������������������0000644�0001750�0001750�00000025723�10640337027�021424� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ namespace org.mozilla.intl.chardet { //import java.lang.* ; public class EUCJPStatistics : nsEUCStatistics { static float[] m_FirstByteFreq ; static float m_FirstByteStdDev; static float m_FirstByteMean; static float m_FirstByteWeight; static float[] m_SecondByteFreq; static float m_SecondByteStdDev; static float m_SecondByteMean; static float m_SecondByteWeight; public override float[] mFirstByteFreq() { return m_FirstByteFreq; } public override float mFirstByteStdDev() { return m_FirstByteStdDev; } public override float mFirstByteMean() { return m_FirstByteMean; } public override float mFirstByteWeight() { return m_FirstByteWeight; } public override float[] mSecondByteFreq() { return m_SecondByteFreq; } public override float mSecondByteStdDev() { return m_SecondByteStdDev; } public override float mSecondByteMean() { return m_SecondByteMean; } public override float mSecondByteWeight() { return m_SecondByteWeight; } public EUCJPStatistics() { m_FirstByteFreq = new float[] { 0.364808f, // FreqH[a1] 0.000000f, // FreqH[a2] 0.000000f, // FreqH[a3] 0.145325f, // FreqH[a4] 0.304891f, // FreqH[a5] 0.000000f, // FreqH[a6] 0.000000f, // FreqH[a7] 0.000000f, // FreqH[a8] 0.000000f, // FreqH[a9] 0.000000f, // FreqH[aa] 0.000000f, // FreqH[ab] 0.000000f, // FreqH[ac] 0.000000f, // FreqH[ad] 0.000000f, // FreqH[ae] 0.000000f, // FreqH[af] 0.001835f, // FreqH[b0] 0.010771f, // FreqH[b1] 0.006462f, // FreqH[b2] 0.001157f, // FreqH[b3] 0.002114f, // FreqH[b4] 0.003231f, // FreqH[b5] 0.001356f, // FreqH[b6] 0.007420f, // FreqH[b7] 0.004189f, // FreqH[b8] 0.003231f, // FreqH[b9] 0.003032f, // FreqH[ba] 0.033190f, // FreqH[bb] 0.006303f, // FreqH[bc] 0.006064f, // FreqH[bd] 0.009973f, // FreqH[be] 0.002354f, // FreqH[bf] 0.003670f, // FreqH[c0] 0.009135f, // FreqH[c1] 0.001675f, // FreqH[c2] 0.002792f, // FreqH[c3] 0.002194f, // FreqH[c4] 0.014720f, // FreqH[c5] 0.011928f, // FreqH[c6] 0.000878f, // FreqH[c7] 0.013124f, // FreqH[c8] 0.001077f, // FreqH[c9] 0.009295f, // FreqH[ca] 0.003471f, // FreqH[cb] 0.002872f, // FreqH[cc] 0.002433f, // FreqH[cd] 0.000957f, // FreqH[ce] 0.001636f, // FreqH[cf] 0.000000f, // FreqH[d0] 0.000000f, // FreqH[d1] 0.000000f, // FreqH[d2] 0.000000f, // FreqH[d3] 0.000000f, // FreqH[d4] 0.000000f, // FreqH[d5] 0.000000f, // FreqH[d6] 0.000000f, // FreqH[d7] 0.000000f, // FreqH[d8] 0.000000f, // FreqH[d9] 0.000000f, // FreqH[da] 0.000000f, // FreqH[db] 0.000000f, // FreqH[dc] 0.000000f, // FreqH[dd] 0.000080f, // FreqH[de] 0.000279f, // FreqH[df] 0.000000f, // FreqH[e0] 0.000000f, // FreqH[e1] 0.000000f, // FreqH[e2] 0.000000f, // FreqH[e3] 0.000000f, // FreqH[e4] 0.000000f, // FreqH[e5] 0.000000f, // FreqH[e6] 0.000000f, // FreqH[e7] 0.000000f, // FreqH[e8] 0.000000f, // FreqH[e9] 0.000000f, // FreqH[ea] 0.000000f, // FreqH[eb] 0.000000f, // FreqH[ec] 0.000000f, // FreqH[ed] 0.000000f, // FreqH[ee] 0.000000f, // FreqH[ef] 0.000000f, // FreqH[f0] 0.000000f, // FreqH[f1] 0.000000f, // FreqH[f2] 0.000000f, // FreqH[f3] 0.000000f, // FreqH[f4] 0.000000f, // FreqH[f5] 0.000000f, // FreqH[f6] 0.000000f, // FreqH[f7] 0.000000f, // FreqH[f8] 0.000000f, // FreqH[f9] 0.000000f, // FreqH[fa] 0.000000f, // FreqH[fb] 0.000000f, // FreqH[fc] 0.000080f, // FreqH[fd] 0.000000f // FreqH[fe] }; m_FirstByteStdDev = 0.050407f; // Lead Byte StdDev m_FirstByteMean = 0.010638f; // Lead Byte Mean m_FirstByteWeight = 0.640871f; // Lead Byte Weight m_SecondByteFreq = new float[] { 0.002473f, // FreqL[a1] 0.039134f, // FreqL[a2] 0.152745f, // FreqL[a3] 0.009694f, // FreqL[a4] 0.000359f, // FreqL[a5] 0.022180f, // FreqL[a6] 0.000758f, // FreqL[a7] 0.004308f, // FreqL[a8] 0.000160f, // FreqL[a9] 0.002513f, // FreqL[aa] 0.003072f, // FreqL[ab] 0.001316f, // FreqL[ac] 0.003830f, // FreqL[ad] 0.001037f, // FreqL[ae] 0.003590f, // FreqL[af] 0.000957f, // FreqL[b0] 0.000160f, // FreqL[b1] 0.000239f, // FreqL[b2] 0.006462f, // FreqL[b3] 0.001596f, // FreqL[b4] 0.031554f, // FreqL[b5] 0.001316f, // FreqL[b6] 0.002194f, // FreqL[b7] 0.016555f, // FreqL[b8] 0.003271f, // FreqL[b9] 0.000678f, // FreqL[ba] 0.000598f, // FreqL[bb] 0.206438f, // FreqL[bc] 0.000718f, // FreqL[bd] 0.001077f, // FreqL[be] 0.003710f, // FreqL[bf] 0.001356f, // FreqL[c0] 0.001356f, // FreqL[c1] 0.000439f, // FreqL[c2] 0.004388f, // FreqL[c3] 0.005704f, // FreqL[c4] 0.000878f, // FreqL[c5] 0.010172f, // FreqL[c6] 0.007061f, // FreqL[c7] 0.014680f, // FreqL[c8] 0.000638f, // FreqL[c9] 0.025730f, // FreqL[ca] 0.002792f, // FreqL[cb] 0.000718f, // FreqL[cc] 0.001795f, // FreqL[cd] 0.091551f, // FreqL[ce] 0.000758f, // FreqL[cf] 0.003909f, // FreqL[d0] 0.000558f, // FreqL[d1] 0.031195f, // FreqL[d2] 0.007061f, // FreqL[d3] 0.001316f, // FreqL[d4] 0.022579f, // FreqL[d5] 0.006981f, // FreqL[d6] 0.007260f, // FreqL[d7] 0.001117f, // FreqL[d8] 0.000239f, // FreqL[d9] 0.012127f, // FreqL[da] 0.000878f, // FreqL[db] 0.003790f, // FreqL[dc] 0.001077f, // FreqL[dd] 0.000758f, // FreqL[de] 0.002114f, // FreqL[df] 0.002234f, // FreqL[e0] 0.000678f, // FreqL[e1] 0.002992f, // FreqL[e2] 0.003311f, // FreqL[e3] 0.023416f, // FreqL[e4] 0.001237f, // FreqL[e5] 0.002753f, // FreqL[e6] 0.005146f, // FreqL[e7] 0.002194f, // FreqL[e8] 0.007021f, // FreqL[e9] 0.008497f, // FreqL[ea] 0.013763f, // FreqL[eb] 0.011768f, // FreqL[ec] 0.006303f, // FreqL[ed] 0.001915f, // FreqL[ee] 0.000638f, // FreqL[ef] 0.008776f, // FreqL[f0] 0.000918f, // FreqL[f1] 0.003431f, // FreqL[f2] 0.057603f, // FreqL[f3] 0.000439f, // FreqL[f4] 0.000439f, // FreqL[f5] 0.000758f, // FreqL[f6] 0.002872f, // FreqL[f7] 0.001675f, // FreqL[f8] 0.011050f, // FreqL[f9] 0.000000f, // FreqL[fa] 0.000279f, // FreqL[fb] 0.012127f, // FreqL[fc] 0.000718f, // FreqL[fd] 0.007380f // FreqL[fe] }; m_SecondByteStdDev = 0.028247f; // Trail Byte StdDev m_SecondByteMean = 0.010638f; // Trail Byte Mean m_SecondByteWeight = 0.359129f; // Trial Byte Weight } } } // namespace ���������������������������������������������sublib-0.9/src/External/NCharDet/nsEUCJPVerifier.cs�������������������������������������������������0000644�0001750�0001750�00000025015�10640337027�021400� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* * DO NOT EDIT THIS DOCUMENT MANUALLY !!! * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER * AutoDetect/tools/ */ using System; namespace org.mozilla.intl.chardet { //import java.lang.* ; public class nsEUCJPVerifier : nsVerifier { static int[] m_cclass ; static int[] m_states ; static int m_stFactor ; static String m_charset ; public override int[] cclass() { return m_cclass ; } public override int[] states() { return m_states ; } public override int stFactor() { return m_stFactor ; } public override String charset() { return m_charset ; } public nsEUCJPVerifier() { m_cclass = new int[256/8] ; m_cclass[0] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[1] = ((int)((( ((int)((( ((int)((( 5) << 4) | (5))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[2] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[3] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[4] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[5] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[6] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[7] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[8] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[9] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[10] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[11] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[12] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[13] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[14] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[15] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[16] = ((int)((( ((int)((( ((int)((( 5) << 4) | (5))) ) << 8) | (((int)(((5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (5))) ) << 8) | ( ((int)(((5) << 4) | (5))) )))))) ; m_cclass[17] = ((int)((( ((int)((( ((int)((( 3) << 4) | (1))) ) << 8) | (((int)(((5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (5))) ) << 8) | ( ((int)(((5) << 4) | (5))) )))))) ; m_cclass[18] = ((int)((( ((int)((( ((int)((( 5) << 4) | (5))) ) << 8) | (((int)(((5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (5))) ) << 8) | ( ((int)(((5) << 4) | (5))) )))))) ; m_cclass[19] = ((int)((( ((int)((( ((int)((( 5) << 4) | (5))) ) << 8) | (((int)(((5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (5))) ) << 8) | ( ((int)(((5) << 4) | (5))) )))))) ; m_cclass[20] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (5))) )))))) ; m_cclass[21] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[22] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[23] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[24] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[25] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[26] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[27] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[28] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[29] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[30] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[31] = ((int)((( ((int)((( ((int)((( 5) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_states = new int[5] ; m_states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)((( 5) << 4) | ( 3))) ) << 8) | ( ((int)((( 4) << 4) | ( 3))) )))))) ; m_states[1] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[2] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eStart))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ; m_states[3] = ((int)((( ((int)((( ((int)((( eError) << 4) | ( 3))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eStart))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[4] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | ( 3))) )))))) ; m_charset = "EUC-JP"; m_stFactor = 6; } public override bool isUCS2() { return false; } } } // namespace �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/nsGB18030Verifier.cs�����������������������������������������������0000644�0001750�0001750�00000025417�10640337027�021424� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* * DO NOT EDIT THIS DOCUMENT MANUALLY !!! * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER * AutoDetect/tools/ */ using System; namespace org.mozilla.intl.chardet { //import java.lang.* ; public class nsGB18030Verifier : nsVerifier { static int[] m_cclass ; static int[] m_states ; static int m_stFactor ; static String m_charset ; public override int[] cclass() { return m_cclass ; } public override int[] states() { return m_states ; } public override int stFactor() { return m_stFactor ; } public override String charset() { return m_charset ; } public nsGB18030Verifier() { m_cclass = new int[256/8] ; m_cclass[0] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[2] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[3] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[4] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[5] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[6] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[7] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[8] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[9] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[10] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[11] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[12] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[13] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[14] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[15] = ((int)((( ((int)((( ((int)((( 4) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[16] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (5))) )))))) ; m_cclass[17] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ; m_cclass[18] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ; m_cclass[19] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ; m_cclass[20] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ; m_cclass[21] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ; m_cclass[22] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ; m_cclass[23] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ; m_cclass[24] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ; m_cclass[25] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ; m_cclass[26] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ; m_cclass[27] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ; m_cclass[28] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ; m_cclass[29] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ; m_cclass[30] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ; m_cclass[31] = ((int)((( ((int)((( ((int)((( 0) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ; m_states = new int[6] ; m_states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | ( 3))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eStart))) ) << 8) | ( ((int)(((eStart) << 4) | (eError))) )))))) ; m_states[1] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[2] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eItsMe))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ; m_states[3] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eStart))) ) << 8) | ( ((int)(((eError) << 4) | ( 4))) )))))) ; m_states[4] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eItsMe))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | ( 5))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[5] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eStart))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_charset = "GB18030"; m_stFactor = 7; } public override bool isUCS2() { return false; } } } // namespace �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/nsSJISVerifier.cs��������������������������������������������������0000644�0001750�0001750�00000024024�10640337027�021301� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* * DO NOT EDIT THIS DOCUMENT MANUALLY !!! * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER * AutoDetect/tools/ */ using System; namespace org.mozilla.intl.chardet { //import java.lang.* ; public class nsSJISVerifier : nsVerifier { static int[] m_cclass ; static int[] m_states ; static int m_stFactor ; static String m_charset ; public override int[] cclass() { return m_cclass ; } public override int[] states() { return m_states ; } public override int stFactor() { return m_stFactor ; } public override String charset() { return m_charset ; } public nsSJISVerifier() { m_cclass = new int[256/8] ; m_cclass[0] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (0))) )))))) ; m_cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[2] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[3] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[4] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[5] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[6] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[7] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[8] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[9] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[10] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[11] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[12] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[13] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[14] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[15] = ((int)((( ((int)((( ((int)((( 1) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[16] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[17] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[18] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[19] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[20] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (4))) )))))) ; m_cclass[21] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[22] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[23] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[24] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[25] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[26] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[27] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[28] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[29] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[30] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[31] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_states = new int[3] ; m_states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)((( 3) << 4) | (eStart))) ) << 8) | ( ((int)(((eStart) << 4) | (eError))) )))))) ; m_states[1] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[2] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ; m_charset = "Shift_JIS"; m_stFactor = 6; } public override bool isUCS2() { return false; } } } // namespace ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/nsEUCStatistics.cs�������������������������������������������������0000644�0001750�0001750�00000004446�10640337027�021532� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ namespace org.mozilla.intl.chardet { //import java.lang.* ; public abstract class nsEUCStatistics { public abstract float[] mFirstByteFreq() ; public abstract float mFirstByteStdDev(); public abstract float mFirstByteMean(); public abstract float mFirstByteWeight(); public abstract float[] mSecondByteFreq(); public abstract float mSecondByteStdDev(); public abstract float mSecondByteMean(); public abstract float mSecondByteWeight(); public nsEUCStatistics() { } } } // namespace ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/GB2312Statistics.cs������������������������������������������������0000644�0001750�0001750�00000026065�10640337027�021356� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ namespace org.mozilla.intl.chardet { //import java.lang.* ; public class GB2312Statistics : nsEUCStatistics { static float[] m_FirstByteFreq ; static float m_FirstByteStdDev; static float m_FirstByteMean; static float m_FirstByteWeight; static float[] m_SecondByteFreq; static float m_SecondByteStdDev; static float m_SecondByteMean; static float m_SecondByteWeight; public override float[] mFirstByteFreq() { return m_FirstByteFreq; } public override float mFirstByteStdDev() { return m_FirstByteStdDev; } public override float mFirstByteMean() { return m_FirstByteMean; } public override float mFirstByteWeight() { return m_FirstByteWeight; } public override float[] mSecondByteFreq() { return m_SecondByteFreq; } public override float mSecondByteStdDev() { return m_SecondByteStdDev; } public override float mSecondByteMean() { return m_SecondByteMean; } public override float mSecondByteWeight() { return m_SecondByteWeight; } public GB2312Statistics() { m_FirstByteFreq = new float[] { 0.011628f, // FreqH[a1] 0.000000f, // FreqH[a2] 0.000000f, // FreqH[a3] 0.000000f, // FreqH[a4] 0.000000f, // FreqH[a5] 0.000000f, // FreqH[a6] 0.000000f, // FreqH[a7] 0.000000f, // FreqH[a8] 0.000000f, // FreqH[a9] 0.000000f, // FreqH[aa] 0.000000f, // FreqH[ab] 0.000000f, // FreqH[ac] 0.000000f, // FreqH[ad] 0.000000f, // FreqH[ae] 0.000000f, // FreqH[af] 0.011628f, // FreqH[b0] 0.012403f, // FreqH[b1] 0.009302f, // FreqH[b2] 0.003876f, // FreqH[b3] 0.017829f, // FreqH[b4] 0.037209f, // FreqH[b5] 0.008527f, // FreqH[b6] 0.010078f, // FreqH[b7] 0.019380f, // FreqH[b8] 0.054264f, // FreqH[b9] 0.010078f, // FreqH[ba] 0.041085f, // FreqH[bb] 0.020930f, // FreqH[bc] 0.018605f, // FreqH[bd] 0.010078f, // FreqH[be] 0.013178f, // FreqH[bf] 0.016279f, // FreqH[c0] 0.006202f, // FreqH[c1] 0.009302f, // FreqH[c2] 0.017054f, // FreqH[c3] 0.011628f, // FreqH[c4] 0.008527f, // FreqH[c5] 0.004651f, // FreqH[c6] 0.006202f, // FreqH[c7] 0.017829f, // FreqH[c8] 0.024806f, // FreqH[c9] 0.020155f, // FreqH[ca] 0.013953f, // FreqH[cb] 0.032558f, // FreqH[cc] 0.035659f, // FreqH[cd] 0.068217f, // FreqH[ce] 0.010853f, // FreqH[cf] 0.036434f, // FreqH[d0] 0.117054f, // FreqH[d1] 0.027907f, // FreqH[d2] 0.100775f, // FreqH[d3] 0.010078f, // FreqH[d4] 0.017829f, // FreqH[d5] 0.062016f, // FreqH[d6] 0.012403f, // FreqH[d7] 0.000000f, // FreqH[d8] 0.000000f, // FreqH[d9] 0.000000f, // FreqH[da] 0.000000f, // FreqH[db] 0.000000f, // FreqH[dc] 0.000000f, // FreqH[dd] 0.000000f, // FreqH[de] 0.000000f, // FreqH[df] 0.000000f, // FreqH[e0] 0.000000f, // FreqH[e1] 0.000000f, // FreqH[e2] 0.000000f, // FreqH[e3] 0.000000f, // FreqH[e4] 0.000000f, // FreqH[e5] 0.000000f, // FreqH[e6] 0.000000f, // FreqH[e7] 0.000000f, // FreqH[e8] 0.000000f, // FreqH[e9] 0.001550f, // FreqH[ea] 0.000000f, // FreqH[eb] 0.000000f, // FreqH[ec] 0.000000f, // FreqH[ed] 0.000000f, // FreqH[ee] 0.000000f, // FreqH[ef] 0.000000f, // FreqH[f0] 0.000000f, // FreqH[f1] 0.000000f, // FreqH[f2] 0.000000f, // FreqH[f3] 0.000000f, // FreqH[f4] 0.000000f, // FreqH[f5] 0.000000f, // FreqH[f6] 0.000000f, // FreqH[f7] 0.000000f, // FreqH[f8] 0.000000f, // FreqH[f9] 0.000000f, // FreqH[fa] 0.000000f, // FreqH[fb] 0.000000f, // FreqH[fc] 0.000000f, // FreqH[fd] 0.000000f // FreqH[fe] }; m_FirstByteStdDev = 0.020081f; // Lead Byte StdDev m_FirstByteMean = 0.010638f; // Lead Byte Mean m_FirstByteWeight = 0.586533f; // Lead Byte Weight m_SecondByteFreq = new float[] { 0.006202f, // FreqL[a1] 0.031008f, // FreqL[a2] 0.005426f, // FreqL[a3] 0.003101f, // FreqL[a4] 0.001550f, // FreqL[a5] 0.003101f, // FreqL[a6] 0.082171f, // FreqL[a7] 0.014729f, // FreqL[a8] 0.006977f, // FreqL[a9] 0.001550f, // FreqL[aa] 0.013953f, // FreqL[ab] 0.000000f, // FreqL[ac] 0.013953f, // FreqL[ad] 0.010078f, // FreqL[ae] 0.008527f, // FreqL[af] 0.006977f, // FreqL[b0] 0.004651f, // FreqL[b1] 0.003101f, // FreqL[b2] 0.003101f, // FreqL[b3] 0.003101f, // FreqL[b4] 0.008527f, // FreqL[b5] 0.003101f, // FreqL[b6] 0.005426f, // FreqL[b7] 0.005426f, // FreqL[b8] 0.005426f, // FreqL[b9] 0.003101f, // FreqL[ba] 0.001550f, // FreqL[bb] 0.006202f, // FreqL[bc] 0.014729f, // FreqL[bd] 0.010853f, // FreqL[be] 0.000000f, // FreqL[bf] 0.011628f, // FreqL[c0] 0.000000f, // FreqL[c1] 0.031783f, // FreqL[c2] 0.013953f, // FreqL[c3] 0.030233f, // FreqL[c4] 0.039535f, // FreqL[c5] 0.008527f, // FreqL[c6] 0.015504f, // FreqL[c7] 0.000000f, // FreqL[c8] 0.003101f, // FreqL[c9] 0.008527f, // FreqL[ca] 0.016279f, // FreqL[cb] 0.005426f, // FreqL[cc] 0.001550f, // FreqL[cd] 0.013953f, // FreqL[ce] 0.013953f, // FreqL[cf] 0.044961f, // FreqL[d0] 0.003101f, // FreqL[d1] 0.004651f, // FreqL[d2] 0.006977f, // FreqL[d3] 0.001550f, // FreqL[d4] 0.005426f, // FreqL[d5] 0.012403f, // FreqL[d6] 0.001550f, // FreqL[d7] 0.015504f, // FreqL[d8] 0.000000f, // FreqL[d9] 0.006202f, // FreqL[da] 0.001550f, // FreqL[db] 0.000000f, // FreqL[dc] 0.007752f, // FreqL[dd] 0.006977f, // FreqL[de] 0.001550f, // FreqL[df] 0.009302f, // FreqL[e0] 0.011628f, // FreqL[e1] 0.004651f, // FreqL[e2] 0.010853f, // FreqL[e3] 0.012403f, // FreqL[e4] 0.017829f, // FreqL[e5] 0.005426f, // FreqL[e6] 0.024806f, // FreqL[e7] 0.000000f, // FreqL[e8] 0.006202f, // FreqL[e9] 0.000000f, // FreqL[ea] 0.082171f, // FreqL[eb] 0.015504f, // FreqL[ec] 0.004651f, // FreqL[ed] 0.000000f, // FreqL[ee] 0.006977f, // FreqL[ef] 0.004651f, // FreqL[f0] 0.000000f, // FreqL[f1] 0.008527f, // FreqL[f2] 0.012403f, // FreqL[f3] 0.004651f, // FreqL[f4] 0.003876f, // FreqL[f5] 0.003101f, // FreqL[f6] 0.022481f, // FreqL[f7] 0.024031f, // FreqL[f8] 0.001550f, // FreqL[f9] 0.047287f, // FreqL[fa] 0.009302f, // FreqL[fb] 0.001550f, // FreqL[fc] 0.005426f, // FreqL[fd] 0.017054f // FreqL[fe] }; m_SecondByteStdDev = 0.014156f; // Trail Byte StdDev m_SecondByteMean = 0.010638f; // Trail Byte Mean m_SecondByteWeight = 0.413467f; // Trial Byte Weight } } } // namespace ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/nsUCS2BEVerifier.cs������������������������������������������������0000644�0001750�0001750�00000026012�10640337027�021453� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* * DO NOT EDIT THIS DOCUMENT MANUALLY !!! * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER * AutoDetect/tools/ */ using System; namespace org.mozilla.intl.chardet { //import java.lang.* ; public class nsUCS2BEVerifier : nsVerifier { static int[] m_cclass ; static int[] m_states ; static int m_stFactor ; static String m_charset ; public override int[] cclass() { return m_cclass ; } public override int[] states() { return m_states ; } public override int stFactor() { return m_stFactor ; } public override String charset() { return m_charset ; } public nsUCS2BEVerifier() { m_cclass = new int[256/8] ; m_cclass[0] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((2) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (1))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[2] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[3] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[4] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[5] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (0))) )))))) ; m_cclass[6] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[7] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[8] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[9] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[10] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[11] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[12] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[13] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[14] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[15] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[16] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[17] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[18] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[19] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[20] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[21] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[22] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[23] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[24] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[25] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[26] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[27] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[28] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[29] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[30] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[31] = ((int)((( ((int)((( ((int)((( 5) << 4) | (4))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_states = new int[7] ; m_states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 3) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | ( 7))) ) << 8) | ( ((int)((( 7) << 4) | ( 5))) )))))) ; m_states[1] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[2] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)((( 6) << 4) | ( 6))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ; m_states[3] = ((int)((( ((int)((( ((int)((( 6) << 4) | ( 6))) ) << 8) | (((int)(((eItsMe) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)((( 6) << 4) | ( 6))) ) << 8) | ( ((int)((( 6) << 4) | ( 6))) )))))) ; m_states[4] = ((int)((( ((int)((( ((int)((( eError) << 4) | ( 7))) ) << 8) | (((int)((( 7) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)((( 6) << 4) | ( 6))) ) << 8) | ( ((int)((( 6) << 4) | ( 6))) )))))) ; m_states[5] = ((int)((( ((int)((( ((int)((( 6) << 4) | ( 6))) ) << 8) | (((int)((( 6) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)((( 6) << 4) | ( 6))) ) << 8) | ( ((int)((( 8) << 4) | ( 5))) )))))) ; m_states[6] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)((( 6) << 4) | ( 6))) ) << 8) | ( ((int)((( 6) << 4) | ( 6))) )))))) ; m_charset = "UTF-16BE"; m_stFactor = 6; } public override bool isUCS2() { return true; } } } // namespace ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/nsDetector.cs������������������������������������������������������0000644�0001750�0001750�00000005434�10640337027�020612� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ using System; namespace org.mozilla.intl.chardet { //import java.lang.* ; public class nsDetector : nsPSMDetector , nsICharsetDetector { nsICharsetDetectionObserver mObserver = null ; public nsDetector() : base(){ //super() ; } public nsDetector(int langFlag) : base(langFlag) { //super(langFlag) ; } public void Init(nsICharsetDetectionObserver aObserver) { mObserver = aObserver ; return ; } public bool DoIt(byte[] aBuf, int aLen, bool oDontFeedMe) { if (aBuf == null || oDontFeedMe ) return false ; this.HandleData(aBuf, aLen) ; return mDone ; } public void Done() { this.DataEnd() ; return ; } public override void Report(String charset) { if (mObserver != null) mObserver.Notify(charset) ; } public bool isAscii(byte[] aBuf, int aLen) { for(int i=0; i<aLen; i++) { if ((0x0080 & aBuf[i]) != 0) { return false ; } } return true ; } } } // namespace ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/nsUTF8Verifier.cs��������������������������������������������������0000644�0001750�0001750�00000037370�10640337027�021267� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* * DO NOT EDIT THIS DOCUMENT MANUALLY !!! * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER * AutoDetect/tools/ */ using System; namespace org.mozilla.intl.chardet { //import java.lang.* ; public class nsUTF8Verifier : nsVerifier { static int[] m_cclass ; static int[] m_states ; static int m_stFactor ; static String m_charset ; public override int[] cclass() { return m_cclass ; } public override int[] states() { return m_states ; } public override int stFactor() { return m_stFactor ; } public override String charset() { return m_charset ; } public nsUTF8Verifier() { m_cclass = new int[256/8] ; m_cclass[0] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[2] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[3] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[4] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[5] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[6] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[7] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[8] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[9] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[10] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[11] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[12] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[13] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[14] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[15] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[16] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[17] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[18] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[19] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[20] = ((int)((( ((int)((( ((int)((( 5) << 4) | (5))) ) << 8) | (((int)(((5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (5))) ) << 8) | ( ((int)(((5) << 4) | (5))) )))))) ; m_cclass[21] = ((int)((( ((int)((( ((int)((( 5) << 4) | (5))) ) << 8) | (((int)(((5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (5))) ) << 8) | ( ((int)(((5) << 4) | (5))) )))))) ; m_cclass[22] = ((int)((( ((int)((( ((int)((( 5) << 4) | (5))) ) << 8) | (((int)(((5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (5))) ) << 8) | ( ((int)(((5) << 4) | (5))) )))))) ; m_cclass[23] = ((int)((( ((int)((( ((int)((( 5) << 4) | (5))) ) << 8) | (((int)(((5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (5))) ) << 8) | ( ((int)(((5) << 4) | (5))) )))))) ; m_cclass[24] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[25] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ; m_cclass[26] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ; m_cclass[27] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ; m_cclass[28] = ((int)((( ((int)((( ((int)((( 8) << 4) | (8))) ) << 8) | (((int)(((8) << 4) | ( 8))) ))) ) << 16) | ( ((int)((( ((int)(((8) << 4) | (8))) ) << 8) | ( ((int)(((8) << 4) | (7))) )))))) ; m_cclass[29] = ((int)((( ((int)((( ((int)((( 8) << 4) | (8))) ) << 8) | (((int)(((9) << 4) | ( 8))) ))) ) << 16) | ( ((int)((( ((int)(((8) << 4) | (8))) ) << 8) | ( ((int)(((8) << 4) | (8))) )))))) ; m_cclass[30] = ((int)((( ((int)((( ((int)((( 11) << 4) | (11))) ) << 8) | (((int)(((11) << 4) | ( 11))) ))) ) << 16) | ( ((int)((( ((int)(((11) << 4) | (11))) ) << 8) | ( ((int)(((11) << 4) | (10))) )))))) ; m_cclass[31] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((15) << 4) | ( 14))) ))) ) << 16) | ( ((int)((( ((int)(((13) << 4) | (13))) ) << 8) | ( ((int)(((13) << 4) | (12))) )))))) ; m_states = new int[26] ; m_states[0] = ((int)((( ((int)((( ((int)((( 10) << 4) | ( 12))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eStart) << 4) | (eError))) )))))) ; m_states[1] = ((int)((( ((int)((( ((int)((( 3) << 4) | ( 4))) ) << 8) | (((int)((( 5) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)((( 7) << 4) | ( 8))) ) << 8) | ( ((int)((( 11) << 4) | ( 9))) )))))) ; m_states[2] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[3] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[4] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eItsMe))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ; m_states[5] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eItsMe))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ; m_states[6] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)((( 5) << 4) | ( 5))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[7] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[8] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)((( 5) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[9] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[10] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 7) << 4) | ( 7))) ))) ) << 16) | ( ((int)((( ((int)((( 7) << 4) | ( 7))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[11] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[12] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 7) << 4) | ( 7))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[13] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[14] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 9) << 4) | ( 9))) ))) ) << 16) | ( ((int)((( ((int)((( 9) << 4) | ( 9))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[15] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[16] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 9) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[17] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[18] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 12) << 4) | ( 12))) ))) ) << 16) | ( ((int)((( ((int)((( 12) << 4) | ( 12))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[19] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[20] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 12) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[21] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[22] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( 12))) ))) ) << 16) | ( ((int)((( ((int)((( 12) << 4) | ( 12))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[23] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[24] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eStart))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[25] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_charset = "UTF-8"; m_stFactor = 16; } public override bool isUCS2() { return false; } } } // namespace ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/nsISO2022JPVerifier.cs���������������������������������������������0000644�0001750�0001750�00000025427�10640337027�021733� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* * DO NOT EDIT THIS DOCUMENT MANUALLY !!! * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER * AutoDetect/tools/ */ using System; namespace org.mozilla.intl.chardet { //import java.lang.* ; public class nsISO2022JPVerifier : nsVerifier { static int[] m_cclass ; static int[] m_states ; static int m_stFactor ; static String m_charset ; public override int[] cclass() { return m_cclass ; } public override int[] states() { return m_states ; } public override int stFactor() { return m_stFactor ; } public override String charset() { return m_charset ; } public nsISO2022JPVerifier() { m_cclass = new int[256/8] ; m_cclass[0] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (2))) )))))) ; m_cclass[1] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[2] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[3] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[4] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 7))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[5] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (3))) )))))) ; m_cclass[6] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[7] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[8] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (4))) ) << 8) | ( ((int)(((0) << 4) | (6))) )))))) ; m_cclass[9] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (5))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[10] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[11] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[12] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[13] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[14] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[15] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[16] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[17] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[18] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[19] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[20] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[21] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[22] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[23] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[24] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[25] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[26] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[27] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[28] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[29] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[30] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[31] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_states = new int[6] ; m_states[0] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eError))) ) << 8) | ( ((int)((( 3) << 4) | (eStart))) )))))) ; m_states[1] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[2] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eItsMe))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ; m_states[3] = ((int)((( ((int)((( ((int)((( 4) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)((( 5) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[4] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eItsMe))) ) << 8) | (((int)(((eError) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[5] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_charset = "ISO-2022-JP"; m_stFactor = 8; } public override bool isUCS2() { return false; } } } // namespace �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/nsGB2312Verifier.cs������������������������������������������������0000644�0001750�0001750�00000023432�10640337027�021333� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* * DO NOT EDIT THIS DOCUMENT MANUALLY !!! * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER * AutoDetect/tools/ */ using System; namespace org.mozilla.intl.chardet { //import java.lang.* ; public class nsGB2312Verifier : nsVerifier { static int[] m_cclass ; static int[] m_states ; static int m_stFactor ; static String m_charset ; public override int[] cclass() { return m_cclass ; } public override int[] states() { return m_states ; } public override int stFactor() { return m_stFactor ; } public override String charset() { return m_charset ; } public nsGB2312Verifier() { m_cclass = new int[256/8] ; m_cclass[0] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[2] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[3] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[4] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[5] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[6] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[7] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[8] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[9] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[10] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[11] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[12] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[13] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[14] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[15] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[16] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[17] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[18] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[19] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[20] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (0))) )))))) ; m_cclass[21] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[22] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[23] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[24] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[25] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[26] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[27] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[28] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[29] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[30] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[31] = ((int)((( ((int)((( ((int)((( 0) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_states = new int[2] ; m_states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | ( 3))) ) << 8) | ( ((int)(((eStart) << 4) | (eError))) )))))) ; m_states[1] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eItsMe))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ; m_charset = "GB2312"; m_stFactor = 4; } public override bool isUCS2() { return false; } } } // namespace ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/nsEUCKRVerifier.cs�������������������������������������������������0000644�0001750�0001750�00000023430�10640337027�021402� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* * DO NOT EDIT THIS DOCUMENT MANUALLY !!! * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER * AutoDetect/tools/ */ using System; namespace org.mozilla.intl.chardet { //import java.lang.* ; public class nsEUCKRVerifier : nsVerifier { static int[] m_cclass ; static int[] m_states ; static int m_stFactor ; static String m_charset ; public override int[] cclass() { return m_cclass ; } public override int[] states() { return m_states ; } public override int stFactor() { return m_stFactor ; } public override String charset() { return m_charset ; } public nsEUCKRVerifier() { m_cclass = new int[256/8] ; m_cclass[0] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[2] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[3] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[4] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[5] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[6] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[7] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[8] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[9] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[10] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[11] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[12] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[13] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[14] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[15] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[16] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[17] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[18] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[19] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[20] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (0))) )))))) ; m_cclass[21] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[22] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[23] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[24] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[25] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((3) << 4) | (2))) )))))) ; m_cclass[26] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[27] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[28] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[29] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[30] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[31] = ((int)((( ((int)((( ((int)((( 0) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_states = new int[2] ; m_states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | ( 3))) ) << 8) | ( ((int)(((eStart) << 4) | (eError))) )))))) ; m_states[1] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eItsMe))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ; m_charset = "EUC-KR"; m_stFactor = 4; } public override bool isUCS2() { return false; } } } // namespace ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/nsBIG5Verifier.cs��������������������������������������������������0000644�0001750�0001750�00000024017�10640337027�021221� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* * DO NOT EDIT THIS DOCUMENT MANUALLY !!! * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER * AutoDetect/tools/ */ using System; namespace org.mozilla.intl.chardet { //import java.lang.* ; public class nsBIG5Verifier : nsVerifier { static int[] m_cclass ; static int[] m_states ; static int m_stFactor ; static String m_charset ; public override int[] cclass() { return m_cclass ; } public override int[] states() { return m_states ; } public override int stFactor() { return m_stFactor ; } public override String charset() { return m_charset ; } public nsBIG5Verifier() { m_cclass = new int[256/8] ; m_cclass[0] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[2] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[3] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[4] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[5] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[6] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[7] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[8] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[9] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[10] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[11] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[12] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[13] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[14] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[15] = ((int)((( ((int)((( ((int)((( 1) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[16] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[17] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[18] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[19] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ; m_cclass[20] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (4))) )))))) ; m_cclass[21] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[22] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[23] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[24] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[25] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[26] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[27] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[28] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[29] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[30] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[31] = ((int)((( ((int)((( ((int)((( 0) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_states = new int[3] ; m_states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)((( 3) << 4) | (eStart))) ) << 8) | ( ((int)(((eStart) << 4) | (eError))) )))))) ; m_states[1] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eItsMe))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[2] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eStart))) ) << 8) | ( ((int)(((eStart) << 4) | (eError))) )))))) ; m_charset = "Big5"; m_stFactor = 5; } public override bool isUCS2() { return false; } } } // namespace �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/EUCTWStatistics.cs�������������������������������������������������0000644�0001750�0001750�00000025561�10640337027�021445� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ namespace org.mozilla.intl.chardet { //import java.lang.* ; public class EUCTWStatistics : nsEUCStatistics { static float[] m_FirstByteFreq ; static float m_FirstByteStdDev; static float m_FirstByteMean; static float m_FirstByteWeight; static float[] m_SecondByteFreq; static float m_SecondByteStdDev; static float m_SecondByteMean; static float m_SecondByteWeight; public override float[] mFirstByteFreq() { return m_FirstByteFreq; } public override float mFirstByteStdDev() { return m_FirstByteStdDev; } public override float mFirstByteMean() { return m_FirstByteMean; } public override float mFirstByteWeight() { return m_FirstByteWeight; } public override float[] mSecondByteFreq() { return m_SecondByteFreq; } public override float mSecondByteStdDev() { return m_SecondByteStdDev; } public override float mSecondByteMean() { return m_SecondByteMean; } public override float mSecondByteWeight() { return m_SecondByteWeight; } public EUCTWStatistics() { m_FirstByteFreq = new float[] { 0.000000f, // FreqH[a1] 0.000000f, // FreqH[a2] 0.000000f, // FreqH[a3] 0.000000f, // FreqH[a4] 0.000000f, // FreqH[a5] 0.000000f, // FreqH[a6] 0.000000f, // FreqH[a7] 0.000000f, // FreqH[a8] 0.000000f, // FreqH[a9] 0.000000f, // FreqH[aa] 0.000000f, // FreqH[ab] 0.000000f, // FreqH[ac] 0.000000f, // FreqH[ad] 0.000000f, // FreqH[ae] 0.000000f, // FreqH[af] 0.000000f, // FreqH[b0] 0.000000f, // FreqH[b1] 0.000000f, // FreqH[b2] 0.000000f, // FreqH[b3] 0.000000f, // FreqH[b4] 0.000000f, // FreqH[b5] 0.000000f, // FreqH[b6] 0.000000f, // FreqH[b7] 0.000000f, // FreqH[b8] 0.000000f, // FreqH[b9] 0.000000f, // FreqH[ba] 0.000000f, // FreqH[bb] 0.000000f, // FreqH[bc] 0.000000f, // FreqH[bd] 0.000000f, // FreqH[be] 0.000000f, // FreqH[bf] 0.000000f, // FreqH[c0] 0.000000f, // FreqH[c1] 0.000000f, // FreqH[c2] 0.000000f, // FreqH[c3] 0.119286f, // FreqH[c4] 0.052233f, // FreqH[c5] 0.044126f, // FreqH[c6] 0.052494f, // FreqH[c7] 0.045906f, // FreqH[c8] 0.019038f, // FreqH[c9] 0.032465f, // FreqH[ca] 0.026252f, // FreqH[cb] 0.025502f, // FreqH[cc] 0.015963f, // FreqH[cd] 0.052493f, // FreqH[ce] 0.019256f, // FreqH[cf] 0.015137f, // FreqH[d0] 0.031782f, // FreqH[d1] 0.017370f, // FreqH[d2] 0.018494f, // FreqH[d3] 0.015575f, // FreqH[d4] 0.016621f, // FreqH[d5] 0.007444f, // FreqH[d6] 0.011642f, // FreqH[d7] 0.013916f, // FreqH[d8] 0.019159f, // FreqH[d9] 0.016445f, // FreqH[da] 0.007851f, // FreqH[db] 0.011079f, // FreqH[dc] 0.022842f, // FreqH[dd] 0.015513f, // FreqH[de] 0.010033f, // FreqH[df] 0.009950f, // FreqH[e0] 0.010347f, // FreqH[e1] 0.013103f, // FreqH[e2] 0.015371f, // FreqH[e3] 0.012502f, // FreqH[e4] 0.007436f, // FreqH[e5] 0.018253f, // FreqH[e6] 0.014134f, // FreqH[e7] 0.008907f, // FreqH[e8] 0.005411f, // FreqH[e9] 0.009570f, // FreqH[ea] 0.013598f, // FreqH[eb] 0.006092f, // FreqH[ec] 0.007409f, // FreqH[ed] 0.008432f, // FreqH[ee] 0.005816f, // FreqH[ef] 0.009349f, // FreqH[f0] 0.005472f, // FreqH[f1] 0.007170f, // FreqH[f2] 0.007420f, // FreqH[f3] 0.003681f, // FreqH[f4] 0.007523f, // FreqH[f5] 0.004610f, // FreqH[f6] 0.006154f, // FreqH[f7] 0.003348f, // FreqH[f8] 0.005074f, // FreqH[f9] 0.005922f, // FreqH[fa] 0.005254f, // FreqH[fb] 0.004682f, // FreqH[fc] 0.002093f, // FreqH[fd] 0.000000f // FreqH[fe] }; m_FirstByteStdDev = 0.016681f; // Lead Byte StdDev m_FirstByteMean = 0.010638f; // Lead Byte Mean m_FirstByteWeight = 0.715599f; // Lead Byte Weight m_SecondByteFreq = new float[] { 0.028933f, // FreqL[a1] 0.011371f, // FreqL[a2] 0.011053f, // FreqL[a3] 0.007232f, // FreqL[a4] 0.010192f, // FreqL[a5] 0.004093f, // FreqL[a6] 0.015043f, // FreqL[a7] 0.011752f, // FreqL[a8] 0.022387f, // FreqL[a9] 0.008410f, // FreqL[aa] 0.012448f, // FreqL[ab] 0.007473f, // FreqL[ac] 0.003594f, // FreqL[ad] 0.007139f, // FreqL[ae] 0.018912f, // FreqL[af] 0.006083f, // FreqL[b0] 0.003302f, // FreqL[b1] 0.010215f, // FreqL[b2] 0.008791f, // FreqL[b3] 0.024236f, // FreqL[b4] 0.014107f, // FreqL[b5] 0.014108f, // FreqL[b6] 0.010303f, // FreqL[b7] 0.009728f, // FreqL[b8] 0.007877f, // FreqL[b9] 0.009719f, // FreqL[ba] 0.007952f, // FreqL[bb] 0.021028f, // FreqL[bc] 0.005764f, // FreqL[bd] 0.009341f, // FreqL[be] 0.006591f, // FreqL[bf] 0.012517f, // FreqL[c0] 0.005921f, // FreqL[c1] 0.008982f, // FreqL[c2] 0.008771f, // FreqL[c3] 0.012802f, // FreqL[c4] 0.005926f, // FreqL[c5] 0.008342f, // FreqL[c6] 0.003086f, // FreqL[c7] 0.006843f, // FreqL[c8] 0.007576f, // FreqL[c9] 0.004734f, // FreqL[ca] 0.016404f, // FreqL[cb] 0.008803f, // FreqL[cc] 0.008071f, // FreqL[cd] 0.005349f, // FreqL[ce] 0.008566f, // FreqL[cf] 0.010840f, // FreqL[d0] 0.015401f, // FreqL[d1] 0.031904f, // FreqL[d2] 0.008670f, // FreqL[d3] 0.011479f, // FreqL[d4] 0.010936f, // FreqL[d5] 0.007617f, // FreqL[d6] 0.008995f, // FreqL[d7] 0.008114f, // FreqL[d8] 0.008658f, // FreqL[d9] 0.005934f, // FreqL[da] 0.010452f, // FreqL[db] 0.009142f, // FreqL[dc] 0.004519f, // FreqL[dd] 0.008339f, // FreqL[de] 0.007476f, // FreqL[df] 0.007027f, // FreqL[e0] 0.006025f, // FreqL[e1] 0.021804f, // FreqL[e2] 0.024248f, // FreqL[e3] 0.015895f, // FreqL[e4] 0.003768f, // FreqL[e5] 0.010171f, // FreqL[e6] 0.010007f, // FreqL[e7] 0.010178f, // FreqL[e8] 0.008316f, // FreqL[e9] 0.006832f, // FreqL[ea] 0.006364f, // FreqL[eb] 0.009141f, // FreqL[ec] 0.009148f, // FreqL[ed] 0.012081f, // FreqL[ee] 0.011914f, // FreqL[ef] 0.004464f, // FreqL[f0] 0.014257f, // FreqL[f1] 0.006907f, // FreqL[f2] 0.011292f, // FreqL[f3] 0.018622f, // FreqL[f4] 0.008149f, // FreqL[f5] 0.004636f, // FreqL[f6] 0.006612f, // FreqL[f7] 0.013478f, // FreqL[f8] 0.012614f, // FreqL[f9] 0.005186f, // FreqL[fa] 0.048285f, // FreqL[fb] 0.006816f, // FreqL[fc] 0.006743f, // FreqL[fd] 0.008671f // FreqL[fe] }; m_SecondByteStdDev = 0.006630f; // Trail Byte StdDev m_SecondByteMean = 0.010638f; // Trail Byte Mean m_SecondByteWeight = 0.284401f; // Trial Byte Weight } } } // namespace �����������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/nsEUCTWVerifier.cs�������������������������������������������������0000644�0001750�0001750�00000025414�10640337027�021424� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* * DO NOT EDIT THIS DOCUMENT MANUALLY !!! * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER * AutoDetect/tools/ */ using System; namespace org.mozilla.intl.chardet { //import java.lang.* ; public class nsEUCTWVerifier : nsVerifier { static int[] m_cclass ; static int[] m_states ; static int m_stFactor ; static String m_charset ; public override int[] cclass() { return m_cclass ; } public override int[] states() { return m_states ; } public override int stFactor() { return m_stFactor ; } public override String charset() { return m_charset ; } public nsEUCTWVerifier() { m_cclass = new int[256/8] ; m_cclass[0] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[2] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[3] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[4] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[5] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[6] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[7] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[8] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[9] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[10] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[11] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[12] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[13] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[14] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[15] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[16] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[17] = ((int)((( ((int)((( ((int)((( 0) << 4) | (6))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[18] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[19] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[20] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((3) << 4) | (0))) )))))) ; m_cclass[21] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((5) << 4) | (5))) )))))) ; m_cclass[22] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[23] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[24] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (3))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[25] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[26] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[27] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[28] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[29] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[30] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_cclass[31] = ((int)((( ((int)((( ((int)((( 0) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ; m_states = new int[6] ; m_states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | ( 4))) ) << 8) | (((int)((( 3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)((( 3) << 4) | (eStart))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[1] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[2] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eStart))) ) << 8) | (((int)(((eError) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eItsMe))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ; m_states[3] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eStart))) ) << 8) | ( ((int)(((eStart) << 4) | (eStart))) )))))) ; m_states[4] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eError) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | ( 5))) )))))) ; m_states[5] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eStart))) ) << 8) | ( ((int)(((eError) << 4) | (eStart))) )))))) ; m_charset = "x-euc-tw"; m_stFactor = 7; } public override bool isUCS2() { return false; } } } // namespace ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/Big5Statistics.cs��������������������������������������������������0000644�0001750�0001750�00000027174�10640337027�021346� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ namespace org.mozilla.intl.chardet { ////import java.lang.* ; public class Big5Statistics : nsEUCStatistics { static float[] m_FirstByteFreq ; static float m_FirstByteStdDev; static float m_FirstByteMean; static float m_FirstByteWeight; static float[] m_SecondByteFreq; static float m_SecondByteStdDev; static float m_SecondByteMean; static float m_SecondByteWeight; public override float[] mFirstByteFreq() { return m_FirstByteFreq; } public override float mFirstByteStdDev() { return m_FirstByteStdDev; } public override float mFirstByteMean() { return m_FirstByteMean; } public override float mFirstByteWeight() { return m_FirstByteWeight; } public override float[] mSecondByteFreq() { return m_SecondByteFreq; } public override float mSecondByteStdDev() { return m_SecondByteStdDev; } public override float mSecondByteMean() { return m_SecondByteMean; } public override float mSecondByteWeight() { return m_SecondByteWeight; } public Big5Statistics() { m_FirstByteFreq = new float[] { 0.000000f, // FreqH[a1] 0.000000f, // FreqH[a2] 0.000000f, // FreqH[a3] 0.114427f, // FreqH[a4] 0.061058f, // FreqH[a5] 0.075598f, // FreqH[a6] 0.048386f, // FreqH[a7] 0.063966f, // FreqH[a8] 0.027094f, // FreqH[a9] 0.095787f, // FreqH[aa] 0.029525f, // FreqH[ab] 0.031331f, // FreqH[ac] 0.036915f, // FreqH[ad] 0.021805f, // FreqH[ae] 0.019349f, // FreqH[af] 0.037496f, // FreqH[b0] 0.018068f, // FreqH[b1] 0.012760f, // FreqH[b2] 0.030053f, // FreqH[b3] 0.017339f, // FreqH[b4] 0.016731f, // FreqH[b5] 0.019501f, // FreqH[b6] 0.011240f, // FreqH[b7] 0.032973f, // FreqH[b8] 0.016658f, // FreqH[b9] 0.015872f, // FreqH[ba] 0.021458f, // FreqH[bb] 0.012378f, // FreqH[bc] 0.017003f, // FreqH[bd] 0.020802f, // FreqH[be] 0.012454f, // FreqH[bf] 0.009239f, // FreqH[c0] 0.012829f, // FreqH[c1] 0.007922f, // FreqH[c2] 0.010079f, // FreqH[c3] 0.009815f, // FreqH[c4] 0.010104f, // FreqH[c5] 0.000000f, // FreqH[c6] 0.000000f, // FreqH[c7] 0.000000f, // FreqH[c8] 0.000053f, // FreqH[c9] 0.000035f, // FreqH[ca] 0.000105f, // FreqH[cb] 0.000031f, // FreqH[cc] 0.000088f, // FreqH[cd] 0.000027f, // FreqH[ce] 0.000027f, // FreqH[cf] 0.000026f, // FreqH[d0] 0.000035f, // FreqH[d1] 0.000024f, // FreqH[d2] 0.000034f, // FreqH[d3] 0.000375f, // FreqH[d4] 0.000025f, // FreqH[d5] 0.000028f, // FreqH[d6] 0.000020f, // FreqH[d7] 0.000024f, // FreqH[d8] 0.000028f, // FreqH[d9] 0.000031f, // FreqH[da] 0.000059f, // FreqH[db] 0.000040f, // FreqH[dc] 0.000030f, // FreqH[dd] 0.000079f, // FreqH[de] 0.000037f, // FreqH[df] 0.000040f, // FreqH[e0] 0.000023f, // FreqH[e1] 0.000030f, // FreqH[e2] 0.000027f, // FreqH[e3] 0.000064f, // FreqH[e4] 0.000020f, // FreqH[e5] 0.000027f, // FreqH[e6] 0.000025f, // FreqH[e7] 0.000074f, // FreqH[e8] 0.000019f, // FreqH[e9] 0.000023f, // FreqH[ea] 0.000021f, // FreqH[eb] 0.000018f, // FreqH[ec] 0.000017f, // FreqH[ed] 0.000035f, // FreqH[ee] 0.000021f, // FreqH[ef] 0.000019f, // FreqH[f0] 0.000025f, // FreqH[f1] 0.000017f, // FreqH[f2] 0.000037f, // FreqH[f3] 0.000018f, // FreqH[f4] 0.000018f, // FreqH[f5] 0.000019f, // FreqH[f6] 0.000022f, // FreqH[f7] 0.000033f, // FreqH[f8] 0.000032f, // FreqH[f9] 0.000000f, // FreqH[fa] 0.000000f, // FreqH[fb] 0.000000f, // FreqH[fc] 0.000000f, // FreqH[fd] 0.000000f // FreqH[fe] }; m_FirstByteStdDev = 0.020606f; // Lead Byte StdDev m_FirstByteMean = 0.010638f; // Lead Byte Mean m_FirstByteWeight = 0.675261f; // Lead Byte Weight m_SecondByteFreq = new float[] { 0.020256f, // FreqL[a1] 0.003293f, // FreqL[a2] 0.045811f, // FreqL[a3] 0.016650f, // FreqL[a4] 0.007066f, // FreqL[a5] 0.004146f, // FreqL[a6] 0.009229f, // FreqL[a7] 0.007333f, // FreqL[a8] 0.003296f, // FreqL[a9] 0.005239f, // FreqL[aa] 0.008282f, // FreqL[ab] 0.003791f, // FreqL[ac] 0.006116f, // FreqL[ad] 0.003536f, // FreqL[ae] 0.004024f, // FreqL[af] 0.016654f, // FreqL[b0] 0.009334f, // FreqL[b1] 0.005429f, // FreqL[b2] 0.033392f, // FreqL[b3] 0.006121f, // FreqL[b4] 0.008983f, // FreqL[b5] 0.002801f, // FreqL[b6] 0.004221f, // FreqL[b7] 0.010357f, // FreqL[b8] 0.014695f, // FreqL[b9] 0.077937f, // FreqL[ba] 0.006314f, // FreqL[bb] 0.004020f, // FreqL[bc] 0.007331f, // FreqL[bd] 0.007150f, // FreqL[be] 0.005341f, // FreqL[bf] 0.009195f, // FreqL[c0] 0.005350f, // FreqL[c1] 0.005698f, // FreqL[c2] 0.004472f, // FreqL[c3] 0.007242f, // FreqL[c4] 0.004039f, // FreqL[c5] 0.011154f, // FreqL[c6] 0.016184f, // FreqL[c7] 0.004741f, // FreqL[c8] 0.012814f, // FreqL[c9] 0.007679f, // FreqL[ca] 0.008045f, // FreqL[cb] 0.016631f, // FreqL[cc] 0.009451f, // FreqL[cd] 0.016487f, // FreqL[ce] 0.007287f, // FreqL[cf] 0.012688f, // FreqL[d0] 0.017421f, // FreqL[d1] 0.013205f, // FreqL[d2] 0.031480f, // FreqL[d3] 0.003404f, // FreqL[d4] 0.009149f, // FreqL[d5] 0.008921f, // FreqL[d6] 0.007514f, // FreqL[d7] 0.008683f, // FreqL[d8] 0.008203f, // FreqL[d9] 0.031403f, // FreqL[da] 0.011733f, // FreqL[db] 0.015617f, // FreqL[dc] 0.015306f, // FreqL[dd] 0.004004f, // FreqL[de] 0.010899f, // FreqL[df] 0.009961f, // FreqL[e0] 0.008388f, // FreqL[e1] 0.010920f, // FreqL[e2] 0.003925f, // FreqL[e3] 0.008585f, // FreqL[e4] 0.009108f, // FreqL[e5] 0.015546f, // FreqL[e6] 0.004659f, // FreqL[e7] 0.006934f, // FreqL[e8] 0.007023f, // FreqL[e9] 0.020252f, // FreqL[ea] 0.005387f, // FreqL[eb] 0.024704f, // FreqL[ec] 0.006963f, // FreqL[ed] 0.002625f, // FreqL[ee] 0.009512f, // FreqL[ef] 0.002971f, // FreqL[f0] 0.008233f, // FreqL[f1] 0.010000f, // FreqL[f2] 0.011973f, // FreqL[f3] 0.010553f, // FreqL[f4] 0.005945f, // FreqL[f5] 0.006349f, // FreqL[f6] 0.009401f, // FreqL[f7] 0.008577f, // FreqL[f8] 0.008186f, // FreqL[f9] 0.008159f, // FreqL[fa] 0.005033f, // FreqL[fb] 0.008714f, // FreqL[fc] 0.010614f, // FreqL[fd] 0.006554f // FreqL[fe] }; m_SecondByteStdDev = 0.009909f; // Trail Byte StdDev m_SecondByteMean = 0.010638f; // Trail Byte Mean m_SecondByteWeight = 0.324739f ; // Trial Byte Weight } } } // namespace ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/nsICharsetDetectionObserver.cs�������������������������������������0000644�0001750�0001750�00000003641�10640337027�024110� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ using System; namespace org.mozilla.intl.chardet { //import java.lang.* ; public interface nsICharsetDetectionObserver { void Notify(String charset) ; } } // namespace �����������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/nsPSMDetector.cs���������������������������������������������������0000644�0001750�0001750�00000026746�10640337027�021203� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ using System; namespace org.mozilla.intl.chardet { //import java.lang.* ; public abstract class nsPSMDetector { public const int ALL = 0 ; public const int JAPANESE = 1 ; public const int CHINESE = 2 ; public const int SIMPLIFIED_CHINESE = 3 ; public const int TRADITIONAL_CHINESE = 4 ; public const int KOREAN = 5 ; public const int NO_OF_LANGUAGES = 6 ; public const int MAX_VERIFIERS = 16 ; nsVerifier[] mVerifier ; nsEUCStatistics[] mStatisticsData ; nsEUCSampler mSampler = new nsEUCSampler() ; byte[] mState = new byte[MAX_VERIFIERS] ; int[] mItemIdx = new int[MAX_VERIFIERS] ; int mItems ; int mClassItems ; protected bool mDone ; protected bool mRunSampler ; protected bool mClassRunSampler ; public nsPSMDetector() { initVerifiers( nsPSMDetector.ALL ); Reset() ; } public nsPSMDetector(int langFlag) { initVerifiers(langFlag); Reset() ; } public nsPSMDetector(int aItems, nsVerifier[] aVerifierSet, nsEUCStatistics[] aStatisticsSet) { mClassRunSampler = ( aStatisticsSet != null ) ; mStatisticsData = aStatisticsSet ; mVerifier = aVerifierSet ; mClassItems = aItems ; Reset() ; } public void Reset() { mRunSampler = mClassRunSampler ; mDone = false ; mItems = mClassItems ; for(int i=0; i<mItems; i++) { mState[i] = 0; mItemIdx[i] = i; } mSampler.Reset() ; } protected void initVerifiers(int currVerSet) { //int idx = 0 ; int currVerifierSet ; if (currVerSet >=0 && currVerSet < NO_OF_LANGUAGES ) { currVerifierSet = currVerSet ; } else { currVerifierSet = nsPSMDetector.ALL ; } mVerifier = null ; mStatisticsData = null ; if ( currVerifierSet == nsPSMDetector.TRADITIONAL_CHINESE ) { mVerifier = new nsVerifier[] { new nsUTF8Verifier(), new nsBIG5Verifier(), new nsISO2022CNVerifier(), new nsEUCTWVerifier(), new nsCP1252Verifier(), new nsUCS2BEVerifier(), new nsUCS2LEVerifier() }; mStatisticsData = new nsEUCStatistics[] { null, new Big5Statistics(), null, new EUCTWStatistics(), null, null, null }; } //========================================================== else if ( currVerifierSet == nsPSMDetector.KOREAN ) { mVerifier = new nsVerifier[] { new nsUTF8Verifier(), new nsEUCKRVerifier(), new nsISO2022KRVerifier(), new nsCP1252Verifier(), new nsUCS2BEVerifier(), new nsUCS2LEVerifier() }; } //========================================================== else if ( currVerifierSet == nsPSMDetector.SIMPLIFIED_CHINESE ) { mVerifier = new nsVerifier[] { new nsUTF8Verifier(), new nsGB2312Verifier(), new nsGB18030Verifier(), new nsISO2022CNVerifier(), new nsHZVerifier(), new nsCP1252Verifier(), new nsUCS2BEVerifier(), new nsUCS2LEVerifier() }; } //========================================================== else if ( currVerifierSet == nsPSMDetector.JAPANESE ) { mVerifier = new nsVerifier[] { new nsUTF8Verifier(), new nsSJISVerifier(), new nsEUCJPVerifier(), new nsISO2022JPVerifier(), new nsCP1252Verifier(), new nsUCS2BEVerifier(), new nsUCS2LEVerifier() }; } //========================================================== else if ( currVerifierSet == nsPSMDetector.CHINESE ) { mVerifier = new nsVerifier[] { new nsUTF8Verifier(), new nsGB2312Verifier(), new nsGB18030Verifier(), new nsBIG5Verifier(), new nsISO2022CNVerifier(), new nsHZVerifier(), new nsEUCTWVerifier(), new nsCP1252Verifier(), new nsUCS2BEVerifier(), new nsUCS2LEVerifier() }; mStatisticsData = new nsEUCStatistics[] { null, new GB2312Statistics(), null, new Big5Statistics(), null, null, new EUCTWStatistics(), null, null, null }; } //========================================================== else if ( currVerifierSet == nsPSMDetector.ALL ) { mVerifier = new nsVerifier[] { new nsUTF8Verifier(), new nsSJISVerifier(), new nsEUCJPVerifier(), new nsISO2022JPVerifier(), new nsEUCKRVerifier(), new nsISO2022KRVerifier(), new nsBIG5Verifier(), new nsEUCTWVerifier(), new nsGB2312Verifier(), new nsGB18030Verifier(), new nsISO2022CNVerifier(), new nsHZVerifier(), new nsCP1252Verifier(), new nsUCS2BEVerifier(), new nsUCS2LEVerifier() }; mStatisticsData = new nsEUCStatistics[] { null, null, new EUCJPStatistics(), null, new EUCKRStatistics(), null, new Big5Statistics(), new EUCTWStatistics(), new GB2312Statistics(), null, null, null, null, null, null }; } mClassRunSampler = ( mStatisticsData != null ) ; mClassItems = mVerifier.Length ; } public abstract void Report(String charset) ; public bool HandleData(byte[] aBuf, int len) { int i,j; byte b, st; for( i=0; i < len; i++) { b = aBuf[i] ; for (j=0; j < mItems; ) { st = nsVerifier.getNextState( mVerifier[mItemIdx[j]], b, mState[j]) ; //if (st != 0) //System.out.println( "state(0x" + Integer.toHexString(0xFF&b) +") =>"+ Integer.toHexString(st&0xFF)+ " " + mVerifier[mItemIdx[j]].charset()); if (st == nsVerifier.eItsMe) { //System.out.println( "eItsMe(0x" + Integer.toHexString(0xFF&b) +") =>"+ mVerifier[mItemIdx[j]].charset()); Report( mVerifier[mItemIdx[j]].charset() ); mDone = true ; return mDone ; } else if (st == nsVerifier.eError ) { //System.out.println( "eNotMe(0x" + Integer.toHexString(0xFF&b) +") =>"+ mVerifier[mItemIdx[j]].charset()); mItems--; if (j < mItems ) { mItemIdx[j] = mItemIdx[mItems]; mState[j] = mState[mItems]; } } else { mState[j++] = st ; } } if ( mItems <= 1 ) { if( 1 == mItems) { Report( mVerifier[mItemIdx[0]].charset() ); } mDone = true ; return mDone ; } else { int nonUCS2Num=0; int nonUCS2Idx=0; for(j=0; j<mItems; j++) { if ( (!(mVerifier[mItemIdx[j]].isUCS2())) && (!(mVerifier[mItemIdx[j]].isUCS2())) ) { nonUCS2Num++ ; nonUCS2Idx = j ; } } if (1 == nonUCS2Num) { Report( mVerifier[mItemIdx[nonUCS2Idx]].charset() ); mDone = true ; return mDone ; } } } // End of for( i=0; i < len ... if (mRunSampler) Sample(aBuf, len); return mDone ; } public void DataEnd() { if (mDone == true) return ; if (mItems == 2) { if ((mVerifier[mItemIdx[0]].charset()) == ("GB18030")) { Report(mVerifier[mItemIdx[1]].charset()) ; mDone = true ; } else if ((mVerifier[mItemIdx[1]].charset()) == ("GB18030")) { Report(mVerifier[mItemIdx[0]].charset()) ; mDone = true ; } } if (mRunSampler) Sample(null, 0, true); } public void Sample(byte[] aBuf, int aLen) { Sample(aBuf, aLen, false) ; } public void Sample(byte[] aBuf, int aLen, bool aLastChance) { int possibleCandidateNum = 0; int j; int eucNum=0 ; for (j=0; j< mItems; j++) { if (null != mStatisticsData[mItemIdx[j]]) eucNum++ ; if ((!mVerifier[mItemIdx[j]].isUCS2()) && (!(mVerifier[mItemIdx[j]].charset() == "GB18030"))) possibleCandidateNum++ ; } mRunSampler = (eucNum > 1) ; if (mRunSampler) { mRunSampler = mSampler.Sample(aBuf, aLen); if(((aLastChance && mSampler.GetSomeData()) || mSampler.EnoughData()) && (eucNum == possibleCandidateNum)) { mSampler.CalFreq(); int bestIdx = -1; int eucCnt=0; float bestScore = 0.0f; for(j = 0; j < mItems; j++) { if((null != mStatisticsData[mItemIdx[j]]) && (!(mVerifier[mItemIdx[j]].charset() == "Big5"))) { float score = mSampler.GetScore( mStatisticsData[mItemIdx[j]].mFirstByteFreq(), mStatisticsData[mItemIdx[j]].mFirstByteWeight(), mStatisticsData[mItemIdx[j]].mSecondByteFreq(), mStatisticsData[mItemIdx[j]].mSecondByteWeight() ); //System.out.println("FequencyScore("+mVerifier[mItemIdx[j]].charset()+")= "+ score); if(( 0 == eucCnt++) || (bestScore > score )) { bestScore = score; bestIdx = j; } // if(( 0 == eucCnt++) || (bestScore > score )) } // if(null != ...) } // for if (bestIdx >= 0) { Report( mVerifier[mItemIdx[bestIdx]].charset()); mDone = true; } } // if (eucNum == possibleCandidateNum) } // if(mRunSampler) } public String[] getProbableCharsets() { if (mItems <= 0) { String[] nomatch = new String[1]; nomatch[0] = "nomatch" ; return nomatch ; } String[] ret = new String[mItems] ; for (int i=0; i<mItems; i++) ret[i] = mVerifier[mItemIdx[i]].charset() ; return ret ; } } } // namespace ��������������������������sublib-0.9/src/External/NCharDet/nsCP1252Verifier.cs������������������������������������������������0000644�0001750�0001750�00000024033�10640337027�021345� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* * DO NOT EDIT THIS DOCUMENT MANUALLY !!! * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER * AutoDetect/tools/ */ using System; namespace org.mozilla.intl.chardet { //import java.lang.* ; public class nsCP1252Verifier : nsVerifier { static int[] m_cclass ; static int[] m_states ; static int m_stFactor ; static String m_charset ; public override int[] cclass() { return m_cclass ; } public override int[] states() { return m_states ; } public override int stFactor() { return m_stFactor ; } public override String charset() { return m_charset ; } public nsCP1252Verifier() { m_cclass = new int[256/8] ; m_cclass[0] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (1))) )))))) ; m_cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[2] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[3] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[4] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[5] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[6] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[7] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[8] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[9] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[10] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[11] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[12] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[13] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[14] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[15] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[16] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((0) << 4) | (2))) )))))) ; m_cclass[17] = ((int)((( ((int)((( ((int)((( 0) << 4) | (1))) ) << 8) | (((int)(((0) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (1))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[18] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (0))) )))))) ; m_cclass[19] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((0) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (1))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[20] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[21] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[22] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[23] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[24] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[25] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[26] = ((int)((( ((int)((( ((int)((( 2) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[27] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[28] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[29] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[30] = ((int)((( ((int)((( ((int)((( 2) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[31] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_states = new int[3] ; m_states[0] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eStart))) ) << 8) | ( ((int)((( 3) << 4) | (eError))) )))))) ; m_states[1] = ((int)((( ((int)((( ((int)((( eError) << 4) | ( 4))) ) << 8) | (((int)((( 5) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | ( 4))) ) << 8) | ( ((int)(((eError) << 4) | (eItsMe))) )))))) ; m_states[2] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eStart))) ) << 8) | ( ((int)((( 4) << 4) | (eError))) )))))) ; m_charset = "windows-1252"; m_stFactor = 3; } public override bool isUCS2() { return false; } } } // namespace �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/nsISO2022KRVerifier.cs���������������������������������������������0000644�0001750�0001750�00000025034�10640337027�021730� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* * DO NOT EDIT THIS DOCUMENT MANUALLY !!! * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER * AutoDetect/tools/ */ using System; namespace org.mozilla.intl.chardet { //import java.lang.* ; public class nsISO2022KRVerifier : nsVerifier { static int[] m_cclass ; static int[] m_states ; static int m_stFactor ; static String m_charset ; public override int[] cclass() { return m_cclass ; } public override int[] states() { return m_states ; } public override int stFactor() { return m_stFactor ; } public override String charset() { return m_charset ; } public nsISO2022KRVerifier() { m_cclass = new int[256/8] ; m_cclass[0] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (2))) )))))) ; m_cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[2] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[3] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[4] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[5] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((4) << 4) | (0))) )))))) ; m_cclass[6] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[7] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[8] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[9] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[10] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[11] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[12] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[13] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[14] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[15] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[16] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[17] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[18] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[19] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[20] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[21] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[22] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[23] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[24] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[25] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[26] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[27] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[28] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[29] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[30] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_cclass[31] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ; m_states = new int[5] ; m_states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eError))) ) << 8) | ( ((int)((( 3) << 4) | (eStart))) )))))) ; m_states[1] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[2] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 4) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ; m_states[3] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[4] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_charset = "ISO-2022-KR"; m_stFactor = 6; } public override bool isUCS2() { return false; } } } // namespace ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/nsICharsetDetector.cs����������������������������������������������0000644�0001750�0001750�00000003751�10640337027�022235� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ namespace org.mozilla.intl.chardet { //import java.lang.* ; public interface nsICharsetDetector { void Init (nsICharsetDetectionObserver observer) ; bool DoIt (byte[] aBuf, int aLen, bool oDontFeedMe) ; void Done () ; } } // namespace �����������������������sublib-0.9/src/External/NCharDet/nsUCS2LEVerifier.cs������������������������������������������������0000644�0001750�0001750�00000026012�10640337027�021465� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* * DO NOT EDIT THIS DOCUMENT MANUALLY !!! * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER * AutoDetect/tools/ */ using System; namespace org.mozilla.intl.chardet { //import java.lang.* ; public class nsUCS2LEVerifier : nsVerifier { static int[] m_cclass ; static int[] m_states ; static int m_stFactor ; static String m_charset ; public override int[] cclass() { return m_cclass ; } public override int[] states() { return m_states ; } public override int stFactor() { return m_stFactor ; } public override String charset() { return m_charset ; } public nsUCS2LEVerifier() { m_cclass = new int[256/8] ; m_cclass[0] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((2) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (1))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[2] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[3] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[4] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[5] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (0))) )))))) ; m_cclass[6] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[7] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[8] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[9] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[10] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[11] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[12] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[13] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[14] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[15] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[16] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[17] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[18] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[19] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[20] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[21] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[22] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[23] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[24] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[25] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[26] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[27] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[28] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[29] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[30] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[31] = ((int)((( ((int)((( ((int)((( 5) << 4) | (4))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_states = new int[7] ; m_states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 3) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)((( 6) << 4) | ( 7))) ) << 8) | ( ((int)((( 6) << 4) | ( 6))) )))))) ; m_states[1] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[2] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eItsMe))) ) << 8) | (((int)(((eError) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)((( 5) << 4) | ( 5))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ; m_states[3] = ((int)((( ((int)((( ((int)((( 6) << 4) | ( 6))) ) << 8) | (((int)(((eError) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | ( 5))) ) << 8) | ( ((int)((( 5) << 4) | ( 5))) )))))) ; m_states[4] = ((int)((( ((int)((( ((int)((( eError) << 4) | ( 5))) ) << 8) | (((int)((( 5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)((( 8) << 4) | ( 8))) ) << 8) | ( ((int)((( 6) << 4) | ( 7))) )))))) ; m_states[5] = ((int)((( ((int)((( ((int)((( 5) << 4) | ( 5))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | ( 5))) ) << 8) | ( ((int)((( 5) << 4) | ( 5))) )))))) ; m_states[6] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eError) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | ( 5))) ) << 8) | ( ((int)((( 5) << 4) | ( 5))) )))))) ; m_charset = "UTF-16LE"; m_stFactor = 6; } public override bool isUCS2() { return true; } } } // namespace ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/nsEUCSampler.cs����������������������������������������������������0000644�0001750�0001750�00000011433�10640337027�020775� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ using System; namespace org.mozilla.intl.chardet { //import java.lang.* ; public class nsEUCSampler { int mTotal = 0; int mThreshold = 200 ; int mState = 0; public int[] mFirstByteCnt = new int[94] ; public int[] mSecondByteCnt = new int[94] ; public float[] mFirstByteFreq = new float[94] ; public float[] mSecondByteFreq = new float[94]; public nsEUCSampler() { Reset() ; } public void Reset() { mTotal = 0 ; mState = 0 ; for(int i=0; i<94; i++) mFirstByteCnt[i] = mSecondByteCnt[i] = 0 ; } public bool EnoughData() { return mTotal > mThreshold; } public bool GetSomeData() { return mTotal > 1; } public bool Sample(byte[] aIn, int aLen) { if(mState == 1) return false; int p = 0; // if(aLen + mTotal > 0x80000000) // aLen = 0x80000000 - mTotal; int i; for(i=0; (i<aLen) && (1 != mState) ;i++,p++) { switch(mState) { case 0: if( ( aIn[p] & 0x0080 ) != 0 ) { if((0xff==(0xff&aIn[p])) || ( 0xa1>(0xff&aIn[p]))) { mState = 1; } else { mTotal++; mFirstByteCnt[(0xff&aIn[p]) - 0xa1]++; mState = 2; } } break; case 1: break; case 2: if( (aIn[p] & 0x0080) != 0 ) { if((0xff == (0xff&aIn[p])) || ( 0xa1 > (0xff&aIn[p]))) { mState = 1; } else { mTotal++; mSecondByteCnt[(0xff&aIn[p]) - 0xa1]++; mState = 0; } } else { mState = 1; } break; default: mState = 1; break; } } return (1 != mState ); } public void CalFreq() { for(int i = 0 ; i < 94; i++) { mFirstByteFreq[i] = (float)mFirstByteCnt[i] / (float)mTotal; mSecondByteFreq[i] = (float)mSecondByteCnt[i] / (float)mTotal; } } public float GetScore(float[] aFirstByteFreq, float aFirstByteWeight, float[] aSecondByteFreq, float aSecondByteWeight) { return aFirstByteWeight * GetScore(aFirstByteFreq, mFirstByteFreq) + aSecondByteWeight * GetScore(aSecondByteFreq, mSecondByteFreq); } public float GetScore(float[] array1, float[] array2) { float s; float sum=0.0f; for(int i=0;i<94;i++) { s = array1[i] - array2[i]; sum += s * s; } return (float)Math.Sqrt((double)sum) / 94.0f; } } } // namespace �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/nsVerifier.cs������������������������������������������������������0000644�0001750�0001750�00000006060�10640337027�020610� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ using System; namespace org.mozilla.intl.chardet { ////import java.lang.* ; public abstract class nsVerifier { //abstract public const byte eStart = (byte)0; public const byte eError = (byte)1; public const byte eItsMe = (byte)2; public const int eidxSft4bits = 3; public const int eSftMsk4bits = 7; public const int eBitSft4bits = 2; public const int eUnitMsk4bits = 0x0000000F; public nsVerifier() { } public abstract String charset() ; public abstract int stFactor() ; public abstract int[] cclass() ; public abstract int[] states() ; public abstract bool isUCS2() ; public static byte getNextState(nsVerifier v, byte b, byte s) { return (byte) ( 0xFF & (((v.states()[(( (s*v.stFactor()+(((v.cclass()[((b&0xFF)>>nsVerifier.eidxSft4bits)]) >> ((b & nsVerifier.eSftMsk4bits) << nsVerifier.eBitSft4bits)) & nsVerifier.eUnitMsk4bits ))&0xFF) >> nsVerifier.eidxSft4bits) ]) >> ((( (s*v.stFactor()+(((v.cclass()[((b&0xFF)>>nsVerifier.eidxSft4bits)]) >> ((b & nsVerifier.eSftMsk4bits) << nsVerifier.eBitSft4bits)) & nsVerifier.eUnitMsk4bits ))&0xFF) & nsVerifier.eSftMsk4bits) << nsVerifier.eBitSft4bits)) & nsVerifier.eUnitMsk4bits ) ) ; } } } // namespace ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/External/NCharDet/nsHZVerifier.cs����������������������������������������������������0000644�0001750�0001750�00000025412�10640337027�021054� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Craig Dunn <craig dot dunn at conceptdevelopment dot net> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* * DO NOT EDIT THIS DOCUMENT MANUALLY !!! * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER * AutoDetect/tools/ */ using System; namespace org.mozilla.intl.chardet { //import java.lang.* ; public class nsHZVerifier : nsVerifier { static int[] m_cclass ; static int[] m_states ; static int m_stFactor ; static String m_charset ; public override int[] cclass() { return m_cclass ; } public override int[] states() { return m_states ; } public override int stFactor() { return m_stFactor ; } public override String charset() { return m_charset ; } public nsHZVerifier() { m_cclass = new int[256/8] ; m_cclass[0] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (1))) )))))) ; m_cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[2] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[3] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[4] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[5] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[6] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[7] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[8] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[9] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[10] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[11] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[12] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[13] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[14] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[15] = ((int)((( ((int)((( ((int)((( 0) << 4) | (2))) ) << 8) | (((int)(((5) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ; m_cclass[16] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[17] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[18] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[19] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[20] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[21] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[22] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[23] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[24] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[25] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[26] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[27] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[28] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[29] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[30] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_cclass[31] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ; m_states = new int[6] ; m_states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | ( 3))) ) << 8) | ( ((int)(((eError) << 4) | (eStart))) )))))) ; m_states[1] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ; m_states[2] = ((int)((( ((int)((( ((int)((( eError) << 4) | ( 4))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ; m_states[3] = ((int)((( ((int)((( ((int)((( eError) << 4) | ( 4))) ) << 8) | (((int)((( 5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | ( 6))) ) << 8) | ( ((int)(((eError) << 4) | ( 5))) )))))) ; m_states[4] = ((int)((( ((int)((( ((int)((( eError) << 4) | ( 4))) ) << 8) | (((int)(((eError) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)((( 4) << 4) | ( 4))) ) << 8) | ( ((int)(((eError) << 4) | ( 4))) )))))) ; m_states[5] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eStart))) ) << 8) | ( ((int)(((eItsMe) << 4) | ( 4))) )))))) ; m_charset = "HZ-GB-2312"; m_stFactor = 6; } public override bool isUCS2() { return false; } } } // namespace ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/src/Makefile.am��������������������������������������������������������������������������0000644�0001750�0001750�00000001051�11002506046�014752� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublibdir=$(pkglibdir) sublib_SCRIPTS = $(ASSEMBLY) sublib_BUILDDIR = $(srcdir)/../build ASSEMBLY = $(sublib_BUILDDIR)/sublib.dll sublib_SCRIPTSOURCES = \ $(srcdir)/SubLib/*.cs \ $(srcdir)/SubLib/Application/*.cs \ $(srcdir)/SubLib/Exception/*.cs \ $(srcdir)/SubLib/Persistency/*.cs \ $(srcdir)/External/NCharDet/*.cs $(ASSEMBLY): $(sublib_SCRIPTSOURCES) $(MCS) $(MCS_FLAGS) -target:library -out:$(ASSEMBLY) $(sublib_SCRIPTSOURCES) CLEANFILES = $(ASSEMBLY) $(ASSEMBLY).mdb EXTRA_DIST = \ $(sublib_SCRIPTSOURCES) \ Executable/Executable.cs ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/Makefile.in������������������������������������������������������������������������������0000644�0001750�0001750�00000043361�11011375137�014213� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/configure \ $(top_srcdir)/src/SubLib/AssemblyInfo.cs.in AUTHORS COPYING \ ChangeLog INSTALL NEWS config.guess config.sub install-sh \ missing subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = src/SubLib/AssemblyInfo.cs SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CSC = @CSC@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MCS = @MCS@ MONO = @MONO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ SUBDIRS = data src EXTRA_DIST = \ CREDITS \ build.properties \ nant.build \ sublib.mdp \ sublib.mds all: all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ cd $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) src/SubLib/AssemblyInfo.cs: $(top_builddir)/config.status $(top_srcdir)/src/SubLib/AssemblyInfo.cs.in cd $(top_builddir) && $(SHELL) ./config.status $@ uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkdir_p) $(distdir)/data $(distdir)/src/SubLib @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-recursive ctags \ ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \ dist-tarZ dist-zip distcheck distclean distclean-generic \ distclean-recursive distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/build.properties�������������������������������������������������������������������������0000644�0001750�0001750�00000003762�10475257727�015405� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<project name="sublib global properties" > <property name="src.dir" value="src" /> <property name="build.dir" value="build" /> <property name="data.dir" value="data" /> <property name="docs.build.dir" value="${build.dir}/docs" /> <property name="release.dir" value="${build.dir}/release" />> <property name="sublib.name" value="SubLib" /> <property name="sublib.name.lowercase" value="sublib" /> <property name="sublib.src.dir" value="${src.dir}/${sublib.name}" /> <property name="executable.name" value="Executable" /> <property name="executable.src.dir" value="${src.dir}/${executable.name}" /> <property name="executable.build.name" value="${sublib.name.lowercase}.exe" /> <property name="executable.build.path" value="${build.dir}/${executable.build.name}" /> <property name="library.build.name" value="${sublib.name.lowercase}.dll" /> <property name="library.build.path" value="${build.dir}/${library.build.name}" /> <property name="docs.namespace.summary" value="NamespaceSummary.xml" /> <property name="docs.namespace.summary.path" value="${data.dir}/${docs.namespace.summary}" /> <property name="external.name" value="External" /> <property name="external.src.dir" value="${src.dir}/${external.name}" /> <property name="release.name" value="${sublib.name.lowercase}-${release.version}-${release.type}" dynamic="true" /> <property name="release.path" value="${release.dir}/${release.name}" dynamic="true" /> <fileset id="executable.release.files"> <include name="AUTHORS" /> <include name="ChangeLog" /> <include name="COPYING" /> <include name="README" /> </fileset> <fileset id="executable.release.build.files" basedir="${build.dir}"> <include name="${executable.build.name}" /> </fileset> <fileset id="source.release.files"> <include name="AUTHORS" /> <include name="build.properties" /> <include name="ChangeLog" /> <include name="COPYING" /> <include name="nant.build" /> <include name="README" /> <include name="${src.dir}/**" /> </fileset> </project> ��������������sublib-0.9/COPYING����������������������������������������������������������������������������������0000644�0001750�0001750�00000043133�10330677026�013203� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/aclocal.m4�������������������������������������������������������������������������������0000644�0001750�0001750�00000052443�11000753645�014011� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# generated automatically by aclocal 1.9.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.9.6])]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 7 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.58])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. # # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). # This was a mistake. There are at least two reasons why we must not # use `-m 0755': # - it causes special bits like SGID to be ignored, # - it may be too restrictive (some setups expect 775 directories). # # Do not use -m 0755 and let people choose whatever they expect by # setting umask. # # We cannot accept any implementation of `mkdir' that recognizes `-p'. # Some implementations (such as Solaris 8's) are not thread-safe: if a # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' # concurrently, both version can detect that a/ is missing, but only # one can create it and the other will error out. Consequently we # restrict ourselves to GNU make (using the --version option ensures # this.) AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar <conftest.tar]) grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/sublib.mdp�������������������������������������������������������������������������������0000644�0001750�0001750�00000025160�10673736773�014151� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<Project name="sublib" fileversion="2.0" language="C#" clr-version="Net_2_0" ctype="DotNetProject"> <Configurations active="Executable"> <Configuration name="Debug" ctype="DotNetProjectConfiguration"> <Output directory="./build" assembly="sublib" /> <Build debugmode="True" target="Library" /> <Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" /> <CodeGeneration compiler="Csc" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" generatexmldocumentation="False" ctype="CSharpCompilerParameters" /> </Configuration> <Configuration name="Release" ctype="DotNetProjectConfiguration"> <Output directory="./build" assembly="sublib" /> <Build debugmode="False" target="Library" /> <Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" /> <CodeGeneration compiler="Csc" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" generatexmldocumentation="False" ctype="CSharpCompilerParameters" /> </Configuration> <Configuration name="Executable" ctype="DotNetProjectConfiguration"> <Output directory="./build" assembly="sublib" /> <Build debugmode="True" target="Exe" /> <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" /> <CodeGeneration compiler="Csc" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="Executable" generatexmldocumentation="False" ctype="CSharpCompilerParameters" /> </Configuration> </Configurations> <Contents> <File name="./src" subtype="Directory" buildaction="Compile" /> <File name="./src/SubLib" subtype="Directory" buildaction="Compile" /> <File name="./src/Executable" subtype="Directory" buildaction="Compile" /> <File name="./src/External" subtype="Directory" buildaction="Compile" /> <File name="./src/External/NCharDet" subtype="Directory" buildaction="Compile" /> <File name="./src/SubLib/Exception" subtype="Directory" buildaction="Compile" /> <File name="./src/SubLib/Application" subtype="Directory" buildaction="Compile" /> <File name="./src/SubLib/Persistency" subtype="Directory" buildaction="Compile" /> <File name="./src/External/NCharDet/Big5Statistics.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/EUCJPStatistics.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/EUCKRStatistics.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/EUCTWStatistics.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/GB2312Statistics.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsBIG5Verifier.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsCP1252Verifier.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsDetector.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsEUCJPVerifier.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsEUCKRVerifier.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsEUCSampler.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsEUCStatistics.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsEUCTWVerifier.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsGB2312Verifier.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsGB18030Verifier.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsHZVerifier.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsICharsetDetectionObserver.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsICharsetDetector.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsISO2022CNVerifier.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsISO2022JPVerifier.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsISO2022KRVerifier.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsPSMDetector.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsSJISVerifier.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsUCS2BEVerifier.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsUCS2LEVerifier.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsUTF8Verifier.cs" subtype="Code" buildaction="Compile" /> <File name="./src/External/NCharDet/nsVerifier.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/Enumerations.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/Frames.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/IncompleteSubtitle.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/IncompleteSubtitleCollection.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/Style.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/Subtitle.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/SubtitleCollection.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/SubtitleFactory.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/SubtitleProperties.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/Subtitles.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/SubtitleText.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/SubtitleTypeInfo.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/Synchronization.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/Times.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Exception/UnknownEncodingException.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Exception/UnknownSubtitleFormatException.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/BuiltInSubtitleFormats.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/FileInputOutput.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/SubtitleFormat.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/SubtitleFormatMicroDVD.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/SubtitleFormatSubRip.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/SubtitleOutput.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/SubtitleParser.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/VerboseConsole.cs" subtype="Code" buildaction="Compile" /> <File name="./src/Executable/Executable.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/SubtitleConstants.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/SubtitleFormatSubStationAlpha.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/SubtitleFormatSubViewer1.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/SubtitleHeaders.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/SubtitleFormatAdvancedSubStationAlpha.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/SubtitleFormatSubViewer2.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/SubtitleFormatMPlayer.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/SubtitleFormatMPlayer2.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/SubtitleFormatMPSub.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/MatchEvaluationCounter.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/FileProperties.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/ParsingProperties.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/SubtitleSaver.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Exception/EncodingNotSupportedException.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/SubtitleInput.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/SubtitleSearchOptions.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/SubtitleSearchResults.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/Translations.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Application/Headers.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/SubtitleFormatDKSSubtitleFormat.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/SubtitleFormatPowerDivX.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/SubtitleFormatPhoenixJapanimationSociety.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/SubtitleFormatAdobeEncoreDVD.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/SubtitleFormatKaraokeLyricsLRC.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/SubtitleFormatKaraokeLyricsVKT.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/PlainTextParser.cs" subtype="Code" buildaction="Compile" /> <File name="./src/SubLib/Persistency/SubtitleFormatPanimator.cs" subtype="Code" buildaction="Compile" /> </Contents> <References> <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> </References> <DeployTargets /> <DeploymentInformation strategy="File"> <excludeFiles> <ExcludeFile file="./src/Executable/Executable.cs" /> </excludeFiles> </DeploymentInformation> </Project>����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/Makefile.am������������������������������������������������������������������������������0000644�0001750�0001750�00000000175�11000753572�014177� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SUBDIRS = data src EXTRA_DIST = \ CREDITS \ build.properties \ nant.build \ sublib.mdp \ sublib.mds ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/sublib.mds�������������������������������������������������������������������������������0000644�0001750�0001750�00000001265�10636255530�014136� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<Combine name="sublib" fileversion="2.0" outputpath="./build/"> <Configurations active="Executable"> <Configuration name="Debug" ctype="CombineConfiguration"> <Entry build="True" name="sublib" configuration="Debug" /> </Configuration> <Configuration name="Release" ctype="CombineConfiguration"> <Entry build="True" name="sublib" configuration="Release" /> </Configuration> <Configuration name="Executable" ctype="CombineConfiguration" /> </Configurations> <DeployTargets /> <StartMode startupentry="sublib" single="True"> <Execute type="None" entry="sublib" /> </StartMode> <Entries> <Entry filename="./sublib.mdp" /> </Entries> </Combine>�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/ChangeLog��������������������������������������������������������������������������������0000644�0001750�0001750�00000157015�11011371643�013720� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������2008-04-20 00:22 noup * src/Makefile.am: Changed sublib_SOURCES to sublib_SCRIPTSOURCES in order for compilation to work with Automake 1.10. 2008-04-17 22:24 noup * src/Makefile.am: Fixed to stop complaining about SL prefix. 2008-04-17 22:20 noup * data: Added files to ignore list. 2008-04-17 22:14 noup * data/Makefile.am, data/sublib.pc.in: Added missing files. 2008-04-14 22:24 noup * Makefile.am, configure.in: Do not include docs in default distribution. 2008-04-14 21:55 noup * src/SubLib/AssemblyInfo.cs.in: Do not use key anymore. 2008-04-14 21:35 noup * Makefile.am, configure.in, src/Makefile.am: Install library and PC file to use with pkg-config. No longer installs to the GAC. 2008-04-14 21:01 noup * configure.in, src/Makefile.am, src/SubLib/AssemblyInfo.cs.in: Added support for installing the assembly to the GAC. Use export DOINST="no" to disable this during configure. 2007-10-07 22:25 arklad * src/SubLib/Persistency/BuiltInSubtitleFormats.cs: Restored the use of 2000 characters when detecting a subtitle format. 2007-10-07 22:20 arklad * src/Executable/Executable.cs, src/SubLib/Application/Enumerations.cs, src/SubLib/Persistency/BuiltInSubtitleFormats.cs, src/SubLib/Persistency/SubtitleFormatAQTitle.cs, src/SubLib/Persistency/SubtitleFormatKaraokeLyricsLRC.cs, src/SubLib/Persistency/SubtitleFormatKaraokeLyricsVKT.cs, src/SubLib/Persistency/SubtitleFormatMacSUB.cs, src/SubLib/Persistency/SubtitleFormatPanimator.cs, src/SubLib/Persistency/SubtitleFormatPhoenixJapanimationSociety.cs, src/SubLib/Persistency/SubtitleFormatSofni.cs, src/SubLib/Persistency/SubtitleFormatSubCreator1x.cs, src/SubLib/Persistency/SubtitleFormatViPlaySubtitleFile.cs: New subtitle formats supported: AQTitle, MacSUB, Sofni, SubCreator 1.x and ViPlay Subtitle File. Access modifiers corrected for some other formats. 2007-10-06 10:32 noup * AUTHORS, CREDITS, ChangeLog, NEWS, TODO, configure.in: Updating for release 0.8. 2007-10-04 20:56 arklad * src/SubLib/Application/SubtitleFactory.cs, src/SubLib/Persistency/PlainTextParser.cs: Algorithm for importing from plain text files improved. 2007-09-28 22:42 noup * src/SubLib/Persistency/PlainTextParser.cs, src/SubLib/Persistency/SubtitleFormatDKSSubtitleFormat.cs, src/SubLib/Persistency/SubtitleFormatPowerDivX.cs: Code cleanup. 2007-09-27 14:30 arklad * src/SubLib/Application/SubtitleFactory.cs, src/SubLib/Persistency/PlainTextParser.cs, src/SubLib/Persistency/SubtitleInput.cs: Handles all encodings correctly when importing from a plain text file. 2007-09-21 17:37 noup * src/Executable/Executable.cs: Added format to Executable. 2007-09-18 12:00 arklad * sublib.mdp: Correct .mdp file for the revision 337. 2007-09-18 11:39 arklad * src/Executable/Executable.cs, src/SubLib/Application/Enumerations.cs, src/SubLib/Application/FileProperties.cs, src/SubLib/Application/SubtitleFactory.cs, src/SubLib/Application/SubtitleText.cs, src/SubLib/Persistency/BuiltInSubtitleFormats.cs, src/SubLib/Persistency/PlainTextParser.cs, src/SubLib/Persistency/SubtitleFormatPanimator.cs, src/SubLib/Persistency/SubtitleFormatPhoenixJapanimationSociety.cs, src/SubLib/Persistency/SubtitleInput.cs, src/SubLib/Persistency/SubtitleParser.cs, sublib.mdp: New feature: import text lines from a plain text file, creating a collection of subtitles ready for timing. New formats supported: Panimator and Phoenix Japanimation Society. 2007-09-13 12:41 arklad * src/SubLib/Application/Enumerations.cs, src/SubLib/Application/Headers.cs, src/SubLib/Application/SubtitleProperties.cs: Subtitle formats now share headers to make easier loading and saving them. 2007-09-13 12:40 arklad * src/SubLib/Persistency/BuiltInSubtitleFormats.cs, src/SubLib/Persistency/ParsingProperties.cs, src/SubLib/Persistency/SubtitleFormatKaraokeLyricsLRC.cs, src/SubLib/Persistency/SubtitleFormatKaraokeLyricsVKT.cs, src/SubLib/Persistency/SubtitleFormatMPSub.cs, src/SubLib/Persistency/SubtitleFormatSubStationAlpha.cs, src/SubLib/Persistency/SubtitleFormatSubViewer1.cs, src/SubLib/Persistency/SubtitleFormatSubViewer2.cs, src/SubLib/Persistency/SubtitleParser.cs: Subtitle formats now share headers to make easier loading and saving them. 2007-09-13 12:37 arklad * src/SubLib/Persistency/SubtitleFormatDKSSubtitleFormat.cs, src/SubLib/Persistency/SubtitleFormatPowerDivX.cs: New subtitle formats supported: - DKS Subtitle Format. - Power DivX. 2007-08-20 02:46 noup * src/SubLib/Application/SubtitleHeaders.cs, src/SubLib/Persistency/SubtitleParser.cs: Treat the Date header in Karaoke Lyrics VKT as string, as input files aren't garanteed to be in the format assumed by the DateTime parser (and there's no specification of the format available). 2007-08-19 04:04 noup * CREDITS: Oops... wrong file. Reverting to previous list of contributors. 2007-08-19 04:03 noup * CREDITS: Updated list of contributors. 2007-08-16 19:06 noup * src/Executable/Executable.cs, src/SubLib/Application/Enumerations.cs, src/SubLib/Application/SubtitleHeaders.cs, src/SubLib/Persistency/BuiltInSubtitleFormats.cs, src/SubLib/Persistency/SubtitleFormatKaraokeLyricsLRC.cs, src/SubLib/Persistency/SubtitleFormatKaraokeLyricsVKT.cs, src/SubLib/Persistency/SubtitleParser.cs, sublib.mdp: Added support for Karaoke Lyrics LRC and VKT, thanks to Cristina Yenyxe. 2007-08-11 10:49 noup * src/SubLib/Application/SubtitleProperties.cs, src/SubLib/Persistency/SubtitleFormat.cs, src/SubLib/Persistency/SubtitleFormatAdobeEncoreDVD.cs, src/SubLib/Persistency/SubtitleFormatMicroDVD.cs, src/SubLib/Persistency/SubtitleFormatSubRip.cs, src/SubLib/Persistency/SubtitleFormatSubStationAlpha.cs, src/SubLib/Persistency/SubtitleParser.cs: Allow to get global properties from the input text before parsing the subtitles. Completed the support for the Adobe Encore DVD format. 2007-08-11 01:10 noup * AUTHORS: Updated info. 2007-08-11 01:07 noup * CREDITS: Added Cristina Yenyxe to the list of contributors. 2007-08-11 01:05 noup * src/Executable/Executable.cs, src/SubLib/Application/Enumerations.cs, src/SubLib/Application/Synchronization.cs, src/SubLib/Persistency/BuiltInSubtitleFormats.cs, src/SubLib/Persistency/SubtitleFormat.cs, src/SubLib/Persistency/SubtitleFormatAdobeEncoreDVD.cs, src/SubLib/Persistency/SubtitleFormatMicroDVD.cs, src/SubLib/Persistency/SubtitleFormatSubRip.cs, src/SubLib/Persistency/SubtitleFormatSubStationAlpha.cs, src/SubLib/Persistency/SubtitleOutput.cs, src/SubLib/Persistency/SubtitleParser.cs, sublib.mdp: Added support for Adobe Encore DVD subtitles, thanks to the help of Cristina Yenyxe. Added support for setting a dynamic subtitle output expression, which is created at runtime based on the subtitle properties. 2007-06-28 01:07 noup * AUTHORS, ChangeLog, NEWS, README: Updating for release 0.7. 2007-06-27 01:32 noup * src/External/NCharDet, src/External/NCharDet/Big5Statistics.cs, src/External/NCharDet/EUCJPStatistics.cs, src/External/NCharDet/EUCKRStatistics.cs, src/External/NCharDet/EUCTWStatistics.cs, src/External/NCharDet/GB2312Statistics.cs, src/External/NCharDet/nsBIG5Verifier.cs, src/External/NCharDet/nsCP1252Verifier.cs, src/External/NCharDet/nsDetector.cs, src/External/NCharDet/nsEUCJPVerifier.cs, src/External/NCharDet/nsEUCKRVerifier.cs, src/External/NCharDet/nsEUCSampler.cs, src/External/NCharDet/nsEUCStatistics.cs, src/External/NCharDet/nsEUCTWVerifier.cs, src/External/NCharDet/nsGB18030Verifier.cs, src/External/NCharDet/nsGB2312Verifier.cs, src/External/NCharDet/nsHZVerifier.cs, src/External/NCharDet/nsICharsetDetectionObserver.cs, src/External/NCharDet/nsICharsetDetector.cs, src/External/NCharDet/nsISO2022CNVerifier.cs, src/External/NCharDet/nsISO2022JPVerifier.cs, src/External/NCharDet/nsISO2022KRVerifier.cs, src/External/NCharDet/nsPSMDetector.cs, src/External/NCharDet/nsSJISVerifier.cs, src/External/NCharDet/nsUCS2BEVerifier.cs, src/External/NCharDet/nsUCS2LEVerifier.cs, src/External/NCharDet/nsUTF8Verifier.cs, src/External/NCharDet/nsVerifier.cs: Updating with a newer NCharDet version. 2007-06-27 01:31 noup * src/External/NCharDet: Updating with a newer NCharDet version. 2007-06-27 01:28 noup * src/External/COPYING-MPL: License file for NCharDet. 2007-06-27 01:27 noup * src/Executable/Executable.cs: Updated license blocks. 2007-06-27 01:27 noup * src/SubLib/Exception/EncodingNotSupportedException.cs, src/SubLib/Exception/UnknownEncodingException.cs, src/SubLib/Exception/UnknownSubtitleFormatException.cs, src/SubLib/Persistency/BuiltInSubtitleFormats.cs, src/SubLib/Persistency/FileInputOutput.cs, src/SubLib/Persistency/ParsingProperties.cs, src/SubLib/Persistency/SubtitleFormat.cs, src/SubLib/Persistency/SubtitleFormatAdvancedSubStationAlpha.cs, src/SubLib/Persistency/SubtitleFormatMPSub.cs, src/SubLib/Persistency/SubtitleFormatMPlayer.cs, src/SubLib/Persistency/SubtitleFormatMPlayer2.cs, src/SubLib/Persistency/SubtitleFormatMicroDVD.cs, src/SubLib/Persistency/SubtitleFormatSubRip.cs, src/SubLib/Persistency/SubtitleFormatSubStationAlpha.cs, src/SubLib/Persistency/SubtitleFormatSubViewer1.cs, src/SubLib/Persistency/SubtitleFormatSubViewer2.cs, src/SubLib/Persistency/SubtitleInput.cs, src/SubLib/Persistency/SubtitleOutput.cs, src/SubLib/Persistency/SubtitleParser.cs, src/SubLib/Persistency/VerboseConsole.cs: Updated license blocks. 2007-06-27 01:27 noup * src/SubLib/Application/Enumerations.cs, src/SubLib/Application/FileProperties.cs, src/SubLib/Application/Frames.cs, src/SubLib/Application/IncompleteSubtitle.cs, src/SubLib/Application/IncompleteSubtitleCollection.cs, src/SubLib/Application/MatchEvaluationCounter.cs, src/SubLib/Application/Style.cs, src/SubLib/Application/Subtitle.cs, src/SubLib/Application/SubtitleCollection.cs, src/SubLib/Application/SubtitleConstants.cs, src/SubLib/Application/SubtitleFactory.cs, src/SubLib/Application/SubtitleHeaders.cs, src/SubLib/Application/SubtitleProperties.cs, src/SubLib/Application/SubtitleSaver.cs, src/SubLib/Application/SubtitleSearchOptions.cs, src/SubLib/Application/SubtitleSearchResults.cs, src/SubLib/Application/SubtitleText.cs, src/SubLib/Application/SubtitleTypeInfo.cs, src/SubLib/Application/Subtitles.cs, src/SubLib/Application/Synchronization.cs, src/SubLib/Application/Times.cs, src/SubLib/Application/Translations.cs: Updated license blocks. 2007-06-26 11:45 noup * src/SubLib/Application/Enumerations.cs, src/SubLib/Application/Translations.cs, src/SubLib/Exception/EncodingNotSupportedException.cs: Updated API documentation. 2007-06-21 20:25 noup * src/SubLib/Persistency/SubtitleOutput.cs: Allow to choose the type of text content to be used for saving (text or translation). 2007-06-21 20:24 noup * src/SubLib/Application/Translations.cs, sublib.mdp: New functionality to perform translation operations on subtitles. This includes clearing the translation and importing a translation into existing subtitles. 2007-06-21 20:23 noup * src/SubLib/Application/SubtitleSaver.cs: Allow to choose the type of text content to be used for saving (text or translation). 2007-06-21 20:22 noup * src/SubLib/Application/Subtitles.cs: Code cleanup. 2007-06-21 20:22 noup * src/SubLib/Application/Subtitle.cs: Allow to clear the translation. 2007-06-21 20:21 noup * src/Executable/Executable.cs: Updated to the changes in the way subtitles are now saved. 2007-06-14 01:59 noup * sublib.mdp: Improved support for translation. 2007-06-14 01:58 noup * src/SubLib/Application/SubtitleSearchOptions.cs, src/SubLib/Application/SubtitleSearchResults.cs, src/SubLib/Application/Subtitles.cs: Updated the search methods to cope with the existence of translations, besides the subtitle text. Search options were encapsulated, as well as search results. Fixed some bugs that were visible when doing a backwards search. 2007-06-14 01:55 noup * src/SubLib/Application/Enumerations.cs: Updated support for translation. 2007-06-08 18:42 noup * src/SubLib/Persistency/SubtitleInput.cs: New method of working with multiple encodings and subtitle format detection. If no encodings are detected, the fallback encoding is used. If multiple encodings are used, the first to work is used. If no encodings work, the errors related to the first tried encoding (the most probable) are reported. 2007-06-08 18:41 noup * src/SubLib/Persistency/FileInputOutput.cs: Refactored to get all the detected encodings, so all of them can be tried if the first doesn't work. 2007-06-08 18:39 noup * sublib.mdp: Exception to be used when an encoding is not supported by the platform. 2007-06-08 18:39 noup * src/SubLib/Exception/EncodingNotSupportedException.cs: Exception to be used when an encoding is not supported by the platform. 2007-06-08 18:38 noup * src/SubLib/Application/SubtitleProperties.cs: Code cleanup. 2007-06-08 18:38 noup * src/SubLib/Application/SubtitleFactory.cs: Code refactored to use SubtitleInput, which now contains part of the old code. 2007-06-08 18:38 noup * src/SubLib/Application/Enumerations.cs: Added enumeration to distinguish from text and translation (and both). 2007-06-06 12:40 noup * src/SubLib/Application/Subtitle.cs: Fixed small bug with text being returned instead of translation. 2007-06-05 23:05 noup * sublib.mdp: Cleanup. 2007-06-05 23:03 noup * src/SubLib/Application/Subtitle.cs: Cleanup. 2007-06-05 23:03 noup * src/SubLib/Application/SubtitleText.cs: Revised documentation. Added method to trim the lines when getting them. When replacing empty lines, also apply the replacement if the text is empty. 2007-06-05 23:02 noup * src/SubLib/Persistency/SubtitleOutput.cs: Trim lines before saving the text. 2007-06-05 18:30 noup * configure.in: Updated with info for the next release. 2007-06-05 18:29 noup * src/SubLib/Application/Subtitle.cs: Initial support for translation. 2007-06-05 18:29 noup * src/Executable/Executable.cs: Code cleanup. 2007-05-12 01:06 noup * ChangeLog: Updated for release 0.6.1 2007-05-12 01:05 noup * src/SubLib/Application/FileProperties.cs, src/SubLib/Application/SubtitleSaver.cs, src/SubLib/Persistency/ParsingProperties.cs: Updated SVN properties. 2007-05-12 00:59 noup * NEWS, README, configure.in: Updated for release 0.6.1. 2007-05-06 00:59 noup * src/SubLib/Application/Enumerations.cs, src/SubLib/Application/FileProperties.cs, src/SubLib/Application/SubtitleSaver.cs, src/SubLib/Persistency/SubtitleOutput.cs, sublib.mdp: Use NewlineType to specify the type of newlines to be used when saving (Macintosh, Unix or Windows). 2007-04-19 10:29 noup * NEWS: Updated for latest version. 2007-04-13 17:25 noup * AUTHORS, ChangeLog, NEWS, README, configure.in: Updated for the 0.6 release. 2007-04-03 18:24 noup * src/SubLib/Application/FileProperties.cs, src/SubLib/Application/SubtitleSaver.cs: Updated the documentation. 2007-04-03 18:08 noup * src/Executable/Executable.cs: Updated to reflect latest code changes. 2007-04-03 18:08 noup * sublib.mdp: Updated with new files. 2007-04-03 18:07 noup * src/SubLib/Application/SubtitleCollection.cs: Added internal method to set the SubtitleProperties for all subtitles. 2007-04-03 18:07 noup * src/SubLib/Application/Subtitle.cs: Added internal property to set the SubtitleProperties after a Subtitle object has been created. 2007-04-03 18:05 noup * src/SubLib/Application/FileProperties.cs: Class to contain the properties of a file, including its path, encoding, subtitle format, and timing mode. 2007-04-03 18:05 noup * src/SubLib/Application/SubtitleFactory.cs: Code cleanup. FileProperties is now used to handle the properties of a file after opening. New and Open methods are more clear now, as some of its derivations were confusing. The Save functionality has moved to SubtitleSaver. 2007-04-03 17:59 noup * src/SubLib/Application/SubtitleProperties.cs: Cleanup of properties. SubtitleProperties now only includes properties that are not file-related. FileProperties is used for all file-related properties. 2007-04-03 17:57 noup * src/SubLib/Application/Subtitles.cs: Clarified the file saving functionality. The existing functionality in Subtitles was moved to SubtitleSaver. No persistent file-related information is now maintained. FileProperties is used, along with a Subtitles object, to save subtitles. 2007-04-03 17:56 noup * src/SubLib/Application/SubtitleSaver.cs: Clarified the file saving functionality. The existing functionality in Subtitles was moved to SubtitleSaver. No persistent file-related information is now maintained. FileProperties is used, along with a Subtitles object, to save subtitles. 2007-04-03 17:49 noup * src/SubLib/Persistency/FileInputOutput.cs, src/SubLib/Persistency/SubtitleFormatMPSub.cs, src/SubLib/Persistency/SubtitleFormatSubStationAlpha.cs, src/SubLib/Persistency/SubtitleFormatSubViewer1.cs, src/SubLib/Persistency/SubtitleFormatSubViewer2.cs, src/SubLib/Persistency/SubtitleOutput.cs, src/SubLib/Persistency/SubtitleParser.cs: Fixed copyright dates. 2007-04-03 17:45 noup * src/SubLib/Persistency/FileInputOutput.cs: Code cleanup. Fixed the attribution of code pages to some of the encodings. Removed some encodings as they didn't have a related code page. 2007-04-03 17:44 noup * src/SubLib/Persistency/SubtitleParser.cs: Cleanup of properties. SubtitleProperties now only includes properties that are not file-related. ParsingProperties is used to store all properties that are gathered when parsing. 2007-04-03 17:42 noup * src/SubLib/Persistency/SubtitleOutput.cs: Cleanup of properties. SubtitleProperties now only includes properties that are not file-related. FileProperties is used for all file-related properties. 2007-04-03 17:41 noup * src/SubLib/Persistency/SubtitleFormat.cs, src/SubLib/Persistency/SubtitleFormatMPSub.cs, src/SubLib/Persistency/SubtitleFormatSubStationAlpha.cs, src/SubLib/Persistency/SubtitleFormatSubViewer1.cs, src/SubLib/Persistency/SubtitleFormatSubViewer2.cs: Cleanup of properties. SubtitleProperties now only includes properties that are not file-related. 2007-04-03 17:37 noup * src/SubLib/Persistency/ParsingProperties.cs: Class that contains properties that result after parsing. 2007-03-05 18:19 noup * ChangeLog, NEWS, README, configure.in: Updating for release 0.5. 2007-03-05 18:15 noup * src/SubLib/Application/Subtitles.cs, src/SubLib/Application/Synchronization.cs: Updated timestamps. 2007-03-04 19:14 noup * .: Updated SVN ignore. 2007-02-25 14:45 noup * src/SubLib/Application/Synchronization.cs: Convert from time to frames given the time in seconds. 2007-01-22 02:06 noup * src/Executable/Executable.cs, src/SubLib/Application/Subtitles.cs: Added find based on a specific time position. 2006-12-08 03:38 noup * ChangeLog, NEWS, README, configure.in: Updated for the 0.4 release. 2006-12-08 03:18 noup * src/SubLib/Application/SubtitleProperties.cs: Code cleanup. 2006-12-08 03:18 noup * src/SubLib/Application/Subtitles.cs: Updated documentation. Set timing mode when using SaveAs, updating it to the timing mode of the new format used. Code cleanup. 2006-12-03 01:56 noup * sublib.mdp: Evaluator that enables to count how many matches are made during a string replacement with Regex. 2006-12-03 01:56 noup * src/SubLib/Application/MatchEvaluationCounter.cs: Evaluator that enables to count how many matches are made during a string replacement with Regex. 2006-12-03 01:54 noup * src/SubLib/Application/Subtitles.cs: Added ReplaceAll functionality. 2006-11-28 22:55 noup * src/SubLib/Application/Subtitles.cs: Check if there are no subtitles when doing a Find. 2006-11-26 16:33 noup * TODO: Updated the TODO list. 2006-11-26 16:33 noup * configure.in: Start using the C#2.0 compiler. 2006-11-26 16:32 noup * src/SubLib/Application/SubtitleCollection.cs: Added indexers and a method to check whether an index is valid in a collection. 2006-11-26 16:29 noup * src/SubLib/Application/Subtitles.cs: Added methods to Find text in the subtitles. Documentation is still missing. The Find methods use Regex. When using Backwards searching, the Regex must be created with the RegexOptions.RightToLeft option. 2006-11-26 16:27 noup * sublib.mdp: Updated compilation flags. 2006-10-30 16:03 noup * NEWS: Updated for version 0.3. 2006-10-30 14:08 noup * ChangeLog: Updated for release 0.3. 2006-10-30 13:52 noup * NEWS, README, configure.in: Updated for release 0.3. 2006-10-30 00:00 noup * AUTHORS, CREDITS, TODO: Updated project information files. 2006-10-28 21:26 noup * src/SubLib/Application/SubtitleTypeInfo.cs: Added method to check whether a SubtitleTypeInfo contains a specified extension. 2006-10-28 00:51 noup * src/SubLib/Application/Subtitles.cs: Updated to reflect changes in FileInputOutput. 2006-10-28 00:51 noup * src/SubLib/Application/SubtitleFactory.cs: Added FallbackEncoding property, to set the encoding to fallback to in case autodetection fails. Updated to reflect changes in FileInputOutput. 2006-10-28 00:48 noup * src/SubLib/Persistency/FileInputOutput.cs: Fixed bugs that existed by not closing the files, using "finally" statements. Auto-detection throws exception when encoding not detected. Auto-detection with fallback uses the fallback encoding (and possible "detectBOM" boolean) when no encoding is detected. Code cleanup. 2006-10-28 00:46 noup * src/SubLib/Exception/UnknownCharEncodingException.cs, src/SubLib/Exception/UnknownEncodingException.cs: Changed UnknownCharEncodingException to UnknownEncodingException 2006-10-28 00:45 noup * sublib.mdp: Changed UnknownCharEncodingException to UnknownEncodingException 2006-10-16 00:59 noup * src/SubLib/Application/Subtitles.cs: Methods and properties for returning info on the available subtitle types are now static. The AvailableTypes property doesn't sort types from now on. The new AvailableTypesSorted property does sort the types. Added method to return a SubtitleTypeInfo given a SubtitleType. 2006-10-16 00:55 noup * src/SubLib/Application/SubtitleTypeInfo.cs: Property to get the preferred extension (the first on the list). 2006-10-04 23:12 noup * Makefile.am: Changes for release version 0.2. 2006-10-04 21:50 noup * Makefile.am, TODO, src/Makefile.am: Changes for release version 0.2. 2006-10-04 21:01 noup * CREDITS, ChangeLog, NEWS, README, configure.in: Changes for release version 0.2. 2006-10-01 21:58 noup * src/Makefile.am: Register sublib.dll with noinst so it doesn't get installed (the install target isn't used). 2006-10-01 16:15 noup * ChangeLog: Merged with the sublib-dev branch. 2006-10-01 16:14 noup * ., ChangeLog: Merged with the sublib-dev branch. 2006-10-01 16:08 noup * src/SubLib/Application/Enumerations.cs, src/SubLib/Application/Frames.cs, src/SubLib/Application/SubtitleCollection.cs, src/SubLib/Application/SubtitleCompletion.cs, src/SubLib/Application/SubtitleFactory.cs, src/SubLib/Application/SubtitleHeaders.cs, src/SubLib/Application/SubtitleProperties.cs, src/SubLib/Application/Subtitles.cs, src/SubLib/Application/Times.cs: Merged with the sublib-dev branch. 2006-10-01 16:07 noup * src/SubLib/Persistency/BuiltInSubtitleFormats.cs, src/SubLib/Persistency/FileInputOutput.cs, src/SubLib/Persistency/SubtitleFormat.cs, src/SubLib/Persistency/SubtitleFormatAdvancedSubStationAlpha.cs, src/SubLib/Persistency/SubtitleFormatMPSub.cs, src/SubLib/Persistency/SubtitleFormatMPlayer.cs, src/SubLib/Persistency/SubtitleFormatMPlayer2.cs, src/SubLib/Persistency/SubtitleFormatMicroDVD.cs, src/SubLib/Persistency/SubtitleFormatSubRip.cs, src/SubLib/Persistency/SubtitleFormatSubStationAlpha.cs, src/SubLib/Persistency/SubtitleFormatSubViewer1.cs, src/SubLib/Persistency/SubtitleFormatSubViewer2.cs, src/SubLib/Persistency/SubtitleOutput.cs, src/SubLib/Persistency/SubtitleParser.cs: Merged with the sublib-dev branch. 2006-10-01 16:04 noup * sublib.mdp, sublib.mds: Merged with the sublib-dev branch. 2006-10-01 15:45 noup * src/Executable/Executable.cs: Merged with the sublib-dev branch. 2006-09-01 01:20 noup * TODO: No description necessary. 2006-08-30 11:16 noup * NEWS: Updated for version 0.1 launch. 2006-08-30 11:03 noup * src/SubLib/Application/Frames.cs, src/SubLib/Application/Subtitle.cs, src/SubLib/Application/Times.cs: Merged from sublib-dev. 2006-08-30 10:57 noup * src/SubLib/Persistency/VerboseConsole.cs: Merged from sublib-dev. 2006-08-30 10:06 noup * configure.in: Updated for version 0.1 launch. 2006-08-30 10:01 noup * data/NamespaceSummary.xml: Renamed doc dir to data dir. 2006-08-30 10:00 noup * data: Renamed doc dir to data dir. 2006-08-30 09:52 noup * build.properties, doc: Renamed doc dir to data dir. 2006-08-30 01:50 noup * README: Updated for new install options. 2006-08-30 01:31 noup * src/Makefile.am: Updated to create build dir when making the library. 2006-08-30 01:26 noup * ChangeLog: Added ChangeLog based on SVN commits. 2006-08-30 01:22 noup * ChangeLog, NEWS, TODO: Old ChangeLog contents are now in NEWS. 2006-08-30 01:19 noup * NEWS: Removed to exchange with data from ChangeLog. 2006-08-29 19:23 noup * ., src, src/Makefile.am, src/SubLib: Cleaned-up makefiles. 2006-08-01 10:39 noup * nant.build: Updated not to show warnings when members aren't documented. 2006-07-20 21:19 noup * src/SubLib/Application/SubtitleCollection.cs: Improved validation of some methods' arguments. Added methods to create and insert new subtitles at a specified position, or after or before existing subtitles, based on them. 2006-07-20 21:16 noup * src/SubLib/Persistency/FileInputOutput.cs: Fixed some warnings. 2006-07-15 03:11 noup * src/SubLib/Application/SubtitleConstants.cs: Updated with default values for properties. 2006-07-14 22:47 noup * src/SubLib/Application/SubtitleConstants.cs, sublib.mdp: Added constants to a set of subtitle parameters. 2006-07-08 18:56 noup * src/SubLib/Application/SubtitleFactory.cs, src/SubLib/Exception/UnknownCharEncodingException.cs, src/SubLib/Exception/UnknownSubtitleFormatException.cs: Added documentation. 2006-07-07 17:41 noup * src/SubLib/Application/Subtitles.cs: Current and Original frame rates are now only seteable internally, so they cannot be changed without using Subtitles.ChangeFrameRate or Subtitles.ChangeOriginalFrameRate. Added documentation. 2006-07-07 17:40 noup * src/SubLib/Application/SubtitleCompletion.cs, src/SubLib/Application/SubtitleProperties.cs: Current and Original frame rates are now only seteable internally, so they cannot be changed without using Subtitles.ChangeFrameRate or Subtitles.ChangeOriginalFrameRate. 2006-07-05 00:49 noup * build.properties, nant.build: Updated for new naming conventions for the library. 2006-07-05 00:49 noup * sublib.mdp: Removed the ParsedSubtitles class. Parsed values are now returned using "out". 2006-07-05 00:48 noup * src/SubLib/Application/ParsedSubtitles.cs: Removed the ParsedSubtitles class. Parsed values are now returned using "out". 2006-07-05 00:39 noup * src/SubLib/Application/SubtitleFactory.cs: Removed the ParsedSubtitles class. Parsed values are now returned using "out". 2006-07-05 00:20 noup * src/SubLib/Application/SubtitleCompletion.cs: Code cleanup. 2006-07-04 23:28 noup * src/SubLib/Application/SubtitleCollection.cs: Code cleanup. Added some useful methods. 2006-07-04 23:22 noup * src/SubLib/Application/Subtitle.cs: Code cleanup. 2006-07-04 22:57 noup * src/SubLib/Application/IncompleteSubtitle.cs, src/SubLib/Application/IncompleteSubtitleCollection.cs: Code cleanup. 2006-07-04 22:55 noup * src/SubLib/Application/SubtitleProperties.cs: Corrected the documentation. 2006-07-04 22:43 noup * src/SubLib/Application/SubtitleText.cs: Added some useful methods. 2006-07-04 22:41 noup * src/SubLib/Application/SubtitleTypeInfo.cs: Written documentation. 2006-07-04 22:38 noup * src/SubLib/Application/Synchronization.cs: Written documentation. 2006-07-04 22:38 noup * src/SubLib/Application/Times.cs: Written documentation. Removed unused isSubtitleValid properties. Code cleanup. 2006-07-04 22:37 noup * src/SubLib/Application/Frames.cs: Written documentation. Removed unused isSubtitleValid properties. Code cleanup. 2006-07-04 22:35 noup * src/SubLib/Persistency/SubtitleParser.cs: Removed the ParsedSubtitles class. Parsed values are now returned using "out". 2006-06-27 21:50 noup * src/SubLib/Application/IncompleteSubtitle.cs, src/SubLib/Application/IncompleteSubtitleCollection.cs, src/SubLib/Application/Style.cs, src/SubLib/Application/Subtitle.cs, src/SubLib/Application/SubtitleCollection.cs, src/SubLib/Application/SubtitleProperties.cs, src/SubLib/Application/SubtitleText.cs: Added and revised documentation. 2006-06-27 19:44 noup * sublib.mdp: ISubtitleCollection's need wasn't very logical. SubtitleCollection and IncompleteSubtitleCollection are now 2 completely separate classes. 2006-06-27 19:43 noup * src/SubLib/Application/SubtitleProperties.cs: Added documentation. 2006-06-27 19:43 noup * src/SubLib/Application/ISubtitleCollection.cs, src/SubLib/Application/IncompleteSubtitleCollection.cs, src/SubLib/Application/SubtitleCollection.cs: ISubtitleCollection's need wasn't very logical. SubtitleCollection and IncompleteSubtitleCollection are now 2 completely separate classes. 2006-06-27 19:41 noup * nant.build: Add properties to clearly mark unwritten documentation. 2006-06-27 00:44 noup * .: Added files to cvsignore. 2006-06-27 00:38 noup * src/SubLib/Application/Enumerations.cs, src/SubLib/Application/Style.cs, src/SubLib/Application/SubtitleText.cs: Written code comments. 2006-06-26 19:44 noup * sublib.mdp, sublib.mds: Imported the project into Monodevelop. 2006-06-26 00:24 noup * INSTALL, Makefile.am, NEWS, autogen.sh, configure.in, src/External/NCharDet/AssemblyInfo.cs, src/Makefile.am, src/SubLib/AssemblyInfo.cs.in: Added support for autotools, to build the library without nant. 2006-06-18 18:10 noup * src/SubLib/Application/SubtitleText.cs: Also trim text around line breaks when specified. 2006-06-18 17:59 noup * src/SubLib/Application/SubtitleText.cs: Fixed bug with last change, trimming is not functioning properly. 2006-06-18 17:40 noup * src/SubLib/Application/SubtitleText.cs, src/SubLib/Persistency/SubtitleFormatMicroDVD.cs, src/SubLib/Persistency/SubtitleFormatSubRip.cs, src/SubLib/Persistency/SubtitleParser.cs: Possibility to select if text should be trimmed when set in a subtitle. Text is trimmed by default when opening subtitles, but not trimmed by default when using Set with only 1 argument (the text). 2006-03-17 01:44 noup * build.properties, doc, doc/NamespaceSummary.xml, nant.build: Initial support for documentation, created with ndoc. 2006-03-05 02:42 noup * src/SubLib/Application/SubtitleFactory.cs: Updated verbose messages for opening. 2006-03-05 01:35 noup * src/SubLib/Application/SubtitleFactory.cs: Created method for setting properties, used after open and save as. 2006-03-05 01:35 noup * src/SubLib/Application/Subtitles.cs: Created method for setting properties, used after open and save as. 2006-03-05 01:34 noup * src/SubLib/Application/SubtitleCompletion.cs, src/SubLib/Application/SubtitleProperties.cs: Removed OriginalTimingMode property. 2006-03-05 01:19 noup * src/SubLib/Persistency/SubtitleParser.cs: moved the set up of properties after parsing to subtitle factory 2006-03-05 01:11 noup * TODO: Added TODO list. 2006-03-05 01:10 noup * src/SubLib/Persistency/SubtitleFormatMicroDVD.cs: Only create styleExpression once. 2006-03-05 01:10 noup * src/SubLib/Persistency/SubtitleFormatSubRip.cs: Corrected bug with not reading the last character when parsing input. Only create styleExpression once. 2006-03-04 18:47 noup * src/Executable/Executable.cs: Updated for verbose mechanism change. 2006-03-04 18:46 noup * src/SubLib/Exception/UnknownCharEncodingException.cs: Renaming exception related to unknown character coding. 2006-03-04 18:46 noup * src/SubLib/Exception/UnknownFileEncodingException.cs: Renaming exception related to unknown character coding. 2006-03-04 18:42 noup * src/SubLib/Persistency/VerboseConsole.cs: Verbose console output methods. 2006-03-04 18:42 noup * src/SubLib/Persistency/FileInputOutput.cs: Moved verbose mechanism to a separate class, to be used internally in the whole namespace. Allow to write files with a specified encoding. 2006-03-04 18:39 noup * src/SubLib/Persistency/SubtitleFormatSubRip.cs: Conform to the new specification: set subtitle name and extensions. 2006-03-04 18:39 noup * src/SubLib/Persistency/SubtitleFormatMicroDVD.cs: Conform to the new specification: set subtitle name and extensions. 2006-03-04 18:38 noup * src/SubLib/Persistency/SubtitleFormat.cs: Also store subtitle format's name and extensions. Oblige to be extended to be used Code cleanup 2006-03-04 18:35 noup * src/SubLib/Persistency/BuiltInSubtitleFormats.cs: Code cleanup. 2006-03-04 18:22 noup * src/SubLib/Application/SubtitleTypeInfo.cs: Class that stores information about a subtitle type. 2006-03-04 18:18 noup * src/SubLib/Application/Subtitles.cs: Allow to save using a specified encoding Store the new file encoding when saving as Updated verbosity mechanism 2006-03-04 18:17 noup * src/SubLib/Application/SubtitleProperties.cs: added file encoding property code cleanup 2006-03-04 18:15 noup * src/SubLib/Application/SubtitleFactory.cs: set encoding name in properties when opening a file updated verbosity mechanism code cleanup 2006-03-01 03:26 noup * src/SubLib/Persistency/SubtitleFormat.cs: Code cleanup. 2006-03-01 03:17 noup * src/SubLib/Persistency/SubtitleFormatMicroDVD.cs: Code cleanup. 2006-03-01 03:14 noup * src/SubLib/Persistency/SubtitleFormatSubRip.cs: Simplified regular expressions. FormatExpression is more rigid (to better detect the format) InputExpression breaks subtitles when it finds a blank line OutputExpression uses the system's newline (\r\n on windows, \n on unix) 2006-03-01 00:52 noup * src/Executable/Executable.cs: Updated Save to SaveAs. 2006-03-01 00:51 noup * src/SubLib/Persistency/BuiltInSubtitleFormats.cs: Heuristics change, now a format can be considered "the best" which makes the detection return immediately. Only the first 2000 characters of the text are used in the detection. Regular expressions are not compiled anymore, since it didn't really make much sense in this context (and has the problem about memory not being freed) 2006-03-01 00:49 noup * src/SubLib/Persistency/SubtitleFormatMicroDVD.cs: More precise support for subtitle format detection (more rigid). 2006-02-28 22:58 noup * src/SubLib/Application/Subtitles.cs: Save returns true if it could save (using CanSave), false otherwise. 2006-02-28 02:04 noup * src/SubLib/Application/Subtitles.cs: Operations for saving, saving as and knowing if a file can be saved without additional parameters. 2006-02-28 02:03 noup * src/SubLib/Application/SubtitleFactory.cs, src/SubLib/Application/SubtitleProperties.cs: Store the SubtitleType after reading a file. 2006-02-27 16:51 noup * ChangeLog: Updating for release 0.0.5 2006-02-27 16:27 noup * src/SubLib/Application/IncompleteSubtitle.cs, src/SubLib/Application/ParsedSubtitles.cs, src/SubLib/Application/Style.cs, src/SubLib/Application/SubtitleProperties.cs, src/SubLib/Application/Subtitles.cs, src/SubLib/Persistency/SubtitleParser.cs: Code cleanup. 2006-02-27 16:24 noup * src/SubLib/Application/SubtitleCollection.cs: Fixed bug when adding an element to the beginning of the collection. 2006-02-24 03:51 noup * .cvsignore: deleting remaining CVS files. 2006-02-22 12:22 noup * src/Executable/Executable.cs, src/SubLib/Application/Enumerations.cs, src/SubLib/Application/Frames.cs, src/SubLib/Application/ISubtitleCollection.cs, src/SubLib/Application/IncompleteSubtitle.cs, src/SubLib/Application/IncompleteSubtitleCollection.cs, src/SubLib/Application/ParsedSubtitles.cs, src/SubLib/Application/Style.cs, src/SubLib/Application/Subtitle.cs, src/SubLib/Application/SubtitleCollection.cs, src/SubLib/Application/SubtitleCompletion.cs, src/SubLib/Application/SubtitleFactory.cs, src/SubLib/Application/SubtitleProperties.cs, src/SubLib/Application/SubtitleText.cs, src/SubLib/Application/Subtitles.cs, src/SubLib/Application/Synchronization.cs, src/SubLib/Application/Times.cs, src/SubLib/Domain, src/SubLib/Exception, src/SubLib/Exception/UnknownFileEncodingException.cs, src/SubLib/Exception/UnknownSubtitleFormatException.cs, src/SubLib/Persistency/BuiltInSubtitleFormats.cs, src/SubLib/Persistency/Exception, src/SubLib/Persistency/FileInputOutput.cs, src/SubLib/Persistency/SubtitleFormat.cs, src/SubLib/Persistency/SubtitleFormatMicroDVD.cs, src/SubLib/Persistency/SubtitleFormatSubRip.cs, src/SubLib/Persistency/SubtitleOutput.cs, src/SubLib/Persistency/SubtitleParser.cs: Namespace change: only 1 namespace now - SubLib. Domain layer removed, since it wasn't making much sense. Its files were moved to "Application", which now contains all the public classes. Exception classes were also moved to the SubLib's source root. 2006-02-22 12:16 noup * nant.build: Added rebuild target. 2006-02-19 03:30 noup * src/SubLib/Application/SubtitleFactory.cs: Stop being verbose by default. 2006-02-15 01:13 noup * src/SubLib/Persistency/FileInputOutput.cs: Fixed bug with detecting the character encoding. Now tries 1252 if both detection and the default encoding failed. 2006-02-15 00:18 noup * src/SubLib/Application/SubtitleFactory.cs, src/SubLib/Domain/Frames.cs, src/SubLib/Domain/SubtitleText.cs, src/SubLib/Domain/Times.cs: Removed Domain.Exception namespace. 2006-02-15 00:01 noup * src/SubLib/Domain/Exception, src/SubLib/Domain/Frames.cs, src/SubLib/Domain/Times.cs: Stop throwing exceptions when times and frames aren't valid (use IsValid to validate) 2006-02-14 23:28 noup * src/SubLib/Domain/ISubtitleCollection.cs, src/SubLib/Domain/IncompleteSubtitleCollection.cs, src/SubLib/Domain/SubtitleCollection.cs: subtitle numbers now start at 0 2006-02-14 23:20 noup * src/SubLib/Domain/Exception/InvalidSubtitleTextException.cs, src/SubLib/Domain/Frames.cs, src/SubLib/Domain/Subtitle.cs, src/SubLib/Domain/SubtitleText.cs, src/SubLib/Domain/Times.cs: Code cleanup. Restructured constructors. Stoped throwing exception when values aren't initialized (values are always initialized from now on). 2006-02-06 06:06 noup * src/SubLib/Application/SubtitleCompletion.cs, src/SubLib/Domain/Enumerations.cs, src/SubLib/Domain/SubtitleProperties.cs, src/SubLib/Persistency/SubtitleFormat.cs, src/SubLib/Persistency/SubtitleFormatMicroDVD.cs, src/SubLib/Persistency/SubtitleFormatSubRip.cs, src/SubLib/Persistency/SubtitleParser.cs: Removed the Unknown field of the TimingMode enumeration, so it can also be used externaly. 2006-02-05 05:18 noup * src/SubLib/Application/SubtitleFactory.cs, src/SubLib/Domain/Frames.cs, src/SubLib/Domain/SubtitleProperties.cs, src/SubLib/Domain/Times.cs: Added a better path handling: allow to store them in SubtitleProperties and create new subtitles in SubtitleFactory Timings' duration can now be set 2006-01-30 03:58 noup * src/SubLib/Application/SubtitleFactory.cs, src/SubLib/Domain/SubtitleProperties.cs, src/SubLib/Domain/Subtitles.cs: Subtitles constructor is now protected, so the class can be inherited SubtitleProperties readjusted, some properties were not necessary SubtitleFactory can now create new initial blank subtitles 2006-01-29 01:54 noup * ChangeLog, src/SubLib/Domain/Subtitle.cs, src/SubLib/Domain/SubtitleText.cs, src/SubLib/Persistency/BuiltInSubtitleFormats.cs, src/SubLib/Persistency/SubtitleFormat.cs, src/SubLib/Persistency/SubtitleFormatMicroDVD.cs, src/SubLib/Persistency/SubtitleFormatSubRip.cs, src/SubLib/Persistency/SubtitleParser.cs: MicroDVD: now detects style tags anywhere inside subtitles' text SubRip: fixed bug related to style parsing Parsing engine optimized Subtitle regular expressions are case-insensitive by default Subtitles are now trimmed Added Get() to SubtitleText, which retrieves subtitles separated by the newline character 2005-10-29 14:32 noup * ChangeLog: Updating for version 0.0.3. 2005-10-29 13:59 noup * ChangeLog: Updating for version 0.0.3. 2005-10-29 13:50 noup * AUTHORS, COPYING, ChangeLog, nant.build, src/Executable/Executable.cs, src/External/NCharDet/AssemblyInfo.cs, src/External/NCharDet/Big5Statistics.cs, src/External/NCharDet/EUCJPStatistics.cs, src/External/NCharDet/EUCKRStatistics.cs, src/External/NCharDet/EUCTWStatistics.cs, src/External/NCharDet/GB2312Statistics.cs, src/External/NCharDet/nsBIG5Verifier.cs, src/External/NCharDet/nsCP1252Verifier.cs, src/External/NCharDet/nsDetector.cs, src/External/NCharDet/nsEUCJPVerifier.cs, src/External/NCharDet/nsEUCKRVerifier.cs, src/External/NCharDet/nsEUCSampler.cs, src/External/NCharDet/nsEUCStatistics.cs, src/External/NCharDet/nsEUCTWVerifier.cs, src/External/NCharDet/nsGB18030Verifier.cs, src/External/NCharDet/nsGB2312Verifier.cs, src/External/NCharDet/nsHZVerifier.cs, src/External/NCharDet/nsICharsetDetectionObserver.cs, src/External/NCharDet/nsICharsetDetector.cs, src/External/NCharDet/nsISO2022CNVerifier.cs, src/External/NCharDet/nsISO2022JPVerifier.cs, src/External/NCharDet/nsISO2022KRVerifier.cs, src/External/NCharDet/nsPSMDetector.cs, src/External/NCharDet/nsSJISVerifier.cs, src/External/NCharDet/nsUCS2BEVerifier.cs, src/External/NCharDet/nsUCS2LEVerifier.cs, src/External/NCharDet/nsUTF8Verifier.cs, src/External/NCharDet/nsVerifier.cs, src/SubLib/Application/SubtitleCompletion.cs, src/SubLib/Application/SubtitleFactory.cs, src/SubLib/Application/Synchronization.cs, src/SubLib/Domain/ISubtitleCollection.cs, src/SubLib/Domain/IncompleteSubtitle.cs, src/SubLib/Domain/IncompleteSubtitleCollection.cs, src/SubLib/Domain/ParsedSubtitles.cs, src/SubLib/Domain/Style.cs, src/SubLib/Domain/Subtitle.cs, src/SubLib/Domain/SubtitleCollection.cs, src/SubLib/Domain/SubtitleProperties.cs, src/SubLib/Persistency/BuiltInSubtitleFormats.cs, src/SubLib/Persistency/Exception/UnknownFileEncodingException.cs, src/SubLib/Persistency/Exception/UnknownSubtitleFormatException.cs, src/SubLib/Persistency/FileInputOutput.cs, src/SubLib/Persistency/SubtitleFormat.cs, src/SubLib/Persistency/SubtitleFormatMicroDVD.cs, src/SubLib/Persistency/SubtitleFormatSubRip.cs, src/SubLib/Persistency/SubtitleOutput.cs, src/SubLib/Persistency/SubtitleParser.cs: changed ascii/binary property 2005-10-29 13:44 noup * README, build.properties, nant.build, src/Executable/Executable.cs, src/SubLib/Domain/Frames.cs, src/SubLib/Domain/Subtitle.cs, src/SubLib/Domain/Times.cs, src/SubLib/Persistency/SubtitleOutput.cs, src/SubLib/Persistency/SubtitleParser.cs: Frames and Times aren't hidden in the subtitle class anymore. Their methods and properties are now public, but they have to be constructed by Subtitle (internal constructor). They also include 2 types of access: common and precise. Precise is for internal use and the other is public. Updated the nant build file with targets to make releases. Updated the README file with the current program usage. 2005-10-26 17:50 noup * ChangeLog, src/Executable/Executable.cs, src/SubLib/Application/SubtitleCompletion.cs, src/SubLib/Application/SubtitleFactory.cs, src/SubLib/Application/Subtitles.cs, src/SubLib/Application/Synchronization.cs, src/SubLib/Domain/Exception, src/SubLib/Domain/Exception/InvalidEndFrameException.cs, src/SubLib/Domain/Exception/InvalidEndTimeException.cs, src/SubLib/Domain/Exception/InvalidStartFrameException.cs, src/SubLib/Domain/Exception/InvalidStartTimeException.cs, src/SubLib/Domain/Exception/InvalidSubtitleTextException.cs, src/SubLib/Domain/Frames.cs, src/SubLib/Domain/ISubtitleCollection.cs, src/SubLib/Domain/IncompleteSubtitleCollection.cs, src/SubLib/Domain/Style.cs, src/SubLib/Domain/Subtitle.cs, src/SubLib/Domain/SubtitleCollection.cs, src/SubLib/Domain/SubtitleProperties.cs, src/SubLib/Domain/SubtitleText.cs, src/SubLib/Domain/Subtitles.cs, src/SubLib/Domain/Times.cs, src/SubLib/Persistency/FileInputOutput.cs, src/SubLib/Persistency/SubtitleFormatSubRip.cs, src/SubLib/Persistency/SubtitleOutput.cs, src/SubLib/Persistency/SubtitleParser.cs, src/SubLib/Persistency/SubtitleReader.cs, src/SubLib/Persistency/SubtitleWriter.cs: - architecture restructured, now features a rich domain model which connects both to the application and persistency layers. - subtitle domain now includes frames and times as classes, and automatically updates the times when changing frames and vice-versa; one has to use the internally-available properties of frames and times to set their values without changing the others - parsing engine rewrite, parsed bits are returned instead of passing a subtitle class to each parsing method - improved the parsing engine's efficiency, using a string builder instead of common strings. - added an optional argument to the executable, to change the input fps 2005-10-22 23:19 noup * README: minor change for README 2005-10-22 23:17 noup * AUTHORS, ChangeLog: updated for version 0.0.2 2005-10-22 23:05 noup * README, src/Executable/Executable.cs, src/SubLib/Application/SubtitleCompletion.cs, src/SubLib/Application/SubtitleFactory.cs, src/SubLib/Application/Subtitles.cs, src/SubLib/Application/Synchronization.cs, src/SubLib/Domain/Enumerations.cs, src/SubLib/Domain/Subtitle.cs, src/SubLib/Domain/SubtitleCollection.cs, src/SubLib/Domain/SubtitleProperties.cs, src/SubLib/Persistency/BuiltInSubtitleFormats.cs, src/SubLib/Persistency/SubtitleFormat.cs, src/SubLib/Persistency/SubtitleOutput.cs, src/SubLib/Persistency/SubtitleParser.cs, src/SubLib/Persistency/SubtitleReader.cs: Added synchronization utilities. The correct place for the related methods is still to be decided, but the added top-level features are changing the fps and the input fps. Internaly, there is also the function of updating the time from frames and vice-versa (SetTimeFromFrames and SetFramesFromTime). Written a README file. 2005-10-15 18:12 noup * ., .cvsignore, src/Executable/Executable.cs, src/SubLib/Application/SubtitleCompletion.cs, src/SubLib/Application/SubtitleFactory.cs, src/SubLib/Application/Subtitles.cs, src/SubLib/Application/Synchronization.cs, src/SubLib/Application/TimeUtilities.cs, src/SubLib/Domain/SubtitleProperties.cs, src/SubLib/Persistency/FileInputOutput.cs, src/SubLib/Persistency/SubtitleFormat.cs, src/SubLib/Persistency/SubtitleFormatMicroDVD.cs, src/SubLib/Persistency/SubtitleFormatSubRip.cs, src/SubLib/Persistency/SubtitleReader.cs: SubtitleFormat isn't static anymore SubtitleFormat accepts many properties, which can be specified before opening a subtitle Added a way to enable verbose prints during the opening of a file. 2005-10-14 10:50 noup * src/SubLib/Domain/SubtitleProperties.cs: *** empty log message *** 2005-10-11 23:34 noup * nant.build: cleaned-up build file. 2005-10-09 01:09 noup * src/SubLib/Domain/Subtitle.cs, src/SubLib/Persistency/SubtitleFormat.cs, src/SubLib/Persistency/SubtitleFormatSubRip.cs, src/SubLib/Persistency/SubtitleOutput.cs, src/SubLib/Persistency/SubtitleParser.cs: improved parsing engine: - added a PostProcess function, to deal with particularities that may arise from some subtitle formats (as of now, SubRip, in what comes to finding and deleting tags inside the subtitle text) - improved parsing of SubRip subtitles - refactored the conversions between subtitle text strings and arraylists (with the subtitle lines), which is now in the subtitle text (SetText and GetText functions) 2005-09-24 17:11 noup * ChangeLog: Added Changelog for version 0.0.1. 2005-09-24 01:28 noup * src/Executable/Executable.cs, src/SubLib/Application/SubtitleCompletion.cs, src/SubLib/Application/SubtitleFactory.cs, src/SubLib/Application/Subtitles.cs, src/SubLib/Application/TimeUtilities.cs, src/SubLib/Domain/ISubtitleCollection.cs, src/SubLib/Domain/Subtitle.cs, src/SubLib/Domain/SubtitleCollection.cs, src/SubLib/Persistency/SubtitleParser.cs: Added timing completion upon parsing. Subtitle class doesn't create a subtitle with zero time by default any more. Instead, it creates a subtitle with invalid time. Improved executable to detect operating system and show usage instructions. 2005-08-20 18:28 noup * src/Executable/Executable.cs, src/SubLib/Application/SubtitleCompletion.cs, src/SubLib/Application/SubtitleFactory.cs, src/SubLib/Application/Subtitles.cs, src/SubLib/Domain/MovieSubtitles.cs, src/SubLib/Domain/ParsedSubtitles.cs, src/SubLib/Domain/SubtitleCollection.cs, src/SubLib/Domain/SubtitleProperties.cs, src/SubLib/Persistency/SubtitleFormatMicroDVD.cs, src/SubLib/Persistency/SubtitleFormatSubRip.cs, src/SubLib/Persistency/SubtitleOutput.cs, src/SubLib/Persistency/SubtitleParser.cs, src/SubLib/Persistency/SubtitleReader.cs, src/SubLib/Persistency/SubtitleWriter.cs: Started building the application layer, which structure was rearranged. Corrected some minor bugs related to SubRip and MicroDVD subtitles parsing. Now uses a SubtitleFactory class to create Subtitles from text files. The incomplete subtitles are optionaly retrieved from the SubtitleFactory after reading the subtitles. 2005-08-14 00:08 noup * src/Executable/Executable.cs, src/External/NCharDet/nsDetector.cs, src/SubLib/Persistency/FileInputOutput.cs, src/SubLib/Persistency/SubtitleParser.cs: Fixed bug with the encoding detection, wasn't detecting correctly because some parts of the buffer were only used in ascii detection, and not in the global one. Added a statistics feature to the testing executable. 2005-08-11 11:34 noup * src/Executable/Executable.cs, src/SubLib/Domain/Style.cs, src/SubLib/Domain/Subtitle.cs, src/SubLib/Persistency/BuiltInSubtitleFormats.cs, src/SubLib/Persistency/FileInputOutput.cs, src/SubLib/Persistency/SubtitleFormat.cs, src/SubLib/Persistency/SubtitleFormatMicroDVD.cs, src/SubLib/Persistency/SubtitleFormatSubRip.cs, src/SubLib/Persistency/SubtitleOutput.cs, src/SubLib/Persistency/SubtitleParser.cs, src/SubLib/Persistency/SubtitleReader.cs: Added complete support for SubRip subtitles. The parsing engine now better supports parsing of time-based subtitles. Persistency structure changed, each subtitle type has a specific related file now. 2005-07-23 21:20 noup * ChangeLog, build.properties, nant.build, src/Executable/Executable.cs, src/External, src/External/NCharDet, src/External/NCharDet/AssemblyInfo.cs, src/External/NCharDet/Big5Statistics.cs, src/External/NCharDet/EUCJPStatistics.cs, src/External/NCharDet/EUCKRStatistics.cs, src/External/NCharDet/EUCTWStatistics.cs, src/External/NCharDet/GB2312Statistics.cs, src/External/NCharDet/nsBIG5Verifier.cs, src/External/NCharDet/nsCP1252Verifier.cs, src/External/NCharDet/nsDetector.cs, src/External/NCharDet/nsEUCJPVerifier.cs, src/External/NCharDet/nsEUCKRVerifier.cs, src/External/NCharDet/nsEUCSampler.cs, src/External/NCharDet/nsEUCStatistics.cs, src/External/NCharDet/nsEUCTWVerifier.cs, src/External/NCharDet/nsGB18030Verifier.cs, src/External/NCharDet/nsGB2312Verifier.cs, src/External/NCharDet/nsHZVerifier.cs, src/External/NCharDet/nsICharsetDetectionObserver.cs, src/External/NCharDet/nsICharsetDetector.cs, src/External/NCharDet/nsISO2022CNVerifier.cs, src/External/NCharDet/nsISO2022JPVerifier.cs, src/External/NCharDet/nsISO2022KRVerifier.cs, src/External/NCharDet/nsPSMDetector.cs, src/External/NCharDet/nsSJISVerifier.cs, src/External/NCharDet/nsUCS2BEVerifier.cs, src/External/NCharDet/nsUCS2LEVerifier.cs, src/External/NCharDet/nsUTF8Verifier.cs, src/External/NCharDet/nsVerifier.cs, src/SubLib/Application/Subtitles.cs, src/SubLib/Domain/ISubtitleCollection.cs, src/SubLib/Domain/IncompleteSubtitle.cs, src/SubLib/Domain/IncompleteSubtitleCollection.cs, src/SubLib/Domain/MovieSubtitles.cs, src/SubLib/Domain/Style.cs, src/SubLib/Domain/Subtitle.cs, src/SubLib/Domain/SubtitleCollection.cs, src/SubLib/Persistency/BuiltInSubtitleFormats.cs, src/SubLib/Persistency/Exception/InvalidPathException.cs, src/SubLib/Persistency/Exception/UnknownFileEncodingException.cs, src/SubLib/Persistency/Exception/UnknownSubtitleFormatException.cs, src/SubLib/Persistency/FileInputOutput.cs, src/SubLib/Persistency/SubtitleFormat.cs, src/SubLib/Persistency/SubtitleOutput.cs, src/SubLib/Persistency/SubtitleParser.cs, src/SubLib/Persistency/SubtitleReader.cs, src/SubLib/Persistency/SubtitleWriter.cs: Added support for automatic file encoding detection. Added support for automatic subtitle format detection. Parser now supports strict and relaxed expressions, and also the option to create a list of the detected invalid subtitles (which couldn't be fixed). Complete support for reading and writing subtitles. Added support for MicroDVD subtitles. 2005-07-16 17:51 noup * src/Executable/Executable.cs, src/SubLib/Application/Subtitles.cs, src/SubLib/Domain/MovieSubtitles.cs, src/SubLib/Domain/Subtitle.cs, src/SubLib/Domain/SubtitleCollection.cs, src/SubLib/Domain/SubtitleProperties.cs, src/SubLib/Persistency/BuiltInSubtitleFormats.cs, src/SubLib/Persistency/FileInputOutput.cs, src/SubLib/Persistency/SubtitleFormat.cs, src/SubLib/Persistency/SubtitleParser.cs, src/SubLib/Persistency/SubtitleReader.cs: Standardized getters and setters. New (very) experimental parsing engine. Use the current locale the default encoding detector doesn't succeed. 2005-07-14 04:47 noup * src/Executable/Executable.cs: Adding a basic testing executable. 2005-05-31 22:33 noup * ., .project, AUTHORS, COPYING, ChangeLog, build.properties, nant.build, src, src/Executable, src/Executable/Executable.cs, src/SubLib, src/SubLib/Application, src/SubLib/Application/Subtitles.cs, src/SubLib/Domain, src/SubLib/Domain/MovieSubtitles.cs, src/SubLib/Domain/Subtitle.cs, src/SubLib/Domain/SubtitleCollection.cs, src/SubLib/Domain/SubtitleProperties.cs, src/SubLib/Persistency, src/SubLib/Persistency/BuiltInSubtitleFormats.cs, src/SubLib/Persistency/Exception, src/SubLib/Persistency/Exception/InvalidPathException.cs, src/SubLib/Persistency/FileInputOutput.cs, src/SubLib/Persistency/SubtitleFormat.cs, src/SubLib/Persistency/SubtitleParser.cs, src/SubLib/Persistency/SubtitleReader.cs: Initial CVS commit. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/AUTHORS����������������������������������������������������������������������������������0000644�0001750�0001750�00000000277�11011321761�013207� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SubLib ==================== http://sublib.sf.net Developers ========== Pedro Castro <dev pedrocastro.org> - Author and Developer Cristina Yenyxe <the.blue.valkyrie gmail.com> - Developer ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/configure��������������������������������������������������������������������������������0000755�0001750�0001750�00000311470�11000753646�014057� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for sublib 0.9. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 </dev/null 6>&1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='sublib' PACKAGE_TARNAME='sublib' PACKAGE_VERSION='0.9' PACKAGE_STRING='sublib 0.9' PACKAGE_BUGREPORT='' ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT PKG_CONFIG CSC MCS MONO LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures sublib 0.9 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/sublib] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of sublib 0.9:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF sublib configure 0.9 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by sublib $as_me 0.9, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6; } if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 echo "$as_me: error: invalid value of canonical target" >&2;} { (exit 1); exit 1; }; };; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- am__api_version="1.9" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm -f conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$AWK" && break done { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='sublib' VERSION='0.9' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' { echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$PKG_CONFIG" = "xno"; then { { echo "$as_me:$LINENO: error: You need to install pkg-config" >&5 echo "$as_me: error: You need to install pkg-config" >&2;} { (exit 1); exit 1; }; } fi # Extract the first word of "csc", so it can be a program name with args. set dummy csc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_CSC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $CSC in [\\/]* | ?:[\\/]*) ac_cv_path_CSC="$CSC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CSC="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_CSC" && ac_cv_path_CSC="no" ;; esac fi CSC=$ac_cv_path_CSC if test -n "$CSC"; then { echo "$as_me:$LINENO: result: $CSC" >&5 echo "${ECHO_T}$CSC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # Extract the first word of "gmcs", so it can be a program name with args. set dummy gmcs; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MCS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MCS in [\\/]* | ?:[\\/]*) ac_cv_path_MCS="$MCS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MCS="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MCS" && ac_cv_path_MCS="no" ;; esac fi MCS=$ac_cv_path_MCS if test -n "$MCS"; then { echo "$as_me:$LINENO: result: $MCS" >&5 echo "${ECHO_T}$MCS" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # Extract the first word of "mono", so it can be a program name with args. set dummy mono; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MONO+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MONO in [\\/]* | ?:[\\/]*) ac_cv_path_MONO="$MONO" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MONO="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MONO" && ac_cv_path_MONO="no" ;; esac fi MONO=$ac_cv_path_MONO if test -n "$MONO"; then { echo "$as_me:$LINENO: result: $MONO" >&5 echo "${ECHO_T}$MONO" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi CS="C#" if test "x$CSC" = "xno" -a "x$MCS" = "xno" ; then { { echo "$as_me:$LINENO: error: No $CS compiler found" >&5 echo "$as_me: error: No $CS compiler found" >&2;} { (exit 1); exit 1; }; } fi if test "x$MCS" = "xno" ; then MCS=$CSC fi if test "x$MONO" = "xno"; then { { echo "$as_me:$LINENO: error: No mono runtime found" >&5 echo "$as_me: error: No mono runtime found" >&2;} { (exit 1); exit 1; }; } fi if test ! -d "build"; then mkdir build fi ac_config_files="$ac_config_files Makefile data/Makefile data/sublib.pc src/Makefile src/SubLib/AssemblyInfo.cs" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by sublib $as_me 0.9, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to <bug-autoconf@gnu.org>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ sublib config.status 0.9 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; "data/sublib.pc") CONFIG_FILES="$CONFIG_FILES data/sublib.pc" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/SubLib/AssemblyInfo.cs") CONFIG_FILES="$CONFIG_FILES src/SubLib/AssemblyInfo.cs" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim target!$target$ac_delim target_cpu!$target_cpu$ac_delim target_vendor!$target_vendor$ac_delim target_os!$target_os$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim ACLOCAL!$ACLOCAL$ac_delim AUTOCONF!$AUTOCONF$ac_delim AUTOMAKE!$AUTOMAKE$ac_delim AUTOHEADER!$AUTOHEADER$ac_delim MAKEINFO!$MAKEINFO$ac_delim install_sh!$install_sh$ac_delim STRIP!$STRIP$ac_delim INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim mkdir_p!$mkdir_p$ac_delim AWK!$AWK$ac_delim SET_MAKE!$SET_MAKE$ac_delim am__leading_dot!$am__leading_dot$ac_delim AMTAR!$AMTAR$ac_delim am__tar!$am__tar$ac_delim am__untar!$am__untar$ac_delim MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim MAINT!$MAINT$ac_delim PKG_CONFIG!$PKG_CONFIG$ac_delim CSC!$CSC$ac_delim MCS!$MCS$ac_delim MONO!$MONO$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 79; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS <conf$$subs.sed rm -f conf$$subs.sed cat >>$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/data/������������������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11011375150�013043� 5����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/data/NamespaceSummary.xml����������������������������������������������������������������0000644�0001750�0001750�00000000374�10475260760�017060� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<namespaces> <namespace name="SubLib"> <b>SubLib</b> is a library for managing movie subtitles. It aims at easily supporting new subtitle formats and includes subtitle editing, conversion and synchronization. </namespace> </namespaces> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/data/Makefile.in�������������������������������������������������������������������������0000644�0001750�0001750�00000022112�11011375136�015112� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = data DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/sublib.pc.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = sublib.pc SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(pkgconfigdir)" pkgconfigDATA_INSTALL = $(INSTALL_DATA) DATA = $(pkgconfig_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CSC = @CSC@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MCS = @MCS@ MONO = @MONO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ EXTRA_DIST = \ sublib.pc.in \ NamespaceSummary.xml pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = sublib.pc all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu data/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh sublib.pc: $(top_builddir)/config.status $(srcdir)/sublib.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ uninstall-info-am: install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfigdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-pkgconfigDATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-pkgconfigDATA .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-pkgconfigDATA install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am uninstall-info-am \ uninstall-pkgconfigDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/data/Makefile.am�������������������������������������������������������������������������0000644�0001750�0001750�00000000172�11000743723�015102� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������EXTRA_DIST = \ sublib.pc.in \ NamespaceSummary.xml pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = sublib.pc ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/data/sublib.pc.in������������������������������������������������������������������������0000644�0001750�0001750�00000000343�11000743402�015251� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Libraries=@libdir@/sublib/sublib.dll Name: sublib Description: sublib - Subtitle Library Version: @VERSION@ Libs: -r:@libdir@/sublib/sublib.dll ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/README�����������������������������������������������������������������������������������0000644�0001750�0001750�00000002307�11011322357�013015� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SubLib ==================== http://sublib.sf.net SubLib is a library that eases the development of subtitling applications. It supports the most common text-based subtitle formats and allows for subtitle editing, conversion and synchronization. SubLib is written in C# and can be used in platforms like Mono or .NET Framework. Building from Source ==================== Windows users can use NAnt (3) or import the project into Visual Studio. Linux users can use any of the following three. 1. Autotools * Build it with the usual `./configure' followed by `make' commands. * Install it with `make install'. * See the INSTALL file for more information 2. MonoDevelop * Use the `sublib.mds' file to open the project with MonoDevelop 3. NAnt * Use `nant build' to build the library as a binary DLL * Use `nant build-as-exe' to build the library as an EXE that allows to test part of its features * Use `nant build-docs' to build the docs Building from SVN ================= Checkout the latest code from the SVN: svn co https://sublib.svn.sf.net/svnroot/sublib/trunk/sublib Run `./autogen.sh' to generate the build scripts. To build SubLib, use the instructions in "Building from Source". �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/config.guess�����������������������������������������������������������������������������0000755�0001750�0001750�00000127350�10621211747�014471� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2006-07-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner <per@bothner.com>. # Please send patches to <config-patches@gnu.org>. Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to <config-patches@gnu.org>." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown if [ "${UNAME_SYSTEM}" = "Linux" ] ; then eval $set_cc_for_build cat << EOF > $dummy.c #include <features.h> #ifdef __UCLIBC__ # ifdef __UCLIBC_CONFIG_VERSION__ LIBC=uclibc __UCLIBC_CONFIG_VERSION__ # else LIBC=uclibc # endif #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'` fi # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include <stdio.h> /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include <sys/systemcfg.h> main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include <stdlib.h> #include <unistd.h> int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include <unistd.h> int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; x86:Interix*:[3456]*) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T:Interix*:[3456]*) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo cris-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo frv-unknown-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-${LIBC}coff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld" exit ;; esac # This should get integrated into the C code below, but now we hack if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include <features.h> #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` echo ${UNAME_MACHINE}-pc-isc$UNAME_REL elif /bin/uname -X 2>/dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says <Richard.M.Bartel@ccMail.Census.GOV> echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes <hewes@openmarket.com>. # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c <<EOF #ifdef _SEQUENT_ # include <sys/types.h> # include <sys/utsname.h> #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include <sys/param.h> printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include <sys/param.h> # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 <<EOF $0: unable to guess system type This script, last modified $timestamp, has failed to recognize the operating system you are using. It is advised that you download the most up to date version of the config scripts from http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess and http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub If the version you run ($0) is already up to date, please send the following data and any information you think might be pertinent to <config-patches@gnu.org> in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/configure.in�����������������������������������������������������������������������������0000644�0001750�0001750�00000001405�11000753636�014452� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������AC_INIT([sublib], [0.9]) AC_CANONICAL_SYSTEM AM_INIT_AUTOMAKE AM_MAINTAINER_MODE AC_PROG_INSTALL dnl pkg-config AC_PATH_PROG(PKG_CONFIG, pkg-config, no) if test "x$PKG_CONFIG" = "xno"; then AC_MSG_ERROR([You need to install pkg-config]) fi dnl C# compiler AC_PATH_PROG(CSC, csc, no) AC_PATH_PROG(MCS, gmcs, no) AC_PATH_PROG(MONO, mono, no) CS="C#" if test "x$CSC" = "xno" -a "x$MCS" = "xno" ; then dnl AC_MSG_ERROR([You need to install a C# compiler]) AC_MSG_ERROR([No $CS compiler found]) fi if test "x$MCS" = "xno" ; then MCS=$CSC fi if test "x$MONO" = "xno"; then AC_MSG_ERROR([No mono runtime found]) fi if test ! -d "build"; then mkdir build fi AC_SUBST(MCS) AC_OUTPUT([ Makefile data/Makefile data/sublib.pc src/Makefile src/SubLib/AssemblyInfo.cs ]) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/nant.build�������������������������������������������������������������������������������0000644�0001750�0001750�00000007206�10463627564�014143� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" ?> <project name="SubLib" default="build" basedir="."> <description>SubLib - Subtitles Library.</description> <include buildfile="build.properties" /> <target name="prepare" description="prepares to build"> <mkdir dir="${build.dir}" /> </target> <target name="clean" description="cleans the generated files"> <delete dir="${build.dir}" failonerror="false" /> </target> <target name="build" depends="prepare"> <csc target="library" output="${library.build.path}" doc="${build.dir}/${sublib.name.lowercase}.xml"> <sources basedir="${src.dir}"> <include name="${external.name}/**/*.cs" /> <include name="${sublib.name}/**/*.cs" /> </sources> </csc> </target> <target name="rebuild" depends="clean,build" /> <target name="build-as-exe" depends="prepare"> <csc target="exe" output="${executable.build.path}"> <sources basedir="${src.dir}"> <include name="**/*.cs" /> </sources> </csc> </target> <target name="run" depends="build-as-exe"> <exec program="mono"> <arg value="${executable.build.path}" /> </exec> </target> <target name="build-docs" depends="build"> <ndoc> <assemblies> <include name="${library.build.path}" /> </assemblies> <summaries> <include name="${docs.namespace.summary.path}" /> </summaries> <documenters> <documenter name="MSDN"> <property name="OutputDirectory" value="${docs.build.dir}" /> <property name="OutputTarget" value="Web" /> <property name="SkipNamespacesWithoutSummaries" value="true" /> <property name="AutoDocumentConstructors" value="true" /> <property name="AutoPropertyBackerSummaries" value="true" /> <property name="Preliminary" value="false" /> <property name="OutputTarget" value="Web" /> <property name="Title" value="SubLib Subtitle Library" /> <property name="SdkLinksOnWeb" value="true" /> <property name="FooterHtml" value='This documentation is part of the <a href="http://sublib.sourceforge.net">SubLlib</a> project.' /> <property name="ShowMissingSummaries" value="false" /> <property name="ShowMissingReturns" value="false" /> <property name="ShowMissingParams" value="false" /> </documenter> </documenters> </ndoc> </target> <target name="clean-release"> <delete dir="${release.dir}" failonerror="false" /> </target> <target name="prepare-release"> <fail if="${not property::exists('release.version')}" message="The release.version property must be defined in order to build a release." /> <fail if="${not property::exists('release.type')}" message="The release.type property must be defined in order to build a release." /> <delete dir="${release.path}" failonerror="false" /> <mkdir dir="${release.path}" /> </target> <target name="archive-release"> <zip zipfile="${release.path}.zip"> <fileset basedir="${release.dir}"> <include name="${release.name}/**" /> </fileset> </zip> </target> <target name="release-exe" depends="build-as-exe"> <property name="release.type" value="exe" /> <call target="prepare-release" /> <copy todir="${release.path}"> <fileset refid="executable.release.files" /> </copy> <copy todir="${release.path}"> <fileset refid="executable.release.build.files" /> </copy> <call target="archive-release" /> </target> <target name="release-src" depends="build"> <property name="release.type" value="src" /> <call target="prepare-release" /> <copy todir="${release.path}"> <fileset refid="source.release.files" /> </copy> <call target="archive-release" /> </target> <target name="release" depends="release-src, release-exe" /> </project> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/INSTALL����������������������������������������������������������������������������������0000644�0001750�0001750�00000022432�10447624466�013211� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Here is a another example: /bin/bash ./configure CONFIG_SHELL=/bin/bash Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent configuration-related scripts to be executed by `/bin/bash'. `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sublib-0.9/install-sh�������������������������������������������������������������������������������0000755�0001750�0001750�00000031600�10621211747�014145� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh # install - install a program, script, or datafile scriptversion=2006-10-14.15 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" posix_glob= posix_mkdir= # Desired mode of installed file. mode=0755 chmodcmd=$chmodprog chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit $?;; -m) mode=$2 shift shift case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac done if test $# -ne 0 && test -z "$dir_arg$dstarg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix=/ ;; -*) prefix=./ ;; *) prefix= ;; esac case $posix_glob in '') if (set -f) 2>/dev/null; then posix_glob=true else posix_glob=false fi ;; esac oIFS=$IFS IFS=/ $posix_glob && set -f set fnord $dstdir shift $posix_glob && set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dst"; then $doit $rmcmd -f "$dst" 2>/dev/null \ || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } } || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: ��������������������������������������������������������������������������������������������������������������������������������sublib-0.9/CREDITS����������������������������������������������������������������������������������0000644�0001750�0001750�00000000141�11000453207�013144� 0����������������������������������������������������������������������������������������������������ustar �meebey��������������������������meebey�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SubLib ==================== http://sublib.sf.net Contributors ============ Fernando Zorrilla �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������