~ubuntu-branches/ubuntu/karmic/firebird2.1/karmic

« back to all changes in this revision

Viewing changes to src/qli/format.h

  • Committer: Bazaar Package Importer
  • Author(s): Damyan Ivanov
  • Date: 2008-05-26 23:59:25 UTC
  • Revision ID: james.westby@ubuntu.com-20080526235925-2pnqj6nxpppoeaer
Tags: upstream-2.1.0.17798-0.ds2
ImportĀ upstreamĀ versionĀ 2.1.0.17798-0.ds2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *      PROGRAM:        JRD Command Oriented Query Language
 
3
 *      MODULE:         format.h
 
4
 *      DESCRIPTION:    Print formatter definitions
 
5
 *
 
6
 * The contents of this file are subject to the Interbase Public
 
7
 * License Version 1.0 (the "License"); you may not use this file
 
8
 * except in compliance with the License. You may obtain a copy
 
9
 * of the License at http://www.Inprise.com/IPL.html
 
10
 *
 
11
 * Software distributed under the License is distributed on an
 
12
 * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
 
13
 * or implied. See the License for the specific language governing
 
14
 * rights and limitations under the License.
 
15
 *
 
16
 * The Original Code was created by Inprise Corporation
 
17
 * and its predecessors. Portions created by Inprise Corporation are
 
18
 * Copyright (C) Inprise Corporation.
 
19
 *
 
20
 * All Rights Reserved.
 
21
 * Contributor(s): ______________________________________.
 
22
 */
 
23
 
 
24
#ifndef QLI_FORMAT_H
 
25
#define QLI_FORMAT_H
 
26
 
 
27
// Logical column block 
 
28
 
 
29
typedef struct col {
 
30
    blk         col_header;
 
31
    col*        col_next;               // Next logical column 
 
32
    qli_nod*    col_expression; // Definitive expression 
 
33
    TEXT        *col_head;              // Column header 
 
34
    USHORT      col_column;             // Starting column number 
 
35
    USHORT      col_print_length;       // Max print length 
 
36
} *COL;
 
37
 
 
38
/* Picture string elements:
 
39
 
 
40
    A           any alpha character (interpreted as X)
 
41
    B           blank character
 
42
    CR          credit (sign)
 
43
    D           day of month (digit)
 
44
    DB          debit (sign)
 
45
    E           exponent
 
46
    G           exponent or decimal format, whichever is shorter
 
47
    H           hex digit
 
48
    J           day of year (digit)
 
49
    M           alpha month 
 
50
    N           month (numeric)
 
51
    P           AM/PM indicator for time
 
52
    T           time 
 
53
    W           weekday (character)
 
54
    X           any character
 
55
    Y           year (digit)
 
56
    Z           digit or leading suppressed digit (blank)
 
57
    9           digit
 
58
    $           fixed or floating insertion
 
59
    *           floating insertion
 
60
    ,           literal character or inserted
 
61
    .           decimal point
 
62
    +           sign (fixed or floating), always present
 
63
    -           sign (fixed or floating), suppressed on positive, or literal
 
64
    ?           separate between real and missing components of edit string
 
65
    "string"    any string
 
66
    (( ))       insert parenthesis if negative
 
67
    /           literal insertion
 
68
    %           literal insertion
 
69
    :           literal insertion
 
70
*/
 
71
 
 
72
typedef enum pic_t {
 
73
    pic_alpha = 1,
 
74
    pic_numeric,
 
75
    pic_date,
 
76
    pic_float,
 
77
    pic_text
 
78
} PIC_T;
 
79
 
 
80
// Picture string handling block 
 
81
 
 
82
struct pics {
 
83
    blk         pic_header;
 
84
    USHORT      pic_print_length;       // Print length of picture string 
 
85
    const TEXT* pic_string;             // Address of string 
 
86
    const TEXT* pic_pointer;            // Address of string 
 
87
    USHORT      pic_flags;              // Misc. trash 
 
88
    USHORT      pic_count;              // Count of repeat characters 
 
89
    TEXT        pic_character;          // Last significant character 
 
90
    PIC_T       pic_type;               // Type of edit 
 
91
    USHORT      pic_length;             /* Printing columns (MAX of edit_string & missing) */
 
92
    USHORT      pic_floats;             // Character of floating things 
 
93
    USHORT      pic_digits;             // Digits of number 
 
94
    USHORT      pic_hex_digits;         // Hexidecimal digits 
 
95
    USHORT      pic_fractions;          // Digits after decimal point 
 
96
    USHORT      pic_chars;              // Insertion characters (alpha) 
 
97
    USHORT      pic_literals;           // Literal insertion characters 
 
98
    USHORT      pic_days;               // Digits of day of month 
 
99
    USHORT      pic_weekdays;           // Characters of weekday 
 
100
    USHORT      pic_months;             // Characters of alpha month 
 
101
    USHORT      pic_nmonths;            // Digits of numeric month 
 
102
    USHORT      pic_years;              // Digits of year 
 
103
    USHORT      pic_julians;            // Digits of julian days 
 
104
    USHORT      pic_decimals;           /* Number of decimal points (?!) */
 
105
    USHORT      pic_brackets;           // Pairs of deficit brackets 
 
106
    USHORT      pic_exponents;          // Exponential indicators 
 
107
    USHORT      pic_float_digits;       // Floating digits 
 
108
    USHORT      pic_hours;              // hours 
 
109
    USHORT      pic_minutes;            // minutes 
 
110
    USHORT      pic_seconds;            // seconds 
 
111
    USHORT      pic_meridian;           // AM/PM indicator 
 
112
    pics*       pic_missing;            // missing value edit string 
 
113
};
 
114
 
 
115
// pic_flags
 
116
const USHORT PIC_suppress_blanks        = 1;    // Suppress leading blanks 
 
117
const USHORT PIC_literal                        = 2;    // We're in a quoted string 
 
118
const USHORT PIC_signed                         = 4;    // This numeric edit string has a sign indicator 
 
119
 
 
120
#endif // QLI_FORMAT_H
 
121