sys_time.c 492 B

12345678910111213141516171819
  1. #include "lib.h"
  2. static ResultType vm_selfunCore(O_FUNC){
  3. time_t t;
  4. if (arg != NULL) {
  5. setResultError(E_ArgumentException, MANY_ARG, LINEFILE, true, CNEXT_NT);
  6. return R_error;
  7. }
  8. time(&t);
  9. makeIntValue(t, LINEFILE, CNEXT_NT);
  10. return result->type;
  11. }
  12. void registeredTimeLib(R_FUNC){
  13. NameFunc tmp[] = {{L"time", vm_selfunCore, fp_no_, .var=nfv_notpush},
  14. {NULL, NULL}};
  15. iterBaseNameFunc(tmp, belong, CFUNC_CORE(var_list));
  16. }