1 06/25/81  add_char_offset_
 2 
 3 
 4 Entry points in add_char_offset_:
 5    (List is generated by the help command)
 6 
 7 
 8 :Entry: add_char_offset_: 05/11/81  add_char_offset_
 9 
10 Function: returns a pointer to a character relative to the character
11 referenced by the input pointer.  The displacement to the desired
12 character may be positive, negative, or zero.
13 
14 
15 Syntax:
16 dcl add_char_offset_ entry (ptr, fixed bin (21)) returns (ptr)
17      reducible;
18 new_pointer_value = add_char_offset_ (pointer_value,
19      char_displacement);
20 
21 
22 Arguments:
23 pointer_value
24    is the original pointer to which the character displacement is
25    applied.  (Input)
26 char_displacement
27    is the displacement in characters to be applied to the above
28    pointer.  (Input)
29 new_pointer_value
30    is the result of this operation.  (Output)
31 
32 
33 Notes:  If the pointer supplied to add_char_offset_ does not point to a
34 character boundary, this operation is applied to a pointer value which
35 references the character containing the bit located by the input
36 pointer.
37 
38 Thus, the program fragment
39      a_ptr = add_char_offset_ (a_ptr, 0);
40 may be used to insure that "a_ptr" points to a character boundary.
41 
42 If the result of applying the displacement would cause the pointer to
43 reference outside the legal boundaries of a segment (either a negative
44 offset or an offset beyond 256K words), the result of the call
45 is not defined.
46 
47 
48 Examples:
49 The program fragment
50 
51      current_char_ptr = add_char_offset (current_char_ptr, -1);
52 
53 changes the value of current_char_ptr to locate the previous character
54 in the segment.