Beispiel #1
0
void make_entry(KeyDataEntry *target,
                AttrType key_type, const void *key,
                nodetype ndtype, Datatype data,
                int *pentry_len)
{
  int keylen, datalen;
  
  fill_entry_key(&target->key, key, key_type, &keylen);

  // below we can't say "&target->data" because <data> field may actually
  // start before that location (recall that KeyDataEntry is simply 
  // a chunk of memory big enough to hold any legal <key,data> pair).
  fill_entry_data((char *) (((char *)target) + keylen),
                  data, ndtype,  
                  &datalen);                
  *pentry_len = keylen + datalen;
}
Beispiel #2
0
void make_entry(KeyDataEntry *target,
                AttrType key_type, const void *key,
                NodeType ndtype, Datatype data,
                int *pentry_len)
{
	int keylen, datalen;

	fill_entry_key(&target->key, key, key_type, &keylen);

	// below we can't say "&target->data" because <data> field may actually
	// start before that location (recall that KeyDataEntry is simply
	// a chunk of memory big enough to hold any legal <key,data> pair).
//	printf("keylen change???%d\n", keylen);
	fill_entry_data((char *) (((char *)target) + keylen),
			data, ndtype,
			&datalen);
//	printf("keylen change???%d\n", keylen);
//	fprintf(stdout, "print make entry: key[%d], data[%d] <%d>\n", 1,target->key.intkey, (int)((char*)target)[keylen], keylen);
	*pentry_len = keylen + datalen;
}