Doxygen Source Code Documentation
thd_notes.c File Reference
#include "mrilib.h"#include <sys/utsname.h>#include <sys/time.h>#include <time.h>#include <unistd.h>#include <stdlib.h>#include <ctype.h>#include <pwd.h>#include <stdarg.h>Go to the source code of this file.
Define Documentation
|
|
Definition at line 76 of file thd_notes.c. Referenced by tross_hostname(), and tross_username(). |
Function Documentation
|
||||||||||||
|
Add a note after the last current note ----------------------------------------------------------------------------- Definition at line 103 of file thd_notes.c. References THD_3dim_dataset::dblk, free, ATR_int::in, ISVALID_DSET, MAX_DSET_NOTES, THD_find_int_atr(), THD_set_int_atr(), THD_set_string_atr, tross_datetime(), and tross_Encode_String(). Referenced by main(), NOTES_add_CB(), RT_start_dataset(), and tross_Store_Note().
00104 {
00105 ATR_int *notecount;
00106 int num_notes;
00107 char note_name[20], *ch ;
00108
00109 if( !ISVALID_DSET(dset) || cn == NULL || cn[0] == '\0' ) return ;
00110
00111 notecount = THD_find_int_atr(dset->dblk, "NOTES_COUNT");
00112 if (notecount == NULL) {
00113 num_notes = 1;
00114 THD_set_int_atr(dset->dblk, "NOTES_COUNT", 1, &num_notes);
00115 } else {
00116 num_notes = notecount->in[0] + 1;
00117 if( num_notes > MAX_DSET_NOTES ){
00118 fprintf(stderr,"*** attempt to add too many notes to dataset!\n") ;
00119 return ;
00120 }
00121 notecount->in[0]++;
00122 }
00123
00124 sprintf(note_name, "NOTE_NUMBER_%03d", num_notes);
00125 ch = tross_Encode_String(cn) ; if( ch == NULL ) return ;
00126 THD_set_string_atr(dset->dblk, note_name, ch);
00127 free(ch) ;
00128
00129 ch = tross_datetime() ;
00130 sprintf(note_name, "NOTE_DATE_%03d", num_notes) ;
00131 THD_set_string_atr(dset->dblk, note_name, ch);
00132 free(ch);
00133
00134 return ;
00135 }
|
|
||||||||||||
|
Add the History in old_dset to that in new_dset [27 Feb 2003] ----------------------------------------------------------------------------- Definition at line 295 of file thd_notes.c. References free, ISVALID_DSET, tross_Append_History(), and tross_Get_History(). Referenced by main().
00296 {
00297 char *ch ;
00298
00299 if( !ISVALID_DSET(old_dset) || !ISVALID_DSET(new_dset) ) return ;
00300
00301 ch = tross_Get_History( old_dset ) ; if( ch == NULL ) return ;
00302 tross_Append_History( new_dset , ch ) ; free(ch) ; return ;
00303 }
|
|
||||||||||||
|
Append a string to the dataset history (create the history if need be). ----------------------------------------------------------------------------- Definition at line 325 of file thd_notes.c. References AFMALL, AFREALL, ATR_string::ch, THD_3dim_dataset::dblk, free, ISVALID_DSET, THD_find_string_atr(), THD_set_string_atr, tross_datetime(), tross_Encode_String(), tross_Expand_String(), tross_hostname(), and tross_username(). Referenced by AFNI_fimmer_execute(), AFNI_marks_action_CB(), AFNI_marks_transform_CB(), AFNI_refashion_dataset(), basis_write_iresp(), basis_write_sresp(), COPY_main(), DRAW_copy_dset(), DUP_main(), EDIT_main(), form_clusters(), IMREG_main(), main(), NUD_doall_CB(), output_ts_array(), POWER_main(), PRIC_main(), process_dataset(), REORDER_main(), RT_fim_recurse(), RT_start_dataset(), STAVG_main(), T3D_read_images(), T3D_save_file_CB(), THD_open_minc(), tross_Addto_History(), tross_Make_History(), tross_multi_Append_History(), VOLREG_main(), write_3dtime(), write_afni_data(), write_bucket(), write_bucket_data(), write_results(), and write_ts_array().
00326 {
00327 ATR_string * hist ;
00328 char * ch , * chold , * cdate , * cname , * cuser ;
00329 int idate , iname , iuser ;
00330
00331 if( !ISVALID_DSET(dset) || cn == NULL || cn[0] == '\0' ) return ;
00332
00333 hist = THD_find_string_atr(dset->dblk,"HISTORY_NOTE") ;
00334 cdate = tross_datetime() ; idate = strlen(cdate) ;
00335 cname = tross_hostname() ; iname = strlen(cname) ; /* 19 Sep 1999 */
00336 cuser = tross_username() ; iuser = strlen(cuser) ; /* 19 Sep 1999 */
00337
00338 /*- add to the history -*/
00339
00340 if( hist != NULL ){
00341
00342 chold = tross_Expand_String(hist->ch) ; if( chold == NULL ) return ;
00343 chold = AFREALL( chold, char,
00344 strlen(chold)+idate+iuser+iname+strlen(cn)+12 ) ;
00345
00346 strcat(chold,"\n") ;
00347 strcat(chold,"[") ; strcat(chold,cuser) ; strcat(chold,"@") ;
00348 strcat(chold,cname) ; strcat(chold,": ") ;
00349 strcat(chold,cdate) ;
00350 strcat(chold,"] ") ;
00351 strcat(chold,cn) ;
00352 ch = tross_Encode_String(chold) ; if( ch == NULL ){ free(chold); return; }
00353 THD_set_string_atr(dset->dblk, "HISTORY_NOTE", ch);
00354 free(ch) ; free(chold) ;
00355
00356 /*- create the history -*/
00357
00358 } else {
00359 chold = AFMALL(char, idate+iuser+iname+strlen(cn)+12 ) ;
00360 sprintf(chold,"[%s@%s: %s] %s",cuser,cname,cdate,cn) ;
00361 ch = tross_Encode_String(chold) ; if( ch == NULL ){ free(chold); return; }
00362 THD_set_string_atr(dset->dblk, "HISTORY_NOTE", ch);
00363 free(ch) ; free(chold) ;
00364 }
00365
00366 free(cdate) ; free(cname) ; free(cuser) ; return ;
00367 }
|
|
||||||||||||||||
|
Break a string up into lines of length between lbot and ltop bytes; free() the result when done with it. NULL return means illegal input was found. ------------------------------------------------------------------------- Definition at line 468 of file thd_notes.c. References AFMALL. Referenced by NOTES_finalize_dset_CB().
00469 {
00470 char * sout ;
00471 int slen , ii , ibot,itop , ldif ;
00472
00473 if( str == NULL || str[0] == '\0' || lbot > ltop || lbot < 4 ) return NULL ;
00474
00475 slen = strlen(str) ; sout = AFMALL(char, slen+4) ;
00476
00477 while( slen > lbot && isspace(str[slen-1]) ) slen-- ; /* trim blanks off end */
00478
00479 ibot = 0 ; ldif = ltop-lbot ;
00480 while(1){
00481 itop = ibot + ltop-1 ; /* want to output str[ibot..itop] */
00482
00483 /* if past end of str, then just output the rest and exit */
00484
00485 if( itop >= slen ){
00486 memcpy( sout+ibot , str+ibot , slen-ibot ) ;
00487 sout[slen] = '\0' ;
00488 return sout ;
00489 }
00490
00491 /* scan forwards to find a newline character before itop; */
00492 /* if one is present, output the string up to there, */
00493 /* and continue again starting after the newline */
00494
00495 for( ii=ibot ; ii <= itop ; ii++ )
00496 if( str[ii] == '\n' ) break ;
00497
00498 if( ii <= itop ){ /* found it! */
00499 memcpy( sout+ibot , str+ibot , ii-ibot+1 ) ;
00500 ibot = ii+1 ;
00501 if( ibot >= slen ){ sout[slen] = '\0'; return sout; }
00502 continue ;
00503 }
00504
00505 /* scan backwards to find a whitespace character */
00506
00507 for( ii=itop ; ii > itop-ldif ; ii-- )
00508 if( isspace(str[ii]) ) break ;
00509
00510 /* found one before the minimum location */
00511 /* copy up to the previous char into output, */
00512 /* then put a newline in for the whitespace */
00513
00514 if( ii > itop-ldif ){
00515 memcpy( sout+ibot , str+ibot , ii-ibot ) ;
00516 sout[ii] = '\n' ;
00517 ibot = ii+1 ;
00518 continue ; /* try to do next line */
00519 }
00520
00521 /* scan ahead to next whitespace instead */
00522
00523 for( ii=itop ; ii < slen ; ii++ )
00524 if( isspace(str[ii]) ) break ;
00525
00526 /* found one */
00527
00528 if( ii < slen ){
00529 memcpy( sout+ibot , str+ibot , ii-ibot ) ;
00530 sout[ii] = '\n' ;
00531 ibot = ii+1 ;
00532 continue ;
00533 }
00534
00535 /* copy rest of input and exit */
00536
00537 memcpy( sout+ibot , str+ibot , slen-ibot ) ;
00538 sout[slen] = '\0' ;
00539 return sout ;
00540 }
00541 }
|
|
||||||||||||||||
|
Assemble a sort-of command line string from the arguments; free() this when done. ----------------------------------------------------------------------------- Definition at line 25 of file thd_notes.c. References AFMALL, AFREALL, argc, free, and THD_filename_ok(). Referenced by AFNI_logger(), basis_write_iresp(), basis_write_sresp(), initialize(), initialize_program(), T3D_initialize_user_data(), tross_Make_History(), and write_ts_array().
00026 {
00027 char * ch ;
00028 int ii , ll ;
00029
00030 if( argc < 2 || argv == NULL ) return NULL ;
00031
00032 if( pname == NULL ) pname = argv[0] ;
00033
00034 ii = strlen(pname) ; ch = AFMALL(char, ii+4) ; strcpy(ch,pname) ;
00035
00036 for( ii=1 ; ii < argc ; ii++ ){
00037 if( argv[ii] == NULL || argv[ii][0] == '\0' ) continue ; /* skip */
00038
00039 ll = strlen(argv[ii]) ;
00040 ch = AFREALL(ch ,char, strlen(ch)+ll+4 ) ; /* expand output array */
00041
00042 if( !THD_filename_ok(argv[ii]) ){ /* bad characters? */
00043 int jj ; char * aa = AFMALL(char, ll+1) ;
00044
00045 strcpy(aa,argv[ii]) ; /* edit out bad characters */
00046 for( jj=0 ; jj < ll ; jj++ )
00047 if( iscntrl(aa[jj]) ||
00048 isspace(aa[jj]) || (aa[jj] & 128) != 0 ) aa[jj] = ' ' ;
00049
00050 strcat(ch," '") ; strcat(ch,aa) ; strcat(ch,"'") ; free(aa) ;
00051
00052 } else {
00053 strcat(ch," ") ; strcat(ch,argv[ii]) ; /* just copy it */
00054 }
00055 }
00056
00057 return ch ;
00058 }
|
|
||||||||||||
|
|
Get the current date/time string; free() this when done. ----------------------------------------------------------------------------- Definition at line 64 of file thd_notes.c. Referenced by AFNI_logger(), tross_Add_Note(), tross_Append_History(), tross_Store_Note(), and XSAVE_output().
|
|
||||||||||||
|
Delete a particular note ----------------------------------------------------------------------------- Definition at line 141 of file thd_notes.c. References THD_3dim_dataset::dblk, ATR_int::in, ISVALID_DSET, MAX_DSET_NOTES, ATR_string::name, THD_erase_one_atr(), THD_find_int_atr(), and THD_find_string_atr(). Referenced by main(), and NOTES_delete_CB().
00142 {
00143 ATR_int *notecount;
00144 int num_notes;
00145 ATR_string *note_text;
00146 char note_name[20];
00147
00148 if( !ISVALID_DSET(dset) || inote <= 0 || inote > MAX_DSET_NOTES ) return ;
00149
00150 notecount = THD_find_int_atr(dset->dblk, "NOTES_COUNT");
00151 if (notecount == NULL) return ;
00152
00153 num_notes = notecount->in[0];
00154 if (inote > num_notes) return ;
00155
00156 sprintf(note_name, "NOTE_NUMBER_%03d", inote);
00157 note_text = THD_find_string_atr(dset->dblk, note_name);
00158 if( note_text == NULL ) return ;
00159 THD_erase_one_atr( dset->dblk , note_name );
00160
00161 sprintf(note_name, "NOTE_DATE_%03d", inote);
00162 note_text = THD_find_string_atr(dset->dblk, note_name);
00163 if( note_text != NULL ) THD_erase_one_atr( dset->dblk , note_name );
00164
00165 notecount->in[0]-- ; /* where the note count is reduced */
00166
00167 /* Slide the higher numbered notes down */
00168
00169 while (inote < num_notes) {
00170 /* find the next note */
00171 sprintf(note_name, "NOTE_NUMBER_%03d", inote+1);
00172 note_text=THD_find_string_atr(dset->dblk, note_name);
00173 if (note_text != NULL){
00174 /* rename to the previous name */
00175 sprintf(note_name, "NOTE_NUMBER_%03d", inote);
00176 strcpy(note_text->name, note_name);
00177 }
00178
00179 sprintf(note_name,"NOTE_DATE_%03d",inote+1) ;
00180 note_text = THD_find_string_atr(dset->dblk, note_name);
00181 if (note_text != NULL){
00182 /* rename to the previous name */
00183 sprintf(note_name, "NOTE_DATE_%03d", inote);
00184 strcpy(note_text->name, note_name);
00185 }
00186
00187 inote++ ;
00188 }
00189
00190 /* No notes left, so remove count attribute */
00191 if (num_notes == 1)
00192 THD_erase_one_atr( dset->dblk, "NOTES_COUNT");
00193 return ;
00194 }
|
|
|
Definition at line 581 of file thd_notes.c. References Dont_Encode_Slash, and q. Referenced by main().
00581 { Dont_Encode_Slash = q ; return ; }
|
|
|
Reverse of tross_Expand_String ---------------------------------------------------------------------------- Definition at line 587 of file thd_notes.c. References Dont_Encode_Slash, i, and malloc. Referenced by tross_Add_Note(), tross_Append_History(), tross_Copy_History(), tross_Replace_History(), and tross_Store_Note().
00588 {
00589 char * ch = NULL ;
00590 int i , j , num_char ;
00591
00592 if( cn == NULL || cn[0] == '\0' ) return NULL ;
00593
00594 num_char = strlen(cn) ;
00595 ch = (char *) malloc( sizeof(char) * (2*num_char+4) ) ;
00596 for( i=j=0 ; j < num_char ; j++ ){
00597 switch( cn[j] ){
00598 default: ch[i++] = cn[j] ; break ;
00599 case '\r': ch[i++] = '\\' ; ch[i++] = 'r' ; break ;
00600 case '\n': ch[i++] = '\\' ; ch[i++] = 'n' ; break ;
00601 case '\"': ch[i++] = '\\' ; ch[i++] = '\"'; break ;
00602 case '\t': ch[i++] = '\\' ; ch[i++] = 't' ; break ;
00603 case '\a': ch[i++] = '\\' ; ch[i++] = 'a' ; break ;
00604 case '\v': ch[i++] = '\\' ; ch[i++] = 'v' ; break ;
00605 case '\b': ch[i++] = '\\' ; ch[i++] = 'b' ; break ;
00606
00607 case '\\': ch[i++] = '\\';
00608 if( !Dont_Encode_Slash ) ch[i++] = '\\';
00609 break ;
00610 }
00611 }
00612 ch[i] = '\0' ;
00613 for( i-- ; i > 0 ; i-- ) if( isspace(ch[i]) ) ch[i] = '\0' ; else break ;
00614 return ch ;
00615 }
|
|
|
Return a printable version of a note string; free() this when done ------------------------------------------------------------------------- Definition at line 547 of file thd_notes.c. Referenced by atr_print(), tross_Append_History(), tross_Get_History(), tross_Get_Note(), and tross_Get_Notedate().
00548 {
00549 char * cn = NULL ;
00550 int i, j, num_char;
00551
00552 if( ch == NULL || ch[0] == '\0' ) return NULL ;
00553
00554 num_char = strlen(ch) ;
00555 cn = (char *) malloc( sizeof(char) * (num_char+4) ) ;
00556 for( i=j=0 ; j < num_char ; j++ ){
00557 if( ch[j] != '\\' ){
00558 cn[i++] = ch[j] ;
00559 } else {
00560 switch (ch[++j] ){
00561 case 'r' : cn[i++] = '\r' ; break;
00562 case 'n' : cn[i++] = '\n' ; break;
00563 case '\\' : cn[i++] = '\\' ; break;
00564 case '"' : cn[i++] = '\"' ; break;
00565 case 't' : cn[i++] = '\t' ; break;
00566 case 'a' : cn[i++] = '\a' ; break;
00567 case 'v' : cn[i++] = '\v' ; break;
00568 case 'b' : cn[i++] = '\b' ; break;
00569 default: cn[i++] = '\\' ; /* 13 Mar 2003 */
00570 cn[i++] = ch[j]; break;
00571 }
00572 }
00573 }
00574 cn[i] = '\0' ; return cn ;
00575 }
|
|
|
Get the history string; free() this when done. If NULL is returned, there is no history (cf. Santayana). ------------------------------------------------------------------------------ Definition at line 415 of file thd_notes.c. References ATR_string::ch, THD_3dim_dataset::dblk, ISVALID_DSET, THD_find_string_atr(), and tross_Expand_String(). Referenced by NOTES_finalize_dset_CB(), THD_dataset_info(), tross_Addto_History(), and tross_Copy_History().
00416 {
00417 ATR_string * hist ;
00418 char * ch ;
00419
00420 if( !ISVALID_DSET(dset) ) return NULL ;
00421
00422 hist = THD_find_string_atr(dset->dblk,"HISTORY_NOTE") ;
00423 if( hist == NULL ) return NULL ;
00424
00425 ch = tross_Expand_String(hist->ch) ; return ch ;
00426 }
|
|
||||||||||||
|
Get the inote-th Note attached to the dataset. free() this string when done with it - it is a copy ----------------------------------------------------------------------------- Definition at line 217 of file thd_notes.c. References ATR_string::ch, THD_3dim_dataset::dblk, ATR_int::in, ISVALID_DSET, MAX_DSET_NOTES, THD_find_int_atr(), THD_find_string_atr(), and tross_Expand_String(). Referenced by Display_Notes(), NOTES_add_CB(), NOTES_finalize_dset_CB(), and THD_dataset_info().
00218 {
00219 ATR_int *notecount;
00220 int num_notes;
00221 ATR_string *note ;
00222 char note_name[20], * ch ;
00223
00224 if( !ISVALID_DSET(dset) || inote <= 0 || inote > MAX_DSET_NOTES ) return NULL ;
00225
00226 notecount = THD_find_int_atr(dset->dblk, "NOTES_COUNT");
00227 if (notecount == NULL) return NULL ;
00228 num_notes = notecount->in[0];
00229 if( inote > num_notes ) return NULL ;
00230
00231 sprintf(note_name, "NOTE_NUMBER_%03d", inote);
00232 note = THD_find_string_atr(dset->dblk, note_name);
00233 if (note == NULL ) return NULL ;
00234 ch = tross_Expand_String( note->ch ) ;
00235 return ch ;
00236 }
|
|
|
Get the number of Notes currently attached to the dataset. Doesn't include the History note. ----------------------------------------------------------------------------- Definition at line 201 of file thd_notes.c. References THD_3dim_dataset::dblk, ATR_int::in, ISVALID_DSET, and THD_find_int_atr(). Referenced by NOTES_finalize_dset_CB().
00202 {
00203 ATR_int *notecount;
00204
00205 if( !ISVALID_DSET(dset) ) return -1 ;
00206
00207 notecount = THD_find_int_atr(dset->dblk, "NOTES_COUNT");
00208 if (notecount == NULL) return 0 ;
00209 return notecount->in[0];
00210 }
|
|
||||||||||||
|
Definition at line 240 of file thd_notes.c. References ATR_string::ch, THD_3dim_dataset::dblk, ATR_int::in, ISVALID_DSET, MAX_DSET_NOTES, THD_find_int_atr(), THD_find_string_atr(), and tross_Expand_String(). Referenced by Display_Notes(), NOTES_add_CB(), NOTES_finalize_dset_CB(), NOTES_save_CB(), and THD_dataset_info().
00241 {
00242 ATR_int *notecount;
00243 int num_notes;
00244 ATR_string *note ;
00245 char note_name[20];
00246
00247 if( !ISVALID_DSET(dset) || inote <= 0 || inote > MAX_DSET_NOTES ) return NULL ;
00248
00249 notecount = THD_find_int_atr(dset->dblk, "NOTES_COUNT");
00250 if (notecount == NULL) return NULL ;
00251 num_notes = notecount->in[0];
00252 if( inote > num_notes ) return NULL ;
00253
00254 sprintf(note_name, "NOTE_DATE_%03d", inote);
00255 note = THD_find_string_atr(dset->dblk, note_name);
00256 if (note == NULL ) return NULL ;
00257 return tross_Expand_String( note->ch ) ;
00258 }
|
|
|
Definition at line 77 of file thd_notes.c. Referenced by tross_Append_History(), and XSAVE_output().
|
|
||||||||||||||||||||
|
Add the history from the command line to the dataset. ----------------------------------------------------------------------------- Definition at line 264 of file thd_notes.c. References argc, free, ISVALID_DSET, tross_Append_History(), and tross_commandline(). Referenced by applyMask(), do_xrestore_stuff(), main(), write_afni_fict(), write_afni_fizt(), write_bucket_data(), write_output(), and write_results().
00265 {
00266 char *ch ;
00267
00268 if( argc < 2 || argv == NULL || !ISVALID_DSET(dset) ) return ;
00269
00270 ch = tross_commandline( pname , argc , argv ) ; if( ch == NULL ) return ;
00271 tross_Append_History( dset , ch ) ;
00272 free(ch) ; return ;
00273 }
|
|
||||||||||||
|
Append multiple strings to the History, all on one line. Usage:
Definition at line 379 of file thd_notes.c. References AFMALL, AFREALL, free, nc, and tross_Append_History(). Referenced by basis_write_iresp(), basis_write_sresp(), output_ts_array(), write_afni_data(), and write_ts_array().
00380 {
00381 va_list vararg_ptr ;
00382 int nstr=0 , nc , first=1 , ii ;
00383 char * str , * cpt ;
00384
00385 va_start( vararg_ptr , dset ) ;
00386
00387 str = AFMALL(char, 4) ; nstr = 0 ; str[0] = '\0' ;
00388 while(1){
00389 cpt = va_arg( vararg_ptr , char * ) ; if( cpt == NULL ) break ;
00390 nc = strlen(cpt) ; if( nc == 0 ) continue ;
00391 nstr += nc ; str = AFREALL(str, char, nstr+8 ) ;
00392 if( !first ) strcat(str," ; ") ;
00393 strcat(str,cpt) ; first = 0 ;
00394 }
00395
00396 va_end( vararg_ptr ) ;
00397
00398 nstr = strlen(str) ;
00399 if( nstr > 0 ){
00400 for( ii=0 ; ii < nstr ; ii++ )
00401 if( str[ii]=='\n' || str[ii]=='\f' || str[ii]=='\r' || str[ii]=='\v' )
00402 str[ii] = ' ' ;
00403
00404 tross_Append_History( dset , str ) ;
00405 }
00406
00407 free(str) ; return ;
00408 }
|
|
||||||||||||
|
Erase the old History and replace it with this one. 09 Dec 2000 - use this wisely. ----------------------------------------------------------------------------- Definition at line 310 of file thd_notes.c. References THD_3dim_dataset::dblk, free, ISVALID_DSET, THD_set_string_atr, and tross_Encode_String(). Referenced by main().
00311 {
00312 char * cn ;
00313
00314 if( !ISVALID_DSET(dset) || ch == NULL ) return ;
00315
00316 cn = tross_Encode_String(ch) ; if( cn == NULL ) return ;
00317 THD_set_string_atr(dset->dblk, "HISTORY_NOTE", cn);
00318 free(cn) ; return ;
00319 }
|
|
||||||||||||||||
|
Store string at location inote; if inote > number of notes now present, gets added at the end of the list; otherwise, replaces existing note ------------------------------------------------------------------------------- Definition at line 434 of file thd_notes.c. References THD_3dim_dataset::dblk, free, ATR_int::in, ISVALID_DSET, MAX_DSET_NOTES, THD_find_int_atr(), THD_set_string_atr, tross_Add_Note(), tross_datetime(), and tross_Encode_String(). Referenced by NOTES_save_CB().
00435 {
00436 ATR_int *notecount;
00437 int num_notes;
00438 ATR_string *note ;
00439 char note_name[20], *ch ;
00440
00441 if( !ISVALID_DSET(dset) || inote <= 0 || inote > MAX_DSET_NOTES ||
00442 cn == NULL || cn[0] == '\0' ) return ;
00443
00444 notecount = THD_find_int_atr(dset->dblk, "NOTES_COUNT");
00445 if (notecount == NULL){ tross_Add_Note( dset , cn ) ; return ; }
00446 num_notes = notecount->in[0];
00447 if( inote > num_notes ){ tross_Add_Note( dset , cn ) ; return ; }
00448
00449 sprintf(note_name, "NOTE_NUMBER_%03d", inote);
00450 ch = tross_Encode_String(cn) ; if( ch == NULL ) return ;
00451 THD_set_string_atr(dset->dblk, note_name, ch);
00452 free(ch) ;
00453
00454 ch = tross_datetime() ;
00455 sprintf(note_name, "NOTE_DATE_%03d", inote) ;
00456 THD_set_string_atr(dset->dblk, note_name, ch);
00457 free(ch);
00458
00459 return ;
00460 }
|
|
|
Definition at line 88 of file thd_notes.c. Referenced by tross_Append_History(), and XSAVE_output().
|
Variable Documentation
|
|
Definition at line 579 of file thd_notes.c. Referenced by tross_Dont_Encode_Slash(), and tross_Encode_String(). |