void Tempo::addM(int M){ minutos += M; if(minutos >= 60){ minutos = minutos%60; addH(1); } }
// Add LIST and NCMD to HIST void hRemember(int ncmd, token *list) { // get effective histsize limit long limit = 323; char *env = getenv("HISTSIZE"); if (env != NULL && strtol(env, NULL, 10) > 0) limit = strtol(env, NULL, 10); // add LIST,NCMD to HIST addH (&hist, list, ncmd); histsize++; // now assume if histsize > limit, // histsize == limit + 1 if (histsize > limit) { Histlist tmp = hist; hist = hist->next; tmp->next = NULL; destroyH(tmp); } }
void Tempo::add(Tempo* tempo){ addH(tempo->getHoras()); addM(tempo->getMinutos()); addS(tempo->getSegundos()); }