cvsuser     04/11/05 10:01:50

  Modified:    charset  Tag: pluggable_encodings ascii.c binary.c
                        iso-8859-1.c
               encodings Tag: pluggable_encodings fixed_8.c
               src      Tag: pluggable_encodings string.c
  Log:
  Introduce some (temporary!) globals
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.1   +8 -2      parrot/charset/ascii.c
  
  Index: ascii.c
  ===================================================================
  RCS file: /cvs/public/parrot/charset/ascii.c,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- ascii.c   3 Nov 2004 23:43:05 -0000       1.3
  +++ ascii.c   5 Nov 2004 18:01:48 -0000       1.3.2.1
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2004 The Perl Foundation.  All Rights Reserved.
  -$Id: ascii.c,v 1.3 2004/11/03 23:43:05 dan Exp $
  +$Id: ascii.c,v 1.3.2.1 2004/11/05 18:01:48 dan Exp $
   
   =head1 NAME
   
  @@ -20,6 +20,9 @@
   /* The encoding we prefer, given a choice */
   static ENCODING *preferred_encoding;
   
  +extern ENCODING *Parrot_fixed_8_encoding_ptr;
  +CHARSET *Parrot_ascii_charset_ptr;
  +
   static STRING *get_graphemes(Interp *interpreter, STRING *source_string, UINTVAL 
offset, UINTVAL count) {
       return ENCODING_GET_BYTES(interpreter, source_string, offset, count);
   }
  @@ -244,9 +247,12 @@
         find_word_boundary
     };
   
  -  preferred_encoding = Parrot_load_encoding(interpreter, "fixed_8");
  +  /* Snag the global. This is... bad. Should be properly fixed at some
  +     point */
  +  preferred_encoding = Parrot_fixed_8_encoding_ptr;
     
     memcpy(return_set, &base_set, sizeof(CHARSET));
  +  Parrot_ascii_charset_ptr = return_set;
     return return_set;
     
   }
  
  
  
  1.4.2.1   +8 -2      parrot/charset/binary.c
  
  Index: binary.c
  ===================================================================
  RCS file: /cvs/public/parrot/charset/binary.c,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- binary.c  3 Nov 2004 21:44:37 -0000       1.4
  +++ binary.c  5 Nov 2004 18:01:48 -0000       1.4.2.1
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2004 The Perl Foundation.  All Rights Reserved.
  -$Id: binary.c,v 1.4 2004/11/03 21:44:37 dan Exp $
  +$Id: binary.c,v 1.4.2.1 2004/11/05 18:01:48 dan Exp $
   
   =head1 NAME
   
  @@ -20,6 +20,9 @@
   /* The encoding we prefer, given a choice */
   static ENCODING *preferred_encoding;
   
  +extern ENCODING *Parrot_fixed_8_encoding_ptr;
  +CHARSET *Parrot_binary_charset_ptr;
  +
   static STRING *get_graphemes(Interp *interpreter, STRING *source_string, UINTVAL 
offset, UINTVAL count) {
       return ENCODING_GET_BYTES(interpreter, source_string, offset, count);
   }
  @@ -196,9 +199,12 @@
         find_word_boundary
     };
   
  -  preferred_encoding = Parrot_load_encoding(interpreter, "fixed_8");
  +  /* Snag the global. This is... bad. Should be properly fixed at some
  +     point */
  +  preferred_encoding = Parrot_fixed_8_encoding_ptr;
     
     memcpy(return_set, &base_set, sizeof(CHARSET));
  +  Parrot_binary_charset_ptr = return_set;
     return return_set;
     
   }
  
  
  
  1.1.2.1   +10 -3     parrot/charset/iso-8859-1.c
  
  Index: iso-8859-1.c
  ===================================================================
  RCS file: /cvs/public/parrot/charset/iso-8859-1.c,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- iso-8859-1.c      3 Nov 2004 23:43:05 -0000       1.1
  +++ iso-8859-1.c      5 Nov 2004 18:01:48 -0000       1.1.2.1
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2004 The Perl Foundation.  All Rights Reserved.
  -$Id: iso-8859-1.c,v 1.1 2004/11/03 23:43:05 dan Exp $
  +$Id: iso-8859-1.c,v 1.1.2.1 2004/11/05 18:01:48 dan Exp $
   
   =head1 NAME
   
  @@ -20,6 +20,10 @@
   /* The encoding we prefer, given a choice */
   static ENCODING *preferred_encoding;
   
  +extern ENCODING *Parrot_fixed_8_encoding_ptr;
  +
  +CHARSET *Parrot_iso_8859_1_charset_ptr;
  +
   static STRING *get_graphemes(Interp *interpreter, STRING *source_string, UINTVAL 
offset, UINTVAL count) {
       return ENCODING_GET_BYTES(interpreter, source_string, offset, count);
   }
  @@ -244,9 +248,12 @@
         find_word_boundary
     };
   
  -  preferred_encoding = Parrot_load_encoding(interpreter, "fixed_8");
  -  
  +  /* Snag the global. This is... bad. Should be properly fixed at some
  +     point */
  +  preferred_encoding = Parrot_fixed_8_encoding_ptr;
  +
     memcpy(return_set, &base_set, sizeof(CHARSET));
  +  Parrot_iso_8859_1_charset_ptr = return_set;
     return return_set;
     
   }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.1   +5 -1      parrot/encodings/fixed_8.c
  
  Index: fixed_8.c
  ===================================================================
  RCS file: /cvs/public/parrot/encodings/fixed_8.c,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- fixed_8.c 4 Nov 2004 18:01:28 -0000       1.4
  +++ fixed_8.c 5 Nov 2004 18:01:49 -0000       1.4.2.1
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2004 The Perl Foundation.  All Rights Reserved.
  -$Id: fixed_8.c,v 1.4 2004/11/04 18:01:28 dan Exp $
  +$Id: fixed_8.c,v 1.4.2.1 2004/11/05 18:01:49 dan Exp $
   
   =head1 NAME
   
  @@ -17,6 +17,9 @@
   #include "parrot/parrot.h"
   #include "fixed_8.h"
   
  +/* Evil global variable. This is a short-term hack for now */
  +ENCODING *Parrot_fixed_8_encoding_ptr;
  +
   /* This function needs to go through and get all the code points one
      by one and turn them into a byte */
   static void to_encoding(Interp *interpreter, STRING *source_string) {
  @@ -103,6 +106,7 @@
         bytes
     };
     memcpy(return_encoding, &base_encoding, sizeof(ENCODING));
  +  Parrot_fixed_8_encoding_ptr = return_encoding;
     return return_encoding;
   }
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.229.2.1 +10 -1     parrot/src/string.c
  
  Index: string.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/string.c,v
  retrieving revision 1.229
  retrieving revision 1.229.2.1
  diff -u -r1.229 -r1.229.2.1
  --- string.c  3 Nov 2004 21:44:39 -0000       1.229
  +++ string.c  5 Nov 2004 18:01:50 -0000       1.229.2.1
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: string.c,v 1.229 2004/11/03 21:44:39 dan Exp $
  +$Id: string.c,v 1.229.2.1 2004/11/05 18:01:50 dan Exp $
   
   =head1 NAME
   
  @@ -45,8 +45,17 @@
   static parrot_string_representation_t _string_smallest_representation(
       Interp *interpreter, STRING *s);
   
  +/* Evil externs for globals which need fixing. Should be turned to
  +static and loaded by an initialization routine at some point */
  +extern CHARSET *Parrot_binary_charset_ptr;
  +extern CHARSET *Parrot_ascii_charset_ptr;
  +extern CHARSET *Parrot_iso_8859_1_charset_ptr;
  +extern ENCODING *Parrot_fixed_8_encoding_ptr;
  +
  +
   /*
   
  +
   =head2 String COW support
   
   =over 4
  
  
  

Reply via email to