Lines Matching refs:p

108 	struct event_cmd_exec * p = this;  in event_cmd_exec_act()  local
121 execl(_PATH_BSHELL, "sh", "-c", p->line, (char *)NULL); in event_cmd_exec_act()
188 clone_event_cmd_list(struct event_cmd *p) in clone_event_cmd_list() argument
192 for ( ;p; p = p->next) { in clone_event_cmd_list()
193 assert(p->op->clone); in clone_event_cmd_list()
194 if ((q->next = p->op->clone(p)) == NULL) in clone_event_cmd_list()
202 free_event_cmd_list(struct event_cmd *p) in free_event_cmd_list() argument
205 for ( ; p ; p = q) { in free_event_cmd_list()
206 q = p->next; in free_event_cmd_list()
207 if (p->op->free) in free_event_cmd_list()
208 p->op->free(p); in free_event_cmd_list()
209 free(p); in free_event_cmd_list()
257 struct event_cmd *p; in register_apm_event_handlers() local
262 p = events[n].cmdlist; in register_apm_event_handlers()
265 if (p) { in register_apm_event_handlers()
266 while (p->next != NULL) in register_apm_event_handlers()
267 p = p->next; in register_apm_event_handlers()
268 p->next = q; in register_apm_event_handlers()
282 exec_run_cmd(struct event_cmd *p) in exec_run_cmd() argument
286 for (; p; p = p->next) { in exec_run_cmd()
287 assert(p->op->act); in exec_run_cmd()
289 syslog(LOG_INFO, "action: %s", p->name); in exec_run_cmd()
290 status = p->op->act(p); in exec_run_cmd()
357 struct event_cmd * p; in dump_config() local
358 if ((p = events[i].cmdlist)) { in dump_config()
360 for ( ; p ; p = p->next) { in dump_config()
361 fprintf(stderr, "\t%s", p->name); in dump_config()
362 if (p->op->dump) in dump_config()
363 p->op->dump(p, stderr); in dump_config()
370 struct event_cmd * p; in dump_config() local
376 for ( p = q -> cmdlist; p ; p = p->next) { in dump_config()
377 fprintf(stderr, "\t%s", p->name); in dump_config()
378 if (p->op->dump) in dump_config()
379 p->op->dump(p, stderr); in dump_config()
403 struct event_cmd * p; in destroy_config() local
404 if ((p = events[i].cmdlist)) in destroy_config()
405 free_event_cmd_list(p); in destroy_config()
515 struct battery_watch_event *p; in check_battery() local
551 for (p = battery_watch_list ; p!=NULL ; p = p -> next) in check_battery()
552 p->done = 0; in check_battery()
554 for (p = battery_watch_list ; p != NULL ; p = p -> next) in check_battery()
555 if (p -> direction == AC_POWER_STATE && in check_battery()
556 !(p -> done) && in check_battery()
557 ((p -> type == BATTERY_PERCENT && in check_battery()
558 p -> level == (int)pw_info.ai_batt_life) || in check_battery()
559 (p -> type == BATTERY_MINUTES && in check_battery()
560 p -> level == (pw_info.ai_batt_time / 60)))) { in check_battery()
561 p -> done++; in check_battery()
564 (p -> direction == BATTERY_CHARGING)?"charging":"discharging", in check_battery()
565 p -> level, in check_battery()
566 (p -> type == BATTERY_PERCENT)?"%":" minutes"); in check_battery()
568 status = exec_run_cmd(p -> cmdlist); in check_battery()