Subversion Repositories wimsdev

Rev

Rev 12884 | Rev 13766 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 12884 Rev 13757
Line 793... Line 793...
793
char *bufprep(char *p)
793
char *bufprep(char *p)
794
{
794
{
795
/*  singlespace(p); strip_trailing_spaces(p); return find_word_start(p); */
795
/*  singlespace(p); strip_trailing_spaces(p); return find_word_start(p); */
796
  nospace(p); return p;
796
  nospace(p); return p;
797
}
797
}
-
 
798
 
-
 
799
char *htmlsymbs[][2]={
-
 
800
  {"",""},
-
 
801
  {"à","à"},
-
 
802
  {"À","À"},
-
 
803
  {"á","á"},
-
 
804
  {"Á","Á"},
-
 
805
  {"â","â"},
-
 
806
  {"Â","Â"},
-
 
807
  {"ã","ã"},
-
 
808
  {"Ã","Ã"},
-
 
809
  {"ä","ä"},
-
 
810
  {"Ä","Ä"},
-
 
811
  {"å","å"},
-
 
812
  {"Å","Å"},
-
 
813
  {"æ","æ"},
-
 
814
  {"Æ","Æ"},
-
 
815
  {"è","è"},
-
 
816
  {"È","È"},
-
 
817
  {"é","é"},
-
 
818
  {"É","É"},
-
 
819
  {"ê","ê"},
-
 
820
  {"Ê","Ê"},
-
 
821
  {"ë","ë"},
-
 
822
  {"Ë","Ë"},
-
 
823
  {"ì","ì"},
-
 
824
  {"Ì","Ì"},
-
 
825
  {"í","í"},
-
 
826
  {"Í","Í"},
-
 
827
  {"î","î"},
-
 
828
  {"Î","Î"},
-
 
829
  {"ï","ï"},
-
 
830
  {"Ï","Ï"},
-
 
831
  {"ò","ò"},
-
 
832
  {"Ò","Ò"},
-
 
833
  {"ó","ó"},
-
 
834
  {"Ó","Ó"},
-
 
835
  {"ô","ô"},
-
 
836
  {"Ô","Ô"},
-
 
837
  {"õ","õ"},
-
 
838
  {"Õ","Õ"},
-
 
839
  {"ö","ö"},
-
 
840
  {"Ö","Ö"},
-
 
841
  {"ø","ø"},
-
 
842
  {"Ø","Ø"},
-
 
843
  {"ù","ù"},
-
 
844
  {"Ù","Ù"},
-
 
845
  {"ú","ú"},
-
 
846
  {"Ú","Ú"},
-
 
847
  {"û","û"},
-
 
848
  {"Û","Û"},
-
 
849
  {"ü","ü"},
-
 
850
  {"Ü","Ü"},
-
 
851
  {"ñ","ñ"},
-
 
852
  {"Ñ","Ñ"},
-
 
853
  {"ç","ç"},
-
 
854
  {"Ç","Ç"},
-
 
855
  {"ý","ý"},
-
 
856
  {"Ý","Ý"},
-
 
857
  {"ß","ß"},
-
 
858
  {"«","«"},
-
 
859
  {"»","»"},
-
 
860
  {"&","&"},
-
 
861
  {"&lt;","<"},
-
 
862
  {"&gt;","<"},
-
 
863
  {"&quot;","\""},
-
 
864
  {"&para;","§"},
-
 
865
  {"&copy;","©"},
-
 
866
  {"&nbsp;"," "},
-
 
867
  {"&euro;","euro"},
-
 
868
  {"&#44;",","},
-
 
869
  {"&#59;",";"},
-
 
870
};
-
 
871
 
-
 
872
#define thesymbs_no (sizeof(htmlsymbs)/sizeof(htmlsymbs[0]) - 1)
-
 
873
 
-
 
874
int htmltrans[6*thesymbs_no][256]; /* 6 is the maximum length of a html symbol stripped of & and ; */
-
 
875
 
-
 
876
void inithtmltrans()
-
 
877
{
-
 
878
  int i, ns, st, nbstates = thesymbs_no;
-
 
879
  for (i = 1; i <= thesymbs_no; i++)
-
 
880
    {
-
 
881
      st = 0;
-
 
882
      unsigned char *p = (unsigned char *)(htmlsymbs[i][0] + 1);
-
 
883
      while (*p != ';')
-
 
884
        {
-
 
885
          ns = htmltrans[st][*p];
-
 
886
          if (ns == 0) ns = (p[1]==';') ? i : -(++nbstates);
-
 
887
          htmltrans[st][*p] = ns;
-
 
888
          st = abs(ns);
-
 
889
          p++;
-
 
890
        }
-
 
891
    }
-
 
892
  /*  printf("%d etats.\n", nbstates); */
-
 
893
}
-
 
894