Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 15 additions & 18 deletions include/dbidef.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,21 @@
Item list codes for TreeGetDbi
**********************************/

#define DbiEND_OF_LIST 0 /* End of list */
#define DbiNAME 1 /* Experiment name used for open - text string */
#define DbiSHOTID 2 /* Shot identification - longword */
#define DbiMODIFIED \
3 /* True if tree has been modified during edit - boolean \
*/
#define DbiOPEN_FOR_EDIT 4 /* True if tree is open for edit - boolean */
#define DbiINDEX \
5 /* Index of tree to use for subsequent information requests */
#define DbiNUMBER_OPENED 6 /* Number of trees currently open */
#define DbiMAX_OPEN 7 /* Maximum number of tree allowed open at one time */
#define DbiDEFAULT 8 /* NID of default node */
#define DbiOPEN_READONLY 9 /* True if tree has been opened readonly */
#define DbiVERSIONS_IN_MODEL 10 /* True if using versioning in model */
#define DbiVERSIONS_IN_PULSE 11 /* True if using versioning in pulse files */
#define DbiREADONLY 12 /* True if making tree readonly */
#define DbiDISPATCH_TABLE 13 /* Tree dispatch table */

#define DbiEND_OF_LIST 0 /* End of list */
#define DbiNAME 1 /* Experiment name used for open - text string */
#define DbiSHOTID 2 /* Shot identification - longword */
#define DbiMODIFIED 3 /* True if tree has been modified during edit - boolean */
#define DbiOPEN_FOR_EDIT 4 /* True if tree is open for edit - boolean */
#define DbiINDEX 5 /* Index of tree to use for subsequent information requests */
#define DbiNUMBER_OPENED 6 /* Number of trees currently open */
#define DbiMAX_OPEN 7 /* Maximum number of tree allowed open at one time */
#define DbiDEFAULT 8 /* NID of default node */
#define DbiOPEN_READONLY 9 /* True if tree has been opened readonly */
#define DbiVERSIONS_IN_MODEL 10 /* True if using versioning in model */
#define DbiVERSIONS_IN_PULSE 11 /* True if using versioning in pulse files */
#define DbiREADONLY 12 /* True if making tree readonly */
#define DbiDISPATCH_TABLE 13 /* Tree dispatch table */
#define DbiALTERNATE_COMPRESSION 14 /* Set to true to enable extended compression methods */
Comment thread
WhoBrokeTheBuild marked this conversation as resolved.
typedef struct dbi_itm
{
short int buffer_length;
Expand Down
8 changes: 7 additions & 1 deletion treeshr/TreeGetDbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int TreeGetDbi(struct dbi_itm *itmlst)
}
#define set_ret_char(val) \
memset(lst->pointer, 0, (size_t)lst->buffer_length); \
*((char *)lst->pointer) = val
*((char *)lst->pointer) = val;
Comment thread
WhoBrokeTheBuild marked this conversation as resolved.
Outdated

int _TreeGetDbi(void *dbid, struct dbi_itm *itmlst)
{
Expand Down Expand Up @@ -96,6 +96,12 @@ int _TreeGetDbi(void *dbid, struct dbi_itm *itmlst)
set_ret_char(db->open_readonly);
break;

case DbiALTERNATE_COMPRESSION:

CheckOpen(db);
set_ret_char(db->alternate_compression);
break;

case DbiINDEX:

{
Expand Down
7 changes: 6 additions & 1 deletion treeshr/TreeGetNci.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,11 @@ int TreeGetNci(int nid_in, struct nci_itm *nci_itm)
break_on_no_node;
read_nci;
set_retlen(sizeof(nci.compression_method));
*(unsigned char *)itm->pointer = nci.compression_method;
if (dblist->tree_info->header->alternate_compression) {
*(unsigned char *)itm->pointer = nci.compression_method;
} else {
*(unsigned char *)itm->pointer = 0;
}
break;
case NciCLASS:
break_on_no_node;
Expand Down Expand Up @@ -697,6 +701,7 @@ int TreeGetNci(int nid_in, struct nci_itm *nci_itm)
{
break_on_no_node;
read_nci;
if (! dblist->tree_info->header->alternate_compression) nci.compression_method = 0;
if (nci.compression_method >= NUM_COMPRESSION_METHODS)
nci.compression_method = 0;
string = strdup(compression_methods[nci.compression_method].name);
Expand Down
7 changes: 7 additions & 0 deletions treeshr/TreeSetDbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ int _TreeSetDbi(void *dbid, DBI_ITM *dbi_itm_ptr)
(*(unsigned int *)itm_ptr->pointer) != 0;
dblist->modified = 1;
break;
case DbiALTERNATE_COMPRESSION:
NEED_EDIT
dblist->tree_info->header->alternate_compression =
(*(unsigned int *)itm_ptr->pointer) != 0;
dblist->modified = 1;
break;

default:
status = TreeILLEGAL_ITEM;
break;
Expand Down
14 changes: 4 additions & 10 deletions treeshr/treeshrp.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,21 +370,13 @@ typedef struct tag_info
typedef struct tree_header
{
char version; /* Version of tree file format */
#ifdef _AIX
Comment thread
WhoBrokeTheBuild marked this conversation as resolved.
unsigned sort_children : 1;
unsigned sort_members : 1;
unsigned versions_in_model : 1;
unsigned versions_in_pulse : 1;
unsigned readonly : 1;
unsigned : 3;
#else
unsigned char sort_children : 1; /* Sort children flag */
unsigned char sort_members : 1; /* Sort members flag */
unsigned char versions_in_model : 1;
unsigned char versions_in_pulse : 1;
unsigned char readonly : 1;
unsigned char : 3;
#endif
unsigned char alternate_compression : 1;
unsigned char : 2;
char fill1[6];
int free; /* First node in free node list (connected by PARENT/CHILD indexes
*/
Expand Down Expand Up @@ -640,6 +632,8 @@ typedef struct pino_database
unsigned modified : 1; /* Flag indicating tree structure modified */
unsigned setup_info : 1; /* Flag indicating setup info is being added */
unsigned remote : 1; /* Flag indicating tree is on remote system */
unsigned alternate_compression : 1;
unsigned char : 1;
Comment thread
WhoBrokeTheBuild marked this conversation as resolved.
Outdated
int stack_size;
timecontext_t timecontext;
int delete_list_vm;
Expand Down