{"id":58,"date":"2014-07-03T09:40:18","date_gmt":"2014-07-03T09:40:18","guid":{"rendered":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=58"},"modified":"2014-07-04T16:27:28","modified_gmt":"2014-07-04T16:27:28","slug":"the-ovm_ctime_t-type","status":"publish","type":"post","link":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=58","title":{"rendered":"The ovm_ctime_t type"},"content":{"rendered":"<p>The <code>ovm_ctime_t<\/code> type is the OrchIDS incarnation of the data type <code>time_t<\/code> of times (not durations: durations are represented as machine integers, of type <a title=\"The ovm_int_t type\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=21\"><code>ovm_int_t<\/code><\/a>).<!--more--><\/p>\n<p>It is defined this way in <tt>src\/lang.h<\/tt>:<\/p>\n<pre>typedef struct ovm_ctime_s ovm_ctime_t;\r\nstruct ovm_ctime_s\r\n{\r\n  gc_header_t gc;\r\n  time_t    time;\r\n};<\/pre>\n<p>This is a type of <a title=\"Garbage collection\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=18\">garbage-collectable<\/a> data. To allocate a new object of type <code>ovm_ctime_t<\/code>, use the function:<\/p>\n<pre>ovm_var_t *ovm_ctime_new(gc_t *gc_ctx, time_t tm);<\/pre>\n<p>This creates a new <code>ovm_ctime_t<\/code> object with value <code>tm<\/code>. Its return type is the universal type <a title=\"The ovm_var_t universal type\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?page_id=121\"><code>ovm_var_t<\/code><\/a> instead of <code>ovm_ctime_t<\/code>, for practical reasons. Calling <code>res<\/code> the result, one always has <code>TYPE(res)==T_CTIME<\/code>.<\/p>\n<p>The result is created white, and much be <code>gc_touch()<\/code>ed before storing it into a garbage-collectable object.<\/p>\n<p>The returned <code>ovm_ctime_t<\/code> object <code>res<\/code> is modifiable. One can read from or write from it by using the <code>CTIME()<\/code> macro (e.g., <code>time_t t=CTIME(res); CTIME(res) = t;<\/code>).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The ovm_ctime_t type is the OrchIDS incarnation of the data type time_t of times (not durations: durations are represented as machine integers, of type ovm_int_t).<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[],"class_list":["post-58","post","type-post","status-publish","format-standard","hentry","category-data-types","category-virtual-machine"],"_links":{"self":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/posts\/58","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=58"}],"version-history":[{"count":6,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/posts\/58\/revisions"}],"predecessor-version":[{"id":130,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/posts\/58\/revisions\/130"}],"wp:attachment":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=58"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=58"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}