Changeset f9bb68 in git
- Timestamp:
- Aug 27, 2010, 10:15:09 AM (13 years ago)
- Branches:
- (u'spielwiese', 'f6c3dc58b0df4bd712574325fe76d0626174ad97')
- Children:
- 555b030713519677d5c1d72e1cdfacc419cc4bdc
- Parents:
- 5cb9ecd7f9c68100731d2b46abd492589627c598
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/iparith.cc
r5cb9ec rf9bb68 72 72 #include <Singular/ipshell.h> 73 73 #include <kernel/mpr_inout.h> 74 75 #include <kernel/timer.h> 74 76 75 77 #ifdef HAVE_PLURAL … … 442 444 443 445 /* set sys vars*/ 446 { "datetime", 0, DATETIME , SYSVAR}, 444 447 { "degBound", 0, VMAXDEG , SYSVAR}, 445 448 { "echo", 0, VECHO , SYSVAR}, -
Singular/misc_ip.cc
r5cb9ec rf9bb68 220 220 if (nlIsZero(nn) || (nnAsInt != 0)) 221 221 { 222 nlDelete(&nn,NULL) :222 nlDelete(&nn,NULL); 223 223 L->m[0].rtyp = INT_CMD; 224 224 L->m[0].data = (void *)nnAsInt; -
Singular/subexpr.cc
r5cb9ec rf9bb68 308 308 } 309 309 break; 310 case DATETIME: 310 311 case STRING_CMD: 311 312 omFree((ADDRESS)data); … … 357 358 case VCOLMAX: 358 359 case VTIMER: 360 case DATETIME: 359 361 #ifdef HAVE_RTIMER 360 362 case VRTIMER: … … 390 392 case VCOLMAX: 391 393 case VTIMER: 394 case DATETIME: 392 395 #ifdef HAVE_RTIMER 393 396 case VRTIMER: … … 569 572 else if (rtyp==LIB_CMD) 570 573 x=(void *)omStrDup((char *)Data()); 574 else if (rtyp==DATETIME) 575 x=(void *)omStrDup((char *)Data()); 571 576 else if ((rtyp==VMINPOLY)&& (currRing->minpoly!=NULL)&&(!rField_is_GF())) 572 577 x=(void *)nCopy(currRing->minpoly); … … 852 857 return INT_CMD; 853 858 case LIB_CMD: 859 case DATETIME: 854 860 return STRING_CMD; 855 861 case VMINPOLY: … … 972 978 case VCOLMAX: return (void *)colmax; 973 979 case VTIMER: return (void *)getTimer(); 980 case DATETIME: return (void *)dateTime(); 974 981 #ifdef HAVE_RTIMER 975 982 case VRTIMER: return (void *)getRTimer(); -
Singular/tok.h
r5cb9ec rf9bb68 54 54 CONTENT_CMD, 55 55 COUNT_CMD, 56 DATETIME, 56 57 DBPRINT_CMD, 57 58 DEF_CMD, -
kernel/timer.cc
r5cb9ec rf9bb68 176 176 extern int iiOp; 177 177 #endif 178 179 char* dateTime() 180 { 181 #ifdef GETRUSAGE 182 time_t rawtime; 183 time(&rawtime); 184 char* s = ctime(&rawtime); // s: with linefeed at the end 185 int l = strlen(s); 186 char* ss = (char*)omAlloc(l); 187 strncpy(ss, s, l - 1); 188 ss[l - 1] = '\0'; // ss: without linefeed at the end 189 return ss; 190 #else 191 char* s = "Warning: date/time not available on your system"; 192 int l = strlen(s) + 1; 193 char* ss = (char*)omAlloc(l); 194 strncpy(ss, s, l - 1); 195 ss[l - 1] = '\0'; 196 return ss; 197 #endif 198 } 199 178 200 void writeTime(const char* v) 179 201 { -
kernel/timer.h
r5cb9ec rf9bb68 12 12 void startTimer(void); 13 13 void writeTime(const char* s); 14 char* dateTime(); // (local) date and local time as a string 14 15 15 16 int initTimer();
Note: See TracChangeset
for help on using the changeset viewer.