[1874] | 1 | /* |
---|
| 2 | * $Header$ |
---|
| 3 | * $Locker$ |
---|
| 4 | |
---|
| 5 | Copyright (c) 2010-2012, Rogue Wave Software, Inc. |
---|
| 6 | |
---|
| 7 | Permission is hereby granted, free of charge, to any person obtaining a copy |
---|
| 8 | of the tv_data_display.h and tv_data_display.c files (the "Software"), to deal |
---|
| 9 | in the Software without restriction, including without limitation the rights |
---|
| 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies |
---|
| 11 | of the Software, and to permit persons to whom the Software is furnished to do |
---|
| 12 | so, subject to the following conditions: |
---|
| 13 | |
---|
| 14 | The above copyright notice and this permission notice shall be included in all |
---|
| 15 | copies or substantial portions of the Software. |
---|
| 16 | |
---|
| 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, |
---|
| 18 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A |
---|
| 19 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
---|
| 20 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
---|
| 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
---|
| 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
---|
| 23 | |
---|
| 24 | * Update log |
---|
| 25 | * |
---|
| 26 | * Feb 1 2012 NYP: Updated Copyright |
---|
| 27 | * Sep 27 2010 ANB: reworked as part of totalview/12314 |
---|
| 28 | * Jun 17 2010 JVD: Added TV_elide_row. |
---|
| 29 | * Sep 25 2009 SJT: Add idempotence header. |
---|
| 30 | * Jul 1 2009 SJT: Created. |
---|
| 31 | * |
---|
| 32 | */ |
---|
| 33 | |
---|
| 34 | #ifndef TV_DATA_DISPLAY_H_INCLUDED |
---|
| 35 | #define TV_DATA_DISPLAY_H_INCLUDED 1 |
---|
| 36 | |
---|
| 37 | #define TV_TTF_DATA_DISPLAY_API_VERSION 1 |
---|
| 38 | |
---|
| 39 | #ifdef __cplusplus |
---|
| 40 | extern "C" { |
---|
| 41 | #endif |
---|
| 42 | |
---|
| 43 | /* TV_ttf_display_type should return one of these values */ |
---|
| 44 | enum TV_ttf_format_result |
---|
| 45 | { |
---|
| 46 | TV_ttf_format_ok, /* Type is known, and successfully converted */ |
---|
| 47 | TV_ttf_format_ok_elide, /* as TV_ttf_format_ok, but elide type */ |
---|
| 48 | TV_ttf_format_failed, /* Type is known, but could not convert it */ |
---|
| 49 | TV_ttf_format_raw, /* Just display it as a regular type for now */ |
---|
| 50 | TV_ttf_format_never /* Don't know about this type, and please don't ask again */ |
---|
| 51 | }; |
---|
| 52 | typedef enum TV_ttf_format_result TV_ttf_format_result; |
---|
| 53 | |
---|
| 54 | /* TV_ttf_add_row returns one of these values */ |
---|
| 55 | enum TV_ttf_error_codes |
---|
| 56 | { |
---|
| 57 | TV_ttf_ec_ok = 0, /* operation succeeded */ |
---|
| 58 | TV_ttf_ec_not_active, |
---|
| 59 | TV_ttf_ec_invalid_characters, |
---|
| 60 | TV_ttf_ec_buffer_exhausted |
---|
| 61 | }; |
---|
| 62 | typedef enum TV_ttf_error_codes TV_ttf_error_codes; |
---|
| 63 | |
---|
| 64 | #define TV_ttf_type_ascii_string "$string" |
---|
| 65 | #define TV_ttf_type_int "$int" |
---|
| 66 | #if 0 |
---|
| 67 | #define TV_elide_row "" /* field_name to use when row elision is desired */ |
---|
| 68 | #endif |
---|
| 69 | |
---|
| 70 | /* returns logical true (non-zero) if the TV_ttf_format_result fr represents |
---|
| 71 | a format result that indicates success |
---|
| 72 | */ |
---|
| 73 | extern int TV_ttf_is_format_result_ok ( TV_ttf_format_result fr ); |
---|
| 74 | |
---|
| 75 | /* |
---|
| 76 | TV_ttf_ec_ok: Success |
---|
| 77 | TV_ttf_ec_not_active: Called with no active callback to |
---|
| 78 | TV_ttf_display_type |
---|
| 79 | TV_ttf_ec_invalid_characters: field_name or type_name has illegal characters |
---|
| 80 | TV_ttf_ec_buffer_exhausted: No more room left for display data |
---|
| 81 | */ |
---|
| 82 | extern int TV_ttf_add_row(const char *field_name, |
---|
| 83 | const char *type_name, |
---|
| 84 | const void *value); |
---|
| 85 | |
---|
| 86 | |
---|
| 87 | #ifdef __cplusplus |
---|
| 88 | } |
---|
| 89 | #endif |
---|
| 90 | |
---|
| 91 | #endif |
---|