From cfe03397617587666e99e3a5c3059ffca3d861b8 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Wed, 24 Jun 2015 12:50:30 -0700 Subject: [PATCH] Rename %time to %behn, tym to now; closes #334 --- Makefile | 4 ++-- include/c/motes.h | 1 - include/vere/vere.h | 36 ++++++++++++++++++------------------ vere/{temp.c => behn.c} | 30 +++++++++++++++--------------- vere/loop.c | 14 +++++++------- 5 files changed, 42 insertions(+), 43 deletions(-) rename vere/{temp.c => behn.c} (68%) diff --git a/Makefile b/Makefile index 86f6bd134..d05d7b15c 100644 --- a/Makefile +++ b/Makefile @@ -295,13 +295,13 @@ OUT_OFILES=\ V_OFILES=\ vere/ames.o \ + vere/behn.o \ vere/cttp.o \ vere/http.o \ vere/loop.o \ vere/raft.o \ vere/reck.o \ vere/sist.o \ - vere/temp.o \ vere/term.o \ vere/time.o \ vere/unix.o \ @@ -411,7 +411,7 @@ $(LIBSCRYPT): $(CRE2_OFILES): outside/cre2/src/src/cre2.cpp outside/cre2/src/src/cre2.h $(LIBRE2) $(CXX) $(CXXFLAGS) -c $< -o $@ -$(V_OFILES): i/v/vere.h +$(V_OFILES): include/vere/vere.h ifdef NO_SILENT_RULES $(BIN)/urbit: $(LIBCRE) $(LIBCOMMONMARK) $(VERE_OFILES) $(LIBUV) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBSCRYPT) diff --git a/include/c/motes.h b/include/c/motes.h index fdda1e459..3147f2270 100644 --- a/include/c/motes.h +++ b/include/c/motes.h @@ -1019,7 +1019,6 @@ # define c3__teal c3_s4('t','e','a','l') # define c3__teck c3_s4('t','e','c','k') # define c3__tell c3_s4('t','e','l','l') -# define c3__temp c3_s4('t','e','m','p') # define c3__terg c3_s4('t','e','r','g') # define c3__term c3_s4('t','e','r','m') # define c3__test c3_s4('t','e','s','t') diff --git a/include/vere/vere.h b/include/vere/vere.h index 4e7a86c90..0160640a9 100644 --- a/include/vere/vere.h +++ b/include/vere/vere.h @@ -369,13 +369,13 @@ #endif } u3_unix; - /* u3_temp: just a timer for ever + /* u3_behn: just a timer for ever */ - typedef struct _u3_temp { - uv_timer_t tim_u; // temp timer + typedef struct _u3_behn { + uv_timer_t tim_u; // behn timer c3_w run_w; // run of consecutive alarms c3_o alm; // alarm - } u3_temp; + } u3_behn; /* u2_utfo: unix terminfo strings. */ @@ -558,7 +558,7 @@ u3_save sav_u; // autosave u3_opts ops_u; // commandline options u3_unix unx_u; // sync and clay - u3_temp teh_u; // temp timer + u3_behn teh_u; // behn timer c3_o liv; // if u3_no, shut down c3_i xit_i; // exit code for shutdown void* ssl_u; // struct SSL_CTX* @@ -976,22 +976,22 @@ u3_unix_io_poll(void); - /** Temp, just a timer. + /** behn, just a timer. **/ - /* u2_temp_io_init(): initialize temp timer. + /* u2_behn_io_init(): initialize behn timer. */ void - u2_temp_io_init(void); + u2_behn_io_init(void); - /* u2_temp_io_exit(): terminate timer. + /* u2_behn_io_exit(): terminate timer. */ void - u2_temp_io_exit(void); + u2_behn_io_exit(void); - /* u2_temp_io_poll(): update temp IO state. + /* u2_behn_io_poll(): update behn IO state. */ void - u2_temp_io_poll(void); + u2_behn_io_poll(void); /** HTTP server. @@ -1125,20 +1125,20 @@ /** New timer system. **/ - /* u3_temp_io_init(): initialize time timer. + /* u3_behn_io_init(): initialize time timer. */ void - u3_temp_io_init(void); + u3_behn_io_init(void); - /* u3_temp_io_exit(): terminate timer. + /* u3_behn_io_exit(): terminate timer. */ void - u3_temp_io_exit(void); + u3_behn_io_exit(void); - /* u3_temp_io_poll(): update temp IO state. + /* u3_behn_io_poll(): update behn IO state. */ void - u3_temp_io_poll(void); + u3_behn_io_poll(void); /** HTTP client. diff --git a/vere/temp.c b/vere/behn.c similarity index 68% rename from vere/temp.c rename to vere/behn.c index 4b0d0cc50..04d1989a2 100644 --- a/vere/temp.c +++ b/vere/behn.c @@ -1,4 +1,4 @@ -/* v/temp.c +/* v/behn.c ** ** This file is in the public domain. */ @@ -21,30 +21,30 @@ #include "all.h" #include "vere/vere.h" -/* u3_temp(): initialize time timer. +/* u3_behn(): initialize time timer. */ void -u3_temp_io_init(void) +u3_behn_io_init(void) { - u3_temp* teh_u = &u3_Host.teh_u; + u3_behn* teh_u = &u3_Host.teh_u; uv_timer_init(u3L, &teh_u->tim_u); teh_u->alm = c3n; } -/* u3_temp_io_exit(): terminate timer. +/* u3_behn_io_exit(): terminate timer. */ void -u3_temp_io_exit(void) +u3_behn_io_exit(void) { } -/* _temp_time_cb(): timer callback. +/* _behn_time_cb(): timer callback. */ static void -_temp_time_cb(uv_timer_t* tim_u) +_behn_time_cb(uv_timer_t* tim_u) { - u3_temp* teh_u = &u3_Host.teh_u; + u3_behn* teh_u = &u3_Host.teh_u; if(teh_u->run_w < 1024) { teh_u->run_w++; } @@ -52,19 +52,19 @@ _temp_time_cb(uv_timer_t* tim_u) u3_lo_open(); { u3v_plan - (u3nt(u3_blip, c3__temp, u3_nul), + (u3nt(u3_blip, c3__behn, u3_nul), u3nc(c3__wake, u3_nul)); } u3_lo_shut(c3n); } -/* u3_temp_io_poll(): update temp IO state. +/* u3_behn_io_poll(): update behn IO state. */ void -u3_temp_io_poll(void) +u3_behn_io_poll(void) { - u3_temp* teh_u = &u3_Host.teh_u; - u3_noun wen = u3v_keep(u3nt(u3_blip, c3__temp, u3_nul)); + u3_behn* teh_u = &u3_Host.teh_u; + u3_noun wen = u3v_keep(u3nt(u3_blip, c3__behn, u3_nul)); if ( (u3_nul != wen) && (c3y == u3du(wen)) && @@ -83,7 +83,7 @@ u3_temp_io_poll(void) } else teh_u->alm = c3y; - uv_timer_start(&teh_u->tim_u, _temp_time_cb, gap_d, 0); + uv_timer_start(&teh_u->tim_u, _behn_time_cb, gap_d, 0); } else { if ( c3y == teh_u->alm ) { diff --git a/vere/loop.c b/vere/loop.c index 827583163..11f4ca394 100644 --- a/vere/loop.c +++ b/vere/loop.c @@ -192,8 +192,8 @@ _lo_init() u3_save_io_init(); u3a_lop(cod_l); - cod_l = u3a_lush(c3__temp); - u3_temp_io_init(); + cod_l = u3a_lush(c3__behn); + u3_behn_io_init(); u3a_lop(cod_l); } @@ -252,8 +252,8 @@ u3_lo_exit(void) u3_save_io_exit(); u3a_lop(cod_l); - cod_l = u3a_lush(c3__temp); - u3_temp_io_exit(); + cod_l = u3a_lush(c3__behn); + u3_behn_io_exit(); u3a_lop(cod_l); } @@ -284,8 +284,8 @@ _lo_poll(void) u3_unix_io_poll(); u3a_lop(cod_l); - cod_l = u3a_lush(c3__temp); - u3_temp_io_poll(); + cod_l = u3a_lush(c3__behn); + u3_behn_io_poll(); u3a_lop(cod_l); } @@ -299,7 +299,7 @@ _lo_how(u3_noun how) default: c3_assert(0); break; case c3__ames: return "ames"; - case c3__temp: return "temp"; + case c3__behn: return "behn"; case c3__term: return "cons"; case c3__htcn: return "http-conn"; case c3__htls: return "http-lisn";