static void load_job(SCM job_list, int index)
{
- SCM scm_i =
- scm_from_signed_integer(index);
- SCM scm_cur_job =
- SCM_ARR(job_list, index);
+ SCM scm_cur_job = SCM_ARR(job_list, index);
- /* scm_cur_job should be a job */
if(scm_is_false(job_predicate(scm_cur_job))){
tomd_p("job %d wasn't a real job type.", index);
return;
}
- SCM scm_cmd =
- get_cmd(scm_cur_job);
- SCM scm_args =
- get_args(scm_cur_job);
- SCM scm_start_trigger =
- get_start_trigger(scm_cur_job);
- SCM scm_end_trigger =
- get_end_trigger(scm_cur_job);
+ SCM scm_cmd = get_cmd(scm_cur_job);
+ SCM scm_args = get_args(scm_cur_job);
- char *job_cmd =
- scm_to_locale_string(scm_cmd);
+ /* TODO > Handle these. */
+ /* planned is to be able to run at different points, and at */
+ /* the request of a user. for testing we do things all at */
+ /* boot up. */
+ SCM scm_start_trigger = get_start_trigger(scm_cur_job);
+ SCM scm_end_trigger = get_end_trigger(scm_cur_job);
+
+ char *job_cmd = scm_to_locale_string(scm_cmd);
char *real_args[10];
int jlen = scm_to_int(scm_length(scm_args));
}
manifest_loc = (char *)args;
- /* tomd_p("load_manifest called with arg '%s'", args); */
-
scm_c_primitive_load(args);
- /* now that we have the file in memory, lets grab the value of job-list */
SCM scm_job_list =
scm_c_public_ref("tomd manifest", "job-list");
uid_t user = getuid();
struct passwd *userpasswd =
getpwuid(user);
- /* tomd_p("pw_name='%s'", userpasswd->pw_name); */
- /* tomd_p("pw_passwd='%s'", userpasswd->pw_passwd); */
- /* tomd_p("pw_uid='%d'", userpasswd->pw_uid); */
- /* tomd_p("pw_gid='%d'", userpasswd->pw_gid); */
- /* tomd_p("pw_gecos='%s'", userpasswd->pw_gecos); */
- /* tomd_p("pw_dir='%s'", userpasswd->pw_dir); */
- /* tomd_p("pw_shell='%s'", userpasswd->pw_shell); */
/* take the manifest location and sub ~ for pw_dir */
char *buffer = (char *)malloc(sizeof(char) * 300);
strcpy(buffer, userpasswd->pw_dir);
int len = strlen(userpasswd->pw_dir);
strcpy(buffer + len, MANIFEST_LOC);
- /* tomd_p("full config path:'%s'", buffer); */
return buffer;
}
void *res =
scm_with_guile(load_manifest,
(void *) manifest);
- /* check if the variable 'job-list' is defined */
tomd_p("Finished loading.");
}