home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / gnat-2.06-src.tgz / tar.out / fsf / gnat / ada / widechar.ads < prev    next >
Text File  |  1996-09-28  |  4KB  |  70 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT COMPILER COMPONENTS                         --
  4. --                                                                          --
  5. --                             W I D E C H A R                              --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.7 $                              --
  10. --                                                                          --
  11. --        Copyright (c) 1992,1993,1994,1995 NYU, All Rights Reserved        --
  12. --                                                                          --
  13. -- The GNAT library is free software; you can redistribute it and/or modify --
  14. -- it under terms of the GNU Library General Public License as published by --
  15. -- the Free Software  Foundation; either version 2, or (at your option) any --
  16. -- later version.  The GNAT library is distributed in the hope that it will --
  17. -- be useful, but WITHOUT ANY WARRANTY;  without even  the implied warranty --
  18. -- of MERCHANTABILITY  or  FITNESS FOR  A PARTICULAR PURPOSE.  See the  GNU --
  19. -- Library  General  Public  License for  more  details.  You  should  have --
  20. -- received  a copy of the GNU  Library  General Public License  along with --
  21. -- the GNAT library;  see the file  COPYING.LIB.  If not, write to the Free --
  22. -- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.        --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. --  Subprograms for manipulation of wide character sequences
  27.  
  28. with Types; use Types;
  29.  
  30. package Widechar is
  31.  
  32.    function Length_Wide return Nat;
  33.    --  Returns the maximum length in characters for the escape sequence that
  34.    --  is used to encode wide character literals outside the ASCII range. Used
  35.    --  only in the implementation of the attribute Width for Wide_Character.
  36.  
  37.    procedure Scan_Wide
  38.      (S : Source_Buffer_Ptr;
  39.       P : in out Source_Ptr;
  40.       C : out Char_Code;
  41.       E : out Boolean);
  42.    --  On entry S (P) points to an ESC character that starts a wide character
  43.    --  escape sequence or for conventions using the upper bit, to an upper
  44.    --  half character starting a wide character sequence. A single wide
  45.    --  character is scanned. If no error is found, the value stored in C is
  46.    --  the code for this wide character, P is updated past the sequence and
  47.    --  E is set to False. If an error is found, then P points to the improper
  48.    --  character, C is undefined, and E is set to True.
  49.  
  50.    procedure Set_Wide
  51.      (C : Char_Code;
  52.       S : in out String;
  53.       P : in out Natural);
  54.    --  The escape sequence (including any leading ESC character) for the
  55.    --  given character code is stored starting at S (P + 1), and on return
  56.    --  P points to the last stored character (i.e. P is the count of stored
  57.    --  characters on entry and exit, and the escape sequence is appended to
  58.    --  the end of the stored string). The character code C represents a code
  59.    --  originally constructed by Scan_Wide, so it is known to be in a range
  60.    --  that is appropriate for the encoding method in use.
  61.  
  62.    procedure Skip_Wide (S : String; P : in out Natural);
  63.    --  On entry, S (P) points to an ESC character for a wide character escape
  64.    --  sequence or to an upper half character if the encoding method uses the
  65.    --  upper bit. On exit, P is bumped past the wide character sequence. No
  66.    --  error checking is done, since this is only used on escape sequences
  67.    --  generated by Set_Wide, which are known to be correct.
  68.  
  69. end Widechar;
  70.