UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ReportTools.h
1 /* ReportTools.h */
2 /* ReportTools.h,v 1.3 1998/06/09 09:19:13 vlad Exp */
3 #ifndef __ReportTools_h
4 #define __ReportTools_h
5 
6 /***********************************************************************
7  *
8  * Tools for reports building.
9  *
10  ***********************************************************************/
11 
12 #include <mix/Types.h>
13 #include <mix/misc.h>
14 #include <ldb/dbnamedefs.h>
15 
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif /* __cplusplus */
20 
21 
22 #define RtOverwidthChar '#'
23 #define RtBadNumberChar '?'
24 #define RtShieldChar '~'
25 #define RtDefBadNumberLen 3
26 #define RtDefaultQuotes {'\"', '\"'}
27 #define RtDefaultFillChar ' '
28 #define RtDefaultDelimiter ","
29 
30 
31 /* Parameters for one field */
32 typedef struct
33  {
34  int flags; /* ORed flags: */
35 #define RtAF_PutDelimiter (1<<0) /* use delimiter or not */
36 #define RtAF_FillWidth (1<<1) /* is width a limit? */
37 #define RtAF_AdjustRight (1<<2) /* adjust to right side */
38  /* (with RtAF_FillWidth only) */
39 #define RtAF_PutQuotes (1<<3) /* use quotes for string and dbtptr */
40  /* or not? */
41  int width; /* limited width for field value */
42  char *delimiter; /* delimiter for field */
43  char quotes[2]; /* for string and dbtptr */
44  char fill_char; /* char for filling to width */
45  char *overwidth; /* overwidth string for field */
46 
47  } RtAtomField;
48 
49 
50 /* Return maximum length (in chars) of pure text representation of
51  pointed atom type. */
52 int RtMaxChars (AtomType atype);
53 
54 /* Return normal (usual) length (in chars) of pure text representation
55  of pointed atom type. */
56 int RtNormChars (AtomType atype);
57 
58 /* Return width of atom field with delimiter. */
59 int RtFieldLength (const RtAtomField* afpar);
60 
61 /* Return width of atom field with delimiter. */
62 const char* RtFlagsToString (int flags);
63 
64 
65 
66 /* Printing to dest string of chars. It's assumed that dest has
67  enough memory to take all printed chars */
68 char* RtFormatString (char* dest, const RtAtomField* afpar,
69  const char* str);
70 
71 /* Printing to dest name of db table. It's assumed that dest has
72  enough memory to take all printed chars */
73 char* RtFormatDbtName (char* dest, const RtAtomField* afpar,
74  const dbNameStruct* ns);
75 
76 /* Printing double number in dest, assuming that dest can hold all chars
77  that will be put. */
78 char* RtFormatRealNum (char* dest, const RtAtomField* afpar,
79  double num);
80 
81 /* Printing integer number in dest, assuming that dest can hold all
82  chars that will be put. */
83 char* RtFormatIntNum (char* dest, const RtAtomField* afpar,
84  int num);
85 
86 /* Printing 64-bit integer number in dest, assuming that dest can hold
87  all chars that will be put. */
88 char* RtFormatInt8Num (char* dest, const RtAtomField* afpar,
89  long long num);
90 
91 
92 #ifdef __cplusplus
93 };
94 #endif /* __cplusplus */
95 
96 #endif /* ReportTools.h */
Definition: ReportTools.h:32
Definition: dbnamedefs.h:67