📄 intf
字号:
objects in process memory remain there, and proto objects withoutallocated memory will have process storage created..sp.PPsdsP = sds_protoize(sdsH);.sp.IPMoves a dataset to the prototype state so that the dataset stucture may bechanged. Attempts to obtain object addresses from sdsP or sdsH are nowinvalid. It cannot be assumed that objects whose addresses were found fromthe generating sdsH before protisation (yuk) will remain in these locationsafter further dataset manipulation. .sp.PPsdsH = sds_duplicate(sdsH, storeH);.sp.IPDuplicates the dataset sdsH to new storage..sp.PPsdsH = sds_deep_duplicate(sdsH, storeH);.sp.IPDuplicates the dataset sdsH to new storage, including all 'disjoint'objects..sp.PPint call_succeeded = sds_discard_all(sdsH);.sp.IPDiscard all system descriptive information about a dataset..sp.PPint call_succeeded = sds_destroy_all(sdsH);.sp.IPDiscard all system descriptive information about a dataset and theobjects in it, having first free'd any Sds-system allocated memoryin the objects..sp.PP.ce 1.I Creation of type_descriptor:.sp.PPtypeH = sds_make_th(struct typelist *tl);.sp.ce 1.I Creation of storage_descriptor:.sp.PPstoreH = sds_make_sh(struct storeage *st);.sp.IP.ce 1.I Calls to an object:.sp.PPobjectH = sds_new_object(th,int number,char *names[]);.brint call_succeeded = sds_oh_instantiations(objectH, storeH[], char *instatiation_names[]);.brint call_succeeded = sds_oh_struct_storage(objectH, storeH[], char *name = NULL);.sp.PPoh = sds_copy(storeH, objectI, pointer = NULL);.sp.IPHaving open'd the dataset, you may now *copy* some or all ofthe objects (including architecture conversion if necessary).Space will be allocated unless 'pointer' has a non-null value, inwhich case data will be loaded starting at the pointer position:caveat programmer..sp.PPobjectH = sds_ohfromindex(sdsH, objectI);objectH = sds_ohfromname(sdsH, name);.sp .IPFind the appropriate object handle from the index or name of an objectwithin a dataset..sp.PPobjectH = sds_ohlikename(sdsH, part_name,int occurrence);.sp.IPFind the occurence'th instance of an object within a dataset whose namecontains 'part_name' as a substring..sp.PPvoid *ohptr = sds_ohptr(objectH);.sp.IPFind the pointer to the data acessed through objectH..brNote: this call will give an.I SDS_FATALerror if the objectH was found by querying a proto-dataset: defaultbehaviour is to print out the error stack and stop..sp.PPchar *ohname = sds_ohname(objectH);.sp.IPFind the name of the data acessed through objectH..sp.PPint multiplicity = sds_ohmult(objectH);.sp.IPFind the multiplicity of the data acessed through objectH - ie how many ofeach element - the array size..sp.PPint sizeof = sds_ohsizeof(objectH);.sp.IPFind the size in bytes of one element of an object.The size could be undetermined; sds_error is then set toSDS_SIZE_UNDETERMINED and the error level set to SDS_WARNING;the size returned is 0..sp.PPint sizeof = sds_thsizeof(th);.sp.IPFind the size in bytes of the data structure accessed by the type_handle. The size could be undetermined; sds_error is then set toSDS_SIZE_UNDETERMINED and the error level set to SDS_WARNING;the size returned is 0..sp.PPint call_succeeded = sds_ohtstamp(int tstamp);.sp.IPSets the time stamp of an object..sp.PPint tstamp = sds_get_ohtstamp(objectH);.sp.IPReturns the time stamp of an object..sp.PPint call_succeeded = sds_discard(objectH);.sp.IPDiscard all system descriptive information about an object..sp.PPint call_succeeded = sds_destroy(objectH);.sp.IPFree any Sds-system allocated memory in the object, then sds_discard()all system information..sp.PP.ce 1.I Object analysis:.sp.PPint descriptor_handle = sds_desc_handle(objectH);.sp.IPGet a handle to refer to subsequent analysis calls on an object..sp.PPThere are two main types of object analysis: linear and hierarchical.In each case repeated calls to the analysis routines return informationabout the analysed objects. In linear analysis, a sequence of statementsabout the primitive elements that make up the object is made - eg 10floats, 23 int, 120 char, 10 floats, 23 int, 120 char......This is effected by sequential calls to.spint level = sds_linear(descH, struct level_description **ld.sp);.spIn hierarchical elements, a series of index numbers refering to an arrayof descriptor structures is returned from.spint level = sds_hierarch(descH, struct level_description **ld);.speach of which give:.IPThe start address of the field.brIts name.brIts type_code.brThe number of elements in the array (or 1)..brIts size in bytes..sp.IPWhen no more fields remain for analysis, 0 is returned and the warning SDS_DONE_ANALYSIS is set..sp.PPint call_succeeded = sds_close_dh(descH);.sp.IPClean up all system stuff created for an analysis. Use of descH before itis reallocated with sds_desc_handle() will cause an error; howeversds_close_dh() is called automatically when an analysis sequence is runcompletion. Re-closing an already closed descH has no effect..sp.PPint level = sds_find_level(descH, field_name, struct level_description **ld);.sp.IPMakes calls to sds_hierarch() until a match is made to the field namedfield_name..sp.ce 1.I Creation of record_handle:.sprecordH = sds_begin_record(char *name);.spsds_record_entry(recordH, handle, int number, void *ptr, char *name);.spsds_begin_sub_record(rh, name).spsds_end_sub_record(rh).spsds_end_and_declare(recordH, sdsH);.spsds_destroy_record_def(recordH, int destroy_object);.spsds_print_record_def(recordH);.ce 1.I Error handling..sp.I Level 1.sp.PPvoid sds_stop_if_error(char *comment);.sp.IPReally crude. If there has been an Sds error, it prints out the error stackand does exit(1); otherwise it is quiet..sp.PPint level = sds_push_error(int errcode, int errlevel, char *errstring);.sp.IPPush a new error onto the stack. We assume that errstring is zeroterminated, and check to see if it is NULL. Returns the 'level' ofthe error in the stack. Filename and line information is added by thepreprocessor from the defines __LINE__ and __FILE__..sp.PP int error_code = sds_last_error();.sp .IPReturns the last sds_error, which is 0 if no problems found..sp.PP int error_code = sds_last_warning();.sp .IPReturns the last sds_error at SDS_WARNING level, which is 0 if no problems found..sp.PP void sds_perror(char *comment);.sp .IPPrint out the top level comment, any filled parts of the error stack,and the last operating system error if there was one..sp.PP.sp.I Level 2:.sp.PPvoid sds_output_proginfo(int truefalse);.sp.IPDefault 0 == Do not print out line and file information..sp.PPvoid sds_exit_on_fatal(int truefalse);.sp.IPDefault 1 == An SDS_FATAL error causes exit(truefalse & 0xff);.sp.PPvoid sds_output_errors(int level);.sp.IPDefault 0 == Do not output errors as they are registered; this is whenyou want to wait for a final catastrophe and then use sds_perror(), orwhen you may be able to take corrective action; in most programssds_output_errors(SDS_FATAL) will be appropriate..sp.PPsds_clear_errors();.sp.IPStart with a clean slate..sp.PPint error_code = sds_pop_error(int errlevel, char *errstring);.sp.PPvoid printoutprog(int i);.sp.IPPrint out program info for the i'th entry on the stack .sp.PPvoid printout(int i);.sp.IPPrint out the i'th entry on the stack .sp.IPCurrently, error levels are:.spSDS_WARNING.brSDS_ERROR.brSDS_FATAL.br
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -