From: Martin Quinson Date: Sat, 6 Feb 2016 09:22:20 +0000 (+0100) Subject: sed -i -e 's/\t/ /g' [sources] Please people, stop using tabs X-Git-Tag: v3_13~964 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/16bbb8a8212497d9c44c81333ed2c0e689e0c5af sed -i -e 's/\t/ /g' [sources] Please people, stop using tabs --- diff --git a/doc/msg-tuto-src/masterworker1.c b/doc/msg-tuto-src/masterworker1.c index 2d44af85da..c5d7877bf4 100644 --- a/doc/msg-tuto-src/masterworker1.c +++ b/doc/msg-tuto-src/masterworker1.c @@ -70,13 +70,13 @@ int master(int argc, char *argv[]) for (i = 0; i < workers_count; i++) if(host_self == workers[i]) { - workers[i] = workers[workers_count-1]; - workers_count--; - break; + workers[i] = workers[workers_count-1]; + workers_count--; + break; } for (i = 0; i < workers_count; i++) - MSG_process_create("worker", worker, master_name, workers[i]); + MSG_process_create("worker", worker, master_name, workers[i]); } XBT_INFO("Got %d workers and %d tasks to process", workers_count, @@ -84,7 +84,7 @@ int master(int argc, char *argv[]) for (i = 0; i < number_of_tasks; i++) { build_channel_name(channel,master_name, - MSG_host_get_name(workers[i % workers_count])); + MSG_host_get_name(workers[i % workers_count])); XBT_INFO("Sending \"%s\" to channel \"%s\"", todo[i]->name, channel); @@ -97,7 +97,7 @@ int master(int argc, char *argv[]) for (i = 0; i < workers_count; i++) { msg_task_t finalize = MSG_task_create("finalize", 0, 0, FINALIZE); MSG_task_send(finalize, build_channel_name(channel,master_name, - MSG_host_get_name(workers[i % workers_count]))); + MSG_host_get_name(workers[i % workers_count]))); } XBT_INFO("Goodbye now!"); @@ -114,7 +114,7 @@ int worker(int argc, char *argv[]) char channel[1024]; build_channel_name(channel,MSG_process_get_data(MSG_process_self()), - MSG_host_get_name(MSG_host_self())); + MSG_host_get_name(MSG_host_self())); XBT_INFO("Receiving on channel \"%s\"", channel); diff --git a/doc/msg-tuto-src/masterworker2.c b/doc/msg-tuto-src/masterworker2.c index 4ac746910a..e3c2826c50 100644 --- a/doc/msg-tuto-src/masterworker2.c +++ b/doc/msg-tuto-src/masterworker2.c @@ -57,17 +57,17 @@ int master(int argc, char *argv[]) for (i = 0; i < workers_count; i++) if(host_self == workers[i]) { - workers[i] = workers[workers_count-1]; - workers_count--; - break; + workers[i] = workers[workers_count-1]; + workers_count--; + break; } for (i = 0; i < workers_count; i++) - MSG_process_create("worker", worker, master_name, workers[i]); + MSG_process_create("worker", worker, master_name, workers[i]); } XBT_INFO("Got %d workers and will send tasks for %g seconds!", - workers_count, timeout); + workers_count, timeout); for (i = 0; 1; i++) { char sprintf_buffer[64]; @@ -77,10 +77,10 @@ int master(int argc, char *argv[]) sprintf(sprintf_buffer, "Task_%d", i); task = MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size, - NULL); + NULL); build_channel_name(channel,master_name, - MSG_host_get_name(workers[i % workers_count])); + MSG_host_get_name(workers[i % workers_count])); XBT_DEBUG("Sending \"%s\" to channel \"%s\"", task->name, channel); MSG_task_send(task, channel); @@ -94,7 +94,7 @@ int master(int argc, char *argv[]) for (i = 0; i < workers_count; i++) { msg_task_t finalize = MSG_task_create("finalize", 0, 0, FINALIZE); MSG_task_send(finalize, build_channel_name(channel,master_name, - MSG_host_get_name(workers[i % workers_count]))); + MSG_host_get_name(workers[i % workers_count]))); } XBT_INFO("Sent %d tasks in total!", task_num); @@ -111,7 +111,7 @@ int worker(int argc, char *argv[]) char channel[1024]; build_channel_name(channel,MSG_process_get_data(MSG_process_self()), - MSG_host_get_name(MSG_host_self())); + MSG_host_get_name(MSG_host_self())); XBT_DEBUG("Receiving on channel \"%s\"", channel); diff --git a/doc/msg-tuto-src/masterworker3.c b/doc/msg-tuto-src/masterworker3.c index 75f351defd..e5e9726f6e 100644 --- a/doc/msg-tuto-src/masterworker3.c +++ b/doc/msg-tuto-src/masterworker3.c @@ -59,17 +59,17 @@ int master(int argc, char *argv[]) for (i = 0; i < workers_count; i++) if(host_self == workers[i]) { - workers[i] = workers[workers_count-1]; - workers_count--; - break; + workers[i] = workers[workers_count-1]; + workers_count--; + break; } for (i = 0; i < workers_count; i++) - MSG_process_create("worker", worker, master_name, workers[i]); + MSG_process_create("worker", worker, master_name, workers[i]); } XBT_INFO("Got %d workers and will send tasks for %g seconds!", - workers_count, timeout); + workers_count, timeout); for (i = 0; 1; i++) { char sprintf_buffer[64]; @@ -79,11 +79,11 @@ int master(int argc, char *argv[]) sprintf(sprintf_buffer, "Task_%d", i); task = MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size, - NULL); + NULL); MSG_task_set_category(task, master_name); build_channel_name(channel,master_name, - MSG_host_get_name(workers[i % workers_count])); + MSG_host_get_name(workers[i % workers_count])); XBT_DEBUG("Sending \"%s\" to channel \"%s\"", task->name, channel); MSG_task_send(task, channel); @@ -97,7 +97,7 @@ int master(int argc, char *argv[]) for (i = 0; i < workers_count; i++) { msg_task_t finalize = MSG_task_create("finalize", 0, 0, FINALIZE); MSG_task_send(finalize, build_channel_name(channel,master_name, - MSG_host_get_name(workers[i % workers_count]))); + MSG_host_get_name(workers[i % workers_count]))); } XBT_INFO("Sent %d tasks in total!", task_num); @@ -114,7 +114,7 @@ int worker(int argc, char *argv[]) char channel[1024]; build_channel_name(channel,MSG_process_get_data(MSG_process_self()), - MSG_host_get_name(MSG_host_self())); + MSG_host_get_name(MSG_host_self())); XBT_DEBUG("Receiving on channel \"%s\"", channel); diff --git a/doc/msg-tuto-src/masterworker4.c b/doc/msg-tuto-src/masterworker4.c index c50a067d31..029ceb9135 100644 --- a/doc/msg-tuto-src/masterworker4.c +++ b/doc/msg-tuto-src/masterworker4.c @@ -59,17 +59,17 @@ int master(int argc, char *argv[]) for (i = 0; i < workers_count; i++) if(host_self == workers[i]) { - workers[i] = workers[workers_count-1]; - workers_count--; - break; + workers[i] = workers[workers_count-1]; + workers_count--; + break; } for (i = 0; i < workers_count; i++) - MSG_process_create("worker", worker, master_name, workers[i]); + MSG_process_create("worker", worker, master_name, workers[i]); } XBT_INFO("Got %d workers and will send tasks for %g seconds!", - workers_count, timeout); + workers_count, timeout); xbt_dynar_t idle_hosts = xbt_dynar_new(sizeof(msg_host_t), NULL); msg_host_t request_host = NULL; @@ -90,8 +90,8 @@ int master(int argc, char *argv[]) if(MSG_get_clock()>timeout) { if(xbt_dynar_length(idle_hosts) == workers_count) break; else { - MSG_process_sleep(.1); - continue; + MSG_process_sleep(.1); + continue; } } @@ -103,7 +103,7 @@ int master(int argc, char *argv[]) sprintf(sprintf_buffer, "Task_%d", i); task = MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size, - NULL); + NULL); MSG_task_set_category(task, master_name); xbt_dynar_shift(idle_hosts, &request_host); @@ -123,7 +123,7 @@ int master(int argc, char *argv[]) for (i = 0; i < workers_count; i++) { msg_task_t finalize = MSG_task_create("finalize", 0, 0, FINALIZE); MSG_task_send(finalize, build_channel_name(channel,master_name, - MSG_host_get_name(workers[i % workers_count]))); + MSG_host_get_name(workers[i % workers_count]))); } XBT_INFO("Sent %d tasks in total!", task_num); diff --git a/examples/msg/actions/actions.c b/examples/msg/actions/actions.c index e43c1d45f5..81ef04e928 100644 --- a/examples/msg/actions/actions.c +++ b/examples/msg/actions/actions.c @@ -482,17 +482,17 @@ int main(int argc, char *argv[]) MSG_action_init(); xbt_assert(argc > 2, - "Usage: %s platform_file deployment_file [action_files]\n" - "\t# if all actions are in the same file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml actions\n" - "\t# if actions are in separate files, specified in deployment\n" - "\tExample: %s msg_platform.xml msg_deployment.xml ", - argv[0],argv[0],argv[0]); + "Usage: %s platform_file deployment_file [action_files]\n" + "\t# if all actions are in the same file\n" + "\tExample: %s msg_platform.xml msg_deployment.xml actions\n" + "\t# if actions are in separate files, specified in deployment\n" + "\tExample: %s msg_platform.xml msg_deployment.xml ", + argv[0],argv[0],argv[0]); printf("WARNING: THIS BINARY IS KINDA DEPRECATED\n" - "This example is still relevant if you want to learn about MSG-based trace replay, " - "but if you want to simulate MPI-like traces, you should use the newer version " - "that is in the examples/smpi/replay directory instead.\n"); + "This example is still relevant if you want to learn about MSG-based trace replay, " + "but if you want to simulate MPI-like traces, you should use the newer version " + "that is in the examples/smpi/replay directory instead.\n"); /* Simulation setting */ MSG_create_environment(argv[1]); diff --git a/examples/msg/actions/storage_actions.c b/examples/msg/actions/storage_actions.c index 17758e469d..aa1ef5b41e 100644 --- a/examples/msg/actions/storage_actions.c +++ b/examples/msg/actions/storage_actions.c @@ -58,7 +58,7 @@ static void action_open(const char *const *action) { double clock = MSG_get_clock(); /* this "call" is free thanks to inlining */ sprintf(full_name, "%s:%s", MSG_process_get_name(MSG_process_self()), - file_name); + file_name); ACT_DEBUG("Entering Open: %s (filename: %s)", NAME, file_name); file = MSG_file_open(file_name, NULL); diff --git a/examples/msg/chord/chord.c b/examples/msg/chord/chord.c index 21c6a8c9d1..8de01ef2b0 100644 --- a/examples/msg/chord/chord.c +++ b/examples/msg/chord/chord.c @@ -714,19 +714,19 @@ static int remote_find_successor(node_t node, int ask_to, int id) XBT_DEBUG("Received a task (%p)", task_received); task_data_t ans_data = MSG_task_get_data(task_received); - // Once upon a time, our code assumed that here, task_received != task_sent all the time - // - // This assumption is wrong (as messages from differing round can interleave), leading to a bug in our code. - // We failed to find this bug directly, as it only occured on large platforms, leading to hardly usable traces. - // Instead, we used the model-checker to track down the issue by adding the following test here in the code: - // if (MC_is_active()) { - // MC_assert(task_received == task_sent); + // Once upon a time, our code assumed that here, task_received != task_sent all the time + // + // This assumption is wrong (as messages from differing round can interleave), leading to a bug in our code. + // We failed to find this bug directly, as it only occured on large platforms, leading to hardly usable traces. + // Instead, we used the model-checker to track down the issue by adding the following test here in the code: + // if (MC_is_active()) { + // MC_assert(task_received == task_sent); // } - // That explained the bug in a snap, with a very cool example and everything. - // - // This MC_assert is now desactivated as the case is now properly handled in our code and we don't want the - // MC to fail any further under that condition, but this comment is here to as a memorial for this first - // brillant victory of the model-checking in the SimGrid community :) + // That explained the bug in a snap, with a very cool example and everything. + // + // This MC_assert is now desactivated as the case is now properly handled in our code and we don't want the + // MC to fail any further under that condition, but this comment is here to as a memorial for this first + // brillant victory of the model-checking in the SimGrid community :) if (task_received != task_sent || ans_data->type != TASK_FIND_SUCCESSOR_ANSWER) { @@ -1027,9 +1027,9 @@ int main(int argc, char *argv[]) { MSG_init(&argc, argv); xbt_assert(argc > 2, - "Usage: %s [-nb_bits=n] [-timeout=t] platform_file deployment_file\n" - "\tExample: %s ../msg_platform.xml chord.xml\n", - argv[0], argv[0]); + "Usage: %s [-nb_bits=n] [-timeout=t] platform_file deployment_file\n" + "\tExample: %s ../msg_platform.xml chord.xml\n", + argv[0], argv[0]); char **options = &argv[1]; while (!strncmp(options[0], "-", 1)) { diff --git a/examples/msg/cloud/migrate_vm.c b/examples/msg/cloud/migrate_vm.c index 853400b366..3eaed071e3 100644 --- a/examples/msg/cloud/migrate_vm.c +++ b/examples/msg/cloud/migrate_vm.c @@ -23,8 +23,8 @@ static void vm_migrate(msg_vm_t vm, msg_host_t dst_pm) double mig_end = MSG_get_clock(); XBT_INFO("%s migrated: %s->%s in %g s", MSG_vm_get_name(vm), - MSG_host_get_name(src_pm), MSG_host_get_name(dst_pm), - mig_end - mig_sta); + MSG_host_get_name(src_pm), MSG_host_get_name(dst_pm), + mig_end - mig_sta); } static int migration_worker_main(int argc, char *argv[]) diff --git a/examples/msg/cloud/multicore.c b/examples/msg/cloud/multicore.c index ea56aba5a8..c6bd09f7c0 100644 --- a/examples/msg/cloud/multicore.c +++ b/examples/msg/cloud/multicore.c @@ -29,9 +29,9 @@ static int worker_main(int argc, char *argv[]) struct task_data { - msg_task_t task; - double prev_computation_amount; - double prev_clock; + msg_task_t task; + double prev_computation_amount; + double prev_clock; }; diff --git a/examples/msg/cloud/scale.c b/examples/msg/cloud/scale.c index 338b75fe08..1c45b8cddc 100644 --- a/examples/msg/cloud/scale.c +++ b/examples/msg/cloud/scale.c @@ -24,14 +24,14 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, **/ static double time_precise(void) { - struct timeval tv; - int ret = gettimeofday(&tv, NULL); + struct timeval tv; + int ret = gettimeofday(&tv, NULL); if (ret < 0) xbt_die("gettimeofday"); - double now = (double) tv.tv_sec + tv.tv_usec * 0.001 * 0.001; + double now = (double) tv.tv_sec + tv.tv_usec * 0.001 * 0.001; - return now; + return now; } static int computation_fun(int argc, char *argv[]) { @@ -67,33 +67,33 @@ static int master_main(int argc, char *argv[]) int i = 0; for (i = 0; i < npm; i++) { - pm[i] = xbt_dynar_get_as(hosts_dynar, i, msg_host_t); + pm[i] = xbt_dynar_get_as(hosts_dynar, i, msg_host_t); } for (i = 0; i < nvm; i++) { - int pm_index = i % npm; - char *vm_name = bprintf("vm%d", i); - vm[i] = MSG_vm_create_core(pm[pm_index], vm_name); - MSG_vm_start(vm[i]); + int pm_index = i % npm; + char *vm_name = bprintf("vm%d", i); + vm[i] = MSG_vm_create_core(pm[pm_index], vm_name); + MSG_vm_start(vm[i]); launch_computation_worker(vm[i]); - xbt_free(vm_name); + xbt_free(vm_name); } XBT_INFO("## Test (start)"); for (i = 0; i < 10; i++) { - double clock_sta = time_precise(); - MSG_process_sleep(1); - double clock_end = time_precise(); - XBT_INFO("duration %f", clock_end - clock_sta); + double clock_sta = time_precise(); + MSG_process_sleep(1); + double clock_end = time_precise(); + XBT_INFO("duration %f", clock_end - clock_sta); } for (i = 0; i < nvm; i++) { - MSG_vm_destroy(vm[i]); + MSG_vm_destroy(vm[i]); } XBT_INFO("## Test (ended)"); diff --git a/examples/msg/cloud/two_tasks_vm.c b/examples/msg/cloud/two_tasks_vm.c index 6a0dd2cb8c..d2e826305c 100644 --- a/examples/msg/cloud/two_tasks_vm.c +++ b/examples/msg/cloud/two_tasks_vm.c @@ -70,9 +70,9 @@ static int master_main(int argc, char *argv[]) launch_computation_worker(vm0); while(MSG_get_clock()<100) { - if (atask != NULL) - XBT_INFO("aTask remaining duration: %g", MSG_task_get_flops_amount(atask)); - MSG_process_sleep(1); + if (atask != NULL) + XBT_INFO("aTask remaining duration: %g", MSG_task_get_flops_amount(atask)); + MSG_process_sleep(1); } MSG_process_sleep(10000); diff --git a/examples/msg/energy/consumption/energy_consumption.c b/examples/msg/energy/consumption/energy_consumption.c index f919a12897..092515ddea 100644 --- a/examples/msg/energy/consumption/energy_consumption.c +++ b/examples/msg/energy/consumption/energy_consumption.c @@ -28,16 +28,16 @@ int dvfs(int argc, char *argv[]) XBT_INFO("Energetic profile: %s", - MSG_host_get_property_value(host,"watt_per_state")); + MSG_host_get_property_value(host,"watt_per_state")); XBT_INFO("Initial peak speed=%.0E flop/s; Energy dissipated =%.0E J", - MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host)); + MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host)); double start = MSG_get_clock(); XBT_INFO("Sleep for 10 seconds"); MSG_process_sleep(10); XBT_INFO("Done sleeping (duration: %.2f s). Current peak speed=%.0E; Energy dissipated=%.2f J", - MSG_get_clock()-start, - MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host)); + MSG_get_clock()-start, + MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host)); // Run a task start = MSG_get_clock(); @@ -46,18 +46,18 @@ int dvfs(int argc, char *argv[]) MSG_task_execute (task1); MSG_task_destroy(task1); XBT_INFO("Task done (duration: %.2f s). Current peak speed=%.0E flop/s; Current consumption: from %.0fW to %.0fW depending on load; Energy dissipated=%.0f J", - MSG_get_clock()-start, - MSG_host_get_current_power_peak(host), sg_host_get_wattmin_at(host,MSG_host_get_pstate(host)), - sg_host_get_wattmax_at(host,MSG_host_get_pstate(host)), - sg_host_get_consumed_energy(host)); + MSG_get_clock()-start, + MSG_host_get_current_power_peak(host), sg_host_get_wattmin_at(host,MSG_host_get_pstate(host)), + sg_host_get_wattmax_at(host,MSG_host_get_pstate(host)), + sg_host_get_consumed_energy(host)); // ========= Change power peak ========= int pstate=2; MSG_host_set_pstate(host, pstate); XBT_INFO("========= Requesting pstate %d (speed should be of %.0E flop/s and is of %.0E flop/s)", - pstate, - MSG_host_get_power_peak_at(host, pstate), - MSG_host_get_current_power_peak(host)); + pstate, + MSG_host_get_power_peak_at(host, pstate), + MSG_host_get_current_power_peak(host)); // Run a second task start = MSG_get_clock(); @@ -66,25 +66,25 @@ int dvfs(int argc, char *argv[]) MSG_task_execute (task1); MSG_task_destroy(task1); XBT_INFO("Task done (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J", - MSG_get_clock()-start, - MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host)); + MSG_get_clock()-start, + MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host)); start = MSG_get_clock(); XBT_INFO("Sleep for 4 seconds"); MSG_process_sleep(4); XBT_INFO("Done sleeping (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J", - MSG_get_clock()-start, - MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host)); + MSG_get_clock()-start, + MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host)); // =========== Turn the other host off ========== XBT_INFO("Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 dissipated %.0f J so far.", - sg_host_get_consumed_energy(MSG_host_by_name("MyHost2")) ); + sg_host_get_consumed_energy(MSG_host_by_name("MyHost2")) ); MSG_host_off(MSG_host_by_name("MyHost2")); start = MSG_get_clock(); MSG_process_sleep(10); XBT_INFO("Done sleeping (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J", - MSG_get_clock()-start, - MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host)); + MSG_get_clock()-start, + MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host)); return 0; } @@ -95,8 +95,8 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", - argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", + argv[0], argv[0]); MSG_create_environment(argv[1]); diff --git a/examples/msg/energy/onoff/onoff.c b/examples/msg/energy/onoff/onoff.c index f06d512ef0..4f0b9277c3 100644 --- a/examples/msg/energy/onoff/onoff.c +++ b/examples/msg/energy/onoff/onoff.c @@ -15,7 +15,7 @@ #include "xbt/asserts.h" XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, - "Messages specific for this msg example"); + "Messages specific for this msg example"); static void simulate_bootup(msg_host_t host) { @@ -68,27 +68,27 @@ static int onoff(int argc, char *argv[]) { msg_host_t host1 = MSG_host_by_name("MyHost1"); XBT_INFO("Energetic profile: %s", - MSG_host_get_property_value(host1,"watt_per_state")); + MSG_host_get_property_value(host1,"watt_per_state")); XBT_INFO("Initial peak speed=%.0E flop/s; Energy dissipated =%.0E J", - MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1)); + MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1)); XBT_INFO("Sleep for 10 seconds"); MSG_process_sleep(10); XBT_INFO("Done sleeping. Current peak speed=%.0E; Energy dissipated=%.2f J", - MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1)); + MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1)); simulate_shutdown(host1); XBT_INFO("Host1 is now OFF. Current peak speed=%.0E flop/s; Energy dissipated=%.0f J", - MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1)); + MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1)); XBT_INFO("Sleep for 10 seconds"); MSG_process_sleep(10); XBT_INFO("Done sleeping. Current peak speed=%.0E; Energy dissipated=%.2f J", - MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1)); + MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1)); simulate_bootup(host1); XBT_INFO("Host1 is now ON again. Current peak speed=%.0E flop/s; Energy dissipated=%.0f J", - MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1)); + MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1)); return 0; @@ -101,8 +101,8 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", - argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", + argv[0], argv[0]); MSG_create_environment(argv[1]); diff --git a/examples/msg/energy/pstate/pstate.c b/examples/msg/energy/pstate/pstate.c index 3e07790275..cd37f4d81b 100644 --- a/examples/msg/energy/pstate/pstate.c +++ b/examples/msg/energy/pstate/pstate.c @@ -15,11 +15,11 @@ /** @addtogroup MSG_examples * * - energy/e1/e1.c Shows how a set of pstates can be defined - * for a host and how the current pstate can be accessed/changed - * with @ref MSG_get_host_current_power_peak and @ref - * MSG_set_host_pstate. - * Make sure to read the platform XML file for details on how - * to declare the CPU capacity for each pstate. + * for a host and how the current pstate can be accessed/changed + * with @ref MSG_get_host_current_power_peak and @ref + * MSG_set_host_pstate. + * Make sure to read the platform XML file for details on how + * to declare the CPU capacity for each pstate. * */ @@ -54,10 +54,10 @@ int dvfs(int argc, char *argv[]) // Change power peak if ((new_peak_index >= nb) || (new_peak_index < 0)) - { - XBT_INFO("Cannot set pstate %d, host supports only %d pstates", new_peak_index, nb); - return 0; - } + { + XBT_INFO("Cannot set pstate %d, host supports only %d pstates", new_peak_index, nb); + return 0; + } double peak_at = MSG_host_get_power_peak_at(host, new_peak_index); XBT_INFO("Changing power peak value to %f (at index %d)", peak_at, new_peak_index); @@ -93,8 +93,8 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", - argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", + argv[0], argv[0]); MSG_create_environment(argv[1]); diff --git a/examples/msg/energy/vm/energy_vm.c b/examples/msg/energy/vm/energy_vm.c index 943cc6c527..14a41d67f9 100644 --- a/examples/msg/energy/vm/energy_vm.c +++ b/examples/msg/energy/vm/energy_vm.c @@ -68,8 +68,8 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 1, "Usage: %s platform_file\n" - "\tExample: %s msg_platform.xml\n", - argv[0], argv[0]); + "\tExample: %s msg_platform.xml\n", + argv[0], argv[0]); MSG_create_environment(argv[1]); diff --git a/examples/msg/exception/exception.c b/examples/msg/exception/exception.c index 7d8af4aeff..18d5c1027f 100644 --- a/examples/msg/exception/exception.c +++ b/examples/msg/exception/exception.c @@ -22,7 +22,7 @@ static int victim(int argc, char *argv[]) { msg_error_t res = MSG_OK; XBT_INFO("Let's work."); - TRY { + TRY { res = MSG_task_execute(MSG_task_create("Task", 1e14, 0, NULL)); if (res != MSG_OK) { XBT_INFO("The MSG_task_execute caught the exception for me and returned %d)",res); @@ -115,8 +115,8 @@ int main(int argc, char *argv[]) { MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", - argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", + argv[0], argv[0]); MSG_function_register("terrorist", terrorist); MSG_create_environment(argv[1]); diff --git a/examples/msg/gtnets/gtnets.c b/examples/msg/gtnets/gtnets.c index 839d4a79bc..a2bed8d2be 100644 --- a/examples/msg/gtnets/gtnets.c +++ b/examples/msg/gtnets/gtnets.c @@ -194,8 +194,8 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s platform.xml deployment.xml\n", - argv[0], argv[0]); + "\tExample: %s platform.xml deployment.xml\n", + argv[0], argv[0]); res = test_all(argv[1], argv[2]); diff --git a/examples/msg/icomms/peer.c b/examples/msg/icomms/peer.c index d36b412a76..a94c91e458 100644 --- a/examples/msg/icomms/peer.c +++ b/examples/msg/icomms/peer.c @@ -172,8 +172,8 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", - argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", + argv[0], argv[0]); res = test_all(argv[1], argv[2]); diff --git a/examples/msg/icomms/peer2.c b/examples/msg/icomms/peer2.c index ddd51cad91..b5b4b5b9c0 100644 --- a/examples/msg/icomms/peer2.c +++ b/examples/msg/icomms/peer2.c @@ -128,8 +128,8 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", - argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", + argv[0], argv[0]); res = test_all(argv[1], argv[2]); diff --git a/examples/msg/kademlia/kademlia.c b/examples/msg/kademlia/kademlia.c index 9952786257..5ba12857b2 100644 --- a/examples/msg/kademlia/kademlia.c +++ b/examples/msg/kademlia/kademlia.c @@ -474,8 +474,8 @@ int main(int argc, char *argv[]) /* Check the arguments */ xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", - argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", + argv[0], argv[0]); const char *platform_file = argv[1]; const char *deployment_file = argv[2]; diff --git a/examples/msg/masterslave/masterslave_arg.c b/examples/msg/masterslave/masterslave_arg.c index 5e1be97211..ecaafac2c4 100644 --- a/examples/msg/masterslave/masterslave_arg.c +++ b/examples/msg/masterslave/masterslave_arg.c @@ -90,8 +90,8 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 3, "Usage: %s platform_file number_of_jobs number_of_slaves\n" - "\tExample: %s msg_platform.xml 10 5\n", - argv[0], argv[0]); + "\tExample: %s msg_platform.xml 10 5\n", + argv[0], argv[0]); MSG_function_register("master", master); MSG_function_register("slave", slave); diff --git a/examples/msg/masterslave/masterslave_failure.c b/examples/msg/masterslave/masterslave_failure.c index 8acbc133c8..2b1b3720c7 100644 --- a/examples/msg/masterslave/masterslave_failure.c +++ b/examples/msg/masterslave/masterslave_failure.c @@ -205,8 +205,8 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", - argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", + argv[0], argv[0]); res = test_all(argv[1], argv[2]); diff --git a/examples/msg/masterslave/masterslave_forwarder.c b/examples/msg/masterslave/masterslave_forwarder.c index 6e01b3b52d..8628584291 100644 --- a/examples/msg/masterslave/masterslave_forwarder.c +++ b/examples/msg/masterslave/masterslave_forwarder.c @@ -208,8 +208,8 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", - argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", + argv[0], argv[0]); res = test_all(argv[1], argv[2]); diff --git a/examples/msg/masterslave/masterslave_kill.c b/examples/msg/masterslave/masterslave_kill.c index 316516e16f..91e99146df 100644 --- a/examples/msg/masterslave/masterslave_kill.c +++ b/examples/msg/masterslave/masterslave_kill.c @@ -67,8 +67,8 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment_suspend.xml\n", - argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment_suspend.xml\n", + argv[0], argv[0]); test_all(argv[1], argv[2]); diff --git a/examples/msg/masterslave/masterslave_mailbox.c b/examples/msg/masterslave/masterslave_mailbox.c index ed1a0a751f..77377226bd 100644 --- a/examples/msg/masterslave/masterslave_mailbox.c +++ b/examples/msg/masterslave/masterslave_mailbox.c @@ -103,8 +103,8 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", - argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", + argv[0], argv[0]); platform_file = argv[1]; application_file = argv[2]; diff --git a/examples/msg/migration/migration.c b/examples/msg/migration/migration.c index 8a6bd75650..9a6bd212a2 100644 --- a/examples/msg/migration/migration.c +++ b/examples/msg/migration/migration.c @@ -77,8 +77,8 @@ int main(int argc, char *argv[]) /* Argument checking */ MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment_suspend.xml\n", - argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment_suspend.xml\n", + argv[0], argv[0]); /* Simulation setting */ MSG_create_environment(argv[1]); diff --git a/examples/msg/ns3/ns3.c b/examples/msg/ns3/ns3.c index 2338f1652b..fecc41cf84 100644 --- a/examples/msg/ns3/ns3.c +++ b/examples/msg/ns3/ns3.c @@ -210,8 +210,8 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s platform.xml deployment.xml\n", - argv[0], argv[0]); + "\tExample: %s platform.xml deployment.xml\n", + argv[0], argv[0]); res = test_all(argv[1], argv[2]); diff --git a/examples/msg/parallel_task/parallel_task.c b/examples/msg/parallel_task/parallel_task.c index 51a5b23481..7035cbad36 100644 --- a/examples/msg/parallel_task/parallel_task.c +++ b/examples/msg/parallel_task/parallel_task.c @@ -96,7 +96,7 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 1, "Usage: %s platform_file\n" - "\tExample: %s msg_platform.xml", argv[0], argv[0]); + "\tExample: %s msg_platform.xml", argv[0], argv[0]); res = test_all(argv[1]); return res != MSG_OK; diff --git a/examples/msg/parallel_task/test_ptask.c b/examples/msg/parallel_task/test_ptask.c index 245990eac3..7bf64aaed5 100644 --- a/examples/msg/parallel_task/test_ptask.c +++ b/examples/msg/parallel_task/test_ptask.c @@ -159,8 +159,8 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", - argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", + argv[0], argv[0]); res = test_all(argv[1], argv[2]); diff --git a/examples/msg/pastry/pastry.c b/examples/msg/pastry/pastry.c index 131e8e7e98..bc85c04e86 100644 --- a/examples/msg/pastry/pastry.c +++ b/examples/msg/pastry/pastry.c @@ -141,11 +141,11 @@ static int closest_in_namespace_set(node_t node, int dest) { int i, dist; for (i=0; inamespace_set[i]!=-1) { - dist = abs(node->namespace_set[i] - dest); - if (distnamespace_set[i]; - } + dist = abs(node->namespace_set[i] - dest); + if (distnamespace_set[i]; + } } } } @@ -226,7 +226,7 @@ static void handle_task(node_t node, msg_task_t task) { if (next!=node->id) { get_mailbox(next, mailbox); task_data->sender_id = node->id; - task_data->steps++; + task_data->steps++; task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, task_data); MSG_task_send_with_timeout(task_sent, mailbox, timeout); type = TASK_JOIN_REPLY; @@ -259,7 +259,7 @@ static void handle_task(node_t node, msg_task_t task) { // if first node touched reply, copy its neighborood set if (task_data->sender_id == node->known_id) { - node->neighborhood_set[0] = task_data->sender_id; + node->neighborhood_set[0] = task_data->sender_id; for (i=1; ineighborhood_set[i] = task_data->state->neighborhood_set[i-1]; } @@ -270,7 +270,7 @@ static void handle_task(node_t node, msg_task_t task) { for (i=min;iid, i); for (j=0; jrouting_table[i][j] = task_data->state->routing_table[i][j]; } @@ -280,15 +280,15 @@ static void handle_task(node_t node, msg_task_t task) { XBT_DEBUG("Node %i is ready!!!", node->id); while(xbt_fifo_size(node->pending_tasks)) - handle_task(node, xbt_fifo_pop(node->pending_tasks)); + handle_task(node, xbt_fifo_pop(node->pending_tasks)); - for (i=0; inamespace_set[i]; if (j!=-1) { XBT_DEBUG("Send update to %i", j); get_mailbox(j, mailbox); - - req_data = xbt_new0(s_task_data_t,1); + + req_data = xbt_new0(s_task_data_t,1); req_data->answer_id = node->id; req_data->steps = 0; req_data->type = TASK_UPDATE; @@ -320,65 +320,65 @@ static void handle_task(node_t node, msg_task_t task) { i=0; for (; inamespace_set[i]; - task_namespace_set[i] = task_data->state->namespace_set[i]; + task_namespace_set[i] = task_data->state->namespace_set[i]; } task_namespace_set[i] = task_data->state->id; for (; inamespace_set[i]; - task_namespace_set[i+1] = task_data->state->namespace_set[i]; + curr_namespace_set[i] = node->namespace_set[i]; + task_namespace_set[i+1] = task_data->state->namespace_set[i]; } // get the index of values before and after node->id in task_namespace min = -1; max = -1; for (i=0; i<=NAMESPACE_SIZE; i++) { - j = task_namespace_set[i]; + j = task_namespace_set[i]; if (iid) min = i; - if (j != -1 && max == -1 && j > node->id) max = i; + printf("%08x %08x | ", j, curr_namespace_set[i]); + if (j != -1 && j < node->id) min = i; + if (j != -1 && max == -1 && j > node->id) max = i; } printf("\n"); // add lower elements j = NAMESPACE_SIZE/2-1; for (i=NAMESPACE_SIZE/2-1; i>=0; i--) { - printf("i:%i, j:%i, min:%i, currj:%08x, taskmin:%08x\n", i, j, min, curr_namespace_set[j], task_namespace_set[min]); + printf("i:%i, j:%i, min:%i, currj:%08x, taskmin:%08x\n", i, j, min, curr_namespace_set[j], task_namespace_set[min]); if (min<0) { - node->namespace_set[i] = curr_namespace_set[j]; - j--; - } else if (curr_namespace_set[j] == task_namespace_set[min]) { - node->namespace_set[i] = curr_namespace_set[j]; - j--; min--; - } else if (curr_namespace_set[j] > task_namespace_set[min]) { + node->namespace_set[i] = curr_namespace_set[j]; + j--; + } else if (curr_namespace_set[j] == task_namespace_set[min]) { + node->namespace_set[i] = curr_namespace_set[j]; + j--; min--; + } else if (curr_namespace_set[j] > task_namespace_set[min]) { node->namespace_set[i] = curr_namespace_set[j]; - j--; - } else { + j--; + } else { node->namespace_set[i] = task_namespace_set[min]; - min--; - } + min--; + } } // add greater elements j = NAMESPACE_SIZE/2; for (i=NAMESPACE_SIZE/2; i=NAMESPACE_SIZE) { - node->namespace_set[i] = curr_namespace_set[j]; - j++; - } else if (curr_namespace_set[j] == -1) { - node->namespace_set[i] = task_namespace_set[max]; - max++; - } else if (curr_namespace_set[j] == task_namespace_set[max]) { - node->namespace_set[i] = curr_namespace_set[j]; - j++; max++; - } else if (curr_namespace_set[j] < task_namespace_set[max]) { + node->namespace_set[i] = curr_namespace_set[j]; + j++; + } else if (curr_namespace_set[j] == -1) { + node->namespace_set[i] = task_namespace_set[max]; + max++; + } else if (curr_namespace_set[j] == task_namespace_set[max]) { + node->namespace_set[i] = curr_namespace_set[j]; + j++; max++; + } else if (curr_namespace_set[j] < task_namespace_set[max]) { node->namespace_set[i] = curr_namespace_set[j]; - j++; - } else { + j++; + } else { node->namespace_set[i] = task_namespace_set[max]; - max++; - } + max++; + } } print_node_namespace_set(node); @@ -389,7 +389,7 @@ static void handle_task(node_t node, msg_task_t task) { node->routing_table[i][j] = task_data->state->routing_table[i][j]; } } - } + } } /** @@ -437,7 +437,7 @@ static void print_node(node_t node) { * Print the node id */ static void print_node_id(node_t node) { - int i; + int i; printf(" id: %i '%08x' ", node->id, node->id); for (i=0;iid, i)); @@ -448,7 +448,7 @@ static void print_node_id(node_t node) { * Print the node neighborood set */ static void print_node_neighborood_set(node_t node) { - int i; + int i; printf(" neighborood:\n"); for (i=0; ineighborhood_set[i]); @@ -458,7 +458,7 @@ static void print_node_neighborood_set(node_t node) { * Print the routing table */ static void print_node_routing_table(node_t node) { - int i,j; + int i,j; printf(" routing table:\n"); for (i=0; iid = node->id; for (i=0; i 2, - "Usage: %s [-nb_bits=n] [-timeout=t] platform_file deployment_file\n" - "\tExample: %s ../msg_platform.xml pastry10.xml\n", - argv[0], argv[0]); + "Usage: %s [-nb_bits=n] [-timeout=t] platform_file deployment_file\n" + "\tExample: %s ../msg_platform.xml pastry10.xml\n", + argv[0], argv[0]); char **options = &argv[1]; while (!strncmp(options[0], "-", 1)) { diff --git a/examples/msg/priority/priority.c b/examples/msg/priority/priority.c index 6cc0b81836..b184bf5c86 100644 --- a/examples/msg/priority/priority.c +++ b/examples/msg/priority/priority.c @@ -75,8 +75,8 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", - argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", + argv[0], argv[0]); res = test_all(argv[1], argv[2]); diff --git a/examples/msg/properties/msg_prop.c b/examples/msg/properties/msg_prop.c index 9417692555..15d2ee042b 100644 --- a/examples/msg/properties/msg_prop.c +++ b/examples/msg/properties/msg_prop.c @@ -157,8 +157,8 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", - argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", + argv[0], argv[0]); res = test_all(argv[1], argv[2]); diff --git a/examples/msg/semaphores/synchro.c b/examples/msg/semaphores/synchro.c index aed1405b54..f64e7265c7 100644 --- a/examples/msg/semaphores/synchro.c +++ b/examples/msg/semaphores/synchro.c @@ -72,9 +72,9 @@ int main(int argc, char* argv[]) { MSG_process_create_with_arguments(xbt_strdup("Alice"), peer, NULL, - h, 8, aliceTimes); + h, 8, aliceTimes); MSG_process_create_with_arguments(xbt_strdup("Bob"), peer, NULL, - h, 8, bobTimes); + h, 8, bobTimes); msg_error_t res = MSG_main(); printf("Finished\n"); diff --git a/examples/msg/sendrecv/sendrecv.c b/examples/msg/sendrecv/sendrecv.c index ca12844df9..fbff3868fa 100644 --- a/examples/msg/sendrecv/sendrecv.c +++ b/examples/msg/sendrecv/sendrecv.c @@ -156,7 +156,7 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); res = test_all(argv[1], argv[2]); diff --git a/examples/msg/start_kill_time/sk_time.c b/examples/msg/start_kill_time/sk_time.c index 014059bdb8..00dfcbb2be 100644 --- a/examples/msg/start_kill_time/sk_time.c +++ b/examples/msg/start_kill_time/sk_time.c @@ -51,8 +51,8 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", - argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", + argv[0], argv[0]); test_all(argv[1], argv[2]); diff --git a/examples/msg/suspend/suspend.c b/examples/msg/suspend/suspend.c index 19e5b84580..a36254ae65 100644 --- a/examples/msg/suspend/suspend.c +++ b/examples/msg/suspend/suspend.c @@ -102,8 +102,8 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment_suspend.xml\n", - argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment_suspend.xml\n", + argv[0], argv[0]); test_all(argv[1], argv[2]); diff --git a/examples/s4u/basic/s4u_basic.cpp b/examples/s4u/basic/s4u_basic.cpp index c1e3ca5181..0a7c018ad0 100644 --- a/examples/s4u/basic/s4u_basic.cpp +++ b/examples/s4u/basic/s4u_basic.cpp @@ -11,41 +11,41 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "a sample log category"); class Worker : simgrid::s4u::Actor { public: - Worker(const char*procname, simgrid::s4u::Host *host,int argc, char **argv) - : simgrid::s4u::Actor(procname,host,argc,argv){} + Worker(const char*procname, simgrid::s4u::Host *host,int argc, char **argv) + : simgrid::s4u::Actor(procname,host,argc,argv){} - int main(int argc, char **argv) { - XBT_INFO("Hello s4u, I'm ready to serve"); + int main(int argc, char **argv) { + XBT_INFO("Hello s4u, I'm ready to serve"); - char *msg = (char*)recv(*simgrid::s4u::Mailbox::byName("worker")); - XBT_INFO("I received '%s'",msg); - XBT_INFO("I'm done. See you."); - return 1; - } + char *msg = (char*)recv(*simgrid::s4u::Mailbox::byName("worker")); + XBT_INFO("I received '%s'",msg); + XBT_INFO("I'm done. See you."); + return 1; + } }; class Master : simgrid::s4u::Actor { public: - Master(const char*procname, simgrid::s4u::Host *host,int argc, char **argv) - : Actor(procname,host,argc,argv){} + Master(const char*procname, simgrid::s4u::Host *host,int argc, char **argv) + : Actor(procname,host,argc,argv){} - int main(int argc, char **argv) { - const char *msg = "GaBuZoMeu"; - XBT_INFO("Hello s4u, I have something to send"); - send(*simgrid::s4u::Mailbox::byName("worker"), xbt_strdup(msg), strlen(msg)); + int main(int argc, char **argv) { + const char *msg = "GaBuZoMeu"; + XBT_INFO("Hello s4u, I have something to send"); + send(*simgrid::s4u::Mailbox::byName("worker"), xbt_strdup(msg), strlen(msg)); - XBT_INFO("I'm done. See you."); - return 1; - } + XBT_INFO("I'm done. See you."); + return 1; + } }; int main(int argc, char **argv) { - simgrid::s4u::Engine *e = new simgrid::s4u::Engine(&argc,argv); - e->loadPlatform("../../platforms/two_hosts_platform.xml"); + simgrid::s4u::Engine *e = new simgrid::s4u::Engine(&argc,argv); + e->loadPlatform("../../platforms/two_hosts_platform.xml"); - new Worker("worker", simgrid::s4u::Host::by_name("host0"), 0, NULL); - new Master("master", simgrid::s4u::Host::by_name("host1"), 0, NULL); - e->run(); - return 0; + new Worker("worker", simgrid::s4u::Host::by_name("host0"), 0, NULL); + new Master("master", simgrid::s4u::Host::by_name("host1"), 0, NULL); + e->run(); + return 0; } diff --git a/examples/s4u/io/s4u_io_test.cpp b/examples/s4u/io/s4u_io_test.cpp index c2e9757b5f..789a8f4479 100644 --- a/examples/s4u/io/s4u_io_test.cpp +++ b/examples/s4u/io/s4u_io_test.cpp @@ -13,103 +13,103 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "a sample log category"); class myHost : simgrid::s4u::Actor { public: - myHost(const char*procname, simgrid::s4u::Host *host,int argc, char **argv) + myHost(const char*procname, simgrid::s4u::Host *host,int argc, char **argv) : simgrid::s4u::Actor(procname,host,argc,argv){} - void show_info(boost::unordered_map const&mounts) { - XBT_INFO("Storage info on %s:", - simgrid::s4u::Host::current()->name().c_str()); - - for (const auto&kv : mounts) { - const char* mountpoint = kv.first.c_str(); - simgrid::s4u::Storage &storage = *kv.second; - - // Retrieve disk's information - sg_size_t free_size = storage.size_free(); - sg_size_t used_size = storage.size_used(); - sg_size_t size = storage.size(); - - XBT_INFO(" %s (%s) Used: %llu; Free: %llu; Total: %llu.", - storage.name(), mountpoint, used_size, free_size, size); - } - } - - int main(int argc, char **argv) { - boost::unordered_map const& mounts = - simgrid::s4u::Host::current()->mounted_storages(); - - show_info(mounts); - - // Open an non-existing file to create it - const char *filename = "/home/tmp/data.txt"; - simgrid::s4u::File *file = new simgrid::s4u::File(filename, NULL); - sg_size_t write, read, file_size; - - write = file->write(200000); // Write 200,000 bytes - XBT_INFO("Create a %llu bytes file named '%s' on /sd1", write, filename); - - // check that sizes have changed - show_info(mounts); - - // Now retrieve the size of created file and read it completely - file_size = file->size(); - file->seek(0); - read = file->read(file_size); - XBT_INFO("Read %llu bytes on %s", read, filename); - - // Now write 100,000 bytes in tmp/data.txt - write = file->write(100000); // Write 100,000 bytes - XBT_INFO("Write %llu bytes on %s", write, filename); - - simgrid::s4u::Storage &storage = simgrid::s4u::Storage::byName("Disk4"); - - // Now rename file from ./tmp/data.txt to ./tmp/simgrid.readme - const char *newpath = "/home/tmp/simgrid.readme"; - XBT_INFO("Move '%s' to '%s'", file->path(), newpath); - file->move(newpath); - - // Test attaching some user data to the file - file->set_userdata(xbt_strdup("777")); - XBT_INFO("User data attached to the file: %s", (char*)file->userdata()); - - // Close the file - delete file; - - // Now attach some user data to disk1 - XBT_INFO("Get/set data for storage element: %s",storage.name()); - XBT_INFO(" Uninitialized storage data: '%s'", (char*)storage.userdata()); - - storage.set_userdata(xbt_strdup("Some user data")); - XBT_INFO(" Set and get data: '%s'", (char*)storage.userdata()); - - /* - // Dump disks contents - XBT_INFO("*** Dump content of %s ***",Host::current()->name()); - xbt_dict_t contents = NULL; - contents = MSG_host_get_storage_content(MSG_host_self()); // contents is a dict of dicts - xbt_dict_cursor_t curs, curs2 = NULL; - char* mountname; - xbt_dict_t content; - char* path; - sg_size_t *size; - xbt_dict_foreach(contents, curs, mountname, content){ - XBT_INFO("Print the content of mount point: %s",mountname); - xbt_dict_foreach(content,curs2,path,size){ - XBT_INFO("%s size: %llu bytes", path,*((sg_size_t*)size)); - } - xbt_dict_free(&content); - } - xbt_dict_free(&contents); - */ - return 0; - } + void show_info(boost::unordered_map const&mounts) { + XBT_INFO("Storage info on %s:", + simgrid::s4u::Host::current()->name().c_str()); + + for (const auto&kv : mounts) { + const char* mountpoint = kv.first.c_str(); + simgrid::s4u::Storage &storage = *kv.second; + + // Retrieve disk's information + sg_size_t free_size = storage.size_free(); + sg_size_t used_size = storage.size_used(); + sg_size_t size = storage.size(); + + XBT_INFO(" %s (%s) Used: %llu; Free: %llu; Total: %llu.", + storage.name(), mountpoint, used_size, free_size, size); + } + } + + int main(int argc, char **argv) { + boost::unordered_map const& mounts = + simgrid::s4u::Host::current()->mounted_storages(); + + show_info(mounts); + + // Open an non-existing file to create it + const char *filename = "/home/tmp/data.txt"; + simgrid::s4u::File *file = new simgrid::s4u::File(filename, NULL); + sg_size_t write, read, file_size; + + write = file->write(200000); // Write 200,000 bytes + XBT_INFO("Create a %llu bytes file named '%s' on /sd1", write, filename); + + // check that sizes have changed + show_info(mounts); + + // Now retrieve the size of created file and read it completely + file_size = file->size(); + file->seek(0); + read = file->read(file_size); + XBT_INFO("Read %llu bytes on %s", read, filename); + + // Now write 100,000 bytes in tmp/data.txt + write = file->write(100000); // Write 100,000 bytes + XBT_INFO("Write %llu bytes on %s", write, filename); + + simgrid::s4u::Storage &storage = simgrid::s4u::Storage::byName("Disk4"); + + // Now rename file from ./tmp/data.txt to ./tmp/simgrid.readme + const char *newpath = "/home/tmp/simgrid.readme"; + XBT_INFO("Move '%s' to '%s'", file->path(), newpath); + file->move(newpath); + + // Test attaching some user data to the file + file->set_userdata(xbt_strdup("777")); + XBT_INFO("User data attached to the file: %s", (char*)file->userdata()); + + // Close the file + delete file; + + // Now attach some user data to disk1 + XBT_INFO("Get/set data for storage element: %s",storage.name()); + XBT_INFO(" Uninitialized storage data: '%s'", (char*)storage.userdata()); + + storage.set_userdata(xbt_strdup("Some user data")); + XBT_INFO(" Set and get data: '%s'", (char*)storage.userdata()); + + /* + // Dump disks contents + XBT_INFO("*** Dump content of %s ***",Host::current()->name()); + xbt_dict_t contents = NULL; + contents = MSG_host_get_storage_content(MSG_host_self()); // contents is a dict of dicts + xbt_dict_cursor_t curs, curs2 = NULL; + char* mountname; + xbt_dict_t content; + char* path; + sg_size_t *size; + xbt_dict_foreach(contents, curs, mountname, content){ + XBT_INFO("Print the content of mount point: %s",mountname); + xbt_dict_foreach(content,curs2,path,size){ + XBT_INFO("%s size: %llu bytes", path,*((sg_size_t*)size)); + } + xbt_dict_free(&content); + } + xbt_dict_free(&contents); + */ + return 0; + } }; int main(int argc, char **argv) { - simgrid::s4u::Engine *e = new simgrid::s4u::Engine(&argc,argv); - e->loadPlatform("../../platforms/storage/storage.xml"); + simgrid::s4u::Engine *e = new simgrid::s4u::Engine(&argc,argv); + e->loadPlatform("../../platforms/storage/storage.xml"); - new myHost("host", simgrid::s4u::Host::by_name("denise"), 0, NULL); - e->run(); - return 0; + new myHost("host", simgrid::s4u::Host::by_name("denise"), 0, NULL); + e->run(); + return 0; } diff --git a/examples/simdag/dax/dax_test.c b/examples/simdag/dax/dax_test.c index 024c00d7bd..3d68e1b0be 100644 --- a/examples/simdag/dax/dax_test.c +++ b/examples/simdag/dax/dax_test.c @@ -35,13 +35,13 @@ int main(int argc, char **argv) /* Check our arguments */ xbt_assert(argc > 2, "Usage: %s platform_file dax_file [jedule_file]\n" - "\tExample: %s simulacrum_7_hosts.xml Montage_25.xml Montage_25.jed", - argv[0], argv[0]); + "\tExample: %s simulacrum_7_hosts.xml Montage_25.xml Montage_25.jed", + argv[0], argv[0]); char *last = strrchr(argv[2], '.'); char * tracefilename = bprintf("%.*s.trace",(int) (last == NULL ? - strlen(argv[2]) : - last - argv[2]), argv[2]); + strlen(argv[2]) : + last - argv[2]), argv[2]); if (argc == 4) tracefilename = xbt_strdup(argv[3]); diff --git a/examples/simdag/properties/sd_prop.c b/examples/simdag/properties/sd_prop.c index ad340f4a5d..c03f7d0053 100644 --- a/examples/simdag/properties/sd_prop.c +++ b/examples/simdag/properties/sd_prop.c @@ -30,8 +30,8 @@ int main(int argc, char **argv) /* SD initialization */ SD_init(&argc, argv); xbt_assert(argc > 1, - "Usage: %s platform_file\n\tExample: %s ../two_hosts.xml", - argv[0], argv[0]); + "Usage: %s platform_file\n\tExample: %s ../two_hosts.xml", + argv[0], argv[0]); SD_create_environment(argv[1]); diff --git a/examples/simdag/scheduling/minmin_test.c b/examples/simdag/scheduling/minmin_test.c index 8ecf2d531b..8e672a9b9f 100644 --- a/examples/simdag/scheduling/minmin_test.c +++ b/examples/simdag/scheduling/minmin_test.c @@ -112,8 +112,8 @@ static double finish_on_at(SD_task_t task, sg_host_t workstation) grand_parents = SD_task_get_parents(parent); xbt_assert(xbt_dynar_length(grand_parents) <2, - "Error: transfer %s has 2 parents", - SD_task_get_name(parent)); + "Error: transfer %s has 2 parents", + SD_task_get_name(parent)); xbt_dynar_get_cpy(grand_parents, 0, &grand_parent); diff --git a/examples/simdag/sd_comm_throttling.c b/examples/simdag/sd_comm_throttling.c index 12657107e1..8bbcf9556c 100644 --- a/examples/simdag/sd_comm_throttling.c +++ b/examples/simdag/sd_comm_throttling.c @@ -27,7 +27,7 @@ int main(int argc, char **argv) /* xbt_log_control_set("sd.thres=debug"); */ xbt_assert(argc > 1, "Usage: %s platform_file\n" - "\nExample: %s two_clusters.xml", argv[0], argv[0]); + "\nExample: %s two_clusters.xml", argv[0], argv[0]); /* creation of the environment */ platform_file = argv[1]; diff --git a/examples/simdag/sd_test.c b/examples/simdag/sd_test.c index 2f236a65d2..5acc969a2a 100644 --- a/examples/simdag/sd_test.c +++ b/examples/simdag/sd_test.c @@ -43,7 +43,7 @@ int main(int argc, char **argv) /* xbt_log_control_set("sd.thres=debug"); */ xbt_assert(argc > 1, "Usage: %s platform_file\n" - "\nExample: %s two_clusters.xml", argv[0], argv[0]); + "\nExample: %s two_clusters.xml", argv[0], argv[0]); /* creation of the environment */ platform_file = argv[1]; diff --git a/examples/simdag/sd_test2.c b/examples/simdag/sd_test2.c index d589e33746..ce4f739dda 100644 --- a/examples/simdag/sd_test2.c +++ b/examples/simdag/sd_test2.c @@ -61,8 +61,8 @@ int main(int argc, char **argv) /* creation of the environment */ xbt_assert(strstr(argv[1],".xml"), - "Unsupported platform description style (not XML): %s", - argv[1]); + "Unsupported platform description style (not XML): %s", + argv[1]); SD_create_environment(argv[1]); /* getting platform infos */ diff --git a/examples/simdag/sd_typed_tasks_test.c b/examples/simdag/sd_typed_tasks_test.c index 4e29f2c27b..632ca94026 100644 --- a/examples/simdag/sd_typed_tasks_test.c +++ b/examples/simdag/sd_typed_tasks_test.c @@ -33,7 +33,7 @@ int main(int argc, char **argv) /* xbt_log_control_set("sd.thres=debug"); */ xbt_assert(argc > 1, "Usage: %s platform_file\n" - "\nExample: %s two_clusters.xml", argv[0], argv[0]); + "\nExample: %s two_clusters.xml", argv[0], argv[0]); /* creation of the environment */ platform_file = argv[1]; diff --git a/examples/smpi/MM/MM_mpi.c b/examples/smpi/MM/MM_mpi.c index 871f83e4df..6767ba47e9 100644 --- a/examples/smpi/MM/MM_mpi.c +++ b/examples/smpi/MM/MM_mpi.c @@ -81,16 +81,16 @@ int main(int argc, char ** argv) case 'h': XBT_INFO( "Usage: mxm_cblas_test [options]\n" - " -M I M size (default: %zu)\n" - " -N I N size (default: %zu)\n" - " -K I K size (default: %zu)\n" - " -B I Block size on the k dimension(default: %zu)\n" - " -G I Number of processor groups(default: %zu)\n" - " -g I group index(default: %zu)\n" - " -k I group rank(default: %zu)\n" - " -r I processor row size (default: %zu)\n" - " -c I processor col size (default: %zu)\n" - " -h help\n", + " -M I M size (default: %zu)\n" + " -N I N size (default: %zu)\n" + " -K I K size (default: %zu)\n" + " -B I Block size on the k dimension(default: %zu)\n" + " -G I Number of processor groups(default: %zu)\n" + " -g I group index(default: %zu)\n" + " -k I group rank(default: %zu)\n" + " -r I processor row size (default: %zu)\n" + " -c I processor col size (default: %zu)\n" + " -h help\n", m, n, k, Block_size, NB_groups, group, key, row, col); return 0; case 'M': diff --git a/examples/smpi/mc/non_termination4.c b/examples/smpi/mc/non_termination4.c index c992b2491e..5d6a8291f0 100644 --- a/examples/smpi/mc/non_termination4.c +++ b/examples/smpi/mc/non_termination4.c @@ -6,7 +6,7 @@ int x = 20; int main(int argc, char **argv) { - int recv_x = 1, size, rank; + int recv_x = 1, size, rank; MPI_Status status; MPI_Init(&argc, &argv); @@ -35,5 +35,5 @@ int main(int argc, char **argv) { MPI_Finalize(); - return 0; + return 0; } diff --git a/examples/smpi/replay_multiple/replay_multiple.c b/examples/smpi/replay_multiple/replay_multiple.c index bb0694970b..03ec4b4c20 100644 --- a/examples/smpi/replay_multiple/replay_multiple.c +++ b/examples/smpi/replay_multiple/replay_multiple.c @@ -13,70 +13,70 @@ #include "xbt/asserts.h" #include "smpi/smpi.h" XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, - "Messages specific for this msg example"); + "Messages specific for this msg example"); static int smpi_replay(int argc, char *argv[]) { - smpi_replay_run(&argc, &argv); - return 0; + smpi_replay_run(&argc, &argv); + return 0; } int main(int argc, char *argv[]){ - msg_error_t res; - const char *platform_file; - const char *application_file; - const char *description_file; - - MSG_init(&argc, argv); - - if (argc < 4) { - printf("Usage: %s description_file platform_file deployment_file\n", argv[0]); - printf("example: %s smpi_multiple_apps msg_platform.xml msg_deployment.xml\n", argv[0]); - exit(1); - } - description_file = argv[1]; - platform_file = argv[2]; - application_file = argv[3]; - - - /* Simulation setting */ - MSG_create_environment(platform_file); - - /* Application deployment: read the description file in order to identify instances to launch */ - FILE* fp = fopen(description_file, "r"); - if (fp == NULL) - xbt_die("Cannot open %s", description_file); - ssize_t read; - char *line = NULL; - size_t n = 0; - int instance_size = 0; - const char* instance_id = NULL; - while ((read = xbt_getline(&line, &n, fp)) != -1 ){ - xbt_dynar_t elems = xbt_str_split_quoted_in_place(line); - if(xbt_dynar_length(elems)<3){ - xbt_die ("Not enough elements in the line"); - } - - const char** line_char= xbt_dynar_to_array(elems); - instance_id = line_char[0]; - instance_size = atoi(line_char[2]); - - XBT_INFO("Initializing instance %s of size %d", instance_id, instance_size); - SMPI_app_instance_register(instance_id, smpi_replay,instance_size); - - xbt_free(line_char); - } - - MSG_launch_application(application_file); - SMPI_init(); - - res = MSG_main(); - - XBT_INFO("Simulation time %g", MSG_get_clock()); - - SMPI_finalize(); - if (res == MSG_OK) - return 0; - else - return 1; + msg_error_t res; + const char *platform_file; + const char *application_file; + const char *description_file; + + MSG_init(&argc, argv); + + if (argc < 4) { + printf("Usage: %s description_file platform_file deployment_file\n", argv[0]); + printf("example: %s smpi_multiple_apps msg_platform.xml msg_deployment.xml\n", argv[0]); + exit(1); + } + description_file = argv[1]; + platform_file = argv[2]; + application_file = argv[3]; + + + /* Simulation setting */ + MSG_create_environment(platform_file); + + /* Application deployment: read the description file in order to identify instances to launch */ + FILE* fp = fopen(description_file, "r"); + if (fp == NULL) + xbt_die("Cannot open %s", description_file); + ssize_t read; + char *line = NULL; + size_t n = 0; + int instance_size = 0; + const char* instance_id = NULL; + while ((read = xbt_getline(&line, &n, fp)) != -1 ){ + xbt_dynar_t elems = xbt_str_split_quoted_in_place(line); + if(xbt_dynar_length(elems)<3){ + xbt_die ("Not enough elements in the line"); + } + + const char** line_char= xbt_dynar_to_array(elems); + instance_id = line_char[0]; + instance_size = atoi(line_char[2]); + + XBT_INFO("Initializing instance %s of size %d", instance_id, instance_size); + SMPI_app_instance_register(instance_id, smpi_replay,instance_size); + + xbt_free(line_char); + } + + MSG_launch_application(application_file); + SMPI_init(); + + res = MSG_main(); + + XBT_INFO("Simulation time %g", MSG_get_clock()); + + SMPI_finalize(); + if (res == MSG_OK) + return 0; + else + return 1; } diff --git a/include/simgrid/msg.h b/include/simgrid/msg.h index 0e03906d65..93b95399a5 100644 --- a/include/simgrid/msg.h +++ b/include/simgrid/msg.h @@ -208,7 +208,7 @@ XBT_PUBLIC(void) MSG_config(const char *key, const char *value); * We allow to link against compiled versions that differ in the patch level. */ #define MSG_init(argc,argv) do { \ - sg_version_check(SIMGRID_VERSION_MAJOR,SIMGRID_VERSION_MINOR,SIMGRID_VERSION_PATCH);\ + sg_version_check(SIMGRID_VERSION_MAJOR,SIMGRID_VERSION_MINOR,SIMGRID_VERSION_PATCH);\ MSG_init_nocheck(argc,argv); \ } while (0) diff --git a/include/simgrid/s4u/actor.hpp b/include/simgrid/s4u/actor.hpp index f8074076d5..696da86dad 100644 --- a/include/simgrid/s4u/actor.hpp +++ b/include/simgrid/s4u/actor.hpp @@ -30,74 +30,74 @@ namespace s4u { * * class Worker : simgrid::s4u::Actor { * - * int main(int argc, char **argv) { - * printf("Hello s4u"); - * } + * int main(int argc, char **argv) { + * printf("Hello s4u"); + * } * }; * \endverbatim * */ XBT_PUBLIC_CLASS Actor { - friend Comm; - Actor(smx_process_t smx_proc); + friend Comm; + Actor(smx_process_t smx_proc); public: - Actor(const char*name, s4u::Host *host, int argc, char **argv); - Actor(const char*name, s4u::Host *host, int argc, char **argv, double killTime); - virtual ~Actor() {} - - /** The main method of your agent */ - virtual int main(int argc, char **argv); - - /** The Actor that is currently running */ - static Actor *current(); - /** Retrieves the actor that have the given PID (or NULL if not existing) */ - static Actor *byPid(int pid); - - /** Retrieves the name of that actor */ - const char*getName(); - /** Retrieves the host on which that actor is running */ - s4u::Host *getHost(); - /** Retrieves the PID of that actor */ - int getPid(); - - /** If set to true, the actor will automatically restart when its host reboots */ - void setAutoRestart(bool autorestart); - /** Sets the time at which that actor should be killed */ - void setKillTime(double time); - /** Retrieves the time at which that actor will be killed (or -1 if not set) */ - double getKillTime(); - - /** Ask kindly to all actors to die. Only the issuer will survive. */ - static void killAll(); - /** Ask the actor to die. - * - * It will only notice your request when doing a simcall next time (a communication or similar). - * SimGrid sometimes have issues when you kill actors that are currently communicating and such. We are working on it to fix the issues. - */ - void kill(); - - /** Block the actor sleeping for that amount of seconds (may throws hostFailure) */ - void sleep(double duration); - - /** Block the actor, computing the given amount of flops */ - e_smx_state_t execute(double flop); - - /** Block the actor until it gets a message from the given mailbox. - * - * See \ref Comm for the full communication API (including non blocking communications). - */ - void *recv(Mailbox &chan); - - /** Block the actor until it delivers a message of the given simulated size to the given mailbox - * - * See \ref Comm for the full communication API (including non blocking communications). - */ - void send(Mailbox &chan, void*payload, size_t simulatedSize); + Actor(const char*name, s4u::Host *host, int argc, char **argv); + Actor(const char*name, s4u::Host *host, int argc, char **argv, double killTime); + virtual ~Actor() {} + + /** The main method of your agent */ + virtual int main(int argc, char **argv); + + /** The Actor that is currently running */ + static Actor *current(); + /** Retrieves the actor that have the given PID (or NULL if not existing) */ + static Actor *byPid(int pid); + + /** Retrieves the name of that actor */ + const char*getName(); + /** Retrieves the host on which that actor is running */ + s4u::Host *getHost(); + /** Retrieves the PID of that actor */ + int getPid(); + + /** If set to true, the actor will automatically restart when its host reboots */ + void setAutoRestart(bool autorestart); + /** Sets the time at which that actor should be killed */ + void setKillTime(double time); + /** Retrieves the time at which that actor will be killed (or -1 if not set) */ + double getKillTime(); + + /** Ask kindly to all actors to die. Only the issuer will survive. */ + static void killAll(); + /** Ask the actor to die. + * + * It will only notice your request when doing a simcall next time (a communication or similar). + * SimGrid sometimes have issues when you kill actors that are currently communicating and such. We are working on it to fix the issues. + */ + void kill(); + + /** Block the actor sleeping for that amount of seconds (may throws hostFailure) */ + void sleep(double duration); + + /** Block the actor, computing the given amount of flops */ + e_smx_state_t execute(double flop); + + /** Block the actor until it gets a message from the given mailbox. + * + * See \ref Comm for the full communication API (including non blocking communications). + */ + void *recv(Mailbox &chan); + + /** Block the actor until it delivers a message of the given simulated size to the given mailbox + * + * See \ref Comm for the full communication API (including non blocking communications). + */ + void send(Mailbox &chan, void*payload, size_t simulatedSize); protected: - smx_process_t getInferior() {return p_smx_process;} + smx_process_t getInferior() {return p_smx_process;} private: - smx_process_t p_smx_process; + smx_process_t p_smx_process; }; }} // namespace simgrid::s4u @@ -106,34 +106,34 @@ private: #if 0 public abstract class Actor implements Runnable { - /** Suspends the process. See {@link #resume()} to resume it afterward */ - public native void suspend(); - /** Resume a process that was suspended by {@link #suspend()}. */ - public native void resume(); - /** Tests if a process is suspended. */ - public native boolean isSuspended(); - - /** - * Returns the value of a given process property. - */ - public native String getProperty(String name); - - - /** - * Migrates a process to another host. - * - * @param host The host where to migrate the process. - * - */ - public native void migrate(Host host); - - public native void exit(); - /** - * This static method returns the current amount of processes running - * - * @return The count of the running processes - */ - public native static int getCount(); + /** Suspends the process. See {@link #resume()} to resume it afterward */ + public native void suspend(); + /** Resume a process that was suspended by {@link #suspend()}. */ + public native void resume(); + /** Tests if a process is suspended. */ + public native boolean isSuspended(); + + /** + * Returns the value of a given process property. + */ + public native String getProperty(String name); + + + /** + * Migrates a process to another host. + * + * @param host The host where to migrate the process. + * + */ + public native void migrate(Host host); + + public native void exit(); + /** + * This static method returns the current amount of processes running + * + * @return The count of the running processes + */ + public native static int getCount(); } #endif diff --git a/include/simgrid/s4u/async.hpp b/include/simgrid/s4u/async.hpp index 37bd4e144f..6500b79640 100644 --- a/include/simgrid/s4u/async.hpp +++ b/include/simgrid/s4u/async.hpp @@ -15,7 +15,7 @@ SG_BEGIN_DECL(); typedef enum { - inited, started, finished + inited, started, finished } e_s4u_async_state_t; SG_END_DECL(); @@ -27,51 +27,51 @@ namespace s4u { * This class is the ancestor of every asynchronous actions, that is, of actions that do take time in the simulated world. */ XBT_PUBLIC_CLASS Async { - friend Comm; + friend Comm; protected: - Async(); - virtual ~Async(); - + Async(); + virtual ~Async(); + private: - struct s_smx_synchro *p_inferior = NULL; + struct s_smx_synchro *p_inferior = NULL; private: - e_s4u_async_state_t p_state = inited; + e_s4u_async_state_t p_state = inited; public: - /** Starts a previously created async. - * - * This function is optional: you can call wait() even if you didn't call start() - */ - virtual void start()=0; - /** Tests whether the given async is terminated yet */ - //virtual bool test()=0; - /** Blocks until the async is terminated */ - virtual void wait()=0; - /** Blocks until the async is terminated, or until the timeout is elapsed - * Raises: timeout exception.*/ - virtual void wait(double timeout)=0; - /** Cancel that async */ - //virtual void cancel(); - /** Retrieve the current state of the async */ - e_s4u_async_state_t getState() {return p_state;} + /** Starts a previously created async. + * + * This function is optional: you can call wait() even if you didn't call start() + */ + virtual void start()=0; + /** Tests whether the given async is terminated yet */ + //virtual bool test()=0; + /** Blocks until the async is terminated */ + virtual void wait()=0; + /** Blocks until the async is terminated, or until the timeout is elapsed + * Raises: timeout exception.*/ + virtual void wait(double timeout)=0; + /** Cancel that async */ + //virtual void cancel(); + /** Retrieve the current state of the async */ + e_s4u_async_state_t getState() {return p_state;} private: - double p_remains = 0; + double p_remains = 0; public: - /** Get the remaining amount of work that this Async entails. When it's 0, it's done. */ - double getRemains(); - /** Set the [remaining] amount of work that this Async will entail - * - * It is forbidden to change the amount of work once the Async is started */ - void setRemains(double remains); + /** Get the remaining amount of work that this Async entails. When it's 0, it's done. */ + double getRemains(); + /** Set the [remaining] amount of work that this Async will entail + * + * It is forbidden to change the amount of work once the Async is started */ + void setRemains(double remains); private: - void *p_userData = NULL; + void *p_userData = NULL; public: - /** Put some user data onto the Async */ - void setUserData(void *data) {p_userData=data;} - /** Retrieve the user data of the Async */ - void *getUserData() { return p_userData; } + /** Put some user data onto the Async */ + void setUserData(void *data) {p_userData=data;} + /** Retrieve the user data of the Async */ + void *getUserData() { return p_userData; } }; // class }}; // Namespace simgrid::s4u diff --git a/include/simgrid/s4u/comm.hpp b/include/simgrid/s4u/comm.hpp index fa6b0648e0..ded149660e 100644 --- a/include/simgrid/s4u/comm.hpp +++ b/include/simgrid/s4u/comm.hpp @@ -20,61 +20,61 @@ namespace s4u { * Represents all asynchronous communications, that you can test or wait onto. */ XBT_PUBLIC_CLASS Comm : public Async { - Comm() : Async() {} + Comm() : Async() {} public: - virtual ~Comm(); + virtual ~Comm(); public: - /** Creates (but don't start) an async send to the mailbox #dest */ - static Comm &send_init(Actor *sender, Mailbox &dest); - /** Creates and start an async send to the mailbox #dest */ - static Comm &send_async(s4u::Actor *sender, Mailbox &dest, void *data, int simulatedByteAmount); + /** Creates (but don't start) an async send to the mailbox #dest */ + static Comm &send_init(Actor *sender, Mailbox &dest); + /** Creates and start an async send to the mailbox #dest */ + static Comm &send_async(s4u::Actor *sender, Mailbox &dest, void *data, int simulatedByteAmount); /** Creates (but don't start) an async recv onto the mailbox #from */ - static Comm &recv_init(s4u::Actor *receiver, Mailbox &from); - /** Creates and start an async recv to the mailbox #from */ - static Comm &recv_async(s4u::Actor *receiver, Mailbox &from, void **data); + static Comm &recv_init(s4u::Actor *receiver, Mailbox &from); + /** Creates and start an async recv to the mailbox #from */ + static Comm &recv_async(s4u::Actor *receiver, Mailbox &from, void **data); - void start() override; - void wait() override; - void wait(double timeout) override; + void start() override; + void wait() override; + void wait(double timeout) override; private: - double p_rate=-1; + double p_rate=-1; public: - /** Sets the maximal communication rate (in byte/sec). Must be done before start */ - void setRate(double rate); + /** Sets the maximal communication rate (in byte/sec). Must be done before start */ + void setRate(double rate); private: - void *p_dstBuff = NULL; - size_t p_dstBuffSize = 0; - void *p_srcBuff = NULL; - size_t p_srcBuffSize = sizeof(void*); + void *p_dstBuff = NULL; + size_t p_dstBuffSize = 0; + void *p_srcBuff = NULL; + size_t p_srcBuffSize = sizeof(void*); public: - /** Specify the data to send */ - void setSrcData(void * buff); - /** Specify the size of the data to send */ - void setSrcDataSize(size_t size); - /** Specify the data to send and its size */ - void setSrcData(void * buff, size_t size); + /** Specify the data to send */ + void setSrcData(void * buff); + /** Specify the size of the data to send */ + void setSrcDataSize(size_t size); + /** Specify the data to send and its size */ + void setSrcData(void * buff, size_t size); - /** Specify where to receive the data */ - void setDstData(void ** buff); - /** Specify the buffer in which the data should be received */ - void setDstData(void ** buff, size_t size); - /** Retrieve the size of the received data */ - size_t getDstDataSize(); + /** Specify where to receive the data */ + void setDstData(void ** buff); + /** Specify the buffer in which the data should be received */ + void setDstData(void ** buff, size_t size); + /** Retrieve the size of the received data */ + size_t getDstDataSize(); private: /* FIXME: expose these elements in the API */ - int p_detached = 0; + int p_detached = 0; int (*p_matchFunction)(void *, void *, smx_synchro_t) = NULL; void (*p_cleanFunction)(void *) = NULL; void (*p_copyDataFunction)(smx_synchro_t, void*, size_t) = NULL; private: - Actor *p_sender = NULL; - Actor *p_receiver = NULL; - Mailbox *p_mailbox = NULL; + Actor *p_sender = NULL; + Actor *p_receiver = NULL; + Mailbox *p_mailbox = NULL; }; }} // namespace simgrid::s4u diff --git a/include/simgrid/s4u/engine.hpp b/include/simgrid/s4u/engine.hpp index da1d33ae3e..e5bc4d2ba0 100644 --- a/include/simgrid/s4u/engine.hpp +++ b/include/simgrid/s4u/engine.hpp @@ -18,35 +18,35 @@ namespace s4u { */ XBT_PUBLIC_CLASS Engine { public: - /** Constructor, taking the command line parameters of your main function */ - Engine(int *argc, char **argv); - - /** @brief Load a platform file describing the environment - * - * The environment is either a XML file following the simgrid.dtd formalism, or a lua file. - * Some examples can be found in the directory examples/platforms. - */ - void loadPlatform(const char *platf); - - /** Registers the main function of an actor that will be launched from the deployment file */ - void register_function(const char*name, int (*code)(int,char**)); - - /** Registers a function as the default main function of actors - * - * It will be used as fallback when the function requested from the deployment file was not registered. - * It is used for trace-based simulations (see examples/msg/actions). - */ - void register_default(int (*code)(int,char**)); - - /** @brief Load a deployment file and launch the actors that it contains */ - void loadDeployment(const char *deploy); - - /** @brief Run the simulation */ - void run(); - - /** @brief Retrieve the simulation time */ - static double getClock(); - + /** Constructor, taking the command line parameters of your main function */ + Engine(int *argc, char **argv); + + /** @brief Load a platform file describing the environment + * + * The environment is either a XML file following the simgrid.dtd formalism, or a lua file. + * Some examples can be found in the directory examples/platforms. + */ + void loadPlatform(const char *platf); + + /** Registers the main function of an actor that will be launched from the deployment file */ + void register_function(const char*name, int (*code)(int,char**)); + + /** Registers a function as the default main function of actors + * + * It will be used as fallback when the function requested from the deployment file was not registered. + * It is used for trace-based simulations (see examples/msg/actions). + */ + void register_default(int (*code)(int,char**)); + + /** @brief Load a deployment file and launch the actors that it contains */ + void loadDeployment(const char *deploy); + + /** @brief Run the simulation */ + void run(); + + /** @brief Retrieve the simulation time */ + static double getClock(); + }; }} // namespace simgrid::sgo diff --git a/include/simgrid/s4u/file.hpp b/include/simgrid/s4u/file.hpp index 6c4ccd0ce7..f2182a384d 100644 --- a/include/simgrid/s4u/file.hpp +++ b/include/simgrid/s4u/file.hpp @@ -27,56 +27,56 @@ class Storage; */ XBT_PUBLIC_CLASS File { public: - File(const char *fullpath, void* userdata); - ~File(); + File(const char *fullpath, void* userdata); + ~File(); private: - smx_file_t p_inferior; - const char *p_path; + smx_file_t p_inferior; + const char *p_path; public: - /** Retrieves the path to the file */ - const char *path() { return p_path;} + /** Retrieves the path to the file */ + const char *path() { return p_path;} public: - /** Simulates a read action. Returns the size of data actually read - * - * FIXME: reading from a remotely mounted disk is not implemented yet. Any storage is considered as local, and no network communication ever occur. - */ - sg_size_t read(sg_size_t size); - /** Simulates a write action. Returns the size of data actually written. - * - * FIXME: reading from a remotely mounted disk is not implemented yet. Any storage is considered as local, and no network communication ever occur. - */ - sg_size_t write(sg_size_t size); - - /** Allows to store user data on that host */ - void set_userdata(void *data) {p_userdata = data;} - /** Retrieves the previously stored data */ - void* userdata() {return p_userdata;} + /** Simulates a read action. Returns the size of data actually read + * + * FIXME: reading from a remotely mounted disk is not implemented yet. Any storage is considered as local, and no network communication ever occur. + */ + sg_size_t read(sg_size_t size); + /** Simulates a write action. Returns the size of data actually written. + * + * FIXME: reading from a remotely mounted disk is not implemented yet. Any storage is considered as local, and no network communication ever occur. + */ + sg_size_t write(sg_size_t size); + + /** Allows to store user data on that host */ + void set_userdata(void *data) {p_userdata = data;} + /** Retrieves the previously stored data */ + void* userdata() {return p_userdata;} private: - void *p_userdata=NULL; + void *p_userdata=NULL; public: - /** Retrieve the datasize */ - sg_size_t size(); - - /** Sets the file head to the given position. */ - void seek(sg_size_t pos); - /** Retrieves the current file position */ - sg_size_t tell(); - - /** Rename a file - * - * WARNING: It is forbidden to move the file to another mount point */ - void move(const char*fullpath); - - /** Remove a file from disk */ - void unlink(); - - /* FIXME: add these to the S4U API: - XBT_PUBLIC(const char *) MSG_file_get_name(msg_file_t file); - XBT_PUBLIC(msg_error_t) MSG_file_rcopy(msg_file_t fd, msg_host_t host, const char* fullpath); - XBT_PUBLIC(msg_error_t) MSG_file_rmove(msg_file_t fd, msg_host_t host, const char* fullpath); - */ + /** Retrieve the datasize */ + sg_size_t size(); + + /** Sets the file head to the given position. */ + void seek(sg_size_t pos); + /** Retrieves the current file position */ + sg_size_t tell(); + + /** Rename a file + * + * WARNING: It is forbidden to move the file to another mount point */ + void move(const char*fullpath); + + /** Remove a file from disk */ + void unlink(); + + /* FIXME: add these to the S4U API: + XBT_PUBLIC(const char *) MSG_file_get_name(msg_file_t file); + XBT_PUBLIC(msg_error_t) MSG_file_rcopy(msg_file_t fd, msg_host_t host, const char* fullpath); + XBT_PUBLIC(msg_error_t) MSG_file_rmove(msg_file_t fd, msg_host_t host, const char* fullpath); + */ }; diff --git a/include/simgrid/s4u/host.hpp b/include/simgrid/s4u/host.hpp index 65960a8049..20e5e7d93d 100644 --- a/include/simgrid/s4u/host.hpp +++ b/include/simgrid/s4u/host.hpp @@ -41,70 +41,70 @@ XBT_PUBLIC_CLASS Host : public simgrid::xbt::Extendable { private: - Host(const char *name); + Host(const char *name); public: // TODO, make me private - ~Host(); + ~Host(); public: static Host* by_name_or_null(const char* name); static Host* by_name_or_create(const char* name); - /** Retrieves an host from its name. */ - static s4u::Host *by_name(std::string name); - /** Retrieves the host on which the current actor is running */ - static s4u::Host *current(); - - simgrid::xbt::string const& name() const { return name_; } - - /** Turns that host on if it was previously off - * - * All actors on that host which were marked autorestart will be restarted automatically. - * This call does nothing if the host is already on. - */ - void turn_on(); - /** Turns that host off. All actors are forcefully stopped. */ - void turn_off(); - /** Returns if that host is currently up and running */ - bool is_on(); - bool is_off() { return !is_on(); } - - double speed(); - int core_count(); - xbt_dict_t properties(); - xbt_swag_t processes(); - double current_power_peak(); - double power_peak_at(int pstate_index); - void set_pstate(int pstate_index); - int pstates_count() const; - int pstate(); - void get_parameters(vm_params_t params); - void set_parameters(vm_params_t params); - xbt_dict_t mounted_storages_as_dict(); // HACK - xbt_dynar_t attached_storages(); - - /** Get an associative list [mount point]->[Storage] off all local mount points. - * - * This is defined in the platform file, and cannot be modified programatically (yet). - */ - boost::unordered_map const &mounted_storages(); + /** Retrieves an host from its name. */ + static s4u::Host *by_name(std::string name); + /** Retrieves the host on which the current actor is running */ + static s4u::Host *current(); + + simgrid::xbt::string const& name() const { return name_; } + + /** Turns that host on if it was previously off + * + * All actors on that host which were marked autorestart will be restarted automatically. + * This call does nothing if the host is already on. + */ + void turn_on(); + /** Turns that host off. All actors are forcefully stopped. */ + void turn_off(); + /** Returns if that host is currently up and running */ + bool is_on(); + bool is_off() { return !is_on(); } + + double speed(); + int core_count(); + xbt_dict_t properties(); + xbt_swag_t processes(); + double current_power_peak(); + double power_peak_at(int pstate_index); + void set_pstate(int pstate_index); + int pstates_count() const; + int pstate(); + void get_parameters(vm_params_t params); + void set_parameters(vm_params_t params); + xbt_dict_t mounted_storages_as_dict(); // HACK + xbt_dynar_t attached_storages(); + + /** Get an associative list [mount point]->[Storage] off all local mount points. + * + * This is defined in the platform file, and cannot be modified programatically (yet). + */ + boost::unordered_map const &mounted_storages(); private: - simgrid::xbt::string name_ = "noname"; - boost::unordered_map *mounts = NULL; // caching + simgrid::xbt::string name_ = "noname"; + boost::unordered_map *mounts = NULL; // caching public: - // FIXME: these should be protected, but it leads to many errors - // Use the extensions stuff for this? Go through simgrid::surf::Host? + // FIXME: these should be protected, but it leads to many errors + // Use the extensions stuff for this? Go through simgrid::surf::Host? // TODO, this could be a unique_ptr - surf::Cpu *pimpl_cpu = nullptr; - surf::NetCard *pimpl_netcard = nullptr; + surf::Cpu *pimpl_cpu = nullptr; + surf::NetCard *pimpl_netcard = nullptr; public: - /*** Called on each newly created object */ - static simgrid::xbt::signal onCreation; - /*** Called just before destructing an object */ - static simgrid::xbt::signal onDestruction; - /*** Called when the machine is turned on or off */ - static simgrid::xbt::signal onStateChange; + /*** Called on each newly created object */ + static simgrid::xbt::signal onCreation; + /*** Called just before destructing an object */ + static simgrid::xbt::signal onDestruction; + /*** Called when the machine is turned on or off */ + static simgrid::xbt::signal onStateChange; }; }} // namespace simgrid::s4u @@ -134,75 +134,75 @@ import org.simgrid.msg.Storage; Host jacquelin; try { - jacquelin = Host.getByName("Jacquelin"); + jacquelin = Host.getByName("Jacquelin"); } catch(HostNotFoundException e) { - System.err.println(e.toString()); + System.err.println(e.toString()); } ... \endverbatim * */ public class Host { - /** - * This static method returns all of the hosts of the installed platform. - * - * @return An array containing all the hosts installed. - * - */ - public native static Host[] all(); - - /** - * This static method sets a mailbox to receive in asynchronous mode. - * - * All messages sent to this mailbox will be transferred to - * the receiver without waiting for the receive call. - * The receive call will still be necessary to use the received data. - * If there is a need to receive some messages asynchronously, and some not, - * two different mailboxes should be used. - * - * @param mailboxName The name of the mailbox - */ - public static native void setAsyncMailbox(String mailboxName); - - /** - * This method returns the number of tasks currently running on a host. - * The external load (comming from an availability trace) is not taken in account. - * - * @return The number of tasks currently running on a host. - */ - public native int getLoad(); - - /** - * This method returns the speed of the processor of a host, - * regardless of the current load of the machine. - * - * @return The speed of the processor of the host in flops. - * - */ - public native double getSpeed(); - - /** - * This method returns the number of core of a host. - * - * @return The speed of the processor of the host in flops. - * - */ - public native double getCoreNumber(); - - /** - * Returns the value of a given host property (set from the platform file). - */ - public native String getProperty(String name); - - /** - * Change the value of a given host property. - */ - public native void setProperty(String name, String value); - - /** This methods returns the list of storages attached to an host - * @return An array containing all storages (name) attached to the host - */ - public native String[] getAttachedStorage(); + /** + * This static method returns all of the hosts of the installed platform. + * + * @return An array containing all the hosts installed. + * + */ + public native static Host[] all(); + + /** + * This static method sets a mailbox to receive in asynchronous mode. + * + * All messages sent to this mailbox will be transferred to + * the receiver without waiting for the receive call. + * The receive call will still be necessary to use the received data. + * If there is a need to receive some messages asynchronously, and some not, + * two different mailboxes should be used. + * + * @param mailboxName The name of the mailbox + */ + public static native void setAsyncMailbox(String mailboxName); + + /** + * This method returns the number of tasks currently running on a host. + * The external load (comming from an availability trace) is not taken in account. + * + * @return The number of tasks currently running on a host. + */ + public native int getLoad(); + + /** + * This method returns the speed of the processor of a host, + * regardless of the current load of the machine. + * + * @return The speed of the processor of the host in flops. + * + */ + public native double getSpeed(); + + /** + * This method returns the number of core of a host. + * + * @return The speed of the processor of the host in flops. + * + */ + public native double getCoreNumber(); + + /** + * Returns the value of a given host property (set from the platform file). + */ + public native String getProperty(String name); + + /** + * Change the value of a given host property. + */ + public native void setProperty(String name, String value); + + /** This methods returns the list of storages attached to an host + * @return An array containing all storages (name) attached to the host + */ + public native String[] getAttachedStorage(); } diff --git a/include/simgrid/s4u/mailbox.hpp b/include/simgrid/s4u/mailbox.hpp index 1962201bde..a2311c752c 100644 --- a/include/simgrid/s4u/mailbox.hpp +++ b/include/simgrid/s4u/mailbox.hpp @@ -23,26 +23,26 @@ namespace s4u { * sender and receiver. */ XBT_PUBLIC_CLASS Mailbox { - friend Comm; + friend Comm; private: - Mailbox(const char*name, smx_rdv_t inferior); + Mailbox(const char*name, smx_rdv_t inferior); public: - ~Mailbox(); - + ~Mailbox(); + protected: - smx_rdv_t getInferior() { return p_inferior; } + smx_rdv_t getInferior() { return p_inferior; } public: - /** Get the name of that mailbox */ - const char *getName(); - /** Retrieve the mailbox associated to the given string */ - static Mailbox *byName(const char *name); + /** Get the name of that mailbox */ + const char *getName(); + /** Retrieve the mailbox associated to the given string */ + static Mailbox *byName(const char *name); private: - std::string p_name; - smx_rdv_t p_inferior; - static boost::unordered_map *mailboxes; + std::string p_name; + smx_rdv_t p_inferior; + static boost::unordered_map *mailboxes; }; }} // namespace simgrid::s4u diff --git a/include/simgrid/s4u/storage.hpp b/include/simgrid/s4u/storage.hpp index 66547b84aa..193a6d20fb 100644 --- a/include/simgrid/s4u/storage.hpp +++ b/include/simgrid/s4u/storage.hpp @@ -17,18 +17,18 @@ namespace s4u { XBT_PUBLIC_CLASS Storage { private: - Storage(std::string name, smx_storage_t inferior); - virtual ~Storage(); + Storage(std::string name, smx_storage_t inferior); + virtual ~Storage(); public: - /** Retrieve a Storage by its name. It must exist in the platform file */ - static Storage &byName(const char* name); - const char *name(); - sg_size_t size_free(); - sg_size_t size_used(); - /** Retrieve the total amount of space of this storage element */ - sg_size_t size(); - - /* TODO: missing API: + /** Retrieve a Storage by its name. It must exist in the platform file */ + static Storage &byName(const char* name); + const char *name(); + sg_size_t size_free(); + sg_size_t size_used(); + /** Retrieve the total amount of space of this storage element */ + sg_size_t size(); + + /* TODO: missing API: XBT_PUBLIC(xbt_dict_t) MSG_storage_get_properties(msg_storage_t storage); XBT_PUBLIC(void) MSG_storage_set_property_value(msg_storage_t storage, const char *name, char *value,void_f_pvoid_t free_ctn); XBT_PUBLIC(const char *)MSG_storage_get_property_value(msg_storage_t storage, const char *name); @@ -36,20 +36,20 @@ XBT_PUBLIC(xbt_dynar_t) MSG_storages_as_dynar(void); XBT_PUBLIC(xbt_dict_t) MSG_storage_get_content(msg_storage_t storage); XBT_PUBLIC(msg_error_t) MSG_storage_file_move(msg_file_t fd, msg_host_t dest, char* mount, char* fullname); XBT_PUBLIC(const char *) MSG_storage_get_host(msg_storage_t storage); - */ + */ protected: - smx_storage_t inferior(); + smx_storage_t inferior(); private: - static boost::unordered_map *storages; - std::string p_name; - smx_storage_t p_inferior; + static boost::unordered_map *storages; + std::string p_name; + smx_storage_t p_inferior; public: - void set_userdata(void *data) {p_userdata = data;} - void *userdata() {return p_userdata;} + void set_userdata(void *data) {p_userdata = data;} + void *userdata() {return p_userdata;} private: - void *p_userdata = NULL; + void *p_userdata = NULL; }; diff --git a/include/xbt/base.h b/include/xbt/base.h index a1fa3696ba..11800076eb 100644 --- a/include/xbt/base.h +++ b/include/xbt/base.h @@ -13,7 +13,7 @@ /* Define _GNU_SOURCE for getline, isfinite, etc. */ #ifndef _GNU_SOURCE - #define _GNU_SOURCE + #define _GNU_SOURCE #endif /* Attributes are only in recent versions of GCC */ @@ -255,18 +255,18 @@ #endif #ifdef _MSC_VER /* MSVC has no ssize_t, and I fail to use the SSIZE_T declared in BaseTsd.h */ - #if defined(_WIN64) - typedef __int64 ssize_t; - #else - typedef long ssize_t; - #endif + #if defined(_WIN64) + typedef __int64 ssize_t; + #else + typedef long ssize_t; + #endif /* Microsoft wants to improve the code quality blah blah blah */ /* See: https://msdn.microsoft.com/en-us/library/8ef0s5kh.aspx */ - /* warning C4996: '_strdup': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strdup. */ - #define _CRT_NONSTDC_NO_WARNINGS - /* warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. */ - #define _CRT_SECURE_NO_WARNINGS + /* warning C4996: '_strdup': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strdup. */ + #define _CRT_NONSTDC_NO_WARNINGS + /* warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. */ + #define _CRT_SECURE_NO_WARNINGS #endif #if !defined (max) && !defined(__cplusplus) diff --git a/include/xbt/log.h b/include/xbt/log.h index 78a4815a24..fbde8e2efa 100644 --- a/include/xbt/log.h +++ b/include/xbt/log.h @@ -460,51 +460,51 @@ extern xbt_log_layout_t xbt_log_default_layout; * @brief Log an event at the DEBUG priority on the specified category with these args. */ #define XBT_CDEBUG(categ, ...) \ - do { \ - if (XBT_LOG_ISENABLED (categ, xbt_log_priority_debug)) { \ - s_xbt_log_event_t _log_ev; \ - _log_ev.cat = &(_XBT_LOGV(categ)); \ - _log_ev.priority = xbt_log_priority_debug; \ - _log_ev.fileName = __FILE__; \ - _log_ev.functionName = _XBT_FUNCTION; \ - _log_ev.lineNum = __LINE__; \ - _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ - } \ - } while (0) + do { \ + if (XBT_LOG_ISENABLED (categ, xbt_log_priority_debug)) { \ + s_xbt_log_event_t _log_ev; \ + _log_ev.cat = &(_XBT_LOGV(categ)); \ + _log_ev.priority = xbt_log_priority_debug; \ + _log_ev.fileName = __FILE__; \ + _log_ev.functionName = _XBT_FUNCTION; \ + _log_ev.lineNum = __LINE__; \ + _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ + } \ + } while (0) /** @ingroup XBT_log * @hideinitializer * @brief Log an event at the VERB priority on the specified category with these args. */ #define XBT_CVERB(categ, ...) \ - do { \ - if (XBT_LOG_ISENABLED (categ, xbt_log_priority_verbose)) { \ - s_xbt_log_event_t _log_ev; \ - _log_ev.cat = &(_XBT_LOGV(categ)); \ - _log_ev.priority = xbt_log_priority_verbose; \ - _log_ev.fileName = __FILE__; \ - _log_ev.functionName = _XBT_FUNCTION; \ - _log_ev.lineNum = __LINE__; \ - _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ - } \ - } while (0) + do { \ + if (XBT_LOG_ISENABLED (categ, xbt_log_priority_verbose)) { \ + s_xbt_log_event_t _log_ev; \ + _log_ev.cat = &(_XBT_LOGV(categ)); \ + _log_ev.priority = xbt_log_priority_verbose; \ + _log_ev.fileName = __FILE__; \ + _log_ev.functionName = _XBT_FUNCTION; \ + _log_ev.lineNum = __LINE__; \ + _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ + } \ + } while (0) /** @ingroup XBT_log * @hideinitializer * @brief Log an event at the INFO priority on the specified category with these args. */ #define XBT_CINFO(categ, ...) \ - do { \ - if (XBT_LOG_ISENABLED (categ, xbt_log_priority_info)) { \ - s_xbt_log_event_t _log_ev; \ - _log_ev.cat = &(_XBT_LOGV(categ)); \ - _log_ev.priority = xbt_log_priority_info; \ - _log_ev.fileName = __FILE__; \ - _log_ev.functionName = _XBT_FUNCTION; \ - _log_ev.lineNum = __LINE__; \ - _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ - } \ - } while (0) + do { \ + if (XBT_LOG_ISENABLED (categ, xbt_log_priority_info)) { \ + s_xbt_log_event_t _log_ev; \ + _log_ev.cat = &(_XBT_LOGV(categ)); \ + _log_ev.priority = xbt_log_priority_info; \ + _log_ev.fileName = __FILE__; \ + _log_ev.functionName = _XBT_FUNCTION; \ + _log_ev.lineNum = __LINE__; \ + _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ + } \ + } while (0) /** @ingroup XBT_log @@ -512,17 +512,17 @@ extern xbt_log_layout_t xbt_log_default_layout; * @brief Log an event at the WARN priority on the specified category with these args. */ #define XBT_CWARN(categ, ...) \ - do { \ - if (XBT_LOG_ISENABLED (categ, xbt_log_priority_warning)) { \ - s_xbt_log_event_t _log_ev; \ - _log_ev.cat = &(_XBT_LOGV(categ)); \ - _log_ev.priority = xbt_log_priority_warning; \ - _log_ev.fileName = __FILE__; \ - _log_ev.functionName = _XBT_FUNCTION; \ - _log_ev.lineNum = __LINE__; \ - _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ - } \ - } while (0) + do { \ + if (XBT_LOG_ISENABLED (categ, xbt_log_priority_warning)) { \ + s_xbt_log_event_t _log_ev; \ + _log_ev.cat = &(_XBT_LOGV(categ)); \ + _log_ev.priority = xbt_log_priority_warning; \ + _log_ev.fileName = __FILE__; \ + _log_ev.functionName = _XBT_FUNCTION; \ + _log_ev.lineNum = __LINE__; \ + _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ + } \ + } while (0) /** @ingroup XBT_log @@ -530,34 +530,34 @@ extern xbt_log_layout_t xbt_log_default_layout; * @brief Log an event at the ERROR priority on the specified category with these args. */ #define XBT_CERROR(categ, ...) \ - do { \ - if (XBT_LOG_ISENABLED (categ, xbt_log_priority_error)) { \ - s_xbt_log_event_t _log_ev; \ - _log_ev.cat = &(_XBT_LOGV(categ)); \ - _log_ev.priority = xbt_log_priority_error; \ - _log_ev.fileName = __FILE__; \ - _log_ev.functionName = _XBT_FUNCTION; \ - _log_ev.lineNum = __LINE__; \ - _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ - } \ - } while (0) + do { \ + if (XBT_LOG_ISENABLED (categ, xbt_log_priority_error)) { \ + s_xbt_log_event_t _log_ev; \ + _log_ev.cat = &(_XBT_LOGV(categ)); \ + _log_ev.priority = xbt_log_priority_error; \ + _log_ev.fileName = __FILE__; \ + _log_ev.functionName = _XBT_FUNCTION; \ + _log_ev.lineNum = __LINE__; \ + _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ + } \ + } while (0) /** @ingroup XBT_log * @hideinitializer * @brief Log an event at the CRITICAL priority on the specified category with these args (CCRITICALn exists for any n<10). */ #define XBT_CCRITICAL(categ, ...) \ - do { \ - if (XBT_LOG_ISENABLED (categ, xbt_log_priority_critical)) { \ - s_xbt_log_event_t _log_ev; \ - _log_ev.cat = &(_XBT_LOGV(categ)); \ - _log_ev.priority = xbt_log_priority_critical; \ - _log_ev.fileName = __FILE__; \ - _log_ev.functionName = _XBT_FUNCTION; \ - _log_ev.lineNum = __LINE__; \ - _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ - } \ - } while (0) + do { \ + if (XBT_LOG_ISENABLED (categ, xbt_log_priority_critical)) { \ + s_xbt_log_event_t _log_ev; \ + _log_ev.cat = &(_XBT_LOGV(categ)); \ + _log_ev.priority = xbt_log_priority_critical; \ + _log_ev.fileName = __FILE__; \ + _log_ev.functionName = _XBT_FUNCTION; \ + _log_ev.lineNum = __LINE__; \ + _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ + } \ + } while (0) /** @ingroup XBT_log * @hideinitializer @@ -565,108 +565,108 @@ extern xbt_log_layout_t xbt_log_default_layout; * @brief Log an event at the DEBUG priority on the default category with these args. */ #define XBT_DEBUG(...) \ - do { \ - if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \ - xbt_log_priority_debug)) { \ - s_xbt_log_event_t _log_ev; \ - _log_ev.cat = _simgrid_log_category__default; \ - _log_ev.priority = xbt_log_priority_debug; \ - _log_ev.fileName = __FILE__; \ - _log_ev.functionName = _XBT_FUNCTION; \ - _log_ev.lineNum = __LINE__; \ - _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ - } \ - } while (0) + do { \ + if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \ + xbt_log_priority_debug)) { \ + s_xbt_log_event_t _log_ev; \ + _log_ev.cat = _simgrid_log_category__default; \ + _log_ev.priority = xbt_log_priority_debug; \ + _log_ev.fileName = __FILE__; \ + _log_ev.functionName = _XBT_FUNCTION; \ + _log_ev.lineNum = __LINE__; \ + _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ + } \ + } while (0) /** @ingroup XBT_log * @hideinitializer * @brief Log an event at the VERB priority on the default category with these args. */ #define XBT_VERB(...) \ - do { \ - if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \ - xbt_log_priority_verbose)) { \ - s_xbt_log_event_t _log_ev; \ - _log_ev.cat = _simgrid_log_category__default; \ - _log_ev.priority = xbt_log_priority_verbose; \ - _log_ev.fileName = __FILE__; \ - _log_ev.functionName = _XBT_FUNCTION; \ - _log_ev.lineNum = __LINE__; \ - _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ - } \ - } while (0) + do { \ + if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \ + xbt_log_priority_verbose)) { \ + s_xbt_log_event_t _log_ev; \ + _log_ev.cat = _simgrid_log_category__default; \ + _log_ev.priority = xbt_log_priority_verbose; \ + _log_ev.fileName = __FILE__; \ + _log_ev.functionName = _XBT_FUNCTION; \ + _log_ev.lineNum = __LINE__; \ + _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ + } \ + } while (0) /** @ingroup XBT_log * @hideinitializer * @brief Log an event at the INFO priority on the default category with these args. */ #define XBT_INFO(...) \ - do { \ - if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \ - xbt_log_priority_info)) { \ - s_xbt_log_event_t _log_ev; \ - _log_ev.cat = _simgrid_log_category__default; \ - _log_ev.priority = xbt_log_priority_info; \ - _log_ev.fileName = __FILE__; \ - _log_ev.functionName = _XBT_FUNCTION; \ - _log_ev.lineNum = __LINE__; \ - _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ - } \ - } while (0) + do { \ + if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \ + xbt_log_priority_info)) { \ + s_xbt_log_event_t _log_ev; \ + _log_ev.cat = _simgrid_log_category__default; \ + _log_ev.priority = xbt_log_priority_info; \ + _log_ev.fileName = __FILE__; \ + _log_ev.functionName = _XBT_FUNCTION; \ + _log_ev.lineNum = __LINE__; \ + _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ + } \ + } while (0) /** @ingroup XBT_log * @hideinitializer * @brief Log an event at the WARN priority on the default category with these args. */ #define XBT_WARN(...) \ - do { \ - if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \ - xbt_log_priority_warning)) { \ - s_xbt_log_event_t _log_ev; \ - _log_ev.cat = _simgrid_log_category__default; \ - _log_ev.priority = xbt_log_priority_warning; \ - _log_ev.fileName = __FILE__; \ - _log_ev.functionName = _XBT_FUNCTION; \ - _log_ev.lineNum = __LINE__; \ - _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ - } \ - } while (0) + do { \ + if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \ + xbt_log_priority_warning)) { \ + s_xbt_log_event_t _log_ev; \ + _log_ev.cat = _simgrid_log_category__default; \ + _log_ev.priority = xbt_log_priority_warning; \ + _log_ev.fileName = __FILE__; \ + _log_ev.functionName = _XBT_FUNCTION; \ + _log_ev.lineNum = __LINE__; \ + _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ + } \ + } while (0) /** @ingroup XBT_log * @hideinitializer * @brief Log an event at the ERROR priority on the default category with these args. */ #define XBT_ERROR(...) \ - do { \ - if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \ - xbt_log_priority_error)) { \ - s_xbt_log_event_t _log_ev; \ - _log_ev.cat = _simgrid_log_category__default; \ - _log_ev.priority = xbt_log_priority_error; \ - _log_ev.fileName = __FILE__; \ - _log_ev.functionName = _XBT_FUNCTION; \ - _log_ev.lineNum = __LINE__; \ - _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ - } \ - } while (0) + do { \ + if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \ + xbt_log_priority_error)) { \ + s_xbt_log_event_t _log_ev; \ + _log_ev.cat = _simgrid_log_category__default; \ + _log_ev.priority = xbt_log_priority_error; \ + _log_ev.fileName = __FILE__; \ + _log_ev.functionName = _XBT_FUNCTION; \ + _log_ev.lineNum = __LINE__; \ + _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ + } \ + } while (0) /** @ingroup XBT_log * @hideinitializer * @brief Log an event at the CRITICAL priority on the default category with these args. */ #define XBT_CRITICAL(...) \ - do { \ - if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \ - xbt_log_priority_critical)) { \ - s_xbt_log_event_t _log_ev; \ - _log_ev.cat = _simgrid_log_category__default; \ - _log_ev.priority = xbt_log_priority_critical; \ - _log_ev.fileName = __FILE__; \ - _log_ev.functionName = _XBT_FUNCTION; \ - _log_ev.lineNum = __LINE__; \ - _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ - } \ - } while (0) + do { \ + if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \ + xbt_log_priority_critical)) { \ + s_xbt_log_event_t _log_ev; \ + _log_ev.cat = _simgrid_log_category__default; \ + _log_ev.priority = xbt_log_priority_critical; \ + _log_ev.fileName = __FILE__; \ + _log_ev.functionName = _XBT_FUNCTION; \ + _log_ev.lineNum = __LINE__; \ + _xbt_log_event_log(&_log_ev, __VA_ARGS__); \ + } \ + } while (0) #define _XBT_IN_OUT(...) \ _XBT_IF_ONE_ARG(_XBT_IN_OUT_ARG1, _XBT_IN_OUT_ARGN, __VA_ARGS__)(__VA_ARGS__) diff --git a/src/bindings/java/jmsg.h b/src/bindings/java/jmsg.h index 75ad3dbcae..06c8f2b5e5 100644 --- a/src/bindings/java/jmsg.h +++ b/src/bindings/java/jmsg.h @@ -25,14 +25,14 @@ JNIEnv *get_current_thread_env(void); void jmsg_throw_status(JNIEnv *env, msg_error_t status); /* - * Class org_simgrid_msg_Msg - * Method getClock - * Signature ()D + * Class org_simgrid_msg_Msg + * Method getClock + * Signature ()D */ JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Msg_getClock(JNIEnv *, jclass); /** - * Class org_simgrid_msg_Msg - * Method run + * Class org_simgrid_msg_Msg + * Method run */ JNIEXPORT void JNICALL JNICALL Java_org_simgrid_msg_Msg_run(JNIEnv * env, jclass cls); diff --git a/src/bindings/java/jmsg_file.h b/src/bindings/java/jmsg_file.h index ea88343dc9..2d92f7a62d 100644 --- a/src/bindings/java/jmsg_file.h +++ b/src/bindings/java/jmsg_file.h @@ -18,34 +18,34 @@ jfieldID jfile_field_bind; void jfile_bind(JNIEnv *env, jobject jfile, msg_file_t fd); msg_file_t jfile_get_native(JNIEnv *env, jobject jfile); /** - * Class org_simgrid_msg_File - * Method nativeInit - * Signature ()V + * Class org_simgrid_msg_File + * Method nativeInit + * Signature ()V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_File_nativeInit(JNIEnv*, jclass); /** - * Class org_simgrid_msg_File - * Method open - * Signature (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V + * Class org_simgrid_msg_File + * Method open + * Signature (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_File_open(JNIEnv*, jobject, jobject); /** - * Class org_simgrid_msg_File - * Method read + * Class org_simgrid_msg_File + * Method read */ JNIEXPORT jlong JNICALL Java_org_simgrid_msg_File_read(JNIEnv*, jobject, jlong); /** - * Class org_simgrid_msg_File - * Method write + * Class org_simgrid_msg_File + * Method write */ JNIEXPORT jlong JNICALL Java_org_simgrid_msg_File_write(JNIEnv*, jobject, jlong); /** - * Class org_simgrid_msg_File - * Method close + * Class org_simgrid_msg_File + * Method close */ JNIEXPORT void JNICALL Java_org_simgrid_msg_File_close(JNIEnv*, jobject); diff --git a/src/bindings/java/jmsg_host.cpp b/src/bindings/java/jmsg_host.cpp index 55cc4a1bb0..1d6e2400b7 100644 --- a/src/bindings/java/jmsg_host.cpp +++ b/src/bindings/java/jmsg_host.cpp @@ -72,8 +72,8 @@ Java_org_simgrid_msg_Host_getByName(JNIEnv * env, jclass cls, /* get the C string from the java string */ if (jname == NULL) { - jxbt_throw_null(env,bprintf("No host can have a null name")); - return NULL; + jxbt_throw_null(env,bprintf("No host can have a null name")); + return NULL; } const char *name = env->GetStringUTFChars(jname, 0); /* get the host by name (the hosts are created during the grid resolution) */ @@ -267,29 +267,29 @@ Java_org_simgrid_msg_Host_getMountedStorage(JNIEnv * env, jobject jhost){ } int index = 0; - jobjectArray jtable; - xbt_dict_t dict = MSG_host_get_mounted_storage_list(host); - int count = xbt_dict_length(dict); - jclass cls = env->FindClass("org/simgrid/msg/Storage"); + jobjectArray jtable; + xbt_dict_t dict = MSG_host_get_mounted_storage_list(host); + int count = xbt_dict_length(dict); + jclass cls = env->FindClass("org/simgrid/msg/Storage"); - jtable = env->NewObjectArray((jsize) count, cls, NULL); + jtable = env->NewObjectArray((jsize) count, cls, NULL); - if (!jtable) { - jxbt_throw_jni(env, "Storages table allocation failed"); - return NULL; - } + if (!jtable) { + jxbt_throw_jni(env, "Storages table allocation failed"); + return NULL; + } - xbt_dict_cursor_t cursor=NULL; - const char *mount_name, *storage_name; + xbt_dict_cursor_t cursor=NULL; + const char *mount_name, *storage_name; - xbt_dict_foreach(dict,cursor,mount_name,storage_name) { - jname = env->NewStringUTF(storage_name); - jstorage = Java_org_simgrid_msg_Storage_getByName(env,cls,jname); - env->SetObjectArrayElement(jtable, index, jstorage); + xbt_dict_foreach(dict,cursor,mount_name,storage_name) { + jname = env->NewStringUTF(storage_name); + jstorage = Java_org_simgrid_msg_Storage_getByName(env,cls,jname); + env->SetObjectArrayElement(jtable, index, jstorage); index++; - } - xbt_dict_free(&dict); - return jtable; + } + xbt_dict_free(&dict); + return jtable; } JNIEXPORT jobjectArray JNICALL @@ -363,7 +363,7 @@ Java_org_simgrid_msg_Host_all(JNIEnv * env, jclass cls_arg) jname = env->NewStringUTF(MSG_host_get_name(host)); jhost = - Java_org_simgrid_msg_Host_getByName(env, cls_arg, jname); + Java_org_simgrid_msg_Host_getByName(env, cls_arg, jname); /* FIXME: leak of jname ? */ } diff --git a/src/bindings/java/jmsg_host.h b/src/bindings/java/jmsg_host.h index 5a342f2262..327940c7b9 100644 --- a/src/bindings/java/jmsg_host.h +++ b/src/bindings/java/jmsg_host.h @@ -17,14 +17,14 @@ SG_BEGIN_DECL() /** * This function returns a new java host instance. * - * @param env The environment of the current thread + * @param env The environment of the current thread * - * @return A new java host object. + * @return A new java host object. * - * @exception If the class Host is not found the function throws - * the ClassNotFoundException. If the constructor of - * this class is not found the function throws the exception - * NotSuchMethodException. + * @exception If the class Host is not found the function throws + * the ClassNotFoundException. If the constructor of + * this class is not found the function throws the exception + * NotSuchMethodException. */ jobject jhost_new_instance(JNIEnv * env); @@ -32,58 +32,58 @@ jobject jhost_new_instance(JNIEnv * env); * This function returns a global reference to the java host instance * specified by the parameter jhost. * - * @param jhost The original java host instance. - * @param env The environment of the current thread + * @param jhost The original java host instance. + * @param env The environment of the current thread * - * @return The global reference to the original java host - * instance. + * @return The global reference to the original java host + * instance. */ jobject jhost_ref(JNIEnv * env, jobject jhost); /** * This function delete a global reference to a java host instance. * - * @param The global refernce to delete. - * @param env The environment of the current thread + * @param The global refernce to delete. + * @param env The environment of the current thread */ void jhost_unref(JNIEnv * env, jobject jhost); /** * This function associated a native host to a java host instance. * - * @param jhost The java host instance. - * @param host The native host to bind. - * @param env The environment of the current thread + * @param jhost The java host instance. + * @param host The native host to bind. + * @param env The environment of the current thread * - * @exception If the class Host is not found the function throws - * the ClassNotFoundException. If the field bind of - * this class is not found the function throws the exception - * NotSuchFieldException. + * @exception If the class Host is not found the function throws + * the ClassNotFoundException. If the field bind of + * this class is not found the function throws the exception + * NotSuchFieldException. */ void jhost_bind(jobject jhost, msg_host_t host, JNIEnv * env); /** * This function returns a native host from a java host instance. * - * @param jhost The java host object from which get the native host. - * @param env The environment of the current thread + * @param jhost The java host object from which get the native host. + * @param env The environment of the current thread * - * @return The function returns the native host associated to the - * java host object. + * @return The function returns the native host associated to the + * java host object. * - * @exception If the class Host is not found the function throws - * the ClassNotFoundException. If the field bind of - * this class is not found the function throws the exception - * NotSuchFieldException. + * @exception If the class Host is not found the function throws + * the ClassNotFoundException. If the field bind of + * this class is not found the function throws the exception + * NotSuchFieldException. */ msg_host_t jhost_get_native(JNIEnv * env, jobject jhost); /** * This function returns the name of a MSG host. * - * @param jhost A java host object. - * @param env The environment of the current thread + * @param jhost A java host object. + * @param env The environment of the current thread * - * @return The name of the host. + * @return The name of the host. */ const char *jhost_get_name(jobject jhost, JNIEnv * env); @@ -91,25 +91,25 @@ const char *jhost_get_name(jobject jhost, JNIEnv * env); * This function tests if a java host instance is valid. * A java host object is valid if it is bind to a native host. * - * @param jhost The host to test the validity. - * @param env The environment of the current thread + * @param jhost The host to test the validity. + * @param env The environment of the current thread * - * @return If the java host is valid the function returns true. - * Otherwise the function returns false. + * @return If the java host is valid the function returns true. + * Otherwise the function returns false. */ jboolean jhost_is_valid(jobject jhost, JNIEnv * env); /* - * Class org_simgrid_msg_Host - * Method nativeInit - * Signature (); + * Class org_simgrid_msg_Host + * Method nativeInit + * Signature (); */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_nativeInit(JNIEnv *env, jclass cls); /* - * Class org_simgrid_msg_Host - * Method getByName - * Signature (Ljava/lang/String;)Lsimgrid/msg/Host; + * Class org_simgrid_msg_Host + * Method getByName + * Signature (Ljava/lang/String;)Lsimgrid/msg/Host; */ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_getByName (JNIEnv *, jclass, jstring); @@ -117,8 +117,8 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_getByName /** * This function start the host if it is off * - * @param jhost The host to test the validity. - * @param env The environment of the current thread + * @param jhost The host to test the validity. + * @param env The environment of the current thread * */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_on(JNIEnv *env, jobject jhost); @@ -126,38 +126,38 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_on(JNIEnv *env, jobject jhost); /** * This function stop the host if it is on * - * @param jhost The host to test the validity. - * @param env The environment of the current thread + * @param jhost The host to test the validity. + * @param env The environment of the current thread * */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_off(JNIEnv *env, jobject jhost); /* - * Class org_simgrid_msg_Host - * Method currentHost - * Signature ()Lsimgrid/msg/Host; + * Class org_simgrid_msg_Host + * Method currentHost + * Signature ()Lsimgrid/msg/Host; */ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_currentHost (JNIEnv *, jclass); /* - * Class org_simgrid_msg_Host - * Method getCount - * Signature ()I + * Class org_simgrid_msg_Host + * Method getCount + * Signature ()I */ JNIEXPORT jint JNICALL Java_org_simgrid_msg_Host_getCount (JNIEnv *, jclass); /* - * Class org_simgrid_msg_Host - * Method getSpeed - * Signature ()D + * Class org_simgrid_msg_Host + * Method getSpeed + * Signature ()D */ JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getSpeed (JNIEnv *, jobject); /* - * Class org_simgrid_msg_Host - * Method getCoreNumber - * Signature ()D + * Class org_simgrid_msg_Host + * Method getCoreNumber + * Signature ()D */ JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getCoreNumber (JNIEnv *, jobject); @@ -176,30 +176,30 @@ Java_org_simgrid_msg_Host_getProperty(JNIEnv *env, jobject jhost, jobject jname) JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_setProperty(JNIEnv *env, jobject jhost, jobject jname, jobject jvalue); /* - * Class org_simgrid_msg_Host - * Method isOn - * Signature ()Z + * Class org_simgrid_msg_Host + * Method isOn + * Signature ()Z */ JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Host_isOn (JNIEnv *, jobject); /* - * Class org_simgrid_msg_Host - * Method getMountedStorage + * Class org_simgrid_msg_Host + * Method getMountedStorage * Signature: ()[Lorg/simgrid/msg/Storage; */ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getMountedStorage(JNIEnv * env, jobject jhost); /* - * Class org_simgrid_msg_Host - * Method getAttachedStorageList + * Class org_simgrid_msg_Host + * Method getAttachedStorageList */ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getAttachedStorage(JNIEnv * env, jobject jhost); /* - * Class org_simgrid_msg_Host - * Method getStorageContent + * Class org_simgrid_msg_Host + * Method getStorageContent */ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getStorageContent(JNIEnv * env, jobject jhost); diff --git a/src/bindings/java/jmsg_process.cpp b/src/bindings/java/jmsg_process.cpp index 601733fc92..05491e3a5e 100644 --- a/src/bindings/java/jmsg_process.cpp +++ b/src/bindings/java/jmsg_process.cpp @@ -49,10 +49,10 @@ void jprocess_delete_global_ref(jobject jprocess, JNIEnv * env) void jprocess_join(jobject jprocess, JNIEnv * env) { - msg_process_t process = jprocess_to_native_process(jprocess,env); - simgrid::java::JavaContext* context = + msg_process_t process = jprocess_to_native_process(jprocess,env); + simgrid::java::JavaContext* context = (simgrid::java::JavaContext*) MSG_process_get_smx_ctx(process); - xbt_os_thread_join(context->thread,NULL); + xbt_os_thread_join(context->thread,NULL); } msg_process_t jprocess_to_native_process(jobject jprocess, JNIEnv * env) @@ -161,9 +161,9 @@ Java_org_simgrid_msg_Process_create(JNIEnv * env, simgrid::java::java_main_jprocess(jprocess); return 0; }, jprocess, - host, - /*argc, argv, properties*/ - 0, NULL, NULL); + host, + /*argc, argv, properties*/ + 0, NULL, NULL); MSG_process_set_kill_time(process, (double)jkill); /* bind the java process instance to the native process */ jprocess_bind(jprocess, process, env); @@ -376,14 +376,14 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_kill(JNIEnv * env, jobject jprocess) { - /* get the native instances from the java ones */ + /* get the native instances from the java ones */ msg_process_t process = jprocess_to_native_process(jprocess, env); if (!process) { jxbt_throw_notbound(env, "process", jprocess); return; } - MSG_process_kill(process); + MSG_process_kill(process); } JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_migrate(JNIEnv * env, @@ -414,8 +414,8 @@ Java_org_simgrid_msg_Process_migrate(JNIEnv * env, } JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_setKillTime (JNIEnv *env , jobject jprocess, jdouble jkilltime) { - msg_process_t process = jprocess_to_native_process(jprocess, env); - MSG_process_set_kill_time(process, (double)jkilltime); + msg_process_t process = jprocess_to_native_process(jprocess, env); + MSG_process_set_kill_time(process, (double)jkilltime); } JNIEXPORT jint JNICALL diff --git a/src/bindings/java/jmsg_process.h b/src/bindings/java/jmsg_process.h index 7cd3c65c1c..145f830ef0 100644 --- a/src/bindings/java/jmsg_process.h +++ b/src/bindings/java/jmsg_process.h @@ -34,11 +34,11 @@ jobject native_to_java_process(msg_process_t process); * This function returns a global reference to the java process instance * specified by the parameter jprocess. * - * @param jprocess The original java process instance. - * @param env The env of the current thread + * @param jprocess The original java process instance. + * @param env The env of the current thread * - * @return The global reference to the original java process - * instance. + * @return The global reference to the original java process + * instance. */ jobject jprocess_new_global_ref(jobject jprocess, JNIEnv * env); @@ -46,11 +46,11 @@ jobject jprocess_new_global_ref(jobject jprocess, JNIEnv * env); * This function delete a global reference to a java process instance. * If the java process is alive the function joins it and stops it before. * - * @param The global refernce to delete. - * @param env The env of the current thread + * @param The global refernce to delete. + * @param env The env of the current thread * - * @see jprocess_join() - * @see jprocess_exit() + * @see jprocess_join() + * @see jprocess_exit() */ void jprocess_delete_global_ref(jobject jprocess, JNIEnv * env); @@ -58,58 +58,58 @@ void jprocess_delete_global_ref(jobject jprocess, JNIEnv * env); /** * This function waits for a java process to terminate. * - * @param jprocess The java process ot wait for. - * @param env The env of the current thread + * @param jprocess The java process ot wait for. + * @param env The env of the current thread * - * @exception If the class Process is not found the function throws - * the ClassNotFoundException. If the methos join() of - * this class is not found the function throws the exception - * NotSuchMethodException. + * @exception If the class Process is not found the function throws + * the ClassNotFoundException. If the methos join() of + * this class is not found the function throws the exception + * NotSuchMethodException. * */ void jprocess_join(jobject jprocess, JNIEnv * env); /** * This function associated a native process to a java process instance. * - * @param jprocess The java process instance. - * @param process The native process to bind. - * @param env The env of the current thread + * @param jprocess The java process instance. + * @param process The native process to bind. + * @param env The env of the current thread * - * @exception If the class Process is not found the function throws - * the ClassNotFoundException. If the field bind of - * this class is not found the function throws the exception - * NotSuchFieldException. + * @exception If the class Process is not found the function throws + * the ClassNotFoundException. If the field bind of + * this class is not found the function throws the exception + * NotSuchFieldException. */ void jprocess_bind(jobject jprocess, msg_process_t process, JNIEnv * env); /** * This function returns a native process from a java process instance. * - * @param jprocess The java process object from which get the native process. - * @param env The env of the current thread + * @param jprocess The java process object from which get the native process. + * @param env The env of the current thread * - * @return The function returns the native process associated to the - * java process object. + * @return The function returns the native process associated to the + * java process object. * - * @exception If the class Process is not found the function throws - * the ClassNotFoundException. If the field bind of - * this class is not found the function throws the exception - * NotSuchFieldException. + * @exception If the class Process is not found the function throws + * the ClassNotFoundException. If the field bind of + * this class is not found the function throws the exception + * NotSuchFieldException. */ msg_process_t jprocess_to_native_process(jobject jprocess, JNIEnv * env); /** * This function gets the id of the specified java process. * - * @param jprocess The java process to get the id. - * @param env The env of the current thread + * @param jprocess The java process to get the id. + * @param env The env of the current thread * - * @exception If the class Process is not found the function throws - * the ClassNotFoundException. If the field id of - * this class is not found the function throws the exception - * NotSuchFieldException. + * @exception If the class Process is not found the function throws + * the ClassNotFoundException. If the field id of + * this class is not found the function throws the exception + * NotSuchFieldException. * - * @return The id of the specified java process. + * @return The id of the specified java process. */ jlong jprocess_get_id(jobject jprocess, JNIEnv * env); @@ -118,41 +118,41 @@ jlong jprocess_get_id(jobject jprocess, JNIEnv * env); * A java process object is valid if it is bind to a native * process. * - * @param jprocess The java process to test the validity. - * @param env The env of the current thread + * @param jprocess The java process to test the validity. + * @param env The env of the current thread * - * @return If the java process is valid the function returns true. - * Otherwise the function returns false. + * @return If the java process is valid the function returns true. + * Otherwise the function returns false. */ jboolean jprocess_is_valid(jobject jprocess, JNIEnv * env); /** * This function gets the name of the specified java process. * - * @param jprocess The java process to get the name. - * @param env The env of the current thread + * @param jprocess The java process to get the name. + * @param env The env of the current thread * - * @exception If the class Process is not found the function throws - * the ClassNotFoundException. If the field name of - * this class is not found the function throws the exception - * NotSuchFieldException. + * @exception If the class Process is not found the function throws + * the ClassNotFoundException. If the field name of + * this class is not found the function throws the exception + * NotSuchFieldException. * - * @return The name of the specified java process. + * @return The name of the specified java process. */ jstring jprocess_get_name(jobject jprocess, JNIEnv * env); /* - * Class org_simgrid_msg_Process - * Method nativeInit - * Signature (); + * Class org_simgrid_msg_Process + * Method nativeInit + * Signature (); */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_nativeInit(JNIEnv *env, jclass cls); /* - * Class org_simgrid_msg_Process - * Method create - * Signature (Lorg/simgrid/msg/Host;)V + * Class org_simgrid_msg_Process + * Method create + * Signature (Lorg/simgrid/msg/Host;)V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_create(JNIEnv * env, @@ -160,17 +160,17 @@ Java_org_simgrid_msg_Process_create(JNIEnv * env, jobject jhostname); /* - * Class org_simgrid_msg_Process - * Method killAll - * Signature (I)I + * Class org_simgrid_msg_Process + * Method killAll + * Signature (I)I */ JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_killAll (JNIEnv *, jclass, jint); /* - * Class org_simgrid_msg_Process - * Method fromPID - * Signature (I)Lorg/simgrid/msg/Process; + * Class org_simgrid_msg_Process + * Method fromPID + * Signature (I)Lorg/simgrid/msg/Process; */ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_fromPID (JNIEnv *, jclass, jint); @@ -182,24 +182,24 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_fromPID JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_getProperty(JNIEnv *env, jobject jprocess, jobject jname); /* - * Class org_simgrid_msg_Process - * Method currentProcess - * Signature ()Lorg/simgrid/msg/Process; + * Class org_simgrid_msg_Process + * Method currentProcess + * Signature ()Lorg/simgrid/msg/Process; */ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_getCurrentProcess (JNIEnv *, jclass); /* - * Class org_simgrid_msg_Process - * Method suspend - * Signature (Lorg/simgrid/msg/Process;)V + * Class org_simgrid_msg_Process + * Method suspend + * Signature (Lorg/simgrid/msg/Process;)V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_suspend(JNIEnv * env, jobject jprocess); /* - * Class org_simgrid_msg_Process - * Method resume - * Signature (Lorg/simgrid/msg/Process;)V + * Class org_simgrid_msg_Process + * Method resume + * Signature (Lorg/simgrid/msg/Process;)V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_resume (JNIEnv *, jobject); @@ -219,46 +219,46 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_restart (JNIEnv *, jobject); /* - * Class org_simgrid_msg_Process - * Method isSuspended - * Signature (Lorg/simgrid/msg/Process;)Z + * Class org_simgrid_msg_Process + * Method isSuspended + * Signature (Lorg/simgrid/msg/Process;)Z */ JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Process_isSuspended (JNIEnv *, jobject); /* - * Class org_simgrid_msg_Process - * Method sleep - * Signature (DI)V + * Class org_simgrid_msg_Process + * Method sleep + * Signature (DI)V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_sleep (JNIEnv *, jclass, jlong, jint); /* - * Class org_simgrid_msg_Process - * Method waitFor - * Signature (D)V + * Class org_simgrid_msg_Process + * Method waitFor + * Signature (D)V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_waitFor (JNIEnv *, jobject, jdouble); /* - * Class org_simgrid_msg_Process - * Method kill - * Signature (Lorg/simgrid/msg/Process;)V + * Class org_simgrid_msg_Process + * Method kill + * Signature (Lorg/simgrid/msg/Process;)V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_kill (JNIEnv *, jobject); /* - * Class org_simgrid_msg_Process - * Method migrate - * Signature (Lorg/simgrid/msg/Host;)V + * Class org_simgrid_msg_Process + * Method migrate + * Signature (Lorg/simgrid/msg/Host;)V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_migrate (JNIEnv *, jobject, jobject); /* - * Class org_simgrid_msg_Process - * Method setKillTime - * Signature (D)V + * Class org_simgrid_msg_Process + * Method setKillTime + * Signature (D)V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_setKillTime (JNIEnv *, jobject, jdouble); diff --git a/src/bindings/java/jmsg_storage.cpp b/src/bindings/java/jmsg_storage.cpp index 299b34a8eb..cc3b39b7aa 100644 --- a/src/bindings/java/jmsg_storage.cpp +++ b/src/bindings/java/jmsg_storage.cpp @@ -65,8 +65,8 @@ Java_org_simgrid_msg_Storage_getByName(JNIEnv * env, jclass cls, /* get the C string from the java string */ if (jname == NULL) { - jxbt_throw_null(env,bprintf("No host can have a null name")); - return NULL; + jxbt_throw_null(env,bprintf("No host can have a null name")); + return NULL; } const char *name = env->GetStringUTFChars(jname, 0); storage = MSG_storage_get_by_name(name); @@ -170,7 +170,7 @@ Java_org_simgrid_msg_Storage_getProperty(JNIEnv *env, jobject jstorage, jobject JNIEXPORT void JNICALL Java_org_simgrid_msg_Storage_setProperty(JNIEnv *env, jobject jstorage, jobject jname, jobject jvalue) { - msg_storage_t storage = jstorage_get_native(env, jstorage); + msg_storage_t storage = jstorage_get_native(env, jstorage); if (!storage) { jxbt_throw_notbound(env, "storage", jstorage); diff --git a/src/bindings/java/jmsg_storage.h b/src/bindings/java/jmsg_storage.h index 739a93060b..ac617ca49f 100644 --- a/src/bindings/java/jmsg_storage.h +++ b/src/bindings/java/jmsg_storage.h @@ -16,28 +16,28 @@ SG_BEGIN_DECL() /** * This function returns a new java storage instance. * - * @param env The environment of the current thread + * @param env The environment of the current thread * - * @return A new java storage object. + * @return A new java storage object. * - * @exception If the class Storage is not found the function throws - * the ClassNotFoundException. If the constructor of - * this class is not found the function throws the exception - * NotSuchMethodException. + * @exception If the class Storage is not found the function throws + * the ClassNotFoundException. If the constructor of + * this class is not found the function throws the exception + * NotSuchMethodException. */ jobject jstorage_new_instance(JNIEnv * env); /** * This function associated a native storage to a java storage instance. * - * @param jstorage The java storage instance. - * @param storage The native storage to bind. - * @param env The environment of the current thread + * @param jstorage The java storage instance. + * @param storage The native storage to bind. + * @param env The environment of the current thread * - * @exception If the class Storage is not found the function throws - * the ClassNotFoundException. If the field bind of - * this class is not found the function throws the exception - * NotSuchFieldException. + * @exception If the class Storage is not found the function throws + * the ClassNotFoundException. If the field bind of + * this class is not found the function throws the exception + * NotSuchFieldException. */ void jstorage_bind(jobject jstorage, msg_storage_t storage, JNIEnv * env); @@ -45,24 +45,24 @@ void jstorage_bind(jobject jstorage, msg_storage_t storage, JNIEnv * env); /** * This function returns a native storage from a java storage instance. * - * @param jstorage The java storage object from which get the native storage. - * @param env The environment of the current thread + * @param jstorage The java storage object from which get the native storage. + * @param env The environment of the current thread * - * @return The function returns the native storage associated to the - * java storage object. + * @return The function returns the native storage associated to the + * java storage object. * - * @exception If the class Storage is not found the function throws - * the ClassNotFoundException. If the field bind of - * this class is not found the function throws the exception - * NotSuchFieldException. + * @exception If the class Storage is not found the function throws + * the ClassNotFoundException. If the field bind of + * this class is not found the function throws the exception + * NotSuchFieldException. */ msg_storage_t jstorage_get_native(JNIEnv * env, jobject jstorage); /** - * Class org_simgrid_msg_Storage - * Method nativeInit - * Signature ()V + * Class org_simgrid_msg_Storage + * Method nativeInit + * Signature ()V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Storage_nativeInit(JNIEnv*, jclass); @@ -72,56 +72,56 @@ Java_org_simgrid_msg_Storage_nativeInit(JNIEnv*, jclass); * This function returns a global reference to the java storage instance * specified by the parameter jstorage. * - * @param jstorage The original java storage instance. - * @param env The environment of the current thread + * @param jstorage The original java storage instance. + * @param env The environment of the current thread * - * @return The global reference to the original java storage - * instance. + * @return The global reference to the original java storage + * instance. */ jobject jstorage_ref(JNIEnv * env, jobject jstorage); /** * This function delete a global reference to a java storage instance. * - * @param The global reference to delete. - * @param env The environment of the current thread + * @param The global reference to delete. + * @param env The environment of the current thread */ void jstorage_unref(JNIEnv * env, jobject jstorage); /** * This function returns the name of a MSG storage. * - * @param jstorage A java storage object. - * @param env The environment of the current thread + * @param jstorage A java storage object. + * @param env The environment of the current thread * - * @return The name of the storage. + * @return The name of the storage. */ const char *jstorage_get_name(jobject jstorage, JNIEnv * env); /* - * Class org_simgrid_msg_Storage - * Method getByName - * Signature (Ljava/lang/String;)Lsimgrid/msg/Storage; + * Class org_simgrid_msg_Storage + * Method getByName + * Signature (Ljava/lang/String;)Lsimgrid/msg/Storage; */ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getByName(JNIEnv *, jclass, jstring); /* - * Class org_simgrid_msg_Storage - * Method getSize - * Signature ()D + * Class org_simgrid_msg_Storage + * Method getSize + * Signature ()D */ JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getSize(JNIEnv *, jobject); /* - * Class org_simgrid_msg_Storage - * Method getFreeSize - * Signature ()D + * Class org_simgrid_msg_Storage + * Method getFreeSize + * Signature ()D */ JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getFreeSize(JNIEnv *, jobject); /* - * Class org_simgrid_msg_Storage - * Method getUsedSize - * Signature ()D + * Class org_simgrid_msg_Storage + * Method getUsedSize + * Signature ()D */ JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getUsedSize(JNIEnv *, jobject); diff --git a/src/bindings/java/jmsg_task.cpp b/src/bindings/java/jmsg_task.cpp index fb1a948181..7c6cb4ac47 100644 --- a/src/bindings/java/jmsg_task.cpp +++ b/src/bindings/java/jmsg_task.cpp @@ -261,7 +261,7 @@ Java_org_simgrid_msg_Task_getSender(JNIEnv * env, process = MSG_task_get_sender(task); if (process == NULL) { - return NULL; + return NULL; } return (jobject) native_to_java_process(process); } @@ -280,7 +280,7 @@ Java_org_simgrid_msg_Task_getSource(JNIEnv * env, host = MSG_task_get_source(task); if (host == NULL) { - return NULL; + return NULL; } if (!host->extension(JAVA_HOST_LEVEL)) { jxbt_throw_jni(env, "MSG_task_get_source() failed"); @@ -304,18 +304,18 @@ Java_org_simgrid_msg_Task_getFlopsAmount(JNIEnv * env, jobject jtask) JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setName(JNIEnv *env, jobject jtask, jobject jname) { - msg_task_t task = jtask_to_native_task(jtask, env); + msg_task_t task = jtask_to_native_task(jtask, env); - if (!task) { - jxbt_throw_notbound(env, "task", jtask); - return; - } - const char *name = env->GetStringUTFChars((jstring) jname, 0); + if (!task) { + jxbt_throw_notbound(env, "task", jtask); + return; + } + const char *name = env->GetStringUTFChars((jstring) jname, 0); - env->SetObjectField(jtask, jtask_field_Task_name, jname); - MSG_task_set_name(task, name); + env->SetObjectField(jtask, jtask_field_Task_name, jname); + MSG_task_set_name(task, name); - env->ReleaseStringUTFChars((jstring) jname, name); + env->ReleaseStringUTFChars((jstring) jname, name); } JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setPriority(JNIEnv * env, @@ -331,26 +331,26 @@ Java_org_simgrid_msg_Task_setPriority(JNIEnv * env, } JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setFlopsAmount - (JNIEnv *env, jobject jtask, jdouble computationAmount) { - msg_task_t task = jtask_to_native_task(jtask, env); + (JNIEnv *env, jobject jtask, jdouble computationAmount) { + msg_task_t task = jtask_to_native_task(jtask, env); - if (!task) { + if (!task) { jxbt_throw_notbound(env, "task", jtask); return; - } - MSG_task_set_flops_amount(task, (double) computationAmount); + } + MSG_task_set_flops_amount(task, (double) computationAmount); } JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setBytesAmount - (JNIEnv *env, jobject jtask, jdouble dataSize) { - msg_task_t task = jtask_to_native_task(jtask, env); + (JNIEnv *env, jobject jtask, jdouble dataSize) { + msg_task_t task = jtask_to_native_task(jtask, env); - if (!task) { + if (!task) { jxbt_throw_notbound(env, "task", jtask); return; - } + } env->SetDoubleField(jtask, jtask_field_Task_messageSize, dataSize); - MSG_task_set_bytes_amount(task, (double) dataSize); + MSG_task_set_bytes_amount(task, (double) dataSize); } JNIEXPORT void JNICALL @@ -455,37 +455,37 @@ Java_org_simgrid_msg_Task_receive(JNIEnv * env, jclass cls, JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_irecv(JNIEnv * env, jclass cls, jstring jmailbox) { - msg_comm_t comm; - const char *mailbox; - jclass comm_class; - //pointer to store the task object pointer. - msg_task_t *task = xbt_new(msg_task_t,1); - *task = NULL; - /* There should be a cache here */ - comm_class = env->FindClass("org/simgrid/msg/Comm"); + msg_comm_t comm; + const char *mailbox; + jclass comm_class; + //pointer to store the task object pointer. + msg_task_t *task = xbt_new(msg_task_t,1); + *task = NULL; + /* There should be a cache here */ + comm_class = env->FindClass("org/simgrid/msg/Comm"); - if (!comm_class) { - jxbt_throw_native(env,bprintf("fieldID or methodID or class not found.")); - return NULL; - } + if (!comm_class) { + jxbt_throw_native(env,bprintf("fieldID or methodID or class not found.")); + return NULL; + } - jobject jcomm = env->NewObject(comm_class, jtask_method_Comm_constructor); - if (!jcomm) { - jxbt_throw_native(env,bprintf("Can't create a Comm object.")); - return NULL; - } + jobject jcomm = env->NewObject(comm_class, jtask_method_Comm_constructor); + if (!jcomm) { + jxbt_throw_native(env,bprintf("Can't create a Comm object.")); + return NULL; + } - mailbox = env->GetStringUTFChars(jmailbox, 0); + mailbox = env->GetStringUTFChars(jmailbox, 0); - comm = MSG_task_irecv(task,mailbox); + comm = MSG_task_irecv(task,mailbox); - env->SetLongField(jcomm, jtask_field_Comm_bind, (jlong) (uintptr_t)(comm)); - env->SetLongField(jcomm, jtask_field_Comm_taskBind, (jlong) (uintptr_t)(task)); - env->SetBooleanField(jcomm, jtask_field_Comm_receiving, JNI_TRUE); + env->SetLongField(jcomm, jtask_field_Comm_bind, (jlong) (uintptr_t)(comm)); + env->SetLongField(jcomm, jtask_field_Comm_taskBind, (jlong) (uintptr_t)(task)); + env->SetBooleanField(jcomm, jtask_field_Comm_receiving, JNI_TRUE); - env->ReleaseStringUTFChars(jmailbox, mailbox); + env->ReleaseStringUTFChars(jmailbox, mailbox); - return jcomm; + return jcomm; } @@ -536,38 +536,38 @@ Java_org_simgrid_msg_Task_receiveBounded(JNIEnv * env, jclass cls, JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_irecvBounded(JNIEnv * env, jclass cls, - jstring jmailbox, jdouble rate) { - msg_comm_t comm; - const char *mailbox; - jclass comm_class; - //pointer to store the task object pointer. - msg_task_t *task = xbt_new(msg_task_t,1); - *task = NULL; - /* There should be a cac hee */ - comm_class = env->FindClass("org/simgrid/msg/Comm"); + jstring jmailbox, jdouble rate) { + msg_comm_t comm; + const char *mailbox; + jclass comm_class; + //pointer to store the task object pointer. + msg_task_t *task = xbt_new(msg_task_t,1); + *task = NULL; + /* There should be a cac hee */ + comm_class = env->FindClass("org/simgrid/msg/Comm"); - if (!comm_class) { - jxbt_throw_native(env,bprintf("fieldID or methodID or class not found.")); - return NULL; - } + if (!comm_class) { + jxbt_throw_native(env,bprintf("fieldID or methodID or class not found.")); + return NULL; + } - jobject jcomm = env->NewObject(comm_class, jtask_method_Comm_constructor); - if (!jcomm) { - jxbt_throw_native(env,bprintf("Can't create a Comm object.")); - return NULL; - } + jobject jcomm = env->NewObject(comm_class, jtask_method_Comm_constructor); + if (!jcomm) { + jxbt_throw_native(env,bprintf("Can't create a Comm object.")); + return NULL; + } - mailbox = env->GetStringUTFChars(jmailbox, 0); + mailbox = env->GetStringUTFChars(jmailbox, 0); - comm = MSG_task_irecv_bounded(task,mailbox, (double) rate); + comm = MSG_task_irecv_bounded(task,mailbox, (double) rate); - env->SetLongField(jcomm, jtask_field_Comm_bind, (jlong) (uintptr_t)(comm)); - env->SetLongField(jcomm, jtask_field_Comm_taskBind, (jlong) (uintptr_t)(task)); - env->SetBooleanField(jcomm, jtask_field_Comm_receiving, JNI_TRUE); + env->SetLongField(jcomm, jtask_field_Comm_bind, (jlong) (uintptr_t)(comm)); + env->SetLongField(jcomm, jtask_field_Comm_taskBind, (jlong) (uintptr_t)(task)); + env->SetBooleanField(jcomm, jtask_field_Comm_receiving, JNI_TRUE); - env->ReleaseStringUTFChars(jmailbox, mailbox); + env->ReleaseStringUTFChars(jmailbox, mailbox); - return jcomm; + return jcomm; } JNIEXPORT jobject JNICALL @@ -650,14 +650,14 @@ Java_org_simgrid_msg_Task_isendBounded(JNIEnv *env, jobject jtask, jstring jmail JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_nativeFinalize(JNIEnv * env, jobject jtask) { - msg_task_t task = jtask_to_native_task(jtask, env); + msg_task_t task = jtask_to_native_task(jtask, env); - if (!task) { - jxbt_throw_notbound(env, "task", jtask); - return; - } + if (!task) { + jxbt_throw_notbound(env, "task", jtask); + return; + } - MSG_task_destroy(task); + MSG_task_destroy(task); } static void msg_task_cancel_on_failed_dsend(void*t) { diff --git a/src/bindings/java/jmsg_task.h b/src/bindings/java/jmsg_task.h index 6509dc0169..2a89b6e2ab 100644 --- a/src/bindings/java/jmsg_task.h +++ b/src/bindings/java/jmsg_task.h @@ -17,30 +17,30 @@ SG_BEGIN_DECL() /** * This function associated a native task to a java task instance. * - * @param jtask The java task instance. - * @param task The native task to bind. - * @param env The environment of the current thread. + * @param jtask The java task instance. + * @param task The native task to bind. + * @param env The environment of the current thread. * - * @exception If the class Task is not found the function throws - * the ClassNotFoundException. If the field bind of - * this class is not found the function throws the exception - * NotSuchFieldException. + * @exception If the class Task is not found the function throws + * the ClassNotFoundException. If the field bind of + * this class is not found the function throws the exception + * NotSuchFieldException. */ void jtask_bind(jobject jtask, msg_task_t task, JNIEnv * env); /** * This function returns a native task from a java task instance. * - * @param jtask The java task object from which get the native task. - * @param env The environment of the current thread. + * @param jtask The java task object from which get the native task. + * @param env The environment of the current thread. * - * @return The function returns the native task associated to the - * java task object. + * @return The function returns the native task associated to the + * java task object. * - * @exception If the class Task is not found the function throws - * the ClassNotFoundException. If the field bind of - * this class is not found the function throws the exception - * NotSuchFieldException. + * @exception If the class Task is not found the function throws + * the ClassNotFoundException. If the field bind of + * this class is not found the function throws the exception + * NotSuchFieldException. */ msg_task_t jtask_to_native_task(jobject jtask, JNIEnv * env); @@ -49,146 +49,146 @@ msg_task_t jtask_to_native_task(jobject jtask, JNIEnv * env); * A java task object is valid if it is bind to a native * task. * - * @param jtask The java task to test the validity. - * @param env The environment of the current thread. + * @param jtask The java task to test the validity. + * @param env The environment of the current thread. * - * @return If the java task is valid the function returns true. - * Otherwise the function returns false. + * @return If the java task is valid the function returns true. + * Otherwise the function returns false. */ jboolean jtask_is_valid(jobject jtask, JNIEnv * env); /* - * Class org_simgrid_msg_Task - * Method nativeInit - * Signature (); + * Class org_simgrid_msg_Task + * Method nativeInit + * Signature (); */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_nativeInit(JNIEnv *env, jclass cls); /* - * Class org_simgrid_msg_Task - * Method create + * Class org_simgrid_msg_Task + * Method create */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_create - (JNIEnv * env, jobject jtask, jstring jname, jdouble jcomputeDuration, jdouble jmessageSize); + (JNIEnv * env, jobject jtask, jstring jname, jdouble jcomputeDuration, jdouble jmessageSize); JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_nativeFinalize(JNIEnv * env, jobject jtask); /* - * Class org_simgrid_msg_Task - * Method parallelCreate + * Class org_simgrid_msg_Task + * Method parallelCreate */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_parallelCreate - (JNIEnv *, jobject, + (JNIEnv *, jobject, jstring, jobjectArray, jdoubleArray, jdoubleArray); /* - * Class org_simgrid_msg_Task - * Method destroy - * Signature (Lsimgrid/msg/Task;)V + * Class org_simgrid_msg_Task + * Method destroy + * Signature (Lsimgrid/msg/Task;)V */ /* JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_destroy */ /* (JNIEnv *, jobject); */ /* - * Class org_simgrid_msg_Task - * Method cancel - * Signature ()V + * Class org_simgrid_msg_Task + * Method cancel + * Signature ()V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_cancel (JNIEnv *, jobject); /* - * Class org_simgrid_msg_Task - * Method execute - * Signature ()V + * Class org_simgrid_msg_Task + * Method execute + * Signature ()V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_execute (JNIEnv *, jobject); /* - * Class org_simgrid_msg_Task - * Method setBound - * Signature ()V + * Class org_simgrid_msg_Task + * Method setBound + * Signature ()V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setBound (JNIEnv *, jobject, jdouble); /* - * Class org_simgrid_msg_Task - * Method getName - * Signature ()Ljava/lang/String; + * Class org_simgrid_msg_Task + * Method getName + * Signature ()Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_org_simgrid_msg_Task_getName (JNIEnv *, jobject); /* - * Class org_simgrid_msg_Task - * Method getSender - * Signature ()Lsimgrid/msg/Process; + * Class org_simgrid_msg_Task + * Method getSender + * Signature ()Lsimgrid/msg/Process; */ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_getSender (JNIEnv *, jobject); /* - * Class org_simgrid_msg_Task - * Method getSource - * Signature ()Lsimgrid/msg/Host; + * Class org_simgrid_msg_Task + * Method getSource + * Signature ()Lsimgrid/msg/Host; */ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_getSource (JNIEnv *, jobject); /* - * Class org_simgrid_msg_Task - * Method getFlopsAmount - * Signature ()D + * Class org_simgrid_msg_Task + * Method getFlopsAmount + * Signature ()D */ JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Task_getFlopsAmount (JNIEnv *, jobject); /** - * Class org_simgrid_msg_Task - * Method setName - * Signature (Ljava/lang/string;)V + * Class org_simgrid_msg_Task + * Method setName + * Signature (Ljava/lang/string;)V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setName(JNIEnv *env, jobject jtask, jobject jname); /* - * Class org_simgrid_msg_Task - * Method setPriority - * Signature (D)V + * Class org_simgrid_msg_Task + * Method setPriority + * Signature (D)V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setPriority (JNIEnv *, jobject, jdouble); /** - * Class org_simgrid_msg_Task - * Method setComputeDuration - * Signature (D)V + * Class org_simgrid_msg_Task + * Method setComputeDuration + * Signature (D)V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setFlopsAmount - (JNIEnv *env, jobject jtask, jdouble computationAmount); - - /** - * Class org_simgrid_msg_Task - * Method setDataSize - * Signature (D)V + (JNIEnv *env, jobject jtask, jdouble computationAmount); + + /** + * Class org_simgrid_msg_Task + * Method setDataSize + * Signature (D)V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setBytesAmount - (JNIEnv *env, jobject jtask, jdouble dataSize); - + (JNIEnv *env, jobject jtask, jdouble dataSize); + /** - * Class org_simgrid_msg_Task - * Method send + * Class org_simgrid_msg_Task + * Method send */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_send (JNIEnv *, jobject, jstring, jdouble); /** - * Class org_simgrid_msg_Task - * Method sendBounded + * Class org_simgrid_msg_Task + * Method sendBounded */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_sendBounded @@ -196,81 +196,81 @@ JNIEXPORT void JNICALL /** - * Class org_simgrid_msg_Task - * Method receive + * Class org_simgrid_msg_Task + * Method receive */ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_receive (JNIEnv *, jclass, jstring, jdouble, jobject); /** - * Class org_simgrid_msg_Task - * Method irecv - * Signature (Ljava/lang/String;)Lorg/simgrid/msg/Comm; + * Class org_simgrid_msg_Task + * Method irecv + * Signature (Ljava/lang/String;)Lorg/simgrid/msg/Comm; */ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_irecv(JNIEnv * env, jclass cls, jstring jmailbox); /** - * Class org_simgrid_msg_Task - * Method receiveBounded + * Class org_simgrid_msg_Task + * Method receiveBounded */ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_receiveBounded(JNIEnv * env, jclass cls, jstring jalias, jdouble jtimeout, jobject jhost, jdouble rate); /** - * Class org_simgrid_msg_Task - * Method irecvBounded + * Class org_simgrid_msg_Task + * Method irecvBounded */ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_irecvBounded(JNIEnv * env, jclass cls, jstring jmailbox, jdouble rate); /** - * Class org_simgrid_msg_Task - * Method isend - * Signature (Lorg/simgrid/msg/Task;Ljava/lang/String;)Lorg/simgrid/msg/Comm; + * Class org_simgrid_msg_Task + * Method isend + * Signature (Lorg/simgrid/msg/Task;Ljava/lang/String;)Lorg/simgrid/msg/Comm; */ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_isend(JNIEnv *env, jobject jtask, jstring jmailbox); /** - * Class org_simgrid_msg_Task - * Method isendBounded + * Class org_simgrid_msg_Task + * Method isendBounded */ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_isendBounded(JNIEnv *env, jobject jtask, jstring jmailbox, jdouble maxrate); /** - * Class org_simgrid_msg_Task - * Method dsend + * Class org_simgrid_msg_Task + * Method dsend */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_dsend(JNIEnv * env, jobject jtask, jstring jalias); /** - * Class org_simgrid_msg_Task - * Method dsendBounded + * Class org_simgrid_msg_Task + * Method dsendBounded */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_dsendBounded(JNIEnv * env, jobject jtask, jstring jalias, jdouble maxrate); /** - * Class org_simgrid_msg_Task - * Method listen + * Class org_simgrid_msg_Task + * Method listen */ JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Task_listen(JNIEnv *, jclass, jstring); /** - * Class org_simgrid_msg_Task - * Method listenFromHost + * Class org_simgrid_msg_Task + * Method listenFromHost */ JNIEXPORT jint JNICALL Java_org_simgrid_msg_Task_listenFromHost(JNIEnv *, jclass, jstring, jobject); /** - * Class org_simgrid_msg_Task - * Method listenFrom + * Class org_simgrid_msg_Task + * Method listenFrom */ JNIEXPORT jint JNICALL Java_org_simgrid_msg_Task_listenFrom(JNIEnv *, jclass, jstring); diff --git a/src/bindings/java/jmsg_vm.cpp b/src/bindings/java/jmsg_vm.cpp index 2d2b382d3d..81da0b2233 100644 --- a/src/bindings/java/jmsg_vm.cpp +++ b/src/bindings/java/jmsg_vm.cpp @@ -29,7 +29,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_nativeInit(JNIEnv *env, jclass cls) { jclass jprocess_class_VM = env->FindClass("org/simgrid/msg/VM"); jvm_field_bind = jxbt_get_jfield(env, jprocess_class_VM, "bind", "J"); - if (!jvm_field_bind ) { + if (!jvm_field_bind ) { jxbt_throw_native(env,bprintf("Can't find some fields in Java class. You should report this bug.")); } } @@ -79,14 +79,14 @@ Java_org_simgrid_msg_VM_isRestoring(JNIEnv * env, jobject jvm) { JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_setBound(JNIEnv *env, jobject jvm, jint load) { - msg_vm_t vm = jvm_get_native(env,jvm); - double bound = MSG_get_host_speed(vm) * load / 100; - MSG_vm_set_bound(vm, bound); + msg_vm_t vm = jvm_get_native(env,jvm); + double bound = MSG_get_host_speed(vm) * load / 100; + MSG_vm_set_bound(vm, bound); } JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_create(JNIEnv *env, jobject jvm, jobject jhost, jstring jname, - jint jncore, jint jramsize, jint jnetcap, jstring jdiskpath, jint jdisksize, jint jmig_netspeed, jint jdp_intensity) { + jint jncore, jint jramsize, jint jnetcap, jstring jdiskpath, jint jdisksize, jint jmig_netspeed, jint jdp_intensity) { msg_host_t host = jhost_get_native(env, jhost); @@ -100,7 +100,7 @@ Java_org_simgrid_msg_VM_create(JNIEnv *env, jobject jvm, jobject jhost, jstring // disk_path = xbt_strdup(disk_path); msg_vm_t vm = MSG_vm_create(host, name, (int) jncore, (int) jramsize, - (int) jnetcap, NULL, (int) jdisksize, (int) jmig_netspeed, (int) jdp_intensity); + (int) jnetcap, NULL, (int) jdisksize, (int) jmig_netspeed, (int) jdp_intensity); jvm_bind(env,jvm,vm); } diff --git a/src/bindings/java/jmsg_vm.h b/src/bindings/java/jmsg_vm.h index 616876654e..1ed5e3b556 100644 --- a/src/bindings/java/jmsg_vm.h +++ b/src/bindings/java/jmsg_vm.h @@ -18,73 +18,73 @@ void jvm_bind(JNIEnv *env, jobject jvm, msg_vm_t vm); msg_vm_t jvm_get_native(JNIEnv *env, jobject jvm); /* - * Class org_simgrid_msg_VM - * Method nativeInit - * Signature ()V + * Class org_simgrid_msg_VM + * Method nativeInit + * Signature ()V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_nativeInit(JNIEnv *env, jclass); /** - * Class org_simgrid_msg_VM - * Method isCreated - * Signature ()B + * Class org_simgrid_msg_VM + * Method isCreated + * Signature ()B */ JNIEXPORT jint JNICALL Java_org_simgrid_msg_VM_isCreated(JNIEnv *env, jobject jvm); /** - * Class org_simgrid_msg_VM - * Method isRunning - * Signature ()B + * Class org_simgrid_msg_VM + * Method isRunning + * Signature ()B */ JNIEXPORT jint JNICALL Java_org_simgrid_msg_VM_isRunning(JNIEnv *env, jobject jvm); /** - * Class org_simgrid_msg_VM - * Method isMigrating - * Signature ()B + * Class org_simgrid_msg_VM + * Method isMigrating + * Signature ()B */ JNIEXPORT jint JNICALL Java_org_simgrid_msg_VM_isMigrating(JNIEnv *env, jobject jvm); /** - * Class org_simgrid_msg_VM - * Method isSuspended - * Signature ()B + * Class org_simgrid_msg_VM + * Method isSuspended + * Signature ()B */ JNIEXPORT jint JNICALL Java_org_simgrid_msg_VM_isSuspended(JNIEnv *env, jobject jvm); /** - * Class org_simgrid_msg_VM - * Method isResuming - * Signature ()B + * Class org_simgrid_msg_VM + * Method isResuming + * Signature ()B */ JNIEXPORT jint JNICALL Java_org_simgrid_msg_VM_isResuming(JNIEnv *env, jobject jvm); /** - * Class org_simgrid_msg_VM - * Method isSuspended - * Signature ()B + * Class org_simgrid_msg_VM + * Method isSuspended + * Signature ()B */ JNIEXPORT jint JNICALL Java_org_simgrid_msg_VM_isSaving(JNIEnv *env, jobject jvm); /** - * Class org_simgrid_msg_VM - * Method isSave - * Signature ()B + * Class org_simgrid_msg_VM + * Method isSave + * Signature ()B */ JNIEXPORT jint JNICALL Java_org_simgrid_msg_VM_isSaved(JNIEnv *env, jobject jvm); /** - * Class org_simgrid_msg_VM - * Method isResuming - * Signature ()B + * Class org_simgrid_msg_VM + * Method isResuming + * Signature ()B */ JNIEXPORT jint JNICALL Java_org_simgrid_msg_VM_isRestoring(JNIEnv *env, jobject jvm); /** - * Class org_simgrid_msg_VM - * Method setBound - * Signature ()B + * Class org_simgrid_msg_VM + * Method setBound + * Signature ()B */ JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_setBound(JNIEnv *env, jobject jvm, jint load); @@ -96,7 +96,7 @@ Java_org_simgrid_msg_VM_setBound(JNIEnv *env, jobject jvm, jint load); */ JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_create(JNIEnv *env, jobject jvm, jobject jhost, jstring jname, - jint jncore, jint jramsize, jint jnetcap, jstring jdiskpath, jint jdisksize, jint dprate, jint mig_netspeed); + jint jncore, jint jramsize, jint jnetcap, jstring jdiskpath, jint jdisksize, jint dprate, jint mig_netspeed); /** * Class org_simgrid_msg_VM @@ -106,37 +106,37 @@ Java_org_simgrid_msg_VM_create(JNIEnv *env, jobject jvm, jobject jhost, jstring JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_nativeFinalize(JNIEnv *env, jobject jvm); /** - * Class org_simgrid_msg_VM - * Method start - * Signature (I)V + * Class org_simgrid_msg_VM + * Method start + * Signature (I)V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_start(JNIEnv *env, jobject jvm); /** - * Class org_simgrid_msg_VM - * Method nativeMigrate - * Signature (Lorg/simgrid/msg/Host;)V + * Class org_simgrid_msg_VM + * Method nativeMigrate + * Signature (Lorg/simgrid/msg/Host;)V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_internalmig(JNIEnv *env, jobject jvm, jobject jhost); /** - * Class org_simgrid_msg_VM - * Method suspend - * Signature ()V + * Class org_simgrid_msg_VM + * Method suspend + * Signature ()V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_suspend(JNIEnv *env, jobject jvm); /** - * Class org_simgrid_msg_VM - * Method resume - * Signature ()V + * Class org_simgrid_msg_VM + * Method resume + * Signature ()V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_resume(JNIEnv *env, jobject jvm); /** - * Class org_simgrid_msg_VM - * Method shutdown - * Signature ()V + * Class org_simgrid_msg_VM + * Method shutdown + * Signature ()V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_shutdown(JNIEnv *env, jobject jvm); diff --git a/src/include/mc/mc.h b/src/include/mc/mc.h index f227baef43..eaeb396691 100644 --- a/src/include/mc/mc.h +++ b/src/include/mc/mc.h @@ -36,7 +36,7 @@ SG_BEGIN_DECL() -/********************************** Configuration of MC **************************************/ +/********************************** Configuration of MC **************************************/ extern XBT_PUBLIC(int) _sg_do_model_check; extern XBT_PRIVATE int _sg_do_model_check_record; diff --git a/src/include/surf/maxmin.h b/src/include/surf/maxmin.h index 6fbb863b75..b7a0a72add 100644 --- a/src/include/surf/maxmin.h +++ b/src/include/surf/maxmin.h @@ -235,7 +235,7 @@ XBT_PUBLIC(void) lmm_constraint_concurrency_maximum_reset(lmm_constraint_t cnst) */ XBT_PUBLIC(int) lmm_constraint_concurrency_maximum_get(lmm_constraint_t cnst); - + /** * @brief Create a new Linear MaxMin variable * diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index 52a2e56a62..4e800a8ade 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -257,7 +257,7 @@ XBT_PUBLIC(surf_action_t) surf_network_model_communicate(surf_network_model_t mo */ XBT_PUBLIC(const char * ) surf_resource_name(surf_cpp_resource_t resource); static inline const char * surf_cpu_name(surf_cpu_t cpu) { - return surf_resource_name((surf_cpp_resource_t)cpu); + return surf_resource_name((surf_cpp_resource_t)cpu); } /** @brief Get the available speed of cpu associated to a host */ diff --git a/src/msg/instr_msg_vm.cpp b/src/msg/instr_msg_vm.cpp index c002413a1a..995a22ddda 100644 --- a/src/msg/instr_msg_vm.cpp +++ b/src/msg/instr_msg_vm.cpp @@ -12,7 +12,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_msg_vm, instr, "MSG VM"); char *instr_vm_id (msg_vm_t vm, char *str, int len) { - return instr_vm_id_2 (MSG_vm_get_name(vm), str, len); + return instr_vm_id_2 (MSG_vm_get_name(vm), str, len); } char *instr_vm_id_2 (const char *vm_name, char *str, int len) diff --git a/src/msg/msg_host.cpp b/src/msg/msg_host.cpp index 87582b1c94..15a78c1cbb 100644 --- a/src/msg/msg_host.cpp +++ b/src/msg/msg_host.cpp @@ -121,7 +121,7 @@ void __MSG_host_priv_free(msg_host_priv_t priv) { if (priv == NULL) - return; + return; unsigned int size = xbt_dict_size(priv->dp_objs); if (size > 0) XBT_WARN("dp_objs: %u pending task?", size); @@ -274,8 +274,8 @@ void MSG_host_get_params(msg_host_t host, vm_params_t params) * \return Returns the processor speed associated with pstate_index */ double MSG_host_get_power_peak_at(msg_host_t host, int pstate_index) { - xbt_assert((host != NULL), "Invalid parameters (host is NULL)"); - return host->power_peak_at(pstate_index); + xbt_assert((host != NULL), "Invalid parameters (host is NULL)"); + return host->power_peak_at(pstate_index); } /** \ingroup m_host_management @@ -285,8 +285,8 @@ double MSG_host_get_power_peak_at(msg_host_t host, int pstate_index) { * \return Returns the current processor speed */ double MSG_host_get_current_power_peak(msg_host_t host) { - xbt_assert((host != NULL), "Invalid parameters (host is NULL)"); - return host->current_power_peak(); + xbt_assert((host != NULL), "Invalid parameters (host is NULL)"); + return host->current_power_peak(); } /** \ingroup m_host_management @@ -295,7 +295,7 @@ double MSG_host_get_current_power_peak(msg_host_t host) { * \param host host to test */ int MSG_host_get_nb_pstates(msg_host_t host) { - return sg_host_get_nb_pstates(host); + return sg_host_get_nb_pstates(host); } /** \ingroup m_host_management diff --git a/src/msg/msg_io.cpp b/src/msg/msg_io.cpp index 959fb1f111..227031e00a 100644 --- a/src/msg/msg_io.cpp +++ b/src/msg/msg_io.cpp @@ -536,7 +536,7 @@ xbt_dynar_t MSG_storages_as_dynar(void) { xbt_dynar_t res = xbt_dynar_new(sizeof(msg_storage_t),NULL); xbt_lib_foreach(storage_lib, cursor, key, data) { - if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), MSG_STORAGE_LEVEL) != NULL) { + if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), MSG_STORAGE_LEVEL) != NULL) { xbt_dictelm_t elm = xbt_dict_cursor_get_elm(cursor); xbt_dynar_push(res, &elm); } diff --git a/src/msg/msg_task.cpp b/src/msg/msg_task.cpp index 22de933d2c..245564538c 100644 --- a/src/msg/msg_task.cpp +++ b/src/msg/msg_task.cpp @@ -318,11 +318,11 @@ msg_error_t MSG_task_cancel(msg_task_t task) */ double MSG_task_get_flops_amount(msg_task_t task) { - if (task->simdata->compute) { - return simcall_execution_get_remains(task->simdata->compute); - } else { - return task->simdata->flops_amount; - } + if (task->simdata->compute) { + return simcall_execution_get_remains(task->simdata->compute); + } else { + return task->simdata->flops_amount; + } } diff --git a/src/s4u/s4u_actor.cpp b/src/s4u/s4u_actor.cpp index 010aff431f..8344b43178 100644 --- a/src/s4u/s4u_actor.cpp +++ b/src/s4u/s4u_actor.cpp @@ -18,10 +18,10 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_actor,"S4U actors"); /* C main function of a actor, running this->main */ static int s4u_actor_runner(int argc, char **argv) { - smx_process_t smx_proc = SIMIX_process_self(); - simgrid::s4u::Actor *actor = (simgrid::s4u::Actor*) SIMIX_process_self_get_data(smx_proc); - int res = actor->main(argc,argv); - return res; + smx_process_t smx_proc = SIMIX_process_self(); + simgrid::s4u::Actor *actor = (simgrid::s4u::Actor*) SIMIX_process_self_get_data(smx_proc); + int res = actor->main(argc,argv); + return res; } @@ -29,83 +29,83 @@ static int s4u_actor_runner(int argc, char **argv) { using namespace simgrid; s4u::Actor::Actor(smx_process_t smx_proc) { - p_smx_process = smx_proc; + p_smx_process = smx_proc; } s4u::Actor::Actor(const char *name, s4u::Host *host, int argc, char **argv) : s4u::Actor::Actor(name,host, argc,argv, -1) { } s4u::Actor::Actor(const char *name, s4u::Host *host, int argc, char **argv, double killTime) { - p_smx_process = simcall_process_create(name, s4u_actor_runner, this, host->name().c_str(), killTime, argc, argv, NULL/*properties*/,0); + p_smx_process = simcall_process_create(name, s4u_actor_runner, this, host->name().c_str(), killTime, argc, argv, NULL/*properties*/,0); - xbt_assert(p_smx_process,"Cannot create the actor"); -// TRACE_msg_process_create(procname, simcall_process_get_PID(p_smx_process), host->getInferior()); -// simcall_process_on_exit(p_smx_process,(int_f_pvoid_pvoid_t)TRACE_msg_process_kill,p_smx_process); + xbt_assert(p_smx_process,"Cannot create the actor"); +// TRACE_msg_process_create(procname, simcall_process_get_PID(p_smx_process), host->getInferior()); +// simcall_process_on_exit(p_smx_process,(int_f_pvoid_pvoid_t)TRACE_msg_process_kill,p_smx_process); } int s4u::Actor::main(int argc, char **argv) { - fprintf(stderr,"Error: You should override the method main(int, char**) in Actor class %s\n",getName()); - return 0; + fprintf(stderr,"Error: You should override the method main(int, char**) in Actor class %s\n",getName()); + return 0; } s4u::Actor *s4u::Actor::current() { - smx_process_t smx_proc = SIMIX_process_self(); - simgrid::s4u::Actor* res = (simgrid::s4u::Actor*) SIMIX_process_self_get_data(smx_proc); - if (res == NULL) // The smx_process was not created by S4U (but by deployment?). Embed it in a S4U object - res = new Actor(smx_proc); - return res; + smx_process_t smx_proc = SIMIX_process_self(); + simgrid::s4u::Actor* res = (simgrid::s4u::Actor*) SIMIX_process_self_get_data(smx_proc); + if (res == NULL) // The smx_process was not created by S4U (but by deployment?). Embed it in a S4U object + res = new Actor(smx_proc); + return res; } s4u::Actor *s4u::Actor::byPid(int pid) { - return (simgrid::s4u::Actor*) SIMIX_process_self_get_data(SIMIX_process_from_PID(pid)); + return (simgrid::s4u::Actor*) SIMIX_process_self_get_data(SIMIX_process_from_PID(pid)); } void s4u::Actor::setAutoRestart(bool autorestart) { - simcall_process_auto_restart_set(p_smx_process,autorestart); + simcall_process_auto_restart_set(p_smx_process,autorestart); } s4u::Host *s4u::Actor::getHost() { - return s4u::Host::by_name(sg_host_get_name(simcall_process_get_host(p_smx_process))); + return s4u::Host::by_name(sg_host_get_name(simcall_process_get_host(p_smx_process))); } const char* s4u::Actor::getName() { - return simcall_process_get_name(p_smx_process); + return simcall_process_get_name(p_smx_process); } int s4u::Actor::getPid(){ - return simcall_process_get_PID(p_smx_process); + return simcall_process_get_PID(p_smx_process); } void s4u::Actor::setKillTime(double time) { - simcall_process_set_kill_time(p_smx_process,time); + simcall_process_set_kill_time(p_smx_process,time); } double s4u::Actor::getKillTime() { - return simcall_process_get_kill_time(p_smx_process); + return simcall_process_get_kill_time(p_smx_process); } void s4u::Actor::killAll() { - simcall_process_killall(1); + simcall_process_killall(1); } void s4u::Actor::kill() { - simcall_process_kill(p_smx_process); + simcall_process_kill(p_smx_process); } void s4u::Actor::sleep(double duration) { - simcall_process_sleep(duration); + simcall_process_sleep(duration); } e_smx_state_t s4u::Actor::execute(double flops) { - smx_synchro_t s = simcall_execution_start(NULL,flops,1.0/*priority*/,0./*bound*/, 0L/*affinity*/); - return simcall_execution_wait(s); + smx_synchro_t s = simcall_execution_start(NULL,flops,1.0/*priority*/,0./*bound*/, 0L/*affinity*/); + return simcall_execution_wait(s); } void *s4u::Actor::recv(Mailbox &chan) { - void *res=NULL; + void *res=NULL; - Comm c = Comm::recv_init(this, chan); - c.setDstData(&res,sizeof(res)); - c.wait(); + Comm c = Comm::recv_init(this, chan); + c.setDstData(&res,sizeof(res)); + c.wait(); return res; } void s4u::Actor::send(Mailbox &chan, void *payload, size_t simulatedSize) { - Comm c = Comm::send_init(this,chan); - c.setRemains(simulatedSize); - c.setSrcData(payload); - // c.start() is optional. - c.wait(); + Comm c = Comm::send_init(this,chan); + c.setRemains(simulatedSize); + c.setSrcData(payload); + // c.start() is optional. + c.wait(); } diff --git a/src/s4u/s4u_async.cpp b/src/s4u/s4u_async.cpp index 5bbce9a31d..331ef22d0e 100644 --- a/src/s4u/s4u_async.cpp +++ b/src/s4u/s4u_async.cpp @@ -22,7 +22,7 @@ s4u::Async::~Async() { } void s4u::Async::setRemains(double remains) { - xbt_assert(p_state == inited, "Cannot change the remaining amount of work once the Async is started"); - p_remains = remains; + xbt_assert(p_state == inited, "Cannot change the remaining amount of work once the Async is started"); + p_remains = remains; } diff --git a/src/s4u/s4u_comm.cpp b/src/s4u/s4u_comm.cpp index d26c4d6952..564ae9c2d9 100644 --- a/src/s4u/s4u_comm.cpp +++ b/src/s4u/s4u_comm.cpp @@ -18,135 +18,135 @@ s4u::Comm::~Comm() { } s4u::Comm &s4u::Comm::send_init(s4u::Actor *sender, s4u::Mailbox &chan) { - s4u::Comm *res = new s4u::Comm(); - res->p_sender = sender; - res->p_mailbox = &chan; + s4u::Comm *res = new s4u::Comm(); + res->p_sender = sender; + res->p_mailbox = &chan; - return *res; + return *res; } s4u::Comm &s4u::Comm::recv_init(s4u::Actor *receiver, s4u::Mailbox &chan) { - s4u::Comm *res = new s4u::Comm(); - res->p_receiver = receiver; - res->p_mailbox = &chan; + s4u::Comm *res = new s4u::Comm(); + res->p_receiver = receiver; + res->p_mailbox = &chan; - return *res; + return *res; } void s4u::Comm::setRate(double rate) { - xbt_assert(p_state==inited); - p_rate = rate; + xbt_assert(p_state==inited); + p_rate = rate; } void s4u::Comm::setSrcData(void * buff) { - xbt_assert(p_state==inited); - xbt_assert(p_dstBuff == NULL, "Cannot set the src and dst buffers at the same time"); - p_srcBuff = buff; + xbt_assert(p_state==inited); + xbt_assert(p_dstBuff == NULL, "Cannot set the src and dst buffers at the same time"); + p_srcBuff = buff; } void s4u::Comm::setSrcDataSize(size_t size){ - xbt_assert(p_state==inited); - p_srcBuffSize = size; + xbt_assert(p_state==inited); + p_srcBuffSize = size; } void s4u::Comm::setSrcData(void * buff, size_t size) { - xbt_assert(p_state==inited); + xbt_assert(p_state==inited); - xbt_assert(p_dstBuff == NULL, "Cannot set the src and dst buffers at the same time"); - p_srcBuff = buff; - p_srcBuffSize = size; + xbt_assert(p_dstBuff == NULL, "Cannot set the src and dst buffers at the same time"); + p_srcBuff = buff; + p_srcBuffSize = size; } void s4u::Comm::setDstData(void ** buff) { - xbt_assert(p_state==inited); - xbt_assert(p_srcBuff == NULL, "Cannot set the src and dst buffers at the same time"); - p_dstBuff = buff; + xbt_assert(p_state==inited); + xbt_assert(p_srcBuff == NULL, "Cannot set the src and dst buffers at the same time"); + p_dstBuff = buff; } size_t s4u::Comm::getDstDataSize(){ - xbt_assert(p_state==finished); - return p_dstBuffSize; + xbt_assert(p_state==finished); + return p_dstBuffSize; } void s4u::Comm::setDstData(void ** buff, size_t size) { - xbt_assert(p_state==inited); + xbt_assert(p_state==inited); - xbt_assert(p_srcBuff == NULL, "Cannot set the src and dst buffers at the same time"); - p_dstBuff = buff; - p_dstBuffSize = size; + xbt_assert(p_srcBuff == NULL, "Cannot set the src and dst buffers at the same time"); + p_dstBuff = buff; + p_dstBuffSize = size; } void s4u::Comm::start() { - xbt_assert(p_state == inited); - - if (p_srcBuff != NULL) { // Sender side - p_inferior = simcall_comm_isend(p_sender->getInferior(), p_mailbox->getInferior(), p_remains, p_rate, - p_srcBuff, p_srcBuffSize, - p_matchFunction, p_cleanFunction, p_copyDataFunction, - p_userData, p_detached); - } else if (p_dstBuff != NULL) { // Receiver side - p_inferior = simcall_comm_irecv(p_receiver->getInferior(), p_mailbox->getInferior(), p_dstBuff, &p_dstBuffSize, - p_matchFunction, p_copyDataFunction, - p_userData, p_rate); - - } else { - xbt_die("Cannot start a communication before specifying whether we are the sender or the receiver"); - } - p_state = started; + xbt_assert(p_state == inited); + + if (p_srcBuff != NULL) { // Sender side + p_inferior = simcall_comm_isend(p_sender->getInferior(), p_mailbox->getInferior(), p_remains, p_rate, + p_srcBuff, p_srcBuffSize, + p_matchFunction, p_cleanFunction, p_copyDataFunction, + p_userData, p_detached); + } else if (p_dstBuff != NULL) { // Receiver side + p_inferior = simcall_comm_irecv(p_receiver->getInferior(), p_mailbox->getInferior(), p_dstBuff, &p_dstBuffSize, + p_matchFunction, p_copyDataFunction, + p_userData, p_rate); + + } else { + xbt_die("Cannot start a communication before specifying whether we are the sender or the receiver"); + } + p_state = started; } void s4u::Comm::wait() { - xbt_assert(p_state == started || p_state == inited); - - if (p_state == started) - simcall_comm_wait(p_inferior, -1/*timeout*/); - else {// p_state == inited. Save a simcall and do directly a blocking send/recv - if (p_srcBuff != NULL) { - simcall_comm_send(p_sender->getInferior(), p_mailbox->getInferior(), p_remains, p_rate, - p_srcBuff, p_srcBuffSize, - p_matchFunction, p_copyDataFunction, - p_userData, -1 /*timeout*/); - } else { - simcall_comm_recv(p_receiver->getInferior(), p_mailbox->getInferior(), p_dstBuff, &p_dstBuffSize, - p_matchFunction, p_copyDataFunction, - p_userData, -1/*timeout*/, p_rate); - } - } - p_state = finished; + xbt_assert(p_state == started || p_state == inited); + + if (p_state == started) + simcall_comm_wait(p_inferior, -1/*timeout*/); + else {// p_state == inited. Save a simcall and do directly a blocking send/recv + if (p_srcBuff != NULL) { + simcall_comm_send(p_sender->getInferior(), p_mailbox->getInferior(), p_remains, p_rate, + p_srcBuff, p_srcBuffSize, + p_matchFunction, p_copyDataFunction, + p_userData, -1 /*timeout*/); + } else { + simcall_comm_recv(p_receiver->getInferior(), p_mailbox->getInferior(), p_dstBuff, &p_dstBuffSize, + p_matchFunction, p_copyDataFunction, + p_userData, -1/*timeout*/, p_rate); + } + } + p_state = finished; } void s4u::Comm::wait(double timeout) { - xbt_assert(p_state == started || p_state == inited); - - if (p_state == started) { - simcall_comm_wait(p_inferior, timeout); - p_state = finished; - return; - } - - // It's not started yet. Do it in one simcall - if (p_srcBuff != NULL) { - simcall_comm_send(p_sender->getInferior(), p_mailbox->getInferior(), p_remains, p_rate, - p_srcBuff, p_srcBuffSize, - p_matchFunction, p_copyDataFunction, - p_userData, timeout); - } else { // Receiver - simcall_comm_recv(p_receiver->getInferior(), p_mailbox->getInferior(), p_dstBuff, &p_dstBuffSize, - p_matchFunction, p_copyDataFunction, - p_userData, timeout, p_rate); - } - p_state = finished; + xbt_assert(p_state == started || p_state == inited); + + if (p_state == started) { + simcall_comm_wait(p_inferior, timeout); + p_state = finished; + return; + } + + // It's not started yet. Do it in one simcall + if (p_srcBuff != NULL) { + simcall_comm_send(p_sender->getInferior(), p_mailbox->getInferior(), p_remains, p_rate, + p_srcBuff, p_srcBuffSize, + p_matchFunction, p_copyDataFunction, + p_userData, timeout); + } else { // Receiver + simcall_comm_recv(p_receiver->getInferior(), p_mailbox->getInferior(), p_dstBuff, &p_dstBuffSize, + p_matchFunction, p_copyDataFunction, + p_userData, timeout, p_rate); + } + p_state = finished; } s4u::Comm &s4u::Comm::send_async(s4u::Actor *sender, Mailbox &dest, void *data, int simulatedSize) { - s4u::Comm &res = s4u::Comm::send_init(sender, dest); + s4u::Comm &res = s4u::Comm::send_init(sender, dest); - res.setRemains(simulatedSize); - res.p_srcBuff = data; - res.p_srcBuffSize = sizeof(void*); + res.setRemains(simulatedSize); + res.p_srcBuff = data; + res.p_srcBuffSize = sizeof(void*); - res.start(); - return res; + res.start(); + return res; } s4u::Comm &s4u::Comm::recv_async(s4u::Actor *receiver, Mailbox &dest, void **data) { - s4u::Comm &res = s4u::Comm::recv_init(receiver, dest); + s4u::Comm &res = s4u::Comm::recv_init(receiver, dest); - res.setDstData(data); + res.setDstData(data); - res.start(); - return res; + res.start(); + return res; } diff --git a/src/s4u/s4u_engine.cpp b/src/s4u/s4u_engine.cpp index dc22416387..3e2e284435 100644 --- a/src/s4u/s4u_engine.cpp +++ b/src/s4u/s4u_engine.cpp @@ -13,31 +13,31 @@ XBT_LOG_NEW_CATEGORY(s4u,"Log channels of the S4U (Simgrid for you) interface"); using namespace simgrid; double s4u::Engine::getClock() { - return SIMIX_get_clock(); + return SIMIX_get_clock(); } s4u::Engine::Engine(int *argc, char **argv) { - SIMIX_global_init(argc, argv); + SIMIX_global_init(argc, argv); } void s4u::Engine::loadPlatform(const char *platf) { - SIMIX_create_environment(platf); + SIMIX_create_environment(platf); } void s4u::Engine::register_function(const char*name, int (*code)(int,char**)) { - SIMIX_function_register(name,code); + SIMIX_function_register(name,code); } void s4u::Engine::register_default(int (*code)(int,char**)) { - SIMIX_function_register_default(code); + SIMIX_function_register_default(code); } void s4u::Engine::loadDeployment(const char *deploy) { - SIMIX_launch_application(deploy); + SIMIX_launch_application(deploy); } void s4u::Engine::run() { - if (MC_is_active()) { - MC_run(); - } else { - SIMIX_run(); - } + if (MC_is_active()) { + MC_run(); + } else { + SIMIX_run(); + } } diff --git a/src/s4u/s4u_file.cpp b/src/s4u/s4u_file.cpp index e68d191414..23a63603ab 100644 --- a/src/s4u/s4u_file.cpp +++ b/src/s4u/s4u_file.cpp @@ -22,37 +22,37 @@ namespace simgrid { namespace s4u { File::File(const char*fullpath, void *userdata) { - // this cannot fail because we get a xbt_die if the mountpoint does not exist - p_inferior = simcall_file_open(fullpath, Host::current()); - p_path = fullpath; + // this cannot fail because we get a xbt_die if the mountpoint does not exist + p_inferior = simcall_file_open(fullpath, Host::current()); + p_path = fullpath; } File::~File() { - simcall_file_close(p_inferior, Host::current()); + simcall_file_close(p_inferior, Host::current()); } sg_size_t File::read(sg_size_t size) { - return simcall_file_read(p_inferior, size, Host::current()); + return simcall_file_read(p_inferior, size, Host::current()); } sg_size_t File::write(sg_size_t size) { - return simcall_file_write(p_inferior,size, Host::current()); + return simcall_file_write(p_inferior,size, Host::current()); } sg_size_t File::size() { - return simcall_file_get_size(p_inferior); + return simcall_file_get_size(p_inferior); } void File::seek(sg_size_t pos) { - simcall_file_seek(p_inferior,pos,SEEK_SET); + simcall_file_seek(p_inferior,pos,SEEK_SET); } sg_size_t File::tell() { - return simcall_file_tell(p_inferior); + return simcall_file_tell(p_inferior); } void File::move(const char*fullpath) { - simcall_file_move(p_inferior,fullpath); + simcall_file_move(p_inferior,fullpath); } void File::unlink() { - sg_host_t attached = Host::current(); // FIXME: we should check where this file is attached - simcall_file_unlink(p_inferior,attached); + sg_host_t attached = Host::current(); // FIXME: we should check where this file is attached + simcall_file_unlink(p_inferior,attached); } }} // namespace simgrid::s4u diff --git a/src/s4u/s4u_host.cpp b/src/s4u/s4u_host.cpp index b9971952df..7aaf021268 100644 --- a/src/s4u/s4u_host.cpp +++ b/src/s4u/s4u_host.cpp @@ -46,16 +46,16 @@ Host::Host(const char* name) } Host::~Host() { - delete pimpl_cpu; - delete mounts; + delete pimpl_cpu; + delete mounts; } Host *Host::by_name(std::string name) { - Host* host = Host::by_name_or_null(name.c_str()); - // TODO, raise an exception instead? - if (host == nullptr) - xbt_die("No such host: %s", name.c_str()); - return host; + Host* host = Host::by_name_or_null(name.c_str()); + // TODO, raise an exception instead? + if (host == nullptr) + xbt_die("No such host: %s", name.c_str()); + return host; } Host* Host::by_name_or_null(const char* name) { @@ -72,14 +72,14 @@ Host* Host::by_name_or_create(const char* name) } Host *Host::current(){ - smx_process_t smx_proc = SIMIX_process_self(); - if (smx_proc == NULL) - xbt_die("Cannot call Host::current() from the maestro context"); - return SIMIX_process_get_host(smx_proc); + smx_process_t smx_proc = SIMIX_process_self(); + if (smx_proc == NULL) + xbt_die("Cannot call Host::current() from the maestro context"); + return SIMIX_process_get_host(smx_proc); } void Host::turn_on() { - simgrid::simix::kernel(std::bind(SIMIX_host_on, this)); + simgrid::simix::kernel(std::bind(SIMIX_host_on, this)); } void Host::turn_off() { @@ -87,37 +87,37 @@ void Host::turn_off() { } bool Host::is_on() { - return this->pimpl_cpu->isOn(); + return this->pimpl_cpu->isOn(); } int Host::pstates_count() const { - return this->pimpl_cpu->getNbPStates(); + return this->pimpl_cpu->getNbPStates(); } boost::unordered_map const& Host::mounted_storages() { - if (mounts == NULL) { - mounts = new boost::unordered_map (); - - xbt_dict_t dict = this->mounted_storages_as_dict(); - - xbt_dict_cursor_t cursor; - char *mountname; - char *storagename; - xbt_dict_foreach(dict, cursor, mountname, storagename) { - mounts->insert({mountname, &Storage::byName(storagename)}); - } - xbt_dict_free(&dict); - } + if (mounts == NULL) { + mounts = new boost::unordered_map (); + + xbt_dict_t dict = this->mounted_storages_as_dict(); + + xbt_dict_cursor_t cursor; + char *mountname; + char *storagename; + xbt_dict_foreach(dict, cursor, mountname, storagename) { + mounts->insert({mountname, &Storage::byName(storagename)}); + } + xbt_dict_free(&dict); + } - return *mounts; + return *mounts; } /** Get the properties assigned to a host */ xbt_dict_t Host::properties() { return simgrid::simix::kernel([&] { - simgrid::surf::Host* surf_host = this->extension(); - return surf_host->getProperties(); - }); + simgrid::surf::Host* surf_host = this->extension(); + return surf_host->getProperties(); + }); } /** Get the processes attached to the host */ @@ -146,11 +146,11 @@ double Host::power_peak_at(int pstate_index) /** @brief Get the speed of the cpu associated to a host */ double Host::speed() { - return pimpl_cpu->getSpeed(1.0); + return pimpl_cpu->getSpeed(1.0); } /** @brief Returns the number of core of the processor. */ int Host::core_count() { - return pimpl_cpu->getCore(); + return pimpl_cpu->getCore(); } /** @brief Set the pstate at which the host should run */ diff --git a/src/s4u/s4u_mailbox.cpp b/src/s4u/s4u_mailbox.cpp index a2a6a42bbf..587a72aad6 100644 --- a/src/s4u/s4u_mailbox.cpp +++ b/src/s4u/s4u_mailbox.cpp @@ -20,24 +20,24 @@ boost::unordered_map *s4u::Mailbox::mailboxes = ne s4u::Mailbox::Mailbox(const char*name, smx_rdv_t inferior) { - p_inferior = inferior; - p_name = name; - mailboxes->insert({name, this}); + p_inferior = inferior; + p_name = name; + mailboxes->insert({name, this}); } const char *s4u::Mailbox::getName() { - return p_name.c_str(); + return p_name.c_str(); } s4u::Mailbox *s4u::Mailbox::byName(const char*name) { - s4u::Mailbox *res; - try { - res = mailboxes->at(name); - } catch (std::out_of_range& e) { - // FIXME: there is a potential race condition here where two actors run Mailbox::byName on a non-existent mailbox - // during the same scheduling round. Both will be interrupted in the simcall creating the underlying simix rdv. - // Only one simix object will be created, but two S4U objects will be created. - // Only one S4U object will be stored in the hashmap and used, and the other one will be leaked. - new Mailbox(name,simcall_rdv_create(name)); - res = mailboxes->at(name); // Use the stored one, even if it's not the one I created myself. - } - return res; + s4u::Mailbox *res; + try { + res = mailboxes->at(name); + } catch (std::out_of_range& e) { + // FIXME: there is a potential race condition here where two actors run Mailbox::byName on a non-existent mailbox + // during the same scheduling round. Both will be interrupted in the simcall creating the underlying simix rdv. + // Only one simix object will be created, but two S4U objects will be created. + // Only one S4U object will be stored in the hashmap and used, and the other one will be leaked. + new Mailbox(name,simcall_rdv_create(name)); + res = mailboxes->at(name); // Use the stored one, even if it's not the one I created myself. + } + return res; } diff --git a/src/s4u/s4u_storage.cpp b/src/s4u/s4u_storage.cpp index 3c5bb111e6..3b0841bbaa 100644 --- a/src/s4u/s4u_storage.cpp +++ b/src/s4u/s4u_storage.cpp @@ -14,45 +14,45 @@ namespace s4u { boost::unordered_map *Storage::storages = new boost::unordered_map (); Storage::Storage(std::string name, smx_storage_t inferior) { - p_name = name; - p_inferior = inferior; + p_name = name; + p_inferior = inferior; - storages->insert({name, this}); + storages->insert({name, this}); } Storage::~Storage() { - // TODO Auto-generated destructor stub + // TODO Auto-generated destructor stub } smx_storage_t Storage::inferior() { - return p_inferior; + return p_inferior; } Storage &Storage::byName(const char*name) { - s4u::Storage *res = NULL; - try { - res = storages->at(name); - } catch (std::out_of_range& e) { - smx_storage_t inferior = xbt_lib_get_elm_or_null(storage_lib,name); - if (inferior == NULL) - xbt_die("Storage %s does not exist. Please only use the storages that are defined in your platform.", name); + s4u::Storage *res = NULL; + try { + res = storages->at(name); + } catch (std::out_of_range& e) { + smx_storage_t inferior = xbt_lib_get_elm_or_null(storage_lib,name); + if (inferior == NULL) + xbt_die("Storage %s does not exist. Please only use the storages that are defined in your platform.", name); - res = new Storage(name,inferior); - } - return *res; + res = new Storage(name,inferior); + } + return *res; } const char*Storage::name() { - return p_name.c_str(); + return p_name.c_str(); } sg_size_t Storage::size_free() { - return simcall_storage_get_free_size(p_inferior); + return simcall_storage_get_free_size(p_inferior); } sg_size_t Storage::size_used() { - return simcall_storage_get_used_size(p_inferior); + return simcall_storage_get_used_size(p_inferior); } sg_size_t Storage::size() { - return SIMIX_storage_get_size(p_inferior); + return SIMIX_storage_get_size(p_inferior); } } /* namespace s4u */ diff --git a/src/simdag/dax_dtd.c b/src/simdag/dax_dtd.c index 7566f87cb1..03ad3d0710 100644 --- a/src/simdag/dax_dtd.c +++ b/src/simdag/dax_dtd.c @@ -111,15 +111,15 @@ typedef unsigned int flex_uint32_t; /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST -#else /* ! __cplusplus */ +#else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const @@ -217,83 +217,83 @@ extern FILE *dax_in, *dax_out; /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up dax_text. */ \ + do \ + { \ + /* Undo effects of setting up dax_text. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up dax_text again */ \ - } \ - while ( 0 ) + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up dax_text again */ \ + } \ + while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - yy_size_t yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + yy_size_t yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; - int yy_buffer_status; + int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via dax_restart()), so that the user can continue scanning by - * just pointing dax_in at a new input file. - */ + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via dax_restart()), so that the user can continue scanning by + * just pointing dax_in at a new input file. + */ #define YY_BUFFER_EOF_PENDING 2 - }; + }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ @@ -318,13 +318,13 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when dax_text is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t dax_leng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ /* Flag which is used to allow dax_wrap()'s to do buffer switches * instead of setting up a fresh dax_in. A bit of a hack ... @@ -356,24 +356,24 @@ void dax_free (void * ); #define yy_new_buffer dax__create_buffer #define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ dax_ensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ + YY_CURRENT_BUFFER_LVALUE = \ dax__create_buffer(dax_in,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } #define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ + { \ + if ( ! YY_CURRENT_BUFFER ){\ dax_ensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ + YY_CURRENT_BUFFER_LVALUE = \ dax__create_buffer(dax_in,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) @@ -404,21 +404,21 @@ static void yy_fatal_error (yyconst char msg[] ); * corresponding action - sets up dax_text. */ #define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - dax_leng = (size_t) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; + (yytext_ptr) = yy_bp; \ + dax_leng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 140 #define YY_END_OF_BUFFER 141 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; static yyconst flex_int16_t yy_accept[775] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1422,23 +1422,23 @@ short int dax__uses_optional_isset; /* XML state. */ #ifdef FLEX_DEBUG -# define ENTER(state) debug_enter(state,#state) -# define LEAVE debug_leave() -# define SET(state) debug_set(state,#state) +# define ENTER(state) debug_enter(state,#state) +# define LEAVE debug_leave() +# define SET(state) debug_set(state,#state) static void debug_enter(int, const char*); static void debug_leave(void); static void debug_set(int, const char*); #else -# define ENTER(state) (yy_push_state(state)) -# define LEAVE (yy_pop_state()) -# define SET(state) BEGIN(state) +# define ENTER(state) (yy_push_state(state)) +# define LEAVE (yy_pop_state()) +# define SET(state) BEGIN(state) #endif /* Generic actions. */ -#define SKIP /*skip*/ +#define SKIP /*skip*/ #define SUCCEED CLEANUP; return 0 -#define FAIL return fail +#define FAIL return fail static int fail(const char*, ...); enum {flexml_max_err_msg_size = 512}; @@ -1475,12 +1475,12 @@ static int inext = 1; static int ck_blimit() { if (bnext >= blimit) { - blimit += FLEXML_BUFFERSTACKSIZE + 2; - { - char *temp = (char *) realloc(dax__bufferstack, blimit); - assert(temp); - dax__bufferstack = temp; - } + blimit += FLEXML_BUFFERSTACKSIZE + 2; + { + char *temp = (char *) realloc(dax__bufferstack, blimit); + assert(temp); + dax__bufferstack = temp; + } } return 0; } @@ -1489,12 +1489,12 @@ static int ck_blimit() static int ck_ilimit() { if (inext >= ilimit) { - ilimit += FLEXML_INDEXSTACKSIZE + 2; - { - int *temp = (int *) realloc(indexstack, ilimit); - assert(temp); - indexstack = temp; - } + ilimit += FLEXML_INDEXSTACKSIZE + 2; + { + int *temp = (int *) realloc(indexstack, ilimit); + assert(temp); + indexstack = temp; + } } return 0; } @@ -1508,16 +1508,16 @@ static void dax__bufferliteral(char c, int* pp, const char* text) assert(s && e && s <= e); ++s; while (s < e) { - if (isspace(*s)) { - BUFFERPUTC(' '); - do ++s; while (s < e && isspace(*s)); - } else - BUFFERPUTC(*s++); + if (isspace(*s)) { + BUFFERPUTC(' '); + do ++s; while (s < e && isspace(*s)); + } else + BUFFERPUTC(*s++); } } else { const char *s = text; while (*s) - BUFFERPUTC(*s++); + BUFFERPUTC(*s++); } BUFFERDONE; } @@ -1551,18 +1551,18 @@ static int popbuffer(void) /* Miscellaneous. */ /* Parser states (flex `exclusive start conditions'): * - * PROLOG the XML prolog of the document before - * DOCTYPE the XML prolog of the document after - * EPILOG after the root element - * INCOMMENT inside an XML comment - * INPI inside an XML PI - * VALUE1 inside a '...'-delimited literal - * VALUE2 inside a "..."-delimited literal - * CDATA inside a section. - * ROOT_ expect root element - * AL_ inside the attribute list for - * IN_ inside a with element contents (ready for end tag) - * IMPOSSIBLE dummy to permit disabling rules; must be last + * PROLOG the XML prolog of the document before + * DOCTYPE the XML prolog of the document after + * EPILOG after the root element + * INCOMMENT inside an XML comment + * INPI inside an XML PI + * VALUE1 inside a '...'-delimited literal + * VALUE2 inside a "..."-delimited literal + * CDATA inside a section. + * ROOT_ expect root element + * AL_ inside the attribute list for + * IN_ inside a with element contents (ready for end tag) + * IMPOSSIBLE dummy to permit disabling rules; must be last */ /* State names. */ @@ -1713,33 +1713,33 @@ static int input (void ); */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( dax_in )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( dax_in ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, dax_in))==0 && ferror(dax_in)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(dax_in); \ - } \ - }\ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + size_t n; \ + for ( n = 0; n < max_size && \ + (c = getc( dax_in )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( dax_in ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, dax_in))==0 && ferror(dax_in)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(dax_in); \ + } \ + }\ \ #endif @@ -1788,43 +1788,43 @@ extern int dax_lex (void); #endif #define YY_RULE_SETUP \ - YY_USER_ACTION + YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; - if ( !(yy_init) ) - { - (yy_init) = 1; + if ( !(yy_init) ) + { + (yy_init) = 1; #ifdef YY_USER_INIT - YY_USER_INIT; + YY_USER_INIT; #endif - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ - if ( ! dax_in ) - dax_in = stdin; + if ( ! dax_in ) + dax_in = stdin; - if ( ! dax_out ) - dax_out = stdout; + if ( ! dax_out ) + dax_out = stdout; - if ( ! YY_CURRENT_BUFFER ) { - dax_ensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - dax__create_buffer(dax_in,YY_BUF_SIZE ); - } + if ( ! YY_CURRENT_BUFFER ) { + dax_ensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + dax__create_buffer(dax_in,YY_BUF_SIZE ); + } - dax__load_buffer_state( ); - } + dax__load_buffer_state( ); + } - { + { /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */ SET(PROLOG); @@ -1888,146 +1888,146 @@ YY_DECL /* COMMENTS and PIs: handled uniformly for efficiency. */ - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); - /* Support of dax_text. */ - *yy_cp = (yy_hold_char); + /* Support of dax_text. */ + *yy_cp = (yy_hold_char); - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; - yy_current_state = (yy_start); + yy_current_state = (yy_start); yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 775 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 2164 ); + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 775 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 2164 ); yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) - { - yy_size_t yyl; - for ( yyl = 0; yyl < dax_leng; ++yyl ) - if ( dax_text[yyl] == '\n' ) + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) + { + yy_size_t yyl; + for ( yyl = 0; yyl < dax_leng; ++yyl ) + if ( dax_text[yyl] == '\n' ) dax_lineno++; ; - } + } -do_action: /* This label is used only to access EOF actions. */ +do_action: /* This label is used only to access EOF actions. */ - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; case 1: YY_RULE_SETUP ENTER(INCOMMENT); - YY_BREAK + YY_BREAK case 2: YY_RULE_SETUP ENTER(INPI); - YY_BREAK + YY_BREAK case 3: YY_RULE_SETUP LEAVE; - YY_BREAK + YY_BREAK case 4: case 5: case 6: /* rule 6 can match eol */ YY_RULE_SETUP SKIP; - YY_BREAK + YY_BREAK case YY_STATE_EOF(INCOMMENT): FAIL("EOF in comment."); - YY_BREAK + YY_BREAK case 7: YY_RULE_SETUP LEAVE; - YY_BREAK + YY_BREAK case 8: case 9: /* rule 9 can match eol */ YY_RULE_SETUP SKIP; - YY_BREAK + YY_BREAK case YY_STATE_EOF(INPI): FAIL("EOF in PI (processing instruction)."); - YY_BREAK + YY_BREAK /* SPACES: skipped uniformly */ case 10: /* rule 10 can match eol */ YY_RULE_SETUP SKIP; - YY_BREAK + YY_BREAK /* PROLOG: determine root element and process it. */ case 11: /* rule 11 can match eol */ YY_RULE_SETUP SET(ROOT_dax__adag); - YY_BREAK + YY_BREAK case 12: /* rule 12 can match eol */ YY_RULE_SETUP FAIL("Bad declaration %s.",dax_text); - YY_BREAK + YY_BREAK case 13: /* rule 13 can match eol */ YY_RULE_SETUP SET(ROOT_dax__adag); - YY_BREAK + YY_BREAK case 14: /* rule 14 can match eol */ YY_RULE_SETUP FAIL("Bad declaration %s.",dax_text); - YY_BREAK + YY_BREAK case 15: YY_RULE_SETUP FAIL("Unexpected character `%c' in prolog.", dax_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(PROLOG): case YY_STATE_EOF(DOCTYPE): FAIL("EOF in prolog."); - YY_BREAK + YY_BREAK /* RULES DERIVED FROM DTD. */ /* */ @@ -2035,7 +2035,7 @@ case 16: /* rule 16 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 17: /* rule 17 can match eol */ YY_RULE_SETUP @@ -2062,114 +2062,114 @@ YY_RULE_SETUP dax__adag_childCount_isset = 0; ENTER(AL_dax__adag); pushbuffer(0); } - YY_BREAK + YY_BREAK case 18: /* rule 18 can match eol */ YY_RULE_SETUP if (dax__adag_xmlns_isset != 0) {FAIL("Multiple definition of attribute xmlns in ");} dax__adag_xmlns_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_xmlns); - YY_BREAK + YY_BREAK case 19: /* rule 19 can match eol */ YY_RULE_SETUP if (dax__adag_xmlns_isset != 0) {FAIL("Multiple definition of attribute xmlns in ");} dax__adag_xmlns_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_xmlns); - YY_BREAK + YY_BREAK case 20: /* rule 20 can match eol */ YY_RULE_SETUP if (dax__adag_xmlns_c_xsi_isset != 0) {FAIL("Multiple definition of attribute xmlns:xsi in ");} dax__adag_xmlns_c_xsi_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_xmlns_c_xsi); - YY_BREAK + YY_BREAK case 21: /* rule 21 can match eol */ YY_RULE_SETUP if (dax__adag_xmlns_c_xsi_isset != 0) {FAIL("Multiple definition of attribute xmlns:xsi in ");} dax__adag_xmlns_c_xsi_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_xmlns_c_xsi); - YY_BREAK + YY_BREAK case 22: /* rule 22 can match eol */ YY_RULE_SETUP if (dax__adag_xsi_c_schemaLocation_isset != 0) {FAIL("Multiple definition of attribute xsi:schemaLocation in ");} dax__adag_xsi_c_schemaLocation_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_xsi_c_schemaLocation); - YY_BREAK + YY_BREAK case 23: /* rule 23 can match eol */ YY_RULE_SETUP if (dax__adag_xsi_c_schemaLocation_isset != 0) {FAIL("Multiple definition of attribute xsi:schemaLocation in ");} dax__adag_xsi_c_schemaLocation_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_xsi_c_schemaLocation); - YY_BREAK + YY_BREAK case 24: /* rule 24 can match eol */ YY_RULE_SETUP if (dax__adag_version_isset != 0) {FAIL("Multiple definition of attribute version in ");} dax__adag_version_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_version); - YY_BREAK + YY_BREAK case 25: /* rule 25 can match eol */ YY_RULE_SETUP if (dax__adag_version_isset != 0) {FAIL("Multiple definition of attribute version in ");} dax__adag_version_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_version); - YY_BREAK + YY_BREAK case 26: /* rule 26 can match eol */ YY_RULE_SETUP if (dax__adag_count_isset != 0) {FAIL("Multiple definition of attribute count in ");} dax__adag_count_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_count); - YY_BREAK + YY_BREAK case 27: /* rule 27 can match eol */ YY_RULE_SETUP if (dax__adag_count_isset != 0) {FAIL("Multiple definition of attribute count in ");} dax__adag_count_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_count); - YY_BREAK + YY_BREAK case 28: /* rule 28 can match eol */ YY_RULE_SETUP if (dax__adag_index_isset != 0) {FAIL("Multiple definition of attribute index in ");} dax__adag_index_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_index); - YY_BREAK + YY_BREAK case 29: /* rule 29 can match eol */ YY_RULE_SETUP if (dax__adag_index_isset != 0) {FAIL("Multiple definition of attribute index in ");} dax__adag_index_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_index); - YY_BREAK + YY_BREAK case 30: /* rule 30 can match eol */ YY_RULE_SETUP if (dax__adag_name_isset != 0) {FAIL("Multiple definition of attribute name in ");} dax__adag_name_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_name); - YY_BREAK + YY_BREAK case 31: /* rule 31 can match eol */ YY_RULE_SETUP if (dax__adag_name_isset != 0) {FAIL("Multiple definition of attribute name in ");} dax__adag_name_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_name); - YY_BREAK + YY_BREAK case 32: /* rule 32 can match eol */ YY_RULE_SETUP if (dax__adag_jobCount_isset != 0) {FAIL("Multiple definition of attribute jobCount in ");} dax__adag_jobCount_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_jobCount); - YY_BREAK + YY_BREAK case 33: /* rule 33 can match eol */ YY_RULE_SETUP if (dax__adag_jobCount_isset != 0) {FAIL("Multiple definition of attribute jobCount in ");} dax__adag_jobCount_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_jobCount); - YY_BREAK + YY_BREAK case 34: /* rule 34 can match eol */ YY_RULE_SETUP if (dax__adag_fileCount_isset != 0) {FAIL("Multiple definition of attribute fileCount in ");} dax__adag_fileCount_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_fileCount); - YY_BREAK + YY_BREAK case 35: /* rule 35 can match eol */ YY_RULE_SETUP if (dax__adag_fileCount_isset != 0) {FAIL("Multiple definition of attribute fileCount in ");} dax__adag_fileCount_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_fileCount); - YY_BREAK + YY_BREAK case 36: /* rule 36 can match eol */ YY_RULE_SETUP if (dax__adag_childCount_isset != 0) {FAIL("Multiple definition of attribute childCount in ");} dax__adag_childCount_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_childCount); - YY_BREAK + YY_BREAK case 37: /* rule 37 can match eol */ YY_RULE_SETUP if (dax__adag_childCount_isset != 0) {FAIL("Multiple definition of attribute childCount in ");} dax__adag_childCount_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_childCount); - YY_BREAK + YY_BREAK case 38: YY_RULE_SETUP { LEAVE; STag_dax__adag();dax__pcdata_ix = 0; ENTER(S_dax__adag); } - YY_BREAK + YY_BREAK case 39: YY_RULE_SETUP { @@ -2178,18 +2178,18 @@ YY_RULE_SETUP case ROOT_dax__adag: SET(EPILOG); break; } } - YY_BREAK + YY_BREAK case 40: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of adag element.", dax_text[0]); - YY_BREAK + YY_BREAK case 41: YY_RULE_SETUP FAIL("Bad attribute `%s' in `adag' element start tag.",dax_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_dax__adag): FAIL("EOF in attribute list of `adag' element."); - YY_BREAK + YY_BREAK case 42: /* rule 42 can match eol */ @@ -2202,29 +2202,29 @@ YY_RULE_SETUP case ROOT_dax__adag: SET(EPILOG); break; } } - YY_BREAK + YY_BREAK case 43: /* rule 43 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",dax_text); - YY_BREAK + YY_BREAK case 44: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",dax_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(E_dax__adag): case YY_STATE_EOF(S_dax__adag): case YY_STATE_EOF(S_dax__adag_5): case YY_STATE_EOF(S_dax__adag_3): case YY_STATE_EOF(S_dax__adag_1): FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 45: /* rule 45 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 46: /* rule 46 can match eol */ YY_RULE_SETUP @@ -2243,68 +2243,68 @@ YY_RULE_SETUP dax__job_level_isset = 0; ENTER(AL_dax__job); pushbuffer(0); } - YY_BREAK + YY_BREAK case 47: /* rule 47 can match eol */ YY_RULE_SETUP if (dax__job_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} dax__job_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__job_id); - YY_BREAK + YY_BREAK case 48: /* rule 48 can match eol */ YY_RULE_SETUP if (dax__job_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} dax__job_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__job_id); - YY_BREAK + YY_BREAK case 49: /* rule 49 can match eol */ YY_RULE_SETUP if (dax__job_namespace_isset != 0) {FAIL("Multiple definition of attribute namespace in ");} dax__job_namespace_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__job_namespace); - YY_BREAK + YY_BREAK case 50: /* rule 50 can match eol */ YY_RULE_SETUP if (dax__job_namespace_isset != 0) {FAIL("Multiple definition of attribute namespace in ");} dax__job_namespace_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__job_namespace); - YY_BREAK + YY_BREAK case 51: /* rule 51 can match eol */ YY_RULE_SETUP if (dax__job_name_isset != 0) {FAIL("Multiple definition of attribute name in ");} dax__job_name_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__job_name); - YY_BREAK + YY_BREAK case 52: /* rule 52 can match eol */ YY_RULE_SETUP if (dax__job_name_isset != 0) {FAIL("Multiple definition of attribute name in ");} dax__job_name_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__job_name); - YY_BREAK + YY_BREAK case 53: /* rule 53 can match eol */ YY_RULE_SETUP if (dax__job_version_isset != 0) {FAIL("Multiple definition of attribute version in ");} dax__job_version_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__job_version); - YY_BREAK + YY_BREAK case 54: /* rule 54 can match eol */ YY_RULE_SETUP if (dax__job_version_isset != 0) {FAIL("Multiple definition of attribute version in ");} dax__job_version_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__job_version); - YY_BREAK + YY_BREAK case 55: /* rule 55 can match eol */ YY_RULE_SETUP if (dax__job_runtime_isset != 0) {FAIL("Multiple definition of attribute runtime in ");} dax__job_runtime_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__job_runtime); - YY_BREAK + YY_BREAK case 56: /* rule 56 can match eol */ YY_RULE_SETUP if (dax__job_runtime_isset != 0) {FAIL("Multiple definition of attribute runtime in ");} dax__job_runtime_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__job_runtime); - YY_BREAK + YY_BREAK case 57: /* rule 57 can match eol */ YY_RULE_SETUP if (dax__job_level_isset != 0) {FAIL("Multiple definition of attribute level in ");} dax__job_level_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__job_level); - YY_BREAK + YY_BREAK case 58: /* rule 58 can match eol */ YY_RULE_SETUP if (dax__job_level_isset != 0) {FAIL("Multiple definition of attribute level in ");} dax__job_level_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__job_level); - YY_BREAK + YY_BREAK case 59: YY_RULE_SETUP { @@ -2313,7 +2313,7 @@ YY_RULE_SETUP if (!AX_dax__job_runtime) FAIL("Required attribute `runtime' not set for `job' element."); LEAVE; STag_dax__job();dax__pcdata_ix = 0; ENTER(S_dax__job); } - YY_BREAK + YY_BREAK case 60: YY_RULE_SETUP { @@ -2325,18 +2325,18 @@ YY_RULE_SETUP case S_dax__adag_2: case S_dax__adag_3: case S_dax__adag: SET(S_dax__adag_3); break; } } - YY_BREAK + YY_BREAK case 61: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of job element.", dax_text[0]); - YY_BREAK + YY_BREAK case 62: YY_RULE_SETUP FAIL("Bad attribute `%s' in `job' element start tag.",dax_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_dax__job): FAIL("EOF in attribute list of `job' element."); - YY_BREAK + YY_BREAK case 63: /* rule 63 can match eol */ @@ -2349,21 +2349,21 @@ YY_RULE_SETUP case S_dax__adag_2: case S_dax__adag_3: case S_dax__adag: SET(S_dax__adag_3); break; } } - YY_BREAK + YY_BREAK case 64: /* rule 64 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",dax_text); - YY_BREAK + YY_BREAK case 65: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",dax_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(S_dax__job): case YY_STATE_EOF(E_dax__job): case YY_STATE_EOF(S_dax__job_2): FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK /* * */ @@ -2371,7 +2371,7 @@ case 66: /* rule 66 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 67: /* rule 67 can match eol */ YY_RULE_SETUP @@ -2392,94 +2392,94 @@ YY_RULE_SETUP dax__uses_size_isset = 0; ENTER(AL_dax__uses); pushbuffer(0); } - YY_BREAK + YY_BREAK case 68: /* rule 68 can match eol */ YY_RULE_SETUP if (dax__uses_file_isset != 0) {FAIL("Multiple definition of attribute file in ");} dax__uses_file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__uses_file); - YY_BREAK + YY_BREAK case 69: /* rule 69 can match eol */ YY_RULE_SETUP if (dax__uses_file_isset != 0) {FAIL("Multiple definition of attribute file in ");} dax__uses_file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__uses_file); - YY_BREAK + YY_BREAK case 70: /* rule 70 can match eol */ case 71: /* rule 71 can match eol */ YY_RULE_SETUP A_dax__uses_link = A_dax__uses_link_input; - YY_BREAK + YY_BREAK case 72: /* rule 72 can match eol */ case 73: /* rule 73 can match eol */ YY_RULE_SETUP A_dax__uses_link = A_dax__uses_link_output; - YY_BREAK + YY_BREAK case 74: /* rule 74 can match eol */ case 75: /* rule 75 can match eol */ YY_RULE_SETUP A_dax__uses_register = A_dax__uses_register_false; - YY_BREAK + YY_BREAK case 76: /* rule 76 can match eol */ case 77: /* rule 77 can match eol */ YY_RULE_SETUP A_dax__uses_register = A_dax__uses_register_true; - YY_BREAK + YY_BREAK case 78: /* rule 78 can match eol */ case 79: /* rule 79 can match eol */ YY_RULE_SETUP A_dax__uses_transfer = A_dax__uses_transfer_false; - YY_BREAK + YY_BREAK case 80: /* rule 80 can match eol */ case 81: /* rule 81 can match eol */ YY_RULE_SETUP A_dax__uses_transfer = A_dax__uses_transfer_true; - YY_BREAK + YY_BREAK case 82: /* rule 82 can match eol */ case 83: /* rule 83 can match eol */ YY_RULE_SETUP A_dax__uses_optional = A_dax__uses_optional_false; - YY_BREAK + YY_BREAK case 84: /* rule 84 can match eol */ case 85: /* rule 85 can match eol */ YY_RULE_SETUP A_dax__uses_optional = A_dax__uses_optional_true; - YY_BREAK + YY_BREAK case 86: /* rule 86 can match eol */ YY_RULE_SETUP if (dax__uses_type_isset != 0) {FAIL("Multiple definition of attribute type in ");} dax__uses_type_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__uses_type); - YY_BREAK + YY_BREAK case 87: /* rule 87 can match eol */ YY_RULE_SETUP if (dax__uses_type_isset != 0) {FAIL("Multiple definition of attribute type in ");} dax__uses_type_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__uses_type); - YY_BREAK + YY_BREAK case 88: /* rule 88 can match eol */ YY_RULE_SETUP if (dax__uses_size_isset != 0) {FAIL("Multiple definition of attribute size in ");} dax__uses_size_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__uses_size); - YY_BREAK + YY_BREAK case 89: /* rule 89 can match eol */ YY_RULE_SETUP if (dax__uses_size_isset != 0) {FAIL("Multiple definition of attribute size in ");} dax__uses_size_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__uses_size); - YY_BREAK + YY_BREAK case 90: YY_RULE_SETUP { @@ -2487,7 +2487,7 @@ YY_RULE_SETUP if (!AX_dax__uses_size) FAIL("Required attribute `size' not set for `uses' element."); LEAVE; STag_dax__uses();dax__pcdata_ix = 0; ENTER(E_dax__uses); } - YY_BREAK + YY_BREAK case 91: YY_RULE_SETUP { @@ -2498,18 +2498,18 @@ YY_RULE_SETUP case S_dax__job_2: case S_dax__job_1: case S_dax__job: SET(S_dax__job_2); break; } } - YY_BREAK + YY_BREAK case 92: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of uses element.", dax_text[0]); - YY_BREAK + YY_BREAK case 93: YY_RULE_SETUP FAIL("Bad attribute `%s' in `uses' element start tag.",dax_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_dax__uses): FAIL("EOF in attribute list of `uses' element."); - YY_BREAK + YY_BREAK case 94: /* rule 94 can match eol */ @@ -2522,25 +2522,25 @@ YY_RULE_SETUP case S_dax__job_2: case S_dax__job_1: case S_dax__job: SET(S_dax__job_2); break; } } - YY_BREAK + YY_BREAK case 95: /* rule 95 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",dax_text); - YY_BREAK + YY_BREAK case 96: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",dax_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(E_dax__uses): FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 97: /* rule 97 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 98: /* rule 98 can match eol */ YY_RULE_SETUP @@ -2549,25 +2549,25 @@ YY_RULE_SETUP dax__child_ref_isset = 0; ENTER(AL_dax__child); pushbuffer(0); } - YY_BREAK + YY_BREAK case 99: /* rule 99 can match eol */ YY_RULE_SETUP if (dax__child_ref_isset != 0) {FAIL("Multiple definition of attribute ref in ");} dax__child_ref_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__child_ref); - YY_BREAK + YY_BREAK case 100: /* rule 100 can match eol */ YY_RULE_SETUP if (dax__child_ref_isset != 0) {FAIL("Multiple definition of attribute ref in ");} dax__child_ref_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__child_ref); - YY_BREAK + YY_BREAK case 101: YY_RULE_SETUP { if (!AX_dax__child_ref) FAIL("Required attribute `ref' not set for `child' element."); LEAVE; STag_dax__child();dax__pcdata_ix = 0; ENTER(S_dax__child); } - YY_BREAK + YY_BREAK case 102: YY_RULE_SETUP { @@ -2577,18 +2577,18 @@ YY_RULE_SETUP case S_dax__adag_4: case S_dax__adag: case S_dax__adag_1: case S_dax__adag_3: case S_dax__adag_5: SET(S_dax__adag_5); break; } } - YY_BREAK + YY_BREAK case 103: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of child element.", dax_text[0]); - YY_BREAK + YY_BREAK case 104: YY_RULE_SETUP FAIL("Bad attribute `%s' in `child' element start tag.",dax_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_dax__child): FAIL("EOF in attribute list of `child' element."); - YY_BREAK + YY_BREAK case 105: /* rule 105 can match eol */ @@ -2601,27 +2601,27 @@ YY_RULE_SETUP case S_dax__adag_4: case S_dax__adag: case S_dax__adag_1: case S_dax__adag_3: case S_dax__adag_5: SET(S_dax__adag_5); break; } } - YY_BREAK + YY_BREAK case 106: /* rule 106 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",dax_text); - YY_BREAK + YY_BREAK case 107: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",dax_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(S_dax__child): case YY_STATE_EOF(S_dax__child_2): case YY_STATE_EOF(E_dax__child): FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 108: /* rule 108 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 109: /* rule 109 can match eol */ YY_RULE_SETUP @@ -2630,25 +2630,25 @@ YY_RULE_SETUP dax__parent_ref_isset = 0; ENTER(AL_dax__parent); pushbuffer(0); } - YY_BREAK + YY_BREAK case 110: /* rule 110 can match eol */ YY_RULE_SETUP if (dax__parent_ref_isset != 0) {FAIL("Multiple definition of attribute ref in ");} dax__parent_ref_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__parent_ref); - YY_BREAK + YY_BREAK case 111: /* rule 111 can match eol */ YY_RULE_SETUP if (dax__parent_ref_isset != 0) {FAIL("Multiple definition of attribute ref in ");} dax__parent_ref_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__parent_ref); - YY_BREAK + YY_BREAK case 112: YY_RULE_SETUP { if (!AX_dax__parent_ref) FAIL("Required attribute `ref' not set for `parent' element."); LEAVE; STag_dax__parent();dax__pcdata_ix = 0; ENTER(E_dax__parent); } - YY_BREAK + YY_BREAK case 113: YY_RULE_SETUP { @@ -2658,18 +2658,18 @@ YY_RULE_SETUP case S_dax__child: case S_dax__child_2: case S_dax__child_1: SET(S_dax__child_2); break; } } - YY_BREAK + YY_BREAK case 114: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of parent element.", dax_text[0]); - YY_BREAK + YY_BREAK case 115: YY_RULE_SETUP FAIL("Bad attribute `%s' in `parent' element start tag.",dax_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_dax__parent): FAIL("EOF in attribute list of `parent' element."); - YY_BREAK + YY_BREAK case 116: /* rule 116 can match eol */ @@ -2682,29 +2682,29 @@ YY_RULE_SETUP case S_dax__child: case S_dax__child_2: case S_dax__child_1: SET(S_dax__child_2); break; } } - YY_BREAK + YY_BREAK case 117: /* rule 117 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",dax_text); - YY_BREAK + YY_BREAK case 118: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",dax_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(E_dax__parent): FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK /* EPILOG: after the root element. */ case 119: YY_RULE_SETUP {SET(PROLOG); yyless(0); CLEANUP; return -1;} - YY_BREAK + YY_BREAK case YY_STATE_EOF(EPILOG): SUCCEED; - YY_BREAK + YY_BREAK /* CHARACTER DATA. */ @@ -2712,32 +2712,32 @@ SUCCEED; case 120: YY_RULE_SETUP BUFFERPUTC('&'); - YY_BREAK + YY_BREAK case 121: YY_RULE_SETUP BUFFERPUTC('<'); - YY_BREAK + YY_BREAK case 122: YY_RULE_SETUP BUFFERPUTC('>'); - YY_BREAK + YY_BREAK case 123: YY_RULE_SETUP BUFFERPUTC('\''); - YY_BREAK + YY_BREAK case 124: YY_RULE_SETUP BUFFERPUTC('"'); - YY_BREAK + YY_BREAK /* Character entities. */ case 125: YY_RULE_SETUP BUFFERPUTC((unsigned char)atoi(dax_text+2)); - YY_BREAK + YY_BREAK case 126: YY_RULE_SETUP BUFFERPUTC((unsigned char)strtol(dax_text+3,NULL,16)); - YY_BREAK + YY_BREAK case 127: /* rule 127 can match eol */ @@ -2749,55 +2749,55 @@ case 130: /* rule 130 can match eol */ YY_RULE_SETUP BUFFERPUTC('\n'); - YY_BREAK + YY_BREAK case 131: YY_RULE_SETUP ENTER(CDATA); - YY_BREAK + YY_BREAK case 132: YY_RULE_SETUP FAIL("Unexpected `]""]>' in character data."); - YY_BREAK + YY_BREAK case 133: YY_RULE_SETUP BUFFERDONE; LEAVE; - YY_BREAK + YY_BREAK case YY_STATE_EOF(VALUE1): FAIL("EOF in literal (\"'\" expected)."); - YY_BREAK + YY_BREAK case 134: YY_RULE_SETUP BUFFERDONE; LEAVE; - YY_BREAK + YY_BREAK case YY_STATE_EOF(VALUE2): FAIL("EOF in literal (`\"' expected)."); - YY_BREAK + YY_BREAK case 135: /* rule 135 can match eol */ YY_RULE_SETUP BUFFERPUTC(dax_text[0]); - YY_BREAK + YY_BREAK case 136: YY_RULE_SETUP FAIL("Spurious `%c' in character data.",dax_text[0]); - YY_BREAK + YY_BREAK case 137: YY_RULE_SETUP LEAVE; - YY_BREAK -/* "]""]" BUFFERPUTC(dax_text[0]); BUFFERPUTC(dax_text[1]); */ + YY_BREAK +/* "]""]" BUFFERPUTC(dax_text[0]); BUFFERPUTC(dax_text[1]); */ case 138: YY_RULE_SETUP BUFFERPUTC(dax_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(CDATA): FAIL("EOF in CDATA section."); - YY_BREAK + YY_BREAK /* Impossible rules to avoid warnings from flex(1). */ /* Ideally, this should be replaced by code in flexml.pl that @@ -2807,12 +2807,12 @@ case 139: /* rule 139 can match eol */ YY_RULE_SETUP FAIL("Syntax error on character `%c'.", dax_text[0]); - YY_BREAK + YY_BREAK case 140: YY_RULE_SETUP ECHO; - YY_BREAK + YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(ROOT_dax__adag): case YY_STATE_EOF(S_dax__adag_2): @@ -2820,332 +2820,332 @@ case YY_STATE_EOF(S_dax__adag_4): case YY_STATE_EOF(S_dax__job_1): case YY_STATE_EOF(S_dax__child_1): case YY_STATE_EOF(IMPOSSIBLE): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed dax_in at a new source and called - * dax_lex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = dax_in; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_c_buf_p); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( dax_wrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * dax_text, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of user's declarations */ + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed dax_in at a new source and called + * dax_lex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = dax_in; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( dax_wrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * dax_text, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of dax_lex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = (yytext_ptr); - int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - yy_size_t num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - yy_size_t new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - dax_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - dax_restart(dax_in ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) dax_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + yy_size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + yy_size_t new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + dax_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + dax_restart(dax_in ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) dax_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - return ret_val; + return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { - yy_state_type yy_current_state; - char *yy_cp; - - yy_current_state = (yy_start); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 775 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; + yy_state_type yy_current_state; + char *yy_cp; + + yy_current_state = (yy_start); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 775 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis - * next_state = yy_try_NUL_trans( current_state ); + * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - int yy_is_jam; - char *yy_cp = (yy_c_buf_p); - - YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 775 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 774); - - return yy_is_jam ? 0 : yy_current_state; + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); + + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 775 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 774); + + return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_INPUT @@ -3156,76 +3156,76 @@ static int yy_get_next_buffer (void) #endif { - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - dax_restart(dax_in ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( dax_wrap( ) ) - return EOF; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + dax_restart(dax_in ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( dax_wrap( ) ) + return EOF; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; #ifdef __cplusplus - return yyinput(); + return yyinput(); #else - return input(); + return input(); #endif - } + } - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve dax_text */ - (yy_hold_char) = *++(yy_c_buf_p); + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve dax_text */ + (yy_hold_char) = *++(yy_c_buf_p); - if ( c == '\n' ) + if ( c == '\n' ) dax_lineno++; ; - return c; + return c; } -#endif /* ifndef YY_NO_INPUT */ +#endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. @@ -3235,14 +3235,14 @@ static int yy_get_next_buffer (void) void dax_restart (FILE * input_file ) { - if ( ! YY_CURRENT_BUFFER ){ + if ( ! YY_CURRENT_BUFFER ){ dax_ensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = + YY_CURRENT_BUFFER_LVALUE = dax__create_buffer(dax_in,YY_BUF_SIZE ); - } + } - dax__init_buffer(YY_CURRENT_BUFFER,input_file ); - dax__load_buffer_state( ); + dax__init_buffer(YY_CURRENT_BUFFER,input_file ); + dax__load_buffer_state( ); } /** Switch to a different input buffer. @@ -3252,40 +3252,40 @@ static int yy_get_next_buffer (void) void dax__switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - /* TODO. We should be able to replace this entire function body - * with - * dax_pop_buffer_state(); - * dax_push_buffer_state(new_buffer); + /* TODO. We should be able to replace this entire function body + * with + * dax_pop_buffer_state(); + * dax_push_buffer_state(new_buffer); */ - dax_ensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - dax__load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (dax_wrap()) processing, but the only time this flag - * is looked at is after dax_wrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; + dax_ensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + dax__load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (dax_wrap()) processing, but the only time this flag + * is looked at is after dax_wrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; } static void dax__load_buffer_state (void) { - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - dax_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + dax_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. @@ -3296,26 +3296,26 @@ static void dax__load_buffer_state (void) */ YY_BUFFER_STATE dax__create_buffer (FILE * file, int size ) { - YY_BUFFER_STATE b; + YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) dax_alloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in dax__create_buffer()" ); + b = (YY_BUFFER_STATE) dax_alloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in dax__create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = size; - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) dax_alloc(b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in dax__create_buffer()" ); + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) dax_alloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in dax__create_buffer()" ); - b->yy_is_our_buffer = 1; + b->yy_is_our_buffer = 1; - dax__init_buffer(b,file ); + dax__init_buffer(b,file ); - return b; + return b; } /** Destroy the buffer. @@ -3325,16 +3325,16 @@ static void dax__load_buffer_state (void) void dax__delete_buffer (YY_BUFFER_STATE b ) { - if ( ! b ) - return; + if ( ! b ) + return; - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - if ( b->yy_is_our_buffer ) - dax_free((void *) b->yy_ch_buf ); + if ( b->yy_is_our_buffer ) + dax_free((void *) b->yy_ch_buf ); - dax_free((void *) b ); + dax_free((void *) b ); } /* Initializes or reinitializes a buffer. @@ -3344,12 +3344,12 @@ static void dax__load_buffer_state (void) static void dax__init_buffer (YY_BUFFER_STATE b, FILE * file ) { - int oerrno = errno; + int oerrno = errno; - dax__flush_buffer(b ); + dax__flush_buffer(b ); - b->yy_input_file = file; - b->yy_fill_buffer = 1; + b->yy_input_file = file; + b->yy_fill_buffer = 1; /* If b is the current buffer, then dax__init_buffer was _probably_ * called from dax_restart() or through yy_get_next_buffer. @@ -3362,7 +3362,7 @@ static void dax__load_buffer_state (void) b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - errno = oerrno; + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. @@ -3371,25 +3371,25 @@ static void dax__load_buffer_state (void) */ void dax__flush_buffer (YY_BUFFER_STATE b ) { - if ( ! b ) - return; + if ( ! b ) + return; - b->yy_n_chars = 0; + b->yy_n_chars = 0; - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - b->yy_buf_pos = &b->yy_ch_buf[0]; + b->yy_buf_pos = &b->yy_ch_buf[0]; - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == YY_CURRENT_BUFFER ) - dax__load_buffer_state( ); + if ( b == YY_CURRENT_BUFFER ) + dax__load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes @@ -3400,28 +3400,28 @@ static void dax__load_buffer_state (void) */ void dax_push_buffer_state (YY_BUFFER_STATE new_buffer ) { - if (new_buffer == NULL) - return; + if (new_buffer == NULL) + return; - dax_ensure_buffer_stack(); + dax_ensure_buffer_stack(); - /* This block is copied from dax__switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } + /* This block is copied from dax__switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; - /* copied from dax__switch_to_buffer. */ - dax__load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; + /* copied from dax__switch_to_buffer. */ + dax__load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. @@ -3430,18 +3430,18 @@ void dax_push_buffer_state (YY_BUFFER_STATE new_buffer ) */ void dax_pop_buffer_state (void) { - if (!YY_CURRENT_BUFFER) - return; + if (!YY_CURRENT_BUFFER) + return; - dax__delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); + dax__delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); - if (YY_CURRENT_BUFFER) { - dax__load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } + if (YY_CURRENT_BUFFER) { + dax__load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } } /* Allocates the stack if it does not exist. @@ -3449,45 +3449,45 @@ void dax_pop_buffer_state (void) */ static void dax_ensure_buffer_stack (void) { - yy_size_t num_to_alloc; + yy_size_t num_to_alloc; - if (!(yy_buffer_stack)) { + if (!(yy_buffer_stack)) { - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)dax_alloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in dax_ensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)dax_realloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in dax_ensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)dax_alloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in dax_ensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)dax_realloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in dax_ensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } } /** Setup the input buffer state to scan directly from a user-specified character buffer. @@ -3498,31 +3498,31 @@ static void dax_ensure_buffer_stack (void) */ YY_BUFFER_STATE dax__scan_buffer (char * base, yy_size_t size ) { - YY_BUFFER_STATE b; + YY_BUFFER_STATE b; - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; - b = (YY_BUFFER_STATE) dax_alloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in dax__scan_buffer()" ); + b = (YY_BUFFER_STATE) dax_alloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in dax__scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; - dax__switch_to_buffer(b ); + dax__switch_to_buffer(b ); - return b; + return b; } /** Setup the input buffer state to scan a string. The next call to dax_lex() will @@ -3536,7 +3536,7 @@ YY_BUFFER_STATE dax__scan_buffer (char * base, yy_size_t size ) YY_BUFFER_STATE dax__scan_string (yyconst char * yystr ) { - return dax__scan_bytes(yystr,strlen(yystr) ); + return dax__scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to dax_lex() will @@ -3548,64 +3548,64 @@ YY_BUFFER_STATE dax__scan_string (yyconst char * yystr ) */ YY_BUFFER_STATE dax__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - yy_size_t i; + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + yy_size_t i; - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) dax_alloc(n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in dax__scan_bytes()" ); + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) dax_alloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in dax__scan_bytes()" ); - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = dax__scan_buffer(buf,n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in dax__scan_bytes()" ); + b = dax__scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in dax__scan_bytes()" ); - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; - return b; + return b; } static void yy_push_state (int new_state ) { - if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) - { - yy_size_t new_size; + if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) + { + yy_size_t new_size; - (yy_start_stack_depth) += YY_START_STACK_INCR; - new_size = (yy_start_stack_depth) * sizeof( int ); + (yy_start_stack_depth) += YY_START_STACK_INCR; + new_size = (yy_start_stack_depth) * sizeof( int ); - if ( ! (yy_start_stack) ) - (yy_start_stack) = (int *) dax_alloc(new_size ); + if ( ! (yy_start_stack) ) + (yy_start_stack) = (int *) dax_alloc(new_size ); - else - (yy_start_stack) = (int *) dax_realloc((void *) (yy_start_stack),new_size ); + else + (yy_start_stack) = (int *) dax_realloc((void *) (yy_start_stack),new_size ); - if ( ! (yy_start_stack) ) - YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); - } + if ( ! (yy_start_stack) ) + YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); + } - (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; + (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; - BEGIN(new_state); + BEGIN(new_state); } static void yy_pop_state (void) { - if ( --(yy_start_stack_ptr) < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); + if ( --(yy_start_stack_ptr) < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); - BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); + BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); } #ifndef YY_EXIT_FAILURE @@ -3614,26 +3614,26 @@ YY_BUFFER_STATE dax__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_le static void yy_fatal_error (yyconst char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up dax_text. */ \ + do \ + { \ + /* Undo effects of setting up dax_text. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ - dax_text[dax_leng] = (yy_hold_char); \ - (yy_c_buf_p) = dax_text + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - dax_leng = yyless_macro_arg; \ - } \ - while ( 0 ) + dax_text[dax_leng] = (yy_hold_char); \ + (yy_c_buf_p) = dax_text + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + dax_leng = yyless_macro_arg; \ + } \ + while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ @@ -3755,15 +3755,15 @@ int dax_lex_destroy (void) { /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - dax__delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - dax_pop_buffer_state(); - } + while(YY_CURRENT_BUFFER){ + dax__delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + dax_pop_buffer_state(); + } - /* Destroy the stack itself. */ - dax_free((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; + /* Destroy the stack itself. */ + dax_free((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; /* Destroy the start condition stack. */ dax_free((yy_start_stack) ); @@ -3783,43 +3783,43 @@ int dax_lex_destroy (void) #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - int n; - for ( n = 0; s[n]; ++n ) - ; + int n; + for ( n = 0; s[n]; ++n ) + ; - return n; + return n; } #endif void *dax_alloc (yy_size_t size ) { - return (void *) malloc( size ); + return (void *) malloc( size ); } void *dax_realloc (void * ptr, yy_size_t size ) { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); } void dax_free (void * ptr ) { - free( (char *) ptr ); /* see dax_realloc() for (char *) cast */ + free( (char *) ptr ); /* see dax_realloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" @@ -3828,8 +3828,8 @@ void dax_free (void * ptr ) int dax__element_context(int i) { return (0name().c_str(); + return host->name().c_str(); } void* sg_host_extension_get(sg_host_t host, size_t ext) @@ -86,7 +86,7 @@ void sg_host_init() }); ROUTING_HOST_LEVEL = simgrid::s4u::Host::extension_create([](void *p) { - delete static_cast(p); + delete static_cast(p); }); SD_HOST_LEVEL = simgrid::s4u::Host::extension_create(NULL); @@ -107,7 +107,7 @@ void sg_host_user_destroy(sg_host_t host) { // ========== MSG Layer ============== msg_host_priv_t sg_host_msg(sg_host_t host) { - return (msg_host_priv_t) host->extension(MSG_HOST_LEVEL); + return (msg_host_priv_t) host->extension(MSG_HOST_LEVEL); } void sg_host_msg_set(sg_host_t host, msg_host_priv_t smx_host) { host->extension_set(MSG_HOST_LEVEL, smx_host); diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index 901f49fff8..e65659a091 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -628,7 +628,7 @@ void simcall_process_set_kill_time(smx_process_t process, double kill_time) * \brief Get the kill time of a process (or 0 if unset). */ double simcall_process_get_kill_time(smx_process_t process) { - return SIMIX_timer_get_date(process->kill_timer); + return SIMIX_timer_get_date(process->kill_timer); } /** diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index 6d2a96d48e..ac17f1b797 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -277,10 +277,10 @@ void SIMIX_clean(void) smx_cleaned = 1; XBT_DEBUG("SIMIX_clean called. Simulation's over."); if (!xbt_dynar_is_empty(simix_global->process_to_run) && SIMIX_get_clock() == 0.0) { - XBT_CRITICAL(" "); - XBT_CRITICAL("The time is still 0, and you still have processes ready to run."); - XBT_CRITICAL("It seems that you forgot to run the simulation that you setup."); - xbt_die("Bailing out to avoid that stop-before-start madness. Please fix your code."); + XBT_CRITICAL(" "); + XBT_CRITICAL("The time is still 0, and you still have processes ready to run."); + XBT_CRITICAL("It seems that you forgot to run the simulation that you setup."); + xbt_die("Bailing out to avoid that stop-before-start madness. Please fix your code."); } /* Kill all processes (but maestro) */ SIMIX_process_killall(simix_global->maestro_process, 1); @@ -540,7 +540,7 @@ void SIMIX_run(void) if (xbt_swag_size(simix_global->process_list) != 0) { - TRACE_end(); + TRACE_end(); XBT_CRITICAL("Oops ! Deadlock or code not perfectly clean."); SIMIX_display_process_status(); @@ -569,12 +569,12 @@ smx_timer_t SIMIX_timer_set(double date, void (*function)(void*), void *arg) } /** @brief cancels a timer that was added earlier */ void SIMIX_timer_remove(smx_timer_t timer) { - xbt_heap_rm_elm(simix_timers, timer, timer->date); + xbt_heap_rm_elm(simix_timers, timer, timer->date); } /** @brief Returns the date at which the timer will trigger (or 0 if NULL timer) */ double SIMIX_timer_get_date(smx_timer_t timer) { - return timer?timer->date:0; + return timer?timer->date:0; } /** diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index 1844ad77c7..b362a16c2d 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -264,8 +264,8 @@ void SIMIX_host_autorestart(sg_host_t host) } smx_synchro_t simcall_HANDLER_execution_start(smx_simcall_t simcall, - const char* name, double flops_amount, double priority, double bound, unsigned long affinity_mask) { - return SIMIX_execution_start(simcall->issuer, name,flops_amount,priority,bound,affinity_mask); + const char* name, double flops_amount, double priority, double bound, unsigned long affinity_mask) { + return SIMIX_execution_start(simcall->issuer, name,flops_amount,priority,bound,affinity_mask); } smx_synchro_t SIMIX_execution_start(smx_process_t issuer, const char *name, double flops_amount, double priority, double bound, unsigned long affinity_mask){ @@ -342,7 +342,7 @@ smx_synchro_t SIMIX_execution_parallel_start(const char *name, if (!MC_is_active() && !MC_record_replay_is_active()) { synchro->execution.surf_exec = surf_host_model->executeParallelTask( - host_nb, host_list_cpy, flops_amount, bytes_amount, rate); + host_nb, host_list_cpy, flops_amount, bytes_amount, rate); synchro->execution.surf_exec->setData(synchro); } diff --git a/src/simix/smx_network.cpp b/src/simix/smx_network.cpp index f613c309a1..f62fa0a48c 100644 --- a/src/simix/smx_network.cpp +++ b/src/simix/smx_network.cpp @@ -335,10 +335,10 @@ void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_process_t src, smx_rdv void *src_buff, size_t src_buff_size, int (*match_fun)(void *, void *,smx_synchro_t), void (*copy_data_fun)(smx_synchro_t, void*, size_t), - void *data, double timeout){ + void *data, double timeout){ smx_synchro_t comm = simcall_HANDLER_comm_isend(simcall, src, rdv, task_size, rate, - src_buff, src_buff_size, match_fun, NULL, copy_data_fun, - data, 0); + src_buff, src_buff_size, match_fun, NULL, copy_data_fun, + data, 0); SIMCALL_SET_MC_VALUE(simcall, 0); simcall_HANDLER_comm_wait(simcall, comm, timeout); } @@ -348,7 +348,7 @@ smx_synchro_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t sr int (*match_fun)(void *, void *,smx_synchro_t), void (*clean_fun)(void *), // used to free the synchro in case of problem after a detached send void (*copy_data_fun)(smx_synchro_t, void*, size_t),// used to copy data if not default one - void *data, int detached) + void *data, int detached) { XBT_DEBUG("send from %p", rdv); @@ -426,7 +426,7 @@ void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_process_t receiver, sm void *data, double timeout, double rate) { smx_synchro_t comm = SIMIX_comm_irecv(receiver, rdv, dst_buff, - dst_buff_size, match_fun, copy_data_fun, data, rate); + dst_buff_size, match_fun, copy_data_fun, data, rate); SIMCALL_SET_MC_VALUE(simcall, 0); simcall_HANDLER_comm_wait(simcall, comm, timeout); } @@ -435,10 +435,10 @@ smx_synchro_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_process_t re void *dst_buff, size_t *dst_buff_size, int (*match_fun)(void *, void *, smx_synchro_t), void (*copy_data_fun)(smx_synchro_t, void*, size_t), - void *data, double rate) + void *data, double rate) { return SIMIX_comm_irecv(receiver, rdv, dst_buff, dst_buff_size, - match_fun, copy_data_fun, data, rate); + match_fun, copy_data_fun, data, rate); } smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_rdv_t rdv, @@ -465,7 +465,7 @@ smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_rdv_t rdv, other_synchro = this_synchro; SIMIX_rdv_push(rdv, this_synchro); }else{ - if(other_synchro->comm.surf_comm && SIMIX_comm_get_remains(other_synchro)==0.0) + if(other_synchro->comm.surf_comm && SIMIX_comm_get_remains(other_synchro)==0.0) { XBT_DEBUG("comm %p has been already sent, and is finished, destroy it",&(other_synchro->comm)); other_synchro->state = SIMIX_DONE; @@ -727,8 +727,8 @@ static inline void SIMIX_comm_start(smx_synchro_t synchro) sg_host_get_name(sender), sg_host_get_name(receiver)); synchro->comm.surf_comm = surf_network_model_communicate(surf_network_model, - sender, receiver, - synchro->comm.task_size, synchro->comm.rate); + sender, receiver, + synchro->comm.task_size, synchro->comm.rate); synchro->comm.surf_comm->setData(synchro); @@ -906,16 +906,16 @@ void SIMIX_post_comm(smx_synchro_t synchro) synchro->comm.src_timeout->getState() == SURF_ACTION_DONE) synchro->state = SIMIX_SRC_TIMEOUT; else if (synchro->comm.dst_timeout && - synchro->comm.dst_timeout->getState() == SURF_ACTION_DONE) + synchro->comm.dst_timeout->getState() == SURF_ACTION_DONE) synchro->state = SIMIX_DST_TIMEOUT; else if (synchro->comm.src_timeout && - synchro->comm.src_timeout->getState() == SURF_ACTION_FAILED) + synchro->comm.src_timeout->getState() == SURF_ACTION_FAILED) synchro->state = SIMIX_SRC_HOST_FAILURE; else if (synchro->comm.dst_timeout && synchro->comm.dst_timeout->getState() == SURF_ACTION_FAILED) synchro->state = SIMIX_DST_HOST_FAILURE; else if (synchro->comm.surf_comm && - synchro->comm.surf_comm->getState() == SURF_ACTION_FAILED) { + synchro->comm.surf_comm->getState() == SURF_ACTION_FAILED) { XBT_DEBUG("Puta madre. Surf says that the link broke"); synchro->state = SIMIX_LINK_FAILURE; } else diff --git a/src/simix/smx_synchro.cpp b/src/simix/smx_synchro.cpp index ff7f7e75d4..b8eff39b8b 100644 --- a/src/simix/smx_synchro.cpp +++ b/src/simix/smx_synchro.cpp @@ -212,8 +212,8 @@ void SIMIX_mutex_unlock(smx_mutex_t mutex, smx_process_t issuer) /* If the mutex is not owned by the issuer, that's not good */ if (issuer != mutex->owner) - THROWF(mismatch_error, 0, "Cannot release that mutex: it was locked by %s (pid:%d), not by you.", - SIMIX_process_get_name(mutex->owner),SIMIX_process_get_PID(mutex->owner)); + THROWF(mismatch_error, 0, "Cannot release that mutex: it was locked by %s (pid:%d), not by you.", + SIMIX_process_get_name(mutex->owner),SIMIX_process_get_PID(mutex->owner)); if (xbt_swag_size(mutex->sleeping) > 0) { /*process to wake up */ @@ -284,7 +284,7 @@ void simcall_HANDLER_cond_wait(smx_simcall_t simcall, smx_cond_t cond, smx_mutex * \param simcall the simcall */ void simcall_HANDLER_cond_wait_timeout(smx_simcall_t simcall, smx_cond_t cond, - smx_mutex_t mutex, double timeout) + smx_mutex_t mutex, double timeout) { XBT_IN("(%p)",simcall); smx_process_t issuer = simcall->issuer; diff --git a/src/simix/smx_vm.cpp b/src/simix/smx_vm.cpp index 6b32988c7d..69088f1809 100644 --- a/src/simix/smx_vm.cpp +++ b/src/simix/smx_vm.cpp @@ -87,7 +87,7 @@ static int __can_be_started(sg_host_t vm) } xbt_dynar_free(&dyn_vms); - return 1; + return 1; } void SIMIX_vm_start(sg_host_t ind_vm) diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index 568168b97b..8b0c747e0b 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -408,7 +408,7 @@ void smpi_mpi_start(MPI_Request request) int rank = request->src; if (TRACE_smpi_view_internals()) { - TRACE_smpi_send(rank, rank, receiver,request->size); + TRACE_smpi_send(rank, rank, receiver,request->size); } print_request("New send", request); @@ -501,7 +501,7 @@ void smpi_mpi_start(MPI_Request request) /* FIXME: detached sends are not traceable (request->action == NULL) */ if (request->action) - simcall_set_category(request->action, TRACE_internal_smpi_get_category()); + simcall_set_category(request->action, TRACE_internal_smpi_get_category()); if (async_small_thresh != 0 || request->flags & RMA) xbt_mutex_release(mut); @@ -1419,10 +1419,10 @@ void smpi_mpi_reduce(void *sendbuf, void *recvbuf, int count, if(src != root) { // FIXME: possibly overkill we we have contiguous/noncontiguous data // mapping... - if (!smpi_process_get_replaying()) + if (!smpi_process_get_replaying()) tmpbufs[index] = xbt_malloc(count * dataext); - else - tmpbufs[index] = smpi_get_tmp_sendbuffer(count * dataext); + else + tmpbufs[index] = smpi_get_tmp_sendbuffer(count * dataext); requests[index] = smpi_irecv_init(tmpbufs[index], count, datatype, src, system_tag, comm); diff --git a/src/smpi/smpi_bench.c b/src/smpi/smpi_bench.c index fcf9a6e0d2..8ed76a50a5 100644 --- a/src/smpi/smpi_bench.c +++ b/src/smpi/smpi_bench.c @@ -674,8 +674,8 @@ void smpi_initialize_global_memory_segments(){ int file_descriptor= mkstemp (path); if (file_descriptor < 0) { - if (errno==EMFILE) { - xbt_die("Impossible to create temporary file for memory mapping: %s\n\ + if (errno==EMFILE) { + xbt_die("Impossible to create temporary file for memory mapping: %s\n\ The open() system call failed with the EMFILE error code (too many files). \n\n\ This means that you reached the system limits concerning the amount of files per process. \ This is not a surprise if you are trying to virtualize many processes on top of SMPI. \ @@ -688,9 +688,9 @@ First, check what your limits are:\n\ If one of these values is less than the amount of MPI processes that you try to run, then you got the explanation of this error. \ Ask the Internet about tutorials on how to increase the files limit such as: https://rtcamp.com/tutorials/linux/increase-open-files-limit/", strerror(errno)); - } + } xbt_die("Impossible to create temporary file for memory mapping: %s", - strerror(errno)); + strerror(errno)); } status = unlink (path); diff --git a/src/smpi/smpi_coll.c b/src/smpi/smpi_coll.c index e685e31c10..4e1fdea6de 100644 --- a/src/smpi/smpi_coll.c +++ b/src/smpi/smpi_coll.c @@ -180,9 +180,9 @@ int smpi_coll_tuned_alltoall_ompi2(void *sendbuf, int sendcount, int recvcount, MPI_Datatype recvtype, MPI_Comm comm) { - int size, sendsize; - size = smpi_comm_size(comm); - sendsize = smpi_datatype_size(sendtype) * sendcount; + int size, sendsize; + size = smpi_comm_size(comm); + sendsize = smpi_datatype_size(sendtype) * sendcount; if (sendsize < 200 && size > 12) { return smpi_coll_tuned_alltoall_bruck(sendbuf, sendcount, sendtype, diff --git a/src/smpi/smpi_mpi_dt.c b/src/smpi/smpi_mpi_dt.c index bb63c6bc69..9342827d2a 100644 --- a/src/smpi/smpi_mpi_dt.c +++ b/src/smpi/smpi_mpi_dt.c @@ -547,8 +547,8 @@ int smpi_datatype_contiguous(int count, MPI_Datatype old_type, MPI_Datatype* new { int retval; if(old_type->has_subtype){ - //handle this case as a hvector with stride equals to the extent of the datatype - return smpi_datatype_hvector(count, 1, smpi_datatype_get_extent(old_type), old_type, new_type); + //handle this case as a hvector with stride equals to the extent of the datatype + return smpi_datatype_hvector(count, 1, smpi_datatype_get_extent(old_type), old_type, new_type); } s_smpi_mpi_contiguous_t* subtype = smpi_datatype_contiguous_create( lb, @@ -557,9 +557,9 @@ int smpi_datatype_contiguous(int count, MPI_Datatype old_type, MPI_Datatype* new smpi_datatype_size(old_type)); smpi_datatype_create(new_type, - count * smpi_datatype_size(old_type), - lb,lb + count * smpi_datatype_size(old_type), - 1,subtype, DT_FLAG_CONTIGUOUS); + count * smpi_datatype_size(old_type), + lb,lb + count * smpi_datatype_size(old_type), + 1,subtype, DT_FLAG_CONTIGUOUS); retval=MPI_SUCCESS; return retval; } @@ -736,7 +736,7 @@ int smpi_datatype_hvector(int count, int blocklen, MPI_Aint stride, MPI_Datatype smpi_datatype_size(old_type)); smpi_datatype_create(new_type, count * blocklen * smpi_datatype_size(old_type), - lb,ub, + lb,ub, 1, subtype, DT_FLAG_VECTOR); @@ -893,9 +893,9 @@ int smpi_datatype_indexed(int count, int* blocklens, int* indices, MPI_Datatype size += blocklens[i]; if(indices[i]*smpi_datatype_get_extent(old_type)+smpi_datatype_lb(old_type)ub) - ub = indices[i]*smpi_datatype_get_extent(old_type)+blocklens[i]*smpi_datatype_ub(old_type); + ub = indices[i]*smpi_datatype_get_extent(old_type)+blocklens[i]*smpi_datatype_ub(old_type); if ( (i< count -1) && (indices[i]+blocklens[i] != indices[i+1]) )contiguous=0; } @@ -1072,7 +1072,7 @@ int smpi_datatype_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Dat old_type, smpi_datatype_size(old_type)); smpi_datatype_create(new_type, size * smpi_datatype_size(old_type), - lb, + lb, ub ,1, subtype, DT_FLAG_DATA); }else{ @@ -1081,8 +1081,8 @@ int smpi_datatype_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Dat old_type, smpi_datatype_size(old_type)); smpi_datatype_create(new_type, size * smpi_datatype_size(old_type), - 0,size * smpi_datatype_size(old_type), - 1, subtype, DT_FLAG_DATA|DT_FLAG_CONTIGUOUS); + 0,size * smpi_datatype_size(old_type), + 1, subtype, DT_FLAG_DATA|DT_FLAG_CONTIGUOUS); } retval=MPI_SUCCESS; return retval; diff --git a/src/smpi/smpi_pmpi.c b/src/smpi/smpi_pmpi.c index 09bb17c9a7..ba912ad870 100644 --- a/src/smpi/smpi_pmpi.c +++ b/src/smpi/smpi_pmpi.c @@ -556,13 +556,13 @@ int PMPI_Group_range_incl(MPI_Group group, int n, int ranges[][3], break; } rank += ranges[i][2]; /* Stride */ - if (ranges[i][0] ranges[i][1]) - break; - }else{ - if(rank < ranges[i][1]) - break; - } + if (ranges[i][0] ranges[i][1]) + break; + }else{ + if(rank < ranges[i][1]) + break; + } } } @@ -579,13 +579,13 @@ int PMPI_Group_range_incl(MPI_Group group, int n, int ranges[][3], break; } rank += ranges[i][2]; /* Stride */ - if (ranges[i][0] ranges[i][1]) - break; - }else{ - if(rank < ranges[i][1]) - break; - } + if (ranges[i][0] ranges[i][1]) + break; + }else{ + if(rank < ranges[i][1]) + break; + } } } } @@ -622,13 +622,13 @@ int PMPI_Group_range_excl(MPI_Group group, int n, int ranges[][3], break; } rank += ranges[i][2]; /* Stride */ - if (ranges[i][0] ranges[i][1]) - break; - }else{ - if(rank < ranges[i][1]) - break; - } + if (ranges[i][0] ranges[i][1]) + break; + }else{ + if(rank < ranges[i][1]) + break; + } } } if (size == 0) { diff --git a/src/smpi/smpi_replay.c b/src/smpi/smpi_replay.c index d92975d608..f1f5caa32a 100644 --- a/src/smpi/smpi_replay.c +++ b/src/smpi/smpi_replay.c @@ -60,7 +60,7 @@ static void set_reqq_self(xbt_dynar_t mpi_request){ //allocate a single buffer for all sends, growing it if needed void* smpi_get_tmp_sendbuffer(int size){ if (!smpi_process_get_replaying()) - return xbt_malloc(size); + return xbt_malloc(size); if (sendbuffer_sizetype=TRACING_TEST; - TRACE_smpi_testing_in(rank, extra); + int rank = smpi_process_index(); + instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1); + extra->type=TRACING_TEST; + TRACE_smpi_testing_in(rank, extra); - flag = smpi_mpi_test(&request, &status); + flag = smpi_mpi_test(&request, &status); - XBT_DEBUG("MPI_Test result: %d", flag); - /* push back request in dynar to be caught by a subsequent wait. if the test - * did succeed, the request is now NULL. - */ - xbt_dynar_push_as(get_reqq_self(),MPI_Request, request); + XBT_DEBUG("MPI_Test result: %d", flag); + /* push back request in dynar to be caught by a subsequent wait. if the test + * did succeed, the request is now NULL. + */ + xbt_dynar_push_as(get_reqq_self(),MPI_Request, request); - TRACE_smpi_testing_out(rank); + TRACE_smpi_testing_out(rank); } log_timed_action (action, clock); } diff --git a/src/surf/PropertyHolder.cpp b/src/surf/PropertyHolder.cpp index cdd87bee05..4458b2d8db 100644 --- a/src/surf/PropertyHolder.cpp +++ b/src/surf/PropertyHolder.cpp @@ -15,28 +15,28 @@ PropertyHolder::PropertyHolder(xbt_dict_t props) } PropertyHolder::~PropertyHolder() { - xbt_dict_free(&p_properties); + xbt_dict_free(&p_properties); } /** @brief Return the property associated to the provided key (or NULL if not existing) */ const char *PropertyHolder::getProperty(const char*key) { - if (p_properties == NULL) - return NULL; - return (const char*) xbt_dict_get_or_null(p_properties,key); + if (p_properties == NULL) + return NULL; + return (const char*) xbt_dict_get_or_null(p_properties,key); } /** @brief Change the value of a given key in the property set */ void PropertyHolder::setProperty(const char*key, const char*value) { - if (!p_properties) - p_properties = xbt_dict_new(); - xbt_dict_set(p_properties, key, xbt_strdup(value), &xbt_free_f); + if (!p_properties) + p_properties = xbt_dict_new(); + xbt_dict_set(p_properties, key, xbt_strdup(value), &xbt_free_f); } /** @brief Return the whole set of properties. Don't mess with it, dude! */ xbt_dict_t PropertyHolder::getProperties() { - if (!p_properties) - p_properties = xbt_dict_new(); - return p_properties; + if (!p_properties) + p_properties = xbt_dict_new(); + return p_properties; } } /* namespace surf */ diff --git a/src/surf/PropertyHolder.hpp b/src/surf/PropertyHolder.hpp index 2f9556304e..0684173fa6 100644 --- a/src/surf/PropertyHolder.hpp +++ b/src/surf/PropertyHolder.hpp @@ -17,18 +17,18 @@ namespace surf { class PropertyHolder { // DO NOT DERIVE THIS CLASS, or the diamond inheritance mayhem will get you public: - PropertyHolder(xbt_dict_t props); - ~PropertyHolder(); + PropertyHolder(xbt_dict_t props); + ~PropertyHolder(); - const char *getProperty(const char*id); - void setProperty(const char*id, const char*value); + const char *getProperty(const char*id); + void setProperty(const char*id, const char*value); - /* FIXME: This should not be exposed, as users may do bad things with the dict they got (it's not a copy). - * But some user API expose this call so removing it is not so easy. - */ - xbt_dict_t getProperties(); + /* FIXME: This should not be exposed, as users may do bad things with the dict they got (it's not a copy). + * But some user API expose this call so removing it is not so easy. + */ + xbt_dict_t getProperties(); private: - xbt_dict_t p_properties = NULL; + xbt_dict_t p_properties = NULL; }; } /* namespace surf */ diff --git a/src/surf/cpu_cas01.cpp b/src/surf/cpu_cas01.cpp index 79d0c91fe2..08a68e8b92 100644 --- a/src/surf/cpu_cas01.cpp +++ b/src/surf/cpu_cas01.cpp @@ -88,7 +88,7 @@ CpuCas01Model::~CpuCas01Model() } Cpu *CpuCas01Model::createCpu(simgrid::s4u::Host *host, xbt_dynar_t speedPeak, - int pstate, double speedScale, + int pstate, double speedScale, tmgr_trace_t speedTrace, int core, int initiallyOn, tmgr_trace_t state_trace) @@ -134,9 +134,9 @@ CpuCas01::CpuCas01(CpuCas01Model *model, simgrid::s4u::Host *host, xbt_dynar_t s int pstate, double speedScale, tmgr_trace_t speedTrace, int core, int initiallyOn, tmgr_trace_t stateTrace) : Cpu(model, host, - lmm_constraint_new(model->getMaxminSystem(), this, core * speedScale * xbt_dynar_get_as(speedPeak, pstate, double)), - speedPeak, pstate, - core, xbt_dynar_get_as(speedPeak, pstate, double), speedScale, + lmm_constraint_new(model->getMaxminSystem(), this, core * speedScale * xbt_dynar_get_as(speedPeak, pstate, double)), + speedPeak, pstate, + core, xbt_dynar_get_as(speedPeak, pstate, double), speedScale, initiallyOn) { XBT_DEBUG("CPU create: peak=%f, pstate=%d", m_speedPeak, m_pstate); @@ -166,8 +166,8 @@ bool CpuCas01::isUsed() /** @brief take into account changes of speed (either load or max) */ void CpuCas01::onSpeedChange() { - lmm_variable_t var = NULL; - lmm_element_t elem = NULL; + lmm_variable_t var = NULL; + lmm_element_t elem = NULL; lmm_update_constraint_bound(getModel()->getMaxminSystem(), getConstraint(), m_core * m_speedScale * m_speedPeak); @@ -180,7 +180,7 @@ void CpuCas01::onSpeedChange() { m_speedScale * m_speedPeak); } - Cpu::onSpeedChange(); + Cpu::onSpeedChange(); } void CpuCas01::updateState(tmgr_trace_iterator_t event_type, double value, double date) @@ -280,8 +280,8 @@ CpuAction *CpuCas01::sleep(double duration) CpuCas01Action::CpuCas01Action(Model *model, double cost, bool failed, double speed, lmm_constraint_t constraint) : CpuAction(model, cost, failed, - lmm_variable_new(model->getMaxminSystem(), this, - 1.0, speed, 1)) + lmm_variable_new(model->getMaxminSystem(), this, + 1.0, speed, 1)) { if (model->getUpdateMechanism() == UM_LAZY) { m_indexHeap = -1; diff --git a/src/surf/cpu_interface.cpp b/src/surf/cpu_interface.cpp index a8572984a7..7629b04619 100644 --- a/src/surf/cpu_interface.cpp +++ b/src/surf/cpu_interface.cpp @@ -27,8 +27,8 @@ namespace surf { Cpu *getActionCpu(CpuAction *action) { return static_cast(lmm_constraint_id(lmm_get_cnst_from_var - (action->getModel()->getMaxminSystem(), - action->getVariable(), 0))); + (action->getModel()->getMaxminSystem(), + action->getVariable(), 0))); } simgrid::xbt::signal cpuActionStateChangedCallbacks; @@ -90,7 +90,7 @@ void CpuModel::updateActionsStateFull(double now, double delta) for(ActionList::iterator it(running_actions->begin()), itNext=it, itend(running_actions->end()) ; it != itend ; it=itNext) { - ++itNext; + ++itNext; action = static_cast(&*it); if (TRACE_is_enabled()) { Cpu *x = static_cast (lmm_constraint_id(lmm_get_cnst_from_var(getMaxminSystem(), action->getVariable(), 0)) ); @@ -128,16 +128,16 @@ void CpuModel::updateActionsStateFull(double now, double delta) * Resource * ************/ Cpu::Cpu(Model *model, simgrid::s4u::Host *host, - xbt_dynar_t speedPeakList, int pstate, - int core, double speedPeak, double speedScale, - int initiallyOn) + xbt_dynar_t speedPeakList, int pstate, + int core, double speedPeak, double speedScale, + int initiallyOn) : Cpu(model, host, NULL/*constraint*/, speedPeakList, pstate, core, speedPeak, speedScale, initiallyOn) { } Cpu::Cpu(Model *model, simgrid::s4u::Host *host, lmm_constraint_t constraint, - xbt_dynar_t speedPeakList, int pstate, - int core, double speedPeak, + xbt_dynar_t speedPeakList, int pstate, + int core, double speedPeak, double speedScale, int initiallyOn) : Resource(model, host->name().c_str(), constraint, initiallyOn) , m_core(core) @@ -163,8 +163,8 @@ Cpu::Cpu(Model *model, simgrid::s4u::Host *host, lmm_constraint_t constraint, xbt_assert(model == surf_cpu_model_pm); if (model->getUpdateMechanism() != UM_UNDEFINED) { - p_constraintCore = xbt_new(lmm_constraint_t, core); - p_constraintCoreId = xbt_new(void*, core); + p_constraintCore = xbt_new(lmm_constraint_t, core); + p_constraintCoreId = xbt_new(void*, core); int i; for (i = 0; i < core; i++) { @@ -179,7 +179,7 @@ Cpu::~Cpu() { if (p_constraintCoreId){ for (int i = 0; i < m_core; i++) { - xbt_free(p_constraintCoreId[i]); + xbt_free(p_constraintCoreId[i]); } xbt_free(p_constraintCore); } @@ -203,7 +203,7 @@ void Cpu::setPState(int pstate_index) { xbt_dynar_t plist = p_speedPeakList; xbt_assert(pstate_index <= (int)xbt_dynar_length(plist), - "Invalid parameters for CPU %s (pstate %d > length of pstates %d)", getName(), pstate_index, (int)xbt_dynar_length(plist)); + "Invalid parameters for CPU %s (pstate %d > length of pstates %d)", getName(), pstate_index, (int)xbt_dynar_length(plist)); double new_peak_speed = xbt_dynar_get_as(plist, pstate_index, double); m_pstate = pstate_index; @@ -237,8 +237,8 @@ double Cpu::getAvailableSpeed() } void Cpu::onSpeedChange() { - TRACE_surf_host_set_speed(surf_get_clock(), getName(), - m_core * m_speedScale * m_speedPeak); + TRACE_surf_host_set_speed(surf_get_clock(), getName(), + m_core * m_speedScale * m_speedPeak); } diff --git a/src/surf/cpu_interface.hpp b/src/surf/cpu_interface.hpp index 27bcee0dcb..1684541bf5 100644 --- a/src/surf/cpu_interface.hpp +++ b/src/surf/cpu_interface.hpp @@ -87,9 +87,9 @@ public: */ Cpu(simgrid::surf::Model *model, simgrid::s4u::Host *host, lmm_constraint_t constraint, - xbt_dynar_t speedPeakList, int pstate, - int core, double speedPeak, double speedScale, - int initiallyOn); + xbt_dynar_t speedPeakList, int pstate, + int core, double speedPeak, double speedScale, + int initiallyOn); /** * @brief Cpu constructor @@ -105,8 +105,8 @@ public: */ Cpu(simgrid::surf::Model *model, simgrid::s4u::Host *host, xbt_dynar_t speedPeakList, int pstate, - int core, double speedPeak, double speedScale, - int initiallyOn); + int core, double speedPeak, double speedScale, + int initiallyOn); ~Cpu(); diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index a59737bbf2..1cd22a7429 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -428,8 +428,8 @@ CpuTiModel::~CpuTiModel() } Cpu *CpuTiModel::createCpu(simgrid::s4u::Host *host, - xbt_dynar_t speedPeak, - int pstate, + xbt_dynar_t speedPeak, + int pstate, double speedScale, tmgr_trace_t speedTrace, int core, @@ -440,7 +440,7 @@ Cpu *CpuTiModel::createCpu(simgrid::s4u::Host *host, xbt_assert(xbt_dynar_getfirst_as(speedPeak, double) > 0.0, "Speed has to be >0.0. Did you forget to specify the mandatory speed attribute?"); CpuTi *cpu = new CpuTi(this, host, speedPeak, pstate, speedScale, speedTrace, - core, initiallyOn, stateTrace); + core, initiallyOn, stateTrace); return cpu; } @@ -526,7 +526,7 @@ CpuTi::CpuTi(CpuTiModel *model, simgrid::s4u::Host *host, xbt_dynar_t speedPeak, p_stateEvent = future_evt_set->add_trace(stateTrace, 0.0, this); if (speedTrace && xbt_dynar_length(speedTrace->event_list) > 1) { - s_tmgr_event_t val; + s_tmgr_event_t val; // add a fake trace event if periodicity == 0 xbt_dynar_get_cpy(speedTrace->event_list, xbt_dynar_length(speedTrace->event_list) - 1, &val); @@ -603,7 +603,7 @@ void CpuTi::updateState(tmgr_trace_iterator_t event_type, /* put all action running on cpu to failed */ for(ActionTiList::iterator it(p_actionSet->begin()), itend(p_actionSet->end()) ; it != itend ; ++it) { - action = &*it; + action = &*it; if (action->getState() == SURF_ACTION_RUNNING || action->getState() == SURF_ACTION_READY || action->getState() == SURF_ACTION_NOT_IN_THE_SYSTEM) { @@ -787,7 +787,7 @@ CpuAction *CpuTi::sleep(double duration) if (duration == NO_MAX_DURATION) { /* Move to the *end* of the corresponding action set. This convention is used to speed up update_resource_state */ - action->getStateSet()->erase(action->getStateSet()->iterator_to(*action)); + action->getStateSet()->erase(action->getStateSet()->iterator_to(*action)); action->p_stateSet = static_cast(getModel())->p_runningActionSetThatDoesNotNeedBeingChecked; action->getStateSet()->push_back(*action); } @@ -816,7 +816,7 @@ void CpuTi::modified(bool modified){ **********/ CpuTiAction::CpuTiAction(CpuTiModel *model_, double cost, bool failed, - CpuTi *cpu) + CpuTi *cpu) : CpuAction(model_, cost, failed) { p_cpu = cpu; @@ -839,8 +839,8 @@ int CpuTiAction::unref() { m_refcount--; if (!m_refcount) { - if (action_hook.is_linked()) - getStateSet()->erase(getStateSet()->iterator_to(*this)); + if (action_hook.is_linked()) + getStateSet()->erase(getStateSet()->iterator_to(*this)); /* remove from action_set */ if (action_ti_hook.is_linked()) p_cpu->p_actionSet->erase(p_cpu->p_actionSet->iterator_to(*this)); diff --git a/src/surf/cpu_ti.hpp b/src/surf/cpu_ti.hpp index a9820c4f16..d4d305a6b5 100644 --- a/src/surf/cpu_ti.hpp +++ b/src/surf/cpu_ti.hpp @@ -55,7 +55,7 @@ class CpuTiTgmr { public: CpuTiTgmr(trace_type type, double value) : m_type(type), m_value(value) - {}; + {}; CpuTiTgmr(tmgr_trace_t speedTrace, double value); ~CpuTiTgmr(); diff --git a/src/surf/fair_bottleneck.cpp b/src/surf/fair_bottleneck.cpp index 684a8cbded..7694c4ca3a 100644 --- a/src/surf/fair_bottleneck.cpp +++ b/src/surf/fair_bottleneck.cpp @@ -39,7 +39,7 @@ void bottleneck_solve(lmm_system_t sys) var_list = &(sys->variable_set); XBT_DEBUG("Variable set : %d", xbt_swag_size(var_list)); xbt_swag_foreach(_var, var_list) { - var = (lmm_variable_t)_var; + var = (lmm_variable_t)_var; int nb = 0; var->value = 0.0; XBT_DEBUG("Handling variable %p", var); @@ -65,12 +65,12 @@ void bottleneck_solve(lmm_system_t sys) cnst_list = &(sys->active_constraint_set); XBT_DEBUG("Active constraints : %d", xbt_swag_size(cnst_list)); xbt_swag_foreach(_cnst, cnst_list) { - cnst = (lmm_constraint_t)_cnst; + cnst = (lmm_constraint_t)_cnst; xbt_swag_insert(cnst, &(sys->saturated_constraint_set)); } cnst_list = &(sys->saturated_constraint_set); xbt_swag_foreach(_cnst, cnst_list) { - cnst = (lmm_constraint_t)_cnst; + cnst = (lmm_constraint_t)_cnst; cnst->remaining = cnst->bound; cnst->usage = 0.0; } @@ -94,7 +94,7 @@ void bottleneck_solve(lmm_system_t sys) elem_list = &(cnst->enabled_element_set); cnst->usage = 0.0; xbt_swag_foreach(_elem, elem_list) { - elem = (lmm_element_t)_elem; + elem = (lmm_element_t)_elem; xbt_assert(elem->variable->weight > 0); if ((elem->value > 0) && xbt_swag_belongs(elem->variable, var_list)) diff --git a/src/surf/host_interface.cpp b/src/surf/host_interface.cpp index 5b9a6f0278..bda8a185db 100644 --- a/src/surf/host_interface.cpp +++ b/src/surf/host_interface.cpp @@ -125,7 +125,7 @@ void Host::classInit() } Host::Host(simgrid::surf::HostModel *model, const char *name, xbt_dict_t props, - xbt_dynar_t storage, Cpu *cpu) + xbt_dynar_t storage, Cpu *cpu) : Resource(model, name) , PropertyHolder(props) , p_storage(storage), p_cpu(cpu) @@ -134,7 +134,7 @@ Host::Host(simgrid::surf::HostModel *model, const char *name, xbt_dict_t props, } Host::Host(simgrid::surf::HostModel *model, const char *name, xbt_dict_t props, lmm_constraint_t constraint, - xbt_dynar_t storage, Cpu *cpu) + xbt_dynar_t storage, Cpu *cpu) : Resource(model, name, constraint) , PropertyHolder(props) , p_storage(storage), p_cpu(cpu) @@ -215,11 +215,11 @@ xbt_dynar_t Host::getAttachedStorageList() xbt_dynar_t result = xbt_dynar_new(sizeof(void*), NULL); xbt_lib_foreach(storage_lib, cursor, key, data) { if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != NULL) { - simgrid::surf::Storage *storage = static_cast(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL)); - if(!strcmp((const char*)storage->p_attach,this->getName())){ - xbt_dynar_push_as(result, void *, (void*)storage->getName()); - } - } + simgrid::surf::Storage *storage = static_cast(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL)); + if(!strcmp((const char*)storage->p_attach,this->getName())){ + xbt_dynar_push_as(result, void *, (void*)storage->getName()); + } + } } return result; } @@ -251,12 +251,12 @@ Action *Host::open(const char* fullpath) { } if(longest_prefix_length>0) { /* Mount point found, split fullpath into mount_name and path+filename*/ - path = (char *) xbt_malloc ((strlen(fullpath)-longest_prefix_length+1)); - mount_name = (char *) xbt_malloc ((longest_prefix_length+1)); - strncpy(mount_name, fullpath, longest_prefix_length+1); - strncpy(path, fullpath+longest_prefix_length, strlen(fullpath)-longest_prefix_length+1); - path[strlen(fullpath)-longest_prefix_length] = '\0'; - mount_name[longest_prefix_length] = '\0'; + path = (char *) xbt_malloc ((strlen(fullpath)-longest_prefix_length+1)); + mount_name = (char *) xbt_malloc ((longest_prefix_length+1)); + strncpy(mount_name, fullpath, longest_prefix_length+1); + strncpy(path, fullpath+longest_prefix_length, strlen(fullpath)-longest_prefix_length+1); + path[strlen(fullpath)-longest_prefix_length] = '\0'; + mount_name[longest_prefix_length] = '\0'; } else xbt_die("Can't find mount point for '%s' on '%s'", fullpath, getName()); diff --git a/src/surf/host_interface.hpp b/src/surf/host_interface.hpp index 7766807dd9..a6f84f232e 100644 --- a/src/surf/host_interface.hpp +++ b/src/surf/host_interface.hpp @@ -73,8 +73,8 @@ public: * @details An host represents a machine with a aggregation of a Cpu, a RoutingEdge and a Storage */ class Host : - public simgrid::surf::Resource, - public simgrid::surf::PropertyHolder { + public simgrid::surf::Resource, + public simgrid::surf::PropertyHolder { public: static simgrid::xbt::Extension EXTENSION_ID; @@ -90,7 +90,7 @@ public: * @param cpu The Cpu associated to this Host */ Host(HostModel *model, const char *name, xbt_dict_t props, - xbt_dynar_t storage, Cpu *cpu); + xbt_dynar_t storage, Cpu *cpu); /** * @brief Host constructor diff --git a/src/surf/host_ptask_L07.cpp b/src/surf/host_ptask_L07.cpp index 298496af00..adc4aba6ea 100644 --- a/src/surf/host_ptask_L07.cpp +++ b/src/surf/host_ptask_L07.cpp @@ -54,10 +54,10 @@ HostL07Model::HostL07Model() : HostModel() { surf_cpu_model_pm = new CpuL07Model(this,p_maxminSystem); routing_model_create(surf_network_model->createLink("__loopback__", - 498000000, NULL, - 0.000015, NULL, - 1/*ON*/, NULL, - SURF_LINK_FATPIPE, NULL)); + 498000000, NULL, + 0.000015, NULL, + 1/*ON*/, NULL, + SURF_LINK_FATPIPE, NULL)); } HostL07Model::~HostL07Model() { @@ -66,26 +66,26 @@ HostL07Model::~HostL07Model() { } CpuL07Model::CpuL07Model(HostL07Model *hmodel,lmm_system_t sys) - : CpuModel() - , p_hostModel(hmodel) - { - p_maxminSystem = sys; - } + : CpuModel() + , p_hostModel(hmodel) + { + p_maxminSystem = sys; + } CpuL07Model::~CpuL07Model() { - surf_cpu_model_pm = NULL; - lmm_system_free(p_maxminSystem); - p_maxminSystem = NULL; + surf_cpu_model_pm = NULL; + lmm_system_free(p_maxminSystem); + p_maxminSystem = NULL; } NetworkL07Model::NetworkL07Model(HostL07Model *hmodel, lmm_system_t sys) - : NetworkModel() - , p_hostModel(hmodel) - { - p_maxminSystem = sys; - } + : NetworkModel() + , p_hostModel(hmodel) + { + p_maxminSystem = sys; + } NetworkL07Model::~NetworkL07Model() { - surf_network_model = NULL; - p_maxminSystem = NULL; // Avoid multi-free + surf_network_model = NULL; + p_maxminSystem = NULL; // Avoid multi-free } @@ -99,8 +99,8 @@ double HostL07Model::shareResources(double /*now*/) bottleneck_solve); for(ActionList::iterator it(running_actions->begin()), itend(running_actions->end()) - ; it != itend ; ++it) { - action = static_cast(&*it); + ; it != itend ; ++it) { + action = static_cast(&*it); if (action->m_latency > 0) { if (min < 0) { min = action->m_latency; @@ -125,9 +125,9 @@ void HostL07Model::updateActionsState(double /*now*/, double delta) { ActionList *actionSet = getRunningActionSet(); for(ActionList::iterator it = actionSet->begin(), itNext = it - ; it != actionSet->end() - ; it = itNext) { - ++itNext; + ; it != actionSet->end() + ; it = itNext) { + ++itNext; action = static_cast(&*it); if (action->m_latency > 0) { if (action->m_latency > delta) { @@ -184,18 +184,18 @@ void HostL07Model::updateActionsState(double /*now*/, double delta) { } Action *HostL07Model::executeParallelTask(int host_nb, sg_host_t *host_list, - double *flops_amount, double *bytes_amount, - double rate) { - return new L07Action(this, host_nb, host_list, flops_amount, bytes_amount, rate); + double *flops_amount, double *bytes_amount, + double rate) { + return new L07Action(this, host_nb, host_list, flops_amount, bytes_amount, rate); } L07Action::L07Action(Model *model, int host_nb, - sg_host_t*host_list, - double *flops_amount, - double *bytes_amount, - double rate) - : CpuAction(model, 1, 0) + sg_host_t*host_list, + double *flops_amount, + double *bytes_amount, + double rate) + : CpuAction(model, 1, 0) { unsigned int cpt; int nb_link = 0; @@ -321,13 +321,13 @@ Link* NetworkL07Model::createLink(const char *name, xbt_dict_t properties) { xbt_assert(!Link::byName(name), - "Link '%s' declared several times in the platform file.", name); + "Link '%s' declared several times in the platform file.", name); Link* link = new LinkL07(this, name, properties, - bw_initial, bw_trace, - lat_initial, lat_trace, - initiallyOn, state_trace, - policy); + bw_initial, bw_trace, + lat_initial, lat_trace, + initiallyOn, state_trace, + policy); Link::onCreation(link); return link; } @@ -388,11 +388,11 @@ void HostL07Model::addTraces() ************/ CpuL07::CpuL07(CpuL07Model *model, simgrid::s4u::Host *host, - xbt_dynar_t speedPeakList, int pstate, - double speedScale, tmgr_trace_t speedTrace, - int core, int initiallyOn, tmgr_trace_t state_trace) + xbt_dynar_t speedPeakList, int pstate, + double speedScale, tmgr_trace_t speedTrace, + int core, int initiallyOn, tmgr_trace_t state_trace) : Cpu(model, host, speedPeakList, pstate, - core, xbt_dynar_get_as(speedPeakList,pstate,double), speedScale, initiallyOn) + core, xbt_dynar_get_as(speedPeakList,pstate,double), speedScale, initiallyOn) { p_constraint = lmm_constraint_new(model->getMaxminSystem(), this, xbt_dynar_get_as(speedPeakList,pstate,double) * speedScale); @@ -408,13 +408,13 @@ CpuL07::~CpuL07() } LinkL07::LinkL07(NetworkL07Model *model, const char* name, xbt_dict_t props, - double bw_initial, - tmgr_trace_t bw_trace, - double lat_initial, - tmgr_trace_t lat_trace, - int initiallyOn, - tmgr_trace_t state_trace, - e_surf_link_sharing_policy_t policy) + double bw_initial, + tmgr_trace_t bw_trace, + double lat_initial, + tmgr_trace_t lat_trace, + int initiallyOn, + tmgr_trace_t state_trace, + e_surf_link_sharing_policy_t policy) : Link(model, name, props, lmm_constraint_new(model->getMaxminSystem(), this, bw_initial), future_evt_set, state_trace) { m_bwCurrent = bw_initial; @@ -431,7 +431,7 @@ LinkL07::LinkL07(NetworkL07Model *model, const char* name, xbt_dict_t props, p_latEvent = future_evt_set->add_trace(lat_trace, 0.0, this); if (policy == SURF_LINK_FATPIPE) - lmm_constraint_shared(getConstraint()); + lmm_constraint_shared(getConstraint()); } Action *CpuL07::execution_start(double size) @@ -462,8 +462,8 @@ bool CpuL07::isUsed(){ /** @brief take into account changes of speed (either load or max) */ void CpuL07::onSpeedChange() { - lmm_variable_t var = NULL; - lmm_element_t elem = NULL; + lmm_variable_t var = NULL; + lmm_element_t elem = NULL; lmm_update_constraint_bound(getModel()->getMaxminSystem(), getConstraint(), m_speedPeak * m_speedScale); while ((var = lmm_get_var_from_cnst @@ -475,7 +475,7 @@ void CpuL07::onSpeedChange() { m_speedScale * m_speedPeak); } - Cpu::onSpeedChange(); + Cpu::onSpeedChange(); } diff --git a/src/surf/host_ptask_L07.hpp b/src/surf/host_ptask_L07.hpp index d811ddfdf8..5ca5d5a197 100644 --- a/src/surf/host_ptask_L07.hpp +++ b/src/surf/host_ptask_L07.hpp @@ -46,8 +46,8 @@ public: double shareResources(double now) override; void updateActionsState(double now, double delta) override; Action *executeParallelTask(int host_nb, sg_host_t *host_list, - double *flops_amount, double *bytes_amount, - double rate) override; + double *flops_amount, double *bytes_amount, + double rate) override; void addTraces() override; }; @@ -72,14 +72,14 @@ public: NetworkL07Model(HostL07Model *hmodel, lmm_system_t sys); ~NetworkL07Model(); Link* createLink(const char *name, - double bw_initial, - tmgr_trace_t bw_trace, - double lat_initial, - tmgr_trace_t lat_trace, - int initiallyOn, - tmgr_trace_t state_trace, - e_surf_link_sharing_policy_t policy, - xbt_dict_t properties) override; + double bw_initial, + tmgr_trace_t bw_trace, + double lat_initial, + tmgr_trace_t lat_trace, + int initiallyOn, + tmgr_trace_t state_trace, + e_surf_link_sharing_policy_t policy, + xbt_dict_t properties) override; Action *communicate(NetCard *src, NetCard *dst, double size, double rate) override; void addTraces() override {DIE_IMPOSSIBLE;}; @@ -95,7 +95,7 @@ public: class CpuL07 : public Cpu { public: CpuL07(CpuL07Model *model, simgrid::s4u::Host *host, xbt_dynar_t speedPeakList, int pstate, - double power_scale, tmgr_trace_t power_trace, + double power_scale, tmgr_trace_t power_trace, int core, int initiallyOn, tmgr_trace_t state_trace); ~CpuL07(); bool isUsed() override; @@ -109,7 +109,7 @@ protected: class LinkL07 : public Link { public: LinkL07(NetworkL07Model *model, const char* name, xbt_dict_t props, - double bw_initial, + double bw_initial, tmgr_trace_t bw_trace, double lat_initial, tmgr_trace_t lat_trace, @@ -142,7 +142,7 @@ public: L07Action(Model *model, int host_nb, sg_host_t*host_list, double *flops_amount, - double *bytes_amount, + double *bytes_amount, double rate); ~L07Action(); diff --git a/src/surf/lagrange.cpp b/src/surf/lagrange.cpp index 1c126b4196..9257a84c6a 100644 --- a/src/surf/lagrange.cpp +++ b/src/surf/lagrange.cpp @@ -52,7 +52,7 @@ static int __check_feasible(xbt_swag_t cnst_list, xbt_swag_t var_list, double tmp; xbt_swag_foreach(_cnst, cnst_list) { - cnst = (lmm_constraint_t)_cnst; + cnst = (lmm_constraint_t)_cnst; tmp = 0; elem_list = &(cnst->enabled_element_set); xbt_swag_foreach(_elem, elem_list) { @@ -75,7 +75,7 @@ static int __check_feasible(xbt_swag_t cnst_list, xbt_swag_t var_list, } xbt_swag_foreach(_var, var_list) { - var = (lmm_variable_t)_var; + var = (lmm_variable_t)_var; if (!var->weight) break; if (var->bound < 0) @@ -134,7 +134,7 @@ static double dual_objective(xbt_swag_t var_list, xbt_swag_t cnst_list) double obj = 0.0; xbt_swag_foreach(_var, var_list) { - var = (lmm_variable_t)_var; + var = (lmm_variable_t)_var; double sigma_i = 0.0; int j; @@ -214,7 +214,7 @@ void lagrange_solve(lmm_system_t sys) */ cnst_list = &(sys->active_constraint_set); xbt_swag_foreach(_cnst, cnst_list) { - cnst = (lmm_constraint_t)_cnst; + cnst = (lmm_constraint_t)_cnst; cnst->lambda = 1.0; cnst->new_lambda = 2.0; XBT_DEBUG("#### cnst(%p)->lambda : %e", cnst, cnst->lambda); @@ -227,7 +227,7 @@ void lagrange_solve(lmm_system_t sys) var_list = &(sys->variable_set); i = 0; xbt_swag_foreach(_var, var_list) { - var = (lmm_variable_t)_var; + var = (lmm_variable_t)_var; if (!var->weight) var->value = 0.0; else { @@ -505,7 +505,7 @@ static double partial_diff_lambda(double lambda, void *param_cnst) XBT_CDEBUG(surf_lagrange_dichotomy, "Computing diff of cnst (%p)", cnst); xbt_swag_foreach(_elem, elem_list) { - elem = (lmm_element_t)_elem; + elem = (lmm_element_t)_elem; var = elem->variable; xbt_assert(var->weight > 0); XBT_CDEBUG(surf_lagrange_dichotomy, "Computing sigma_i for var (%p)", diff --git a/src/surf/maxmin.cpp b/src/surf/maxmin.cpp index 902e48f791..5e7441057e 100644 --- a/src/surf/maxmin.cpp +++ b/src/surf/maxmin.cpp @@ -488,7 +488,7 @@ lmm_variable_t lmm_get_var_from_cnst(lmm_system_t /*sys*/, //Look at enabled_element_set, and jump to disabled_element_set when finished *elem = (lmm_element_t) xbt_swag_getNext(*elem, cnst->enabled_element_set.offset); if (!(*elem)) - *elem = (lmm_element_t) xbt_swag_getFirst(&(cnst->disabled_element_set)); + *elem = (lmm_element_t) xbt_swag_getFirst(&(cnst->disabled_element_set)); } else { *elem = (lmm_element_t) xbt_swag_getNext(*elem, cnst->disabled_element_set.offset); } @@ -525,7 +525,7 @@ lmm_variable_t lmm_get_var_from_cnst_safe(lmm_system_t /*sys*/, //Look at enabled_element_set, and jump to disabled_element_set when finished *nextelem = (lmm_element_t) xbt_swag_getNext(*elem, cnst->enabled_element_set.offset); if (!(*nextelem)) - *nextelem = (lmm_element_t) xbt_swag_getFirst(&(cnst->disabled_element_set)); + *nextelem = (lmm_element_t) xbt_swag_getFirst(&(cnst->disabled_element_set)); } else { *nextelem = (lmm_element_t) xbt_swag_getNext(*elem, cnst->disabled_element_set.offset); } @@ -610,7 +610,7 @@ void lmm_print(lmm_system_t sys) xbt_realloc(trace_buf, strlen(trace_buf) + strlen(print_buf) + 1); strcat(trace_buf, print_buf); xbt_swag_foreach(_var, var_list) { - var = (lmm_variable_t)_var; + var = (lmm_variable_t)_var; sprintf(print_buf, "'%d'(%f) ", var->id_int, var->weight); trace_buf = (char*) xbt_realloc(trace_buf, strlen(trace_buf) + strlen(print_buf) + 1); @@ -627,7 +627,7 @@ void lmm_print(lmm_system_t sys) /* Printing Constraints */ cnst_list = &(sys->active_constraint_set); xbt_swag_foreach(_cnst, cnst_list) { - cnst = (lmm_constraint_t)_cnst; + cnst = (lmm_constraint_t)_cnst; sum = 0.0; //Show the enabled variables elem_list = &(cnst->enabled_element_set); @@ -649,9 +649,9 @@ void lmm_print(lmm_system_t sys) strlen(trace_buf) + strlen(print_buf) + 1); strcat(trace_buf, print_buf); if(cnst->sharing_policy) - sum += elem->value * elem->variable->value; + sum += elem->value * elem->variable->value; else - sum = MAX(sum,elem->value * elem->variable->value); + sum = MAX(sum,elem->value * elem->variable->value); } //TODO: Adding disabled elements only for test compatibility, but do we really want them to be printed? elem_list = &(cnst->disabled_element_set); @@ -664,9 +664,9 @@ void lmm_print(lmm_system_t sys) strlen(trace_buf) + strlen(print_buf) + 1); strcat(trace_buf, print_buf); if(cnst->sharing_policy) - sum += elem->value * elem->variable->value; + sum += elem->value * elem->variable->value; else - sum = MAX(sum,elem->value * elem->variable->value); + sum = MAX(sum,elem->value * elem->variable->value); } sprintf(print_buf, "0) <= %f ('%d')", cnst->bound, cnst->id_int); @@ -691,7 +691,7 @@ void lmm_print(lmm_system_t sys) XBT_DEBUG("Variables"); /* Printing Result */ xbt_swag_foreach(_var, var_list) { - var = (lmm_variable_t)_var; + var = (lmm_variable_t)_var; if (var->bound > 0) { XBT_DEBUG("'%d'(%f) : %f (<=%f)", var->id_int, var->weight, var->value, var->bound); @@ -734,7 +734,7 @@ void lmm_solve(lmm_system_t sys) XBT_DEBUG("Active constraints : %d", xbt_swag_size(cnst_list)); /* Init: Only modified code portions: reset the value of active variables */ xbt_swag_foreach(_cnst, cnst_list) { - cnst = (lmm_constraint_t)_cnst; + cnst = (lmm_constraint_t)_cnst; elem_list = &(cnst->enabled_element_set); //XBT_DEBUG("Variable set : %d", xbt_swag_size(elem_list)); xbt_swag_foreach(_elem, elem_list) { @@ -751,7 +751,7 @@ void lmm_solve(lmm_system_t sys) saturated_constraint_set->data = xbt_new0(int, saturated_constraint_set->size); xbt_swag_foreach_safe(_cnst, _cnst_next, cnst_list) { - cnst = (lmm_constraint_t)_cnst; + cnst = (lmm_constraint_t)_cnst; /* INIT: Collect constraints that actually need to be saturated (i.e remaining and usage are strictly positive) into cnst_light_tab. */ cnst->remaining = cnst->bound; if (!double_positive(cnst->remaining, cnst->bound*sg_maxmin_precision)) @@ -821,17 +821,17 @@ void lmm_solve(lmm_system_t sys) int i; if (min_bound < 0) { - //If no variable could reach its bound, deal iteratively the constraints usage ( at worst one constraint is saturated at each cycle) + //If no variable could reach its bound, deal iteratively the constraints usage ( at worst one constraint is saturated at each cycle) var->value = min_usage / var->weight; XBT_DEBUG("Setting %p (%d) value to %f\n", var, var->id_int, var->value); } else { - //If there exist a variable that can reach its bound, only update it (and other with the same bound) for now. - if (double_equals(min_bound, var->bound*var->weight, sg_maxmin_precision)){ + //If there exist a variable that can reach its bound, only update it (and other with the same bound) for now. + if (double_equals(min_bound, var->bound*var->weight, sg_maxmin_precision)){ var->value = var->bound; XBT_DEBUG("Setting %p (%d) value to %f\n", var, var->id_int, var->value); } else { - // Variables which bound is different are not considered for this cycle, but they will be afterwards. + // Variables which bound is different are not considered for this cycle, but they will be afterwards. XBT_DEBUG("Do not consider %p (%d) \n", var, var->id_int); xbt_swag_remove(var, var_list); continue; @@ -846,15 +846,15 @@ void lmm_solve(lmm_system_t sys) elem = &var->cnsts[i]; cnst = elem->constraint; if (cnst->sharing_policy) { - //Remember: shared constraints require that sum(elem->value * var->value) < cnst->bound + //Remember: shared constraints require that sum(elem->value * var->value) < cnst->bound double_update(&(cnst->remaining), elem->value * var->value, cnst->bound*sg_maxmin_precision); double_update(&(cnst->usage), elem->value / var->weight, sg_maxmin_precision); - //If the constraint is saturated, remove it from the set of active constraints (light_tab) + //If the constraint is saturated, remove it from the set of active constraints (light_tab) if(!double_positive(cnst->usage,sg_maxmin_precision) || !double_positive(cnst->remaining,cnst->bound*sg_maxmin_precision)) { if (cnst->cnst_light) { int index = (cnst->cnst_light-cnst_light_tab); XBT_DEBUG("index: %d \t cnst_light_num: %d \t || \t cnst: %p \t cnst->cnst_light: %p \t cnst_light_tab: %p usage: %f remaining: %f bound: %f ", - index,cnst_light_num, cnst, cnst->cnst_light, cnst_light_tab, cnst->usage, cnst->remaining, cnst->bound); + index,cnst_light_num, cnst, cnst->cnst_light, cnst_light_tab, cnst->usage, cnst->remaining, cnst->bound); cnst_light_tab[index]=cnst_light_tab[cnst_light_num-1]; cnst_light_tab[index].cnst->cnst_light = &cnst_light_tab[index]; cnst_light_num--; @@ -865,23 +865,23 @@ void lmm_solve(lmm_system_t sys) } make_elem_inactive(elem); } else { - //Remember: non-shared constraints only require that max(elem->value * var->value) < cnst->bound + //Remember: non-shared constraints only require that max(elem->value * var->value) < cnst->bound cnst->usage = 0.0; make_elem_inactive(elem); elem_list = &(cnst->enabled_element_set); xbt_swag_foreach(_elem, elem_list) { - elem = (lmm_element_t)_elem; - xbt_assert(elem->variable->weight > 0); - if (elem->variable->value > 0) continue; - if (elem->value > 0) - cnst->usage = MAX(cnst->usage, elem->value / elem->variable->weight); + elem = (lmm_element_t)_elem; + xbt_assert(elem->variable->weight > 0); + if (elem->variable->value > 0) continue; + if (elem->value > 0) + cnst->usage = MAX(cnst->usage, elem->value / elem->variable->weight); } - //If the constraint is saturated, remove it from the set of active constraints (light_tab) + //If the constraint is saturated, remove it from the set of active constraints (light_tab) if(!double_positive(cnst->usage,sg_maxmin_precision) || !double_positive(cnst->remaining,cnst->bound*sg_maxmin_precision)) { if(cnst->cnst_light) { int index = (cnst->cnst_light-cnst_light_tab); XBT_DEBUG("index: %d \t cnst_light_num: %d \t || \t cnst: %p \t cnst->cnst_light: %p \t cnst_light_tab: %p usage: %f remaining: %f bound: %f ", - index,cnst_light_num, cnst, cnst->cnst_light, cnst_light_tab, cnst->usage, cnst->remaining, cnst->bound); + index,cnst_light_num, cnst, cnst->cnst_light, cnst_light_tab, cnst->usage, cnst->remaining, cnst->bound); cnst_light_tab[index]=cnst_light_tab[cnst_light_num-1]; cnst_light_tab[index].cnst->cnst_light = &cnst_light_tab[index]; cnst_light_num--; @@ -908,7 +908,7 @@ void lmm_solve(lmm_system_t sys) pos, saturated_constraint_set, &min_usage); - } + } saturated_variable_set_update( cnst_light_tab, saturated_constraint_set, @@ -1072,12 +1072,12 @@ void lmm_on_disabled_var(lmm_system_t sys, lmm_constraint_t cnstr){ if (elem->variable->staged_weight>0 ) { - //Found a staged variable - //TODOLATER: Add random timing function to model reservation protocol fuzziness? Then how to make sure that staged variables will eventually be called? - if(lmm_can_enable_var(elem->variable)){ - lmm_enable_var(sys,elem->variable); - concurrency++; - } + //Found a staged variable + //TODOLATER: Add random timing function to model reservation protocol fuzziness? Then how to make sure that staged variables will eventually be called? + if(lmm_can_enable_var(elem->variable)){ + lmm_enable_var(sys,elem->variable); + concurrency++; + } } xbt_assert(concurrency<=cnstr->concurrency_limit,"Concurrency overflow!"); @@ -1093,7 +1093,7 @@ void lmm_on_disabled_var(lmm_system_t sys, lmm_constraint_t cnstr){ * @return Returns whether a change was made */ void lmm_update_variable_weight(lmm_system_t sys, lmm_variable_t var, - double weight) + double weight) { int minslack; @@ -1232,7 +1232,7 @@ static void lmm_remove_all_modified_set(lmm_system_t sys) //To be clean, when visited counter has wrapped around, we force these var->visited values so that variables that were in the modified a long (long long) time ago are not wrongly skipped here, which would lead to very nasty bugs (i.e. not readibily reproducible, and requiring a lot of run time before happening). if (++sys->visited_counter == 1) { /* the counter wrapped around, reset each variable->visited */ - void *_var; + void *_var; xbt_swag_foreach(_var, &sys->variable_set) ((lmm_variable_t)_var)->visited = 0; } @@ -1254,7 +1254,7 @@ double lmm_constraint_get_usage(lmm_constraint_t cnst) { lmm_element_t elem = NULL; xbt_swag_foreach(_elem, elem_list) { - elem = (lmm_element_t)_elem; + elem = (lmm_element_t)_elem; if ((elem->value > 0)) { if (cnst->sharing_policy) usage += elem->value * elem->variable->value; @@ -1280,15 +1280,15 @@ void lmm_check_concurrency(lmm_system_t sys){ concurrency=0; xbt_swag_foreach(_elem, &(cnst->enabled_element_set)) { - elem = (lmm_element_t)_elem; - xbt_assert(elem->variable->weight > 0); - concurrency++; + elem = (lmm_element_t)_elem; + xbt_assert(elem->variable->weight > 0); + concurrency++; } xbt_swag_foreach(_elem, &(cnst->disabled_element_set)) { - elem = (lmm_element_t)_elem; - //We should have staged variables only if conccurency is reached in some constraint - xbt_assert(cnst->concurrency_limit<0 || elem->variable->staged_weight==0 || lmm_cnstrs_min_concurrency_slack(elem->variable) < elem->variable->concurrency_share,"should not have staged variable!"); + elem = (lmm_element_t)_elem; + //We should have staged variables only if conccurency is reached in some constraint + xbt_assert(cnst->concurrency_limit<0 || elem->variable->staged_weight==0 || lmm_cnstrs_min_concurrency_slack(elem->variable) < elem->variable->concurrency_share,"should not have staged variable!"); } xbt_assert(cnst->concurrency_limit<0 || cnst->concurrency_limit >= concurrency,"concurrency check failed!"); diff --git a/src/surf/network_cm02.cpp b/src/surf/network_cm02.cpp index 3f7a944f20..5b672e7494 100644 --- a/src/surf/network_cm02.cpp +++ b/src/surf/network_cm02.cpp @@ -158,7 +158,7 @@ namespace simgrid { namespace surf { NetworkCm02Model::NetworkCm02Model() - :NetworkModel() + :NetworkModel() { char *optim = xbt_cfg_get_string(_sg_cfg_set, "network/optim"); int select = @@ -180,18 +180,18 @@ NetworkCm02Model::NetworkCm02Model() } if (!p_maxminSystem) - p_maxminSystem = lmm_system_new(m_selectiveUpdate); + p_maxminSystem = lmm_system_new(m_selectiveUpdate); routing_model_create(createLink("__loopback__", - 498000000, NULL, 0.000015, NULL, - 1 /*SURF_RESOURCE_ON*/, NULL, - SURF_LINK_FATPIPE, NULL)); + 498000000, NULL, 0.000015, NULL, + 1 /*SURF_RESOURCE_ON*/, NULL, + SURF_LINK_FATPIPE, NULL)); if (p_updateMechanism == UM_LAZY) { - p_actionHeap = xbt_heap_new(8, NULL); - xbt_heap_set_update_callback(p_actionHeap, surf_action_lmm_update_index_heap); - p_modifiedSet = new ActionLmmList(); - p_maxminSystem->keep_track = p_modifiedSet; + p_actionHeap = xbt_heap_new(8, NULL); + xbt_heap_set_update_callback(p_actionHeap, surf_action_lmm_update_index_heap); + p_modifiedSet = new ActionLmmList(); + p_maxminSystem->keep_track = p_modifiedSet; } } @@ -210,7 +210,7 @@ Link* NetworkCm02Model::createLink(const char *name, name); Link* link = new NetworkCm02Link(this, name, properties, p_maxminSystem, sg_bandwidth_factor * bw_initial, future_evt_set, - initiallyOn, state_trace, bw_initial, bw_trace, lat_initial, lat_trace, policy); + initiallyOn, state_trace, bw_initial, bw_trace, lat_initial, lat_trace, policy); Link::onCreation(link); return link; } @@ -273,7 +273,7 @@ void NetworkCm02Model::updateActionsStateFull(double now, double delta) for(ActionList::iterator it(running_actions->begin()), itNext=it, itend(running_actions->end()) ; it != itend ; it=itNext) { - ++itNext; + ++itNext; action = static_cast (&*it); XBT_DEBUG("Something happened to action %p", action); @@ -359,14 +359,14 @@ Action *NetworkCm02Model::communicate(NetCard *src, NetCard *dst, src->getName(), dst->getName()); xbt_dynar_foreach(route, i, _link) { - link = static_cast(_link); + link = static_cast(_link); if (link->isOff()) { failed = 1; break; } } if (sg_network_crosstraffic == 1) { - routing_platf->getRouteAndLatency(dst, src, &back_route, NULL); + routing_platf->getRouteAndLatency(dst, src, &back_route, NULL); xbt_dynar_foreach(back_route, i, _link) { link = static_cast(_link); if (link->isOff()) { @@ -397,7 +397,7 @@ Action *NetworkCm02Model::communicate(NetCard *src, NetCard *dst, } } xbt_dynar_foreach(route, i, _link) { - link = static_cast(_link); + link = static_cast(_link); double bb = bandwidthFactor(size) * link->getBandwidth(); bandwidth_bound = (bandwidth_bound < 0.0) ? bb : std::min(bandwidth_bound, bb); @@ -440,7 +440,7 @@ Action *NetworkCm02Model::communicate(NetCard *src, NetCard *dst, } xbt_dynar_foreach(route, i, _link) { - link = static_cast(_link); + link = static_cast(_link); lmm_expand(p_maxminSystem, link->getConstraint(), action->getVariable(), 1.0); } @@ -514,16 +514,16 @@ void NetworkCm02Model::addTraces(){ * Resource * ************/ NetworkCm02Link::NetworkCm02Link(NetworkCm02Model *model, const char *name, xbt_dict_t props, - lmm_system_t system, - double constraint_value, - sg_future_evt_set_t fes, - int initiallyOn, - tmgr_trace_t state_trace, - double metric_peak, - tmgr_trace_t metric_trace, - double lat_initial, - tmgr_trace_t lat_trace, - e_surf_link_sharing_policy_t policy) + lmm_system_t system, + double constraint_value, + sg_future_evt_set_t fes, + int initiallyOn, + tmgr_trace_t state_trace, + double metric_peak, + tmgr_trace_t metric_trace, + double lat_initial, + tmgr_trace_t lat_trace, + e_surf_link_sharing_policy_t policy) : Link(model, name, props, lmm_constraint_new(system, this, constraint_value), fes, state_trace) { if (initiallyOn) @@ -540,10 +540,10 @@ NetworkCm02Link::NetworkCm02Link(NetworkCm02Model *model, const char *name, xbt_ m_latCurrent = lat_initial; if (lat_trace) - p_latEvent = fes->add_trace(lat_trace, 0.0, this); + p_latEvent = fes->add_trace(lat_trace, 0.0, this); if (policy == SURF_LINK_FATPIPE) - lmm_constraint_shared(getConstraint()); + lmm_constraint_shared(getConstraint()); } diff --git a/src/surf/network_cm02.hpp b/src/surf/network_cm02.hpp index a7f479e26e..fb354f7aa9 100644 --- a/src/surf/network_cm02.hpp +++ b/src/surf/network_cm02.hpp @@ -47,19 +47,19 @@ public: NetworkCm02Model(); ~NetworkCm02Model() { } Link* createLink(const char *name, - double bw_initial, - tmgr_trace_t bw_trace, - double lat_initial, - tmgr_trace_t lat_trace, - int initiallyOn, - tmgr_trace_t state_trace, - e_surf_link_sharing_policy_t policy, - xbt_dict_t properties) override; + double bw_initial, + tmgr_trace_t bw_trace, + double lat_initial, + tmgr_trace_t lat_trace, + int initiallyOn, + tmgr_trace_t state_trace, + e_surf_link_sharing_policy_t policy, + xbt_dict_t properties) override; void addTraces() override; void updateActionsStateLazy(double now, double delta) override; void updateActionsStateFull(double now, double delta) override; Action *communicate(NetCard *src, NetCard *dst, - double size, double rate) override; + double size, double rate) override; bool shareResourcesIsIdempotent() override {return true;} virtual void gapAppend(double /*size*/, const Link* /*link*/, NetworkAction * /*action*/) {}; protected: @@ -73,15 +73,15 @@ protected: class NetworkCm02Link : public Link { public: NetworkCm02Link(NetworkCm02Model *model, const char *name, xbt_dict_t props, - lmm_system_t system, - double constraint_value, - sg_future_evt_set_t fes, - int initiallyOn, - tmgr_trace_t state_trace, - double metric_peak, - tmgr_trace_t metric_trace, - double lat_initial, - tmgr_trace_t lat_trace, + lmm_system_t system, + double constraint_value, + sg_future_evt_set_t fes, + int initiallyOn, + tmgr_trace_t state_trace, + double metric_peak, + tmgr_trace_t metric_trace, + double lat_initial, + tmgr_trace_t lat_trace, e_surf_link_sharing_policy_t policy); void updateState(tmgr_trace_iterator_t event_type, double value, double date) override; void updateBandwidth(double value, double date=surf_get_clock()) override; diff --git a/src/surf/network_constant.cpp b/src/surf/network_constant.cpp index 71ceece2f8..0e2b4b7a63 100644 --- a/src/surf/network_constant.cpp +++ b/src/surf/network_constant.cpp @@ -38,8 +38,8 @@ double NetworkConstantModel::shareResources(double /*now*/) ActionList *actionSet = getRunningActionSet(); for(ActionList::iterator it(actionSet->begin()), itend(actionSet->end()) - ; it != itend ; ++it) { - action = static_cast(&*it); + ; it != itend ; ++it) { + action = static_cast(&*it); if (action->m_latency > 0 && (min < 0 || action->m_latency < min)) min = action->m_latency; } @@ -54,7 +54,7 @@ void NetworkConstantModel::updateActionsState(double /*now*/, double delta) for(ActionList::iterator it(actionSet->begin()), itNext=it, itend(actionSet->end()) ; it != itend ; it=itNext) { ++itNext; - action = static_cast(&*it); + action = static_cast(&*it); if (action->m_latency > 0) { if (action->m_latency > delta) { double_update(&(action->m_latency), delta, sg_surf_precision); @@ -78,7 +78,7 @@ void NetworkConstantModel::updateActionsState(double /*now*/, double delta) } Action *NetworkConstantModel::communicate(NetCard *src, NetCard *dst, - double size, double rate) + double size, double rate) { char *src_name = src->getName(); char *dst_name = dst->getName(); @@ -99,8 +99,8 @@ int NetworkConstantAction::unref() { m_refcount--; if (!m_refcount) { - if (action_hook.is_linked()) - p_stateSet->erase(p_stateSet->iterator_to(*this)); + if (action_hook.is_linked()) + p_stateSet->erase(p_stateSet->iterator_to(*this)); delete this; return 1; } diff --git a/src/surf/network_constant.hpp b/src/surf/network_constant.hpp index bd9b1ee8f7..9ff6964354 100644 --- a/src/surf/network_constant.hpp +++ b/src/surf/network_constant.hpp @@ -56,12 +56,12 @@ public: : NetworkAction(model_, size, false) , m_latInit(latency) { - m_latency = latency; - if (m_latency <= 0.0) { - p_stateSet = getModel()->getDoneActionSet(); - p_stateSet->push_back(*this); - } - p_variable = NULL; + m_latency = latency; + if (m_latency <= 0.0) { + p_stateSet = getModel()->getDoneActionSet(); + p_stateSet->push_back(*this); + } + p_variable = NULL; }; int unref() override; void cancel() override; diff --git a/src/surf/network_ib.cpp b/src/surf/network_ib.cpp index 8771a39a89..5ddb5e2ff4 100644 --- a/src/surf/network_ib.cpp +++ b/src/surf/network_ib.cpp @@ -145,9 +145,9 @@ void NetworkIBModel::computeIBfactors(IBNode *root) { if(num_comm_out!=1){ if((*it)->destination->nbActiveCommsDown > 2)//number of comms sent to the receiving node - my_penalty_out = num_comm_out * Bs * ys; + my_penalty_out = num_comm_out * Bs * ys; else - my_penalty_out = num_comm_out * Bs; + my_penalty_out = num_comm_out * Bs; } max_penalty_out = std::max(max_penalty_out,my_penalty_out); @@ -160,8 +160,8 @@ void NetworkIBModel::computeIBfactors(IBNode *root) { int nb_comms = (*it)->destination->nbActiveCommsDown;//total number of incoming comms if(nb_comms!=1) my_penalty_in = ((*it)->destination->ActiveCommsDown)[root] //number of comm sent to dest by root node - * Be - * (*it)->destination->ActiveCommsDown.size();//number of different nodes sending to dest + * Be + * (*it)->destination->ActiveCommsDown.size();//number of different nodes sending to dest double penalty = std::max(my_penalty_in,max_penalty_out); @@ -214,11 +214,11 @@ void NetworkIBModel::updateIBfactors(NetworkAction *action, IBNode *from, IBNode to->nbActiveCommsDown--; for (std::vector::iterator it= from->ActiveCommsUp.begin(); - it != from->ActiveCommsUp.end(); ++it) { + it != from->ActiveCommsUp.end(); ++it) { if((*it)->action==action){ - comm=(*it); - from->ActiveCommsUp.erase(it); - break; + comm=(*it); + from->ActiveCommsUp.erase(it); + break; } } action->unref(); diff --git a/src/surf/network_interface.cpp b/src/surf/network_interface.cpp index 14cde62b76..1ed38ad77f 100644 --- a/src/surf/network_interface.cpp +++ b/src/surf/network_interface.cpp @@ -38,19 +38,19 @@ double sg_link_latency(Link *link){ return link->getLatency(); } void* sg_link_data(Link *link) { - return link->getData(); + return link->getData(); } void sg_link_data_set(Link *link,void *data) { - link->setData(data); + link->setData(data); } int sg_link_count(void) { - return Link::linksCount(); + return Link::linksCount(); } Link** sg_link_list(void) { - return Link::linksList(); + return Link::linksList(); } void sg_link_exit(void) { - Link::linksExit(); + Link::linksExit(); } } @@ -64,31 +64,31 @@ namespace surf { boost::unordered_map *Link::links = new boost::unordered_map(); Link *Link::byName(const char* name) { - Link * res = NULL; - try { - res = links->at(name); - } catch (std::out_of_range& e) {} + Link * res = NULL; + try { + res = links->at(name); + } catch (std::out_of_range& e) {} - return res; + return res; } /** @brief Returns the amount of links in the platform */ int Link::linksCount() { - return links->size(); + return links->size(); } /** @brief Returns a list of all existing links */ Link **Link::linksList() { - Link **res = xbt_new(Link*, (int)links->size()); - int i=0; - for (auto kv : *links) { - res[i++] = kv.second; - } - return res; + Link **res = xbt_new(Link*, (int)links->size()); + int i=0; + for (auto kv : *links) { + res[i++] = kv.second; + } + return res; } /** @brief destructor of the static data */ void Link::linksExit() { - for (auto kv : *links) - (kv.second)->destroy(); - delete links; + for (auto kv : *links) + (kv.second)->destroy(); + delete links; } /************* @@ -127,13 +127,13 @@ void netlink_parse_init(sg_platf_link_cbarg_t link){ link->state_trace, link->policy, link->properties); xbt_free(link_id); } else { - surf_network_model->createLink(link->id, - link->bandwidth, - link->bandwidth_trace, - link->latency, - link->latency_trace, - link->initiallyOn, - link->state_trace, link->policy, link->properties); + surf_network_model->createLink(link->id, + link->bandwidth, + link->bandwidth_trace, + link->latency, + link->latency_trace, + link->initiallyOn, + link->state_trace, link->policy, link->properties); } } @@ -200,9 +200,9 @@ Link::Link(simgrid::surf::NetworkModel *model, const char *name, xbt_dict_t prop } Link::Link(simgrid::surf::NetworkModel *model, const char *name, xbt_dict_t props, - lmm_constraint_t constraint, - sg_future_evt_set_t fes, - tmgr_trace_t state_trace) + lmm_constraint_t constraint, + sg_future_evt_set_t fes, + tmgr_trace_t state_trace) : Resource(model, name, constraint), PropertyHolder(props) { @@ -216,7 +216,7 @@ Link::Link(simgrid::surf::NetworkModel *model, const char *name, xbt_dict_t prop /** @brief use destroy() instead of this destructor */ Link::~Link() { - xbt_assert(currentlyDestroying_, "Don't delete Links directly. Call destroy() instead."); + xbt_assert(currentlyDestroying_, "Don't delete Links directly. Call destroy() instead."); } /** @brief Fire the require callbacks and destroy the object * @@ -224,11 +224,11 @@ Link::~Link() { */ void Link::destroy() { - if (!currentlyDestroying_) { - currentlyDestroying_ = true; - onDestruction(this); - delete this; - } + if (!currentlyDestroying_) { + currentlyDestroying_ = true; + onDestruction(this); + delete this; + } } bool Link::isUsed() diff --git a/src/surf/network_interface.hpp b/src/surf/network_interface.hpp index 0ead107f0f..eee8fae205 100644 --- a/src/surf/network_interface.hpp +++ b/src/surf/network_interface.hpp @@ -68,12 +68,12 @@ public: /** @brief Destructor */ ~NetworkModel() { - if (p_maxminSystem) - lmm_system_free(p_maxminSystem); - if (p_actionHeap) - xbt_heap_free(p_actionHeap); - if (p_modifiedSet) - delete p_modifiedSet; + if (p_maxminSystem) + lmm_system_free(p_maxminSystem); + if (p_actionHeap) + xbt_heap_free(p_actionHeap); + if (p_modifiedSet) + delete p_modifiedSet; } /** @@ -113,7 +113,7 @@ public: * @return The action representing the communication */ virtual Action *communicate(NetCard *src, NetCard *dst, - double size, double rate)=0; + double size, double rate)=0; /** @brief Function pointer to the function to use to solve the lmm_system_t * @@ -166,8 +166,8 @@ public: * @details A Link represents the link between two [hosts](\ref Host) */ class Link : - public simgrid::surf::Resource, - public simgrid::surf::PropertyHolder { + public simgrid::surf::Resource, + public simgrid::surf::PropertyHolder { public: /** * @brief Link constructor @@ -198,9 +198,9 @@ public: protected: ~Link(); public: - void destroy(); // Must be called instead of the destructor + void destroy(); // Must be called instead of the destructor private: - bool currentlyDestroying_ = false; + bool currentlyDestroying_ = false; public: /** @brief Callback signal fired when a new Link is created. diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index fd34a63232..9063b50303 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -285,14 +285,14 @@ NetworkNS3Model::~NetworkNS3Model() { } Link* NetworkNS3Model::createLink(const char *name, - double bw_initial, - tmgr_trace_t bw_trace, - double lat_initial, - tmgr_trace_t lat_trace, - int initiallyOn, - tmgr_trace_t state_trace, - e_surf_link_sharing_policy_t policy, - xbt_dict_t properties){ + double bw_initial, + tmgr_trace_t bw_trace, + double lat_initial, + tmgr_trace_t lat_trace, + int initiallyOn, + tmgr_trace_t state_trace, + e_surf_link_sharing_policy_t policy, + xbt_dict_t properties){ if (bw_trace) XBT_INFO("The NS3 network model doesn't support bandwidth state traces"); if (lat_trace) @@ -312,7 +312,7 @@ xbt_dynar_t NetworkNS3Model::getRoute(NetCard *src, NetCard *dst) } Action *NetworkNS3Model::communicate(NetCard *src, NetCard *dst, - double size, double rate) + double size, double rate) { XBT_DEBUG("Communicate from %s to %s", src->getName(), dst->getName()); NetworkNS3Action *action = new NetworkNS3Action(this, size, 0); @@ -372,23 +372,23 @@ void NetworkNS3Model::updateActionsState(double now, double delta) action->setRemains(action->getCost() - ns3_get_socket_sent(data)); if (TRACE_is_enabled() && - action->getState() == SURF_ACTION_RUNNING){ - double data_sent = ns3_get_socket_sent(data); - double data_delta_sent = data_sent - action->m_lastSent; - - xbt_dynar_t route = NULL; - - routing_platf->getRouteAndLatency (action->p_srcElm, action->p_dstElm, &route, NULL); - unsigned int i; - for (i = 0; i < xbt_dynar_length (route); i++){ - NetworkNS3Link* link = ((NetworkNS3Link*)xbt_dynar_get_ptr(route, i)); - TRACE_surf_link_set_utilization (link->getName(), - action->getCategory(), - (data_delta_sent)/delta, - now-delta, - delta); - } - action->m_lastSent = data_sent; + action->getState() == SURF_ACTION_RUNNING){ + double data_sent = ns3_get_socket_sent(data); + double data_delta_sent = data_sent - action->m_lastSent; + + xbt_dynar_t route = NULL; + + routing_platf->getRouteAndLatency (action->p_srcElm, action->p_dstElm, &route, NULL); + unsigned int i; + for (i = 0; i < xbt_dynar_length (route); i++){ + NetworkNS3Link* link = ((NetworkNS3Link*)xbt_dynar_get_ptr(route, i)); + TRACE_surf_link_set_utilization (link->getName(), + action->getCategory(), + (data_delta_sent)/delta, + now-delta, + delta); + } + action->m_lastSent = data_sent; } if(ns3_get_socket_is_finished(data) == 1){ @@ -415,7 +415,7 @@ void NetworkNS3Model::updateActionsState(double now, double delta) ************/ NetworkNS3Link::NetworkNS3Link(NetworkNS3Model *model, const char *name, xbt_dict_t props, - double bw_initial, double lat_initial) + double bw_initial, double lat_initial) : Link(model, name, props) , p_lat(bprintf("%f", lat_initial)) , p_bdw(bprintf("%f", bw_initial)) @@ -466,10 +466,10 @@ int NetworkNS3Action::unref() { m_refcount--; if (!m_refcount) { - if (action_hook.is_linked()) - p_stateSet->erase(p_stateSet->iterator_to(*this)); + if (action_hook.is_linked()) + p_stateSet->erase(p_stateSet->iterator_to(*this)); XBT_DEBUG ("Removing action %p", this); - delete this; + delete this; return 1; } return 0; diff --git a/src/surf/network_ns3.hpp b/src/surf/network_ns3.hpp index 1fea2d7bfa..0393388d0a 100644 --- a/src/surf/network_ns3.hpp +++ b/src/surf/network_ns3.hpp @@ -44,17 +44,17 @@ public: ~NetworkNS3Model(); Link* createLink(const char *name, - double bw_initial, - tmgr_trace_t bw_trace, - double lat_initial, - tmgr_trace_t lat_trace, - int initiallyOn, - tmgr_trace_t state_trace, - e_surf_link_sharing_policy_t policy, - xbt_dict_t properties); + double bw_initial, + tmgr_trace_t bw_trace, + double lat_initial, + tmgr_trace_t lat_trace, + int initiallyOn, + tmgr_trace_t state_trace, + e_surf_link_sharing_policy_t policy, + xbt_dict_t properties); xbt_dynar_t getRoute(NetCard *src, NetCard *dst); Action *communicate(NetCard *src, NetCard *dst, - double size, double rate); + double size, double rate); double shareResources(double now); void updateActionsState(double now, double delta); void addTraces(){DIE_IMPOSSIBLE;} @@ -67,7 +67,7 @@ public: class NetworkNS3Link : public Link { public: NetworkNS3Link(NetworkNS3Model *model, const char *name, xbt_dict_t props, - double bw_initial, double lat_initial); + double bw_initial, double lat_initial); ~NetworkNS3Link(); void updateState(tmgr_trace_iterator_t event_type, double value, double date); diff --git a/src/surf/network_smpi.cpp b/src/surf/network_smpi.cpp index c0d682f238..ff92bf92a7 100644 --- a/src/surf/network_smpi.cpp +++ b/src/surf/network_smpi.cpp @@ -96,7 +96,7 @@ namespace surf { NetworkSmpiModel::NetworkSmpiModel() : NetworkCm02Model() { - m_haveGap=true; + m_haveGap=true; } NetworkSmpiModel::~NetworkSmpiModel(){ diff --git a/src/surf/plugins/energy.cpp b/src/surf/plugins/energy.cpp index a2d14c2b7a..451dd832f4 100644 --- a/src/surf/plugins/energy.cpp +++ b/src/surf/plugins/energy.cpp @@ -66,35 +66,35 @@ simgrid::xbt::Extension HostEnergy::EXTENSION_ID void HostEnergy::update() { simgrid::surf::Host* surf_host = host->extension(); - double start_time = this->last_updated; - double finish_time = surf_get_clock(); - double cpu_load; - if (surf_host->p_cpu->m_speedPeak == 0) - // Some users declare a pstate of speed 0 flops (eg to model boot time). - // We consider that the machine is then fully loaded. That's arbitrary but it avoids a NaN - cpu_load = 1; - else - cpu_load = lmm_constraint_get_usage(surf_host->p_cpu->getConstraint()) + double start_time = this->last_updated; + double finish_time = surf_get_clock(); + double cpu_load; + if (surf_host->p_cpu->m_speedPeak == 0) + // Some users declare a pstate of speed 0 flops (eg to model boot time). + // We consider that the machine is then fully loaded. That's arbitrary but it avoids a NaN + cpu_load = 1; + else + cpu_load = lmm_constraint_get_usage(surf_host->p_cpu->getConstraint()) / surf_host->p_cpu->m_speedPeak; - if (cpu_load > 1) // A machine with a load > 1 consumes as much as a fully loaded machine, not mores - cpu_load = 1; + if (cpu_load > 1) // A machine with a load > 1 consumes as much as a fully loaded machine, not mores + cpu_load = 1; - double previous_energy = this->total_energy; + double previous_energy = this->total_energy; - double instantaneous_consumption; - if (host->is_off()) - instantaneous_consumption = this->watts_off; - else - instantaneous_consumption = this->getCurrentWattsValue(cpu_load); + double instantaneous_consumption; + if (host->is_off()) + instantaneous_consumption = this->watts_off; + else + instantaneous_consumption = this->getCurrentWattsValue(cpu_load); - double energy_this_step = instantaneous_consumption*(finish_time-start_time); + double energy_this_step = instantaneous_consumption*(finish_time-start_time); - this->total_energy = previous_energy + energy_this_step; - this->last_updated = finish_time; + this->total_energy = previous_energy + energy_this_step; + this->last_updated = finish_time; - XBT_DEBUG("[update_energy of %s] period=[%.2f-%.2f]; current power peak=%.0E flop/s; consumption change: %.2f J -> %.2f J", - surf_host->getName(), start_time, finish_time, surf_host->p_cpu->m_speedPeak, previous_energy, energy_this_step); + XBT_DEBUG("[update_energy of %s] period=[%.2f-%.2f]; current power peak=%.0E flop/s; consumption change: %.2f J -> %.2f J", + surf_host->getName(), start_time, finish_time, surf_host->p_cpu->m_speedPeak, previous_energy, energy_this_step); } HostEnergy::HostEnergy(simgrid::s4u::Host *ptr) : @@ -134,7 +134,7 @@ double HostEnergy::getWattMaxAt(int pstate) /** @brief Computes the power consumed by the host according to the current pstate and processor load */ double HostEnergy::getCurrentWattsValue(double cpu_load) { - xbt_assert(!power_range_watts_list.empty(), + xbt_assert(!power_range_watts_list.empty(), "No power range properties specified for host %s", host->name().c_str()); /* min_power corresponds to the idle power (cpu load = 0) */ @@ -143,53 +143,53 @@ double HostEnergy::getCurrentWattsValue(double cpu_load) double min_power = range.first; double max_power = range.second; double power_slope = max_power - min_power; - double current_power = min_power + cpu_load * power_slope; + double current_power = min_power + cpu_load * power_slope; - XBT_DEBUG("[get_current_watts] min_power=%f, max_power=%f, slope=%f", min_power, max_power, power_slope); - XBT_DEBUG("[get_current_watts] Current power (watts) = %f, load = %f", current_power, cpu_load); + XBT_DEBUG("[get_current_watts] min_power=%f, max_power=%f, slope=%f", min_power, max_power, power_slope); + XBT_DEBUG("[get_current_watts] Current power (watts) = %f, load = %f", current_power, cpu_load); - return current_power; + return current_power; } double HostEnergy::getConsumedEnergy() { - if (last_updated < surf_get_clock()) // We need to simcall this as it modifies the environment - simgrid::simix::kernel(std::bind(&HostEnergy::update, this)); + if (last_updated < surf_get_clock()) // We need to simcall this as it modifies the environment + simgrid::simix::kernel(std::bind(&HostEnergy::update, this)); - return total_energy; + return total_energy; } void HostEnergy::initWattsRangeList() { - if (host->properties() == NULL) - return; - char* all_power_values_str = + if (host->properties() == NULL) + return; + char* all_power_values_str = (char*)xbt_dict_get_or_null(host->properties(), "watt_per_state"); - if (all_power_values_str == NULL) - return; - - xbt_dynar_t all_power_values = xbt_str_split(all_power_values_str, ","); - int pstate_nb = xbt_dynar_length(all_power_values); - - for (int i=0; i< pstate_nb; i++) - { - /* retrieve the power values associated with the current pstate */ - xbt_dynar_t current_power_values = xbt_str_split(xbt_dynar_get_as(all_power_values, i, char*), ":"); - xbt_assert(xbt_dynar_length(current_power_values) > 1, - "Power properties incorrectly defined - " + if (all_power_values_str == NULL) + return; + + xbt_dynar_t all_power_values = xbt_str_split(all_power_values_str, ","); + int pstate_nb = xbt_dynar_length(all_power_values); + + for (int i=0; i< pstate_nb; i++) + { + /* retrieve the power values associated with the current pstate */ + xbt_dynar_t current_power_values = xbt_str_split(xbt_dynar_get_as(all_power_values, i, char*), ":"); + xbt_assert(xbt_dynar_length(current_power_values) > 1, + "Power properties incorrectly defined - " "could not retrieve min and max power values for host %s", - host->name().c_str()); + host->name().c_str()); - /* min_power corresponds to the idle power (cpu load = 0) */ - /* max_power is the power consumed at 100% cpu load */ + /* min_power corresponds to the idle power (cpu load = 0) */ + /* max_power is the power consumed at 100% cpu load */ power_range_watts_list.push_back(power_range( atof(xbt_dynar_get_as(current_power_values, 0, char*)), atof(xbt_dynar_get_as(current_power_values, 1, char*)) )); xbt_dynar_free(¤t_power_values); - } - xbt_dynar_free(&all_power_values); + } + xbt_dynar_free(&all_power_values); } } diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index c55dd85ea8..e2968b1da6 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -54,7 +54,7 @@ void sg_platf_exit(void) { void sg_platf_new_host(sg_platf_host_cbarg_t host) { xbt_assert(! sg_host_by_name(host->id), - "Refusing to create a second host named '%s'.", host->id); + "Refusing to create a second host named '%s'.", host->id); simgrid::surf::NetCard *net = NULL; simgrid::surf::As* current_routing = routing_get_current(); @@ -63,7 +63,7 @@ void sg_platf_new_host(sg_platf_host_cbarg_t host) sg_host_t h = simgrid::s4u::Host::by_name_or_create(host->id); simgrid::surf::Cpu *cpu = surf_cpu_model_pm->createCpu( - h, + h, host->speed_peak, host->pstate, host->speed_scale, @@ -166,13 +166,13 @@ void sg_platf_new_storage(sg_platf_storage_cbarg_t storage) ((storage_type_t) stype)->type_id, storage->content, storage->content_type, - storage->properties); + storage->properties); surf_storage_model->createStorage(storage->id, ((storage_type_t) stype)->type_id, storage->content, storage->content_type, - storage->properties, + storage->properties, storage->attach); } void sg_platf_new_storage_type(sg_platf_storage_type_cbarg_t storage_type){ diff --git a/src/surf/simgrid_dtd.c b/src/surf/simgrid_dtd.c index 03e2864746..e96012115c 100644 --- a/src/surf/simgrid_dtd.c +++ b/src/surf/simgrid_dtd.c @@ -111,15 +111,15 @@ typedef unsigned int flex_uint32_t; /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST -#else /* ! __cplusplus */ +#else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const @@ -217,83 +217,83 @@ extern FILE *surf_parse_in, *surf_parse_out; /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up surf_parse_text. */ \ + do \ + { \ + /* Undo effects of setting up surf_parse_text. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up surf_parse_text again */ \ - } \ - while ( 0 ) + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up surf_parse_text again */ \ + } \ + while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - yy_size_t yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + yy_size_t yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; - int yy_buffer_status; + int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via surf_parse_restart()), so that the user can continue scanning by - * just pointing surf_parse_in at a new input file. - */ + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via surf_parse_restart()), so that the user can continue scanning by + * just pointing surf_parse_in at a new input file. + */ #define YY_BUFFER_EOF_PENDING 2 - }; + }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ @@ -318,13 +318,13 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when surf_parse_text is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t surf_parse_leng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ /* Flag which is used to allow surf_parse_wrap()'s to do buffer switches * instead of setting up a fresh surf_parse_in. A bit of a hack ... @@ -356,24 +356,24 @@ void surf_parse_free (void * ); #define yy_new_buffer surf_parse__create_buffer #define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ surf_parse_ensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ + YY_CURRENT_BUFFER_LVALUE = \ surf_parse__create_buffer(surf_parse_in,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } #define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ + { \ + if ( ! YY_CURRENT_BUFFER ){\ surf_parse_ensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ + YY_CURRENT_BUFFER_LVALUE = \ surf_parse__create_buffer(surf_parse_in,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) @@ -404,21 +404,21 @@ static void yy_fatal_error (yyconst char msg[] ); * corresponding action - sets up surf_parse_text. */ #define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - surf_parse_leng = (size_t) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; + (yytext_ptr) = yy_bp; \ + surf_parse_leng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 595 #define YY_END_OF_BUFFER 596 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; static yyconst flex_int16_t yy_accept[3466] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -4999,23 +4999,23 @@ short int surfxml_trace___connect_trace_isset; /* XML state. */ #ifdef FLEX_DEBUG -# define ENTER(state) debug_enter(state,#state) -# define LEAVE debug_leave() -# define SET(state) debug_set(state,#state) +# define ENTER(state) debug_enter(state,#state) +# define LEAVE debug_leave() +# define SET(state) debug_set(state,#state) static void debug_enter(int, const char*); static void debug_leave(void); static void debug_set(int, const char*); #else -# define ENTER(state) (yy_push_state(state)) -# define LEAVE (yy_pop_state()) -# define SET(state) BEGIN(state) +# define ENTER(state) (yy_push_state(state)) +# define LEAVE (yy_pop_state()) +# define SET(state) BEGIN(state) #endif /* Generic actions. */ -#define SKIP /*skip*/ +#define SKIP /*skip*/ #define SUCCEED CLEANUP; return 0 -#define FAIL return fail +#define FAIL return fail static int fail(const char*, ...); enum {flexml_max_err_msg_size = 512}; @@ -5052,12 +5052,12 @@ static int inext = 1; static int ck_blimit() { if (bnext >= blimit) { - blimit += FLEXML_BUFFERSTACKSIZE + 2; - { - char *temp = (char *) realloc(surfxml_bufferstack, blimit); - assert(temp); - surfxml_bufferstack = temp; - } + blimit += FLEXML_BUFFERSTACKSIZE + 2; + { + char *temp = (char *) realloc(surfxml_bufferstack, blimit); + assert(temp); + surfxml_bufferstack = temp; + } } return 0; } @@ -5066,12 +5066,12 @@ static int ck_blimit() static int ck_ilimit() { if (inext >= ilimit) { - ilimit += FLEXML_INDEXSTACKSIZE + 2; - { - int *temp = (int *) realloc(indexstack, ilimit); - assert(temp); - indexstack = temp; - } + ilimit += FLEXML_INDEXSTACKSIZE + 2; + { + int *temp = (int *) realloc(indexstack, ilimit); + assert(temp); + indexstack = temp; + } } return 0; } @@ -5085,16 +5085,16 @@ static void surfxml_bufferliteral(char c, int* pp, const char* text) assert(s && e && s <= e); ++s; while (s < e) { - if (isspace(*s)) { - BUFFERPUTC(' '); - do ++s; while (s < e && isspace(*s)); - } else - BUFFERPUTC(*s++); + if (isspace(*s)) { + BUFFERPUTC(' '); + do ++s; while (s < e && isspace(*s)); + } else + BUFFERPUTC(*s++); } } else { const char *s = text; while (*s) - BUFFERPUTC(*s++); + BUFFERPUTC(*s++); } BUFFERDONE; } @@ -5128,18 +5128,18 @@ static int popbuffer(void) /* Miscellaneous. */ /* Parser states (flex `exclusive start conditions'): * - * PROLOG the XML prolog of the document before - * DOCTYPE the XML prolog of the document after - * EPILOG after the root element - * INCOMMENT inside an XML comment - * INPI inside an XML PI - * VALUE1 inside a '...'-delimited literal - * VALUE2 inside a "..."-delimited literal - * CDATA inside a section. - * ROOT_ expect root element - * AL_ inside the attribute list for - * IN_ inside a with element contents (ready for end tag) - * IMPOSSIBLE dummy to permit disabling rules; must be last + * PROLOG the XML prolog of the document before + * DOCTYPE the XML prolog of the document after + * EPILOG after the root element + * INCOMMENT inside an XML comment + * INPI inside an XML PI + * VALUE1 inside a '...'-delimited literal + * VALUE2 inside a "..."-delimited literal + * CDATA inside a section. + * ROOT_ expect root element + * AL_ inside the attribute list for + * IN_ inside a with element contents (ready for end tag) + * IMPOSSIBLE dummy to permit disabling rules; must be last */ /* State names. */ @@ -5380,33 +5380,33 @@ static int input (void ); */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( surf_parse_in )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( surf_parse_in ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, surf_parse_in))==0 && ferror(surf_parse_in)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(surf_parse_in); \ - } \ - }\ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + size_t n; \ + for ( n = 0; n < max_size && \ + (c = getc( surf_parse_in )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( surf_parse_in ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, surf_parse_in))==0 && ferror(surf_parse_in)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(surf_parse_in); \ + } \ + }\ \ #endif @@ -5455,43 +5455,43 @@ extern int surf_parse_lex (void); #endif #define YY_RULE_SETUP \ - YY_USER_ACTION + YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; - if ( !(yy_init) ) - { - (yy_init) = 1; + if ( !(yy_init) ) + { + (yy_init) = 1; #ifdef YY_USER_INIT - YY_USER_INIT; + YY_USER_INIT; #endif - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ - if ( ! surf_parse_in ) - surf_parse_in = stdin; + if ( ! surf_parse_in ) + surf_parse_in = stdin; - if ( ! surf_parse_out ) - surf_parse_out = stdout; + if ( ! surf_parse_out ) + surf_parse_out = stdout; - if ( ! YY_CURRENT_BUFFER ) { - surf_parse_ensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - surf_parse__create_buffer(surf_parse_in,YY_BUF_SIZE ); - } + if ( ! YY_CURRENT_BUFFER ) { + surf_parse_ensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + surf_parse__create_buffer(surf_parse_in,YY_BUF_SIZE ); + } - surf_parse__load_buffer_state( ); - } + surf_parse__load_buffer_state( ); + } - { + { /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */ SET(PROLOG); @@ -5650,146 +5650,146 @@ YY_DECL /* COMMENTS and PIs: handled uniformly for efficiency. */ - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); - /* Support of surf_parse_text. */ - *yy_cp = (yy_hold_char); + /* Support of surf_parse_text. */ + *yy_cp = (yy_hold_char); - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; - yy_current_state = (yy_start); + yy_current_state = (yy_start); yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 3466 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 12512 ); + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 3466 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 12512 ); yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) - { - yy_size_t yyl; - for ( yyl = 0; yyl < surf_parse_leng; ++yyl ) - if ( surf_parse_text[yyl] == '\n' ) - + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) + { + yy_size_t yyl; + for ( yyl = 0; yyl < surf_parse_leng; ++yyl ) + if ( surf_parse_text[yyl] == '\n' ) + surf_parse_lineno++; ; - } + } -do_action: /* This label is used only to access EOF actions. */ +do_action: /* This label is used only to access EOF actions. */ - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; case 1: YY_RULE_SETUP ENTER(INCOMMENT); - YY_BREAK + YY_BREAK case 2: YY_RULE_SETUP ENTER(INPI); - YY_BREAK + YY_BREAK case 3: YY_RULE_SETUP LEAVE; - YY_BREAK + YY_BREAK case 4: case 5: case 6: /* rule 6 can match eol */ YY_RULE_SETUP SKIP; - YY_BREAK + YY_BREAK case YY_STATE_EOF(INCOMMENT): FAIL("EOF in comment."); - YY_BREAK + YY_BREAK case 7: YY_RULE_SETUP LEAVE; - YY_BREAK + YY_BREAK case 8: case 9: /* rule 9 can match eol */ YY_RULE_SETUP SKIP; - YY_BREAK + YY_BREAK case YY_STATE_EOF(INPI): FAIL("EOF in PI (processing instruction)."); - YY_BREAK + YY_BREAK /* SPACES: skipped uniformly */ case 10: /* rule 10 can match eol */ YY_RULE_SETUP SKIP; - YY_BREAK + YY_BREAK /* PROLOG: determine root element and process it. */ case 11: /* rule 11 can match eol */ YY_RULE_SETUP SET(DOCTYPE); - YY_BREAK + YY_BREAK case 12: /* rule 12 can match eol */ YY_RULE_SETUP FAIL("Bad declaration %s.",surf_parse_text); - YY_BREAK + YY_BREAK case 13: /* rule 13 can match eol */ YY_RULE_SETUP SET(ROOT_surfxml_platform); - YY_BREAK + YY_BREAK case 14: /* rule 14 can match eol */ YY_RULE_SETUP FAIL("Bad declaration %s.",surf_parse_text); - YY_BREAK + YY_BREAK case 15: YY_RULE_SETUP FAIL("Unexpected character `%c' in prolog.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(PROLOG): case YY_STATE_EOF(DOCTYPE): FAIL("EOF in prolog."); - YY_BREAK + YY_BREAK /* RULES DERIVED FROM DTD. */ /* */ @@ -5797,7 +5797,7 @@ case 16: /* rule 16 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 17: /* rule 17 can match eol */ YY_RULE_SETUP @@ -5806,24 +5806,24 @@ YY_RULE_SETUP surfxml_platform_version_isset = 0; ENTER(AL_surfxml_platform); pushbuffer(0); } - YY_BREAK + YY_BREAK case 18: /* rule 18 can match eol */ YY_RULE_SETUP if (surfxml_platform_version_isset != 0) {FAIL("Multiple definition of attribute version in ");} surfxml_platform_version_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_version); - YY_BREAK + YY_BREAK case 19: /* rule 19 can match eol */ YY_RULE_SETUP if (surfxml_platform_version_isset != 0) {FAIL("Multiple definition of attribute version in ");} surfxml_platform_version_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_version); - YY_BREAK + YY_BREAK case 20: YY_RULE_SETUP { LEAVE; STag_surfxml_platform();surfxml_pcdata_ix = 0; ENTER(S_surfxml_platform); } - YY_BREAK + YY_BREAK case 21: YY_RULE_SETUP { @@ -5832,18 +5832,18 @@ YY_RULE_SETUP case ROOT_surfxml_platform: SET(EPILOG); break; } } - YY_BREAK + YY_BREAK case 22: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of platform element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 23: YY_RULE_SETUP FAIL("Bad attribute `%s' in `platform' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_platform): FAIL("EOF in attribute list of `platform' element."); - YY_BREAK + YY_BREAK case 24: /* rule 24 can match eol */ @@ -5856,16 +5856,16 @@ YY_RULE_SETUP case ROOT_surfxml_platform: SET(EPILOG); break; } } - YY_BREAK + YY_BREAK case 25: /* rule 25 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 26: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(S_surfxml_platform_1): case YY_STATE_EOF(S_surfxml_platform_6): case YY_STATE_EOF(S_surfxml_platform_4): @@ -5874,13 +5874,13 @@ case YY_STATE_EOF(S_surfxml_platform): case YY_STATE_EOF(E_surfxml_platform): case YY_STATE_EOF(S_surfxml_platform_8): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 27: /* rule 27 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 28: /* rule 28 can match eol */ YY_RULE_SETUP @@ -5889,25 +5889,25 @@ YY_RULE_SETUP surfxml_include_file_isset = 0; ENTER(AL_surfxml_include); pushbuffer(0); } - YY_BREAK + YY_BREAK case 29: /* rule 29 can match eol */ YY_RULE_SETUP if (surfxml_include_file_isset != 0) {FAIL("Multiple definition of attribute file in ");} surfxml_include_file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_include_file); - YY_BREAK + YY_BREAK case 30: /* rule 30 can match eol */ YY_RULE_SETUP if (surfxml_include_file_isset != 0) {FAIL("Multiple definition of attribute file in ");} surfxml_include_file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_include_file); - YY_BREAK + YY_BREAK case 31: YY_RULE_SETUP { if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element."); LEAVE; STag_surfxml_include();surfxml_pcdata_ix = 0; ENTER(S_surfxml_include); } - YY_BREAK + YY_BREAK case 32: YY_RULE_SETUP { @@ -5919,18 +5919,18 @@ YY_RULE_SETUP case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break; } } - YY_BREAK + YY_BREAK case 33: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of include element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 34: YY_RULE_SETUP FAIL("Bad attribute `%s' in `include' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_include): FAIL("EOF in attribute list of `include' element."); - YY_BREAK + YY_BREAK case 35: /* rule 35 can match eol */ @@ -5945,27 +5945,27 @@ YY_RULE_SETUP case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break; } } - YY_BREAK + YY_BREAK case 36: /* rule 36 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 37: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(S_surfxml_include_2): case YY_STATE_EOF(E_surfxml_include): case YY_STATE_EOF(S_surfxml_include): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 38: /* rule 38 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 39: /* rule 39 can match eol */ YY_RULE_SETUP @@ -5978,38 +5978,38 @@ YY_RULE_SETUP surfxml_trace_periodicity_isset = 0; ENTER(AL_surfxml_trace); pushbuffer(0); } - YY_BREAK + YY_BREAK case 40: /* rule 40 can match eol */ YY_RULE_SETUP if (surfxml_trace_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_trace_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_id); - YY_BREAK + YY_BREAK case 41: /* rule 41 can match eol */ YY_RULE_SETUP if (surfxml_trace_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_trace_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_id); - YY_BREAK + YY_BREAK case 42: /* rule 42 can match eol */ YY_RULE_SETUP if (surfxml_trace_file_isset != 0) {FAIL("Multiple definition of attribute file in ");} surfxml_trace_file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_file); - YY_BREAK + YY_BREAK case 43: /* rule 43 can match eol */ YY_RULE_SETUP if (surfxml_trace_file_isset != 0) {FAIL("Multiple definition of attribute file in ");} surfxml_trace_file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_file); - YY_BREAK + YY_BREAK case 44: /* rule 44 can match eol */ YY_RULE_SETUP if (surfxml_trace_periodicity_isset != 0) {FAIL("Multiple definition of attribute periodicity in ");} surfxml_trace_periodicity_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_periodicity); - YY_BREAK + YY_BREAK case 45: /* rule 45 can match eol */ YY_RULE_SETUP if (surfxml_trace_periodicity_isset != 0) {FAIL("Multiple definition of attribute periodicity in ");} surfxml_trace_periodicity_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_periodicity); - YY_BREAK + YY_BREAK case 46: YY_RULE_SETUP { @@ -6017,7 +6017,7 @@ YY_RULE_SETUP if (!AX_surfxml_trace_periodicity) FAIL("Required attribute `periodicity' not set for `trace' element."); LEAVE; STag_surfxml_trace();pushbuffer(surfxml_pcdata_ix); BUFFERSET(surfxml_pcdata_ix);; ENTER(IN_trace); } - YY_BREAK + YY_BREAK case 47: YY_RULE_SETUP { @@ -6030,18 +6030,18 @@ YY_RULE_SETUP case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break; } } - YY_BREAK + YY_BREAK case 48: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of trace element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 49: YY_RULE_SETUP FAIL("Bad attribute `%s' in `trace' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_trace): FAIL("EOF in attribute list of `trace' element."); - YY_BREAK + YY_BREAK case 50: /* rule 50 can match eol */ @@ -6058,21 +6058,21 @@ YY_RULE_SETUP case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break; } } - YY_BREAK + YY_BREAK case 51: /* rule 51 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(IN_trace): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 52: /* rule 52 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 53: /* rule 53 can match eol */ YY_RULE_SETUP @@ -6095,106 +6095,106 @@ YY_RULE_SETUP surfxml_random_generator_isset = 0; ENTER(AL_surfxml_random); pushbuffer(0); } - YY_BREAK + YY_BREAK case 54: /* rule 54 can match eol */ YY_RULE_SETUP if (surfxml_random_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_random_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_random_id); - YY_BREAK + YY_BREAK case 55: /* rule 55 can match eol */ YY_RULE_SETUP if (surfxml_random_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_random_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_random_id); - YY_BREAK + YY_BREAK case 56: /* rule 56 can match eol */ YY_RULE_SETUP if (surfxml_random_min_isset != 0) {FAIL("Multiple definition of attribute min in ");} surfxml_random_min_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_random_min); - YY_BREAK + YY_BREAK case 57: /* rule 57 can match eol */ YY_RULE_SETUP if (surfxml_random_min_isset != 0) {FAIL("Multiple definition of attribute min in ");} surfxml_random_min_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_random_min); - YY_BREAK + YY_BREAK case 58: /* rule 58 can match eol */ YY_RULE_SETUP if (surfxml_random_max_isset != 0) {FAIL("Multiple definition of attribute max in ");} surfxml_random_max_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_random_max); - YY_BREAK + YY_BREAK case 59: /* rule 59 can match eol */ YY_RULE_SETUP if (surfxml_random_max_isset != 0) {FAIL("Multiple definition of attribute max in ");} surfxml_random_max_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_random_max); - YY_BREAK + YY_BREAK case 60: /* rule 60 can match eol */ YY_RULE_SETUP if (surfxml_random_mean_isset != 0) {FAIL("Multiple definition of attribute mean in ");} surfxml_random_mean_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_random_mean); - YY_BREAK + YY_BREAK case 61: /* rule 61 can match eol */ YY_RULE_SETUP if (surfxml_random_mean_isset != 0) {FAIL("Multiple definition of attribute mean in ");} surfxml_random_mean_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_random_mean); - YY_BREAK + YY_BREAK case 62: /* rule 62 can match eol */ YY_RULE_SETUP if (surfxml_random_std___deviation_isset != 0) {FAIL("Multiple definition of attribute std_deviation in ");} surfxml_random_std___deviation_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_random_std___deviation); - YY_BREAK + YY_BREAK case 63: /* rule 63 can match eol */ YY_RULE_SETUP if (surfxml_random_std___deviation_isset != 0) {FAIL("Multiple definition of attribute std_deviation in ");} surfxml_random_std___deviation_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_random_std___deviation); - YY_BREAK + YY_BREAK case 64: /* rule 64 can match eol */ YY_RULE_SETUP if (surfxml_random_seed_isset != 0) {FAIL("Multiple definition of attribute seed in ");} surfxml_random_seed_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_random_seed); - YY_BREAK + YY_BREAK case 65: /* rule 65 can match eol */ YY_RULE_SETUP if (surfxml_random_seed_isset != 0) {FAIL("Multiple definition of attribute seed in ");} surfxml_random_seed_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_random_seed); - YY_BREAK + YY_BREAK case 66: /* rule 66 can match eol */ YY_RULE_SETUP if (surfxml_random_radical_isset != 0) {FAIL("Multiple definition of attribute radical in ");} surfxml_random_radical_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_random_radical); - YY_BREAK + YY_BREAK case 67: /* rule 67 can match eol */ YY_RULE_SETUP if (surfxml_random_radical_isset != 0) {FAIL("Multiple definition of attribute radical in ");} surfxml_random_radical_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_random_radical); - YY_BREAK + YY_BREAK case 68: /* rule 68 can match eol */ case 69: /* rule 69 can match eol */ YY_RULE_SETUP A_surfxml_random_generator = A_surfxml_random_generator_DRAND48; - YY_BREAK + YY_BREAK case 70: /* rule 70 can match eol */ case 71: /* rule 71 can match eol */ YY_RULE_SETUP A_surfxml_random_generator = A_surfxml_random_generator_RAND; - YY_BREAK + YY_BREAK case 72: /* rule 72 can match eol */ case 73: /* rule 73 can match eol */ YY_RULE_SETUP A_surfxml_random_generator = A_surfxml_random_generator_RNGSTREAM; - YY_BREAK + YY_BREAK case 74: /* rule 74 can match eol */ case 75: /* rule 75 can match eol */ YY_RULE_SETUP A_surfxml_random_generator = A_surfxml_random_generator_NONE; - YY_BREAK + YY_BREAK case 76: YY_RULE_SETUP { @@ -6205,7 +6205,7 @@ YY_RULE_SETUP if (!AX_surfxml_random_std___deviation) FAIL("Required attribute `std_deviation' not set for `random' element."); LEAVE; STag_surfxml_random();surfxml_pcdata_ix = 0; ENTER(E_surfxml_random); } - YY_BREAK + YY_BREAK case 77: YY_RULE_SETUP { @@ -6219,18 +6219,18 @@ YY_RULE_SETUP case S_surfxml_platform: case S_surfxml_platform_2: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break; } } - YY_BREAK + YY_BREAK case 78: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of random element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 79: YY_RULE_SETUP FAIL("Bad attribute `%s' in `random' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_random): FAIL("EOF in attribute list of `random' element."); - YY_BREAK + YY_BREAK case 80: /* rule 80 can match eol */ @@ -6243,25 +6243,25 @@ YY_RULE_SETUP case S_surfxml_platform: case S_surfxml_platform_2: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break; } } - YY_BREAK + YY_BREAK case 81: /* rule 81 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 82: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(E_surfxml_random): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 83: /* rule 83 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 84: /* rule 84 can match eol */ YY_RULE_SETUP @@ -6274,7 +6274,7 @@ YY_RULE_SETUP surfxml_trace___connect_element_isset = 0; ENTER(AL_surfxml_trace___connect); pushbuffer(0); } - YY_BREAK + YY_BREAK case 85: /* rule 85 can match eol */ @@ -6282,55 +6282,55 @@ case 86: /* rule 86 can match eol */ YY_RULE_SETUP A_surfxml_trace___connect_kind = A_surfxml_trace___connect_kind_HOST___AVAIL; - YY_BREAK + YY_BREAK case 87: /* rule 87 can match eol */ case 88: /* rule 88 can match eol */ YY_RULE_SETUP A_surfxml_trace___connect_kind = A_surfxml_trace___connect_kind_POWER; - YY_BREAK + YY_BREAK case 89: /* rule 89 can match eol */ case 90: /* rule 90 can match eol */ YY_RULE_SETUP A_surfxml_trace___connect_kind = A_surfxml_trace___connect_kind_LINK___AVAIL; - YY_BREAK + YY_BREAK case 91: /* rule 91 can match eol */ case 92: /* rule 92 can match eol */ YY_RULE_SETUP A_surfxml_trace___connect_kind = A_surfxml_trace___connect_kind_BANDWIDTH; - YY_BREAK + YY_BREAK case 93: /* rule 93 can match eol */ case 94: /* rule 94 can match eol */ YY_RULE_SETUP A_surfxml_trace___connect_kind = A_surfxml_trace___connect_kind_LATENCY; - YY_BREAK + YY_BREAK case 95: /* rule 95 can match eol */ YY_RULE_SETUP if (surfxml_trace___connect_trace_isset != 0) {FAIL("Multiple definition of attribute trace in ");} surfxml_trace___connect_trace_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_trace___connect_trace); - YY_BREAK + YY_BREAK case 96: /* rule 96 can match eol */ YY_RULE_SETUP if (surfxml_trace___connect_trace_isset != 0) {FAIL("Multiple definition of attribute trace in ");} surfxml_trace___connect_trace_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_trace___connect_trace); - YY_BREAK + YY_BREAK case 97: /* rule 97 can match eol */ YY_RULE_SETUP if (surfxml_trace___connect_element_isset != 0) {FAIL("Multiple definition of attribute element in ");} surfxml_trace___connect_element_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_trace___connect_element); - YY_BREAK + YY_BREAK case 98: /* rule 98 can match eol */ YY_RULE_SETUP if (surfxml_trace___connect_element_isset != 0) {FAIL("Multiple definition of attribute element in ");} surfxml_trace___connect_element_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_trace___connect_element); - YY_BREAK + YY_BREAK case 99: YY_RULE_SETUP { @@ -6338,7 +6338,7 @@ YY_RULE_SETUP if (!AX_surfxml_trace___connect_element) FAIL("Required attribute `element' not set for `trace_connect' element."); LEAVE; STag_surfxml_trace___connect();surfxml_pcdata_ix = 0; ENTER(E_surfxml_trace___connect); } - YY_BREAK + YY_BREAK case 100: YY_RULE_SETUP { @@ -6351,18 +6351,18 @@ YY_RULE_SETUP case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break; } } - YY_BREAK + YY_BREAK case 101: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of trace_connect element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 102: YY_RULE_SETUP FAIL("Bad attribute `%s' in `trace_connect' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_trace___connect): FAIL("EOF in attribute list of `trace_connect' element."); - YY_BREAK + YY_BREAK case 103: /* rule 103 can match eol */ @@ -6377,25 +6377,25 @@ YY_RULE_SETUP case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break; } } - YY_BREAK + YY_BREAK case 104: /* rule 104 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 105: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(E_surfxml_trace___connect): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 106: /* rule 106 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 107: /* rule 107 can match eol */ YY_RULE_SETUP @@ -6406,81 +6406,81 @@ YY_RULE_SETUP surfxml_AS_routing_isset = 0; ENTER(AL_surfxml_AS); pushbuffer(0); } - YY_BREAK + YY_BREAK case 108: /* rule 108 can match eol */ YY_RULE_SETUP if (surfxml_AS_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_AS_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_AS_id); - YY_BREAK + YY_BREAK case 109: /* rule 109 can match eol */ YY_RULE_SETUP if (surfxml_AS_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_AS_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_AS_id); - YY_BREAK + YY_BREAK case 110: /* rule 110 can match eol */ case 111: /* rule 111 can match eol */ YY_RULE_SETUP A_surfxml_AS_routing = A_surfxml_AS_routing_Full; - YY_BREAK + YY_BREAK case 112: /* rule 112 can match eol */ case 113: /* rule 113 can match eol */ YY_RULE_SETUP A_surfxml_AS_routing = A_surfxml_AS_routing_Floyd; - YY_BREAK + YY_BREAK case 114: /* rule 114 can match eol */ case 115: /* rule 115 can match eol */ YY_RULE_SETUP A_surfxml_AS_routing = A_surfxml_AS_routing_Dijkstra; - YY_BREAK + YY_BREAK case 116: /* rule 116 can match eol */ case 117: /* rule 117 can match eol */ YY_RULE_SETUP A_surfxml_AS_routing = A_surfxml_AS_routing_DijkstraCache; - YY_BREAK + YY_BREAK case 118: /* rule 118 can match eol */ case 119: /* rule 119 can match eol */ YY_RULE_SETUP A_surfxml_AS_routing = A_surfxml_AS_routing_None; - YY_BREAK + YY_BREAK case 120: /* rule 120 can match eol */ case 121: /* rule 121 can match eol */ YY_RULE_SETUP A_surfxml_AS_routing = A_surfxml_AS_routing_Vivaldi; - YY_BREAK + YY_BREAK case 122: /* rule 122 can match eol */ case 123: /* rule 123 can match eol */ YY_RULE_SETUP A_surfxml_AS_routing = A_surfxml_AS_routing_Cluster; - YY_BREAK + YY_BREAK case 124: /* rule 124 can match eol */ case 125: /* rule 125 can match eol */ YY_RULE_SETUP A_surfxml_AS_routing = A_surfxml_AS_routing_Cluster___torus; - YY_BREAK + YY_BREAK case 126: /* rule 126 can match eol */ case 127: /* rule 127 can match eol */ YY_RULE_SETUP A_surfxml_AS_routing = A_surfxml_AS_routing_Cluster___fat___tree; - YY_BREAK + YY_BREAK case 128: YY_RULE_SETUP { @@ -6488,7 +6488,7 @@ YY_RULE_SETUP if (!AX_surfxml_AS_routing) FAIL("Required attribute `routing' not set for `AS' element."); LEAVE; STag_surfxml_AS();surfxml_pcdata_ix = 0; ENTER(S_surfxml_AS); } - YY_BREAK + YY_BREAK case 129: YY_RULE_SETUP { @@ -6501,18 +6501,18 @@ YY_RULE_SETUP case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break; } } - YY_BREAK + YY_BREAK case 130: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of AS element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 131: YY_RULE_SETUP FAIL("Bad attribute `%s' in `AS' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_AS): FAIL("EOF in attribute list of `AS' element."); - YY_BREAK + YY_BREAK case 132: /* rule 132 can match eol */ @@ -6527,16 +6527,16 @@ YY_RULE_SETUP case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break; } } - YY_BREAK + YY_BREAK case 133: /* rule 133 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 134: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(S_surfxml_AS_8): case YY_STATE_EOF(E_surfxml_AS): case YY_STATE_EOF(S_surfxml_AS): @@ -6545,13 +6545,13 @@ case YY_STATE_EOF(S_surfxml_AS_6): case YY_STATE_EOF(S_surfxml_AS_3): case YY_STATE_EOF(S_surfxml_AS_1): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 135: /* rule 135 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 136: /* rule 136 can match eol */ YY_RULE_SETUP @@ -6568,58 +6568,58 @@ YY_RULE_SETUP surfxml_storage___type_content___type_isset = 0; ENTER(AL_surfxml_storage___type); pushbuffer(0); } - YY_BREAK + YY_BREAK case 137: /* rule 137 can match eol */ YY_RULE_SETUP if (surfxml_storage___type_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_storage___type_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage___type_id); - YY_BREAK + YY_BREAK case 138: /* rule 138 can match eol */ YY_RULE_SETUP if (surfxml_storage___type_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_storage___type_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage___type_id); - YY_BREAK + YY_BREAK case 139: /* rule 139 can match eol */ YY_RULE_SETUP if (surfxml_storage___type_model_isset != 0) {FAIL("Multiple definition of attribute model in ");} surfxml_storage___type_model_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage___type_model); - YY_BREAK + YY_BREAK case 140: /* rule 140 can match eol */ YY_RULE_SETUP if (surfxml_storage___type_model_isset != 0) {FAIL("Multiple definition of attribute model in ");} surfxml_storage___type_model_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage___type_model); - YY_BREAK + YY_BREAK case 141: /* rule 141 can match eol */ YY_RULE_SETUP if (surfxml_storage___type_size_isset != 0) {FAIL("Multiple definition of attribute size in ");} surfxml_storage___type_size_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage___type_size); - YY_BREAK + YY_BREAK case 142: /* rule 142 can match eol */ YY_RULE_SETUP if (surfxml_storage___type_size_isset != 0) {FAIL("Multiple definition of attribute size in ");} surfxml_storage___type_size_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage___type_size); - YY_BREAK + YY_BREAK case 143: /* rule 143 can match eol */ YY_RULE_SETUP if (surfxml_storage___type_content_isset != 0) {FAIL("Multiple definition of attribute content in ");} surfxml_storage___type_content_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage___type_content); - YY_BREAK + YY_BREAK case 144: /* rule 144 can match eol */ YY_RULE_SETUP if (surfxml_storage___type_content_isset != 0) {FAIL("Multiple definition of attribute content in ");} surfxml_storage___type_content_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage___type_content); - YY_BREAK + YY_BREAK case 145: /* rule 145 can match eol */ YY_RULE_SETUP if (surfxml_storage___type_content___type_isset != 0) {FAIL("Multiple definition of attribute content_type in ");} surfxml_storage___type_content___type_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage___type_content___type); - YY_BREAK + YY_BREAK case 146: /* rule 146 can match eol */ YY_RULE_SETUP if (surfxml_storage___type_content___type_isset != 0) {FAIL("Multiple definition of attribute content_type in ");} surfxml_storage___type_content___type_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage___type_content___type); - YY_BREAK + YY_BREAK case 147: YY_RULE_SETUP { @@ -6628,7 +6628,7 @@ YY_RULE_SETUP if (!AX_surfxml_storage___type_size) FAIL("Required attribute `size' not set for `storage_type' element."); LEAVE; STag_surfxml_storage___type();surfxml_pcdata_ix = 0; ENTER(S_surfxml_storage___type); } - YY_BREAK + YY_BREAK case 148: YY_RULE_SETUP { @@ -6640,18 +6640,18 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; } } - YY_BREAK + YY_BREAK case 149: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of storage_type element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 150: YY_RULE_SETUP FAIL("Bad attribute `%s' in `storage_type' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_storage___type): FAIL("EOF in attribute list of `storage_type' element."); - YY_BREAK + YY_BREAK case 151: /* rule 151 can match eol */ @@ -6664,27 +6664,27 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; } } - YY_BREAK + YY_BREAK case 152: /* rule 152 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 153: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(S_surfxml_storage___type_2): case YY_STATE_EOF(S_surfxml_storage___type): case YY_STATE_EOF(E_surfxml_storage___type): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 154: /* rule 154 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 155: /* rule 155 can match eol */ YY_RULE_SETUP @@ -6695,28 +6695,28 @@ YY_RULE_SETUP surfxml_mount_name_isset = 0; ENTER(AL_surfxml_mount); pushbuffer(0); } - YY_BREAK + YY_BREAK case 156: /* rule 156 can match eol */ YY_RULE_SETUP if (surfxml_mount_storageId_isset != 0) {FAIL("Multiple definition of attribute storageId in ");} surfxml_mount_storageId_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_mount_storageId); - YY_BREAK + YY_BREAK case 157: /* rule 157 can match eol */ YY_RULE_SETUP if (surfxml_mount_storageId_isset != 0) {FAIL("Multiple definition of attribute storageId in ");} surfxml_mount_storageId_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_mount_storageId); - YY_BREAK + YY_BREAK case 158: /* rule 158 can match eol */ YY_RULE_SETUP if (surfxml_mount_name_isset != 0) {FAIL("Multiple definition of attribute name in ");} surfxml_mount_name_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_mount_name); - YY_BREAK + YY_BREAK case 159: /* rule 159 can match eol */ YY_RULE_SETUP if (surfxml_mount_name_isset != 0) {FAIL("Multiple definition of attribute name in ");} surfxml_mount_name_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_mount_name); - YY_BREAK + YY_BREAK case 160: YY_RULE_SETUP { @@ -6724,7 +6724,7 @@ YY_RULE_SETUP if (!AX_surfxml_mount_name) FAIL("Required attribute `name' not set for `mount' element."); LEAVE; STag_surfxml_mount();surfxml_pcdata_ix = 0; ENTER(E_surfxml_mount); } - YY_BREAK + YY_BREAK case 161: YY_RULE_SETUP { @@ -6735,18 +6735,18 @@ YY_RULE_SETUP case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break; } } - YY_BREAK + YY_BREAK case 162: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of mount element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 163: YY_RULE_SETUP FAIL("Bad attribute `%s' in `mount' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_mount): FAIL("EOF in attribute list of `mount' element."); - YY_BREAK + YY_BREAK case 164: /* rule 164 can match eol */ @@ -6759,25 +6759,25 @@ YY_RULE_SETUP case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break; } } - YY_BREAK + YY_BREAK case 165: /* rule 165 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 166: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(E_surfxml_mount): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 167: /* rule 167 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 168: /* rule 168 can match eol */ YY_RULE_SETUP @@ -6788,28 +6788,28 @@ YY_RULE_SETUP surfxml_mstorage_name_isset = 0; ENTER(AL_surfxml_mstorage); pushbuffer(0); } - YY_BREAK + YY_BREAK case 169: /* rule 169 can match eol */ YY_RULE_SETUP if (surfxml_mstorage_typeId_isset != 0) {FAIL("Multiple definition of attribute typeId in ");} surfxml_mstorage_typeId_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_mstorage_typeId); - YY_BREAK + YY_BREAK case 170: /* rule 170 can match eol */ YY_RULE_SETUP if (surfxml_mstorage_typeId_isset != 0) {FAIL("Multiple definition of attribute typeId in ");} surfxml_mstorage_typeId_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_mstorage_typeId); - YY_BREAK + YY_BREAK case 171: /* rule 171 can match eol */ YY_RULE_SETUP if (surfxml_mstorage_name_isset != 0) {FAIL("Multiple definition of attribute name in ");} surfxml_mstorage_name_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_mstorage_name); - YY_BREAK + YY_BREAK case 172: /* rule 172 can match eol */ YY_RULE_SETUP if (surfxml_mstorage_name_isset != 0) {FAIL("Multiple definition of attribute name in ");} surfxml_mstorage_name_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_mstorage_name); - YY_BREAK + YY_BREAK case 173: YY_RULE_SETUP { @@ -6817,7 +6817,7 @@ YY_RULE_SETUP if (!AX_surfxml_mstorage_name) FAIL("Required attribute `name' not set for `mstorage' element."); LEAVE; STag_surfxml_mstorage();surfxml_pcdata_ix = 0; ENTER(E_surfxml_mstorage); } - YY_BREAK + YY_BREAK case 174: YY_RULE_SETUP { @@ -6828,18 +6828,18 @@ YY_RULE_SETUP case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break; } } - YY_BREAK + YY_BREAK case 175: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of mstorage element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 176: YY_RULE_SETUP FAIL("Bad attribute `%s' in `mstorage' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_mstorage): FAIL("EOF in attribute list of `mstorage' element."); - YY_BREAK + YY_BREAK case 177: /* rule 177 can match eol */ @@ -6852,25 +6852,25 @@ YY_RULE_SETUP case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break; } } - YY_BREAK + YY_BREAK case 178: /* rule 178 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 179: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(E_surfxml_mstorage): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 180: /* rule 180 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 181: /* rule 181 can match eol */ YY_RULE_SETUP @@ -6895,102 +6895,102 @@ YY_RULE_SETUP surfxml_host_pstate_isset = 0; ENTER(AL_surfxml_host); pushbuffer(0); } - YY_BREAK + YY_BREAK case 182: /* rule 182 can match eol */ YY_RULE_SETUP if (surfxml_host_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_host_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_id); - YY_BREAK + YY_BREAK case 183: /* rule 183 can match eol */ YY_RULE_SETUP if (surfxml_host_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_host_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_id); - YY_BREAK + YY_BREAK case 184: /* rule 184 can match eol */ YY_RULE_SETUP if (surfxml_host_power_isset != 0) {FAIL("Multiple definition of attribute power in ");} surfxml_host_power_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_power); - YY_BREAK + YY_BREAK case 185: /* rule 185 can match eol */ YY_RULE_SETUP if (surfxml_host_power_isset != 0) {FAIL("Multiple definition of attribute power in ");} surfxml_host_power_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_power); - YY_BREAK + YY_BREAK case 186: /* rule 186 can match eol */ YY_RULE_SETUP if (surfxml_host_core_isset != 0) {FAIL("Multiple definition of attribute core in ");} surfxml_host_core_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_core); - YY_BREAK + YY_BREAK case 187: /* rule 187 can match eol */ YY_RULE_SETUP if (surfxml_host_core_isset != 0) {FAIL("Multiple definition of attribute core in ");} surfxml_host_core_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_core); - YY_BREAK + YY_BREAK case 188: /* rule 188 can match eol */ YY_RULE_SETUP if (surfxml_host_availability_isset != 0) {FAIL("Multiple definition of attribute availability in ");} surfxml_host_availability_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability); - YY_BREAK + YY_BREAK case 189: /* rule 189 can match eol */ YY_RULE_SETUP if (surfxml_host_availability_isset != 0) {FAIL("Multiple definition of attribute availability in ");} surfxml_host_availability_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability); - YY_BREAK + YY_BREAK case 190: /* rule 190 can match eol */ YY_RULE_SETUP if (surfxml_host_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in ");} surfxml_host_availability___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability___file); - YY_BREAK + YY_BREAK case 191: /* rule 191 can match eol */ YY_RULE_SETUP if (surfxml_host_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in ");} surfxml_host_availability___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability___file); - YY_BREAK + YY_BREAK case 192: /* rule 192 can match eol */ case 193: /* rule 193 can match eol */ YY_RULE_SETUP A_surfxml_host_state = A_surfxml_host_state_ON; - YY_BREAK + YY_BREAK case 194: /* rule 194 can match eol */ case 195: /* rule 195 can match eol */ YY_RULE_SETUP A_surfxml_host_state = A_surfxml_host_state_OFF; - YY_BREAK + YY_BREAK case 196: /* rule 196 can match eol */ YY_RULE_SETUP if (surfxml_host_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in ");} surfxml_host_state___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_state___file); - YY_BREAK + YY_BREAK case 197: /* rule 197 can match eol */ YY_RULE_SETUP if (surfxml_host_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in ");} surfxml_host_state___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_state___file); - YY_BREAK + YY_BREAK case 198: /* rule 198 can match eol */ YY_RULE_SETUP if (surfxml_host_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in ");} surfxml_host_coordinates_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_coordinates); - YY_BREAK + YY_BREAK case 199: /* rule 199 can match eol */ YY_RULE_SETUP if (surfxml_host_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in ");} surfxml_host_coordinates_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_coordinates); - YY_BREAK + YY_BREAK case 200: /* rule 200 can match eol */ YY_RULE_SETUP if (surfxml_host_pstate_isset != 0) {FAIL("Multiple definition of attribute pstate in ");} surfxml_host_pstate_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_pstate); - YY_BREAK + YY_BREAK case 201: /* rule 201 can match eol */ YY_RULE_SETUP if (surfxml_host_pstate_isset != 0) {FAIL("Multiple definition of attribute pstate in ");} surfxml_host_pstate_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_pstate); - YY_BREAK + YY_BREAK case 202: YY_RULE_SETUP { @@ -6998,7 +6998,7 @@ YY_RULE_SETUP if (!AX_surfxml_host_power) FAIL("Required attribute `power' not set for `host' element."); LEAVE; STag_surfxml_host();surfxml_pcdata_ix = 0; ENTER(S_surfxml_host); } - YY_BREAK + YY_BREAK case 203: YY_RULE_SETUP { @@ -7009,18 +7009,18 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; } } - YY_BREAK + YY_BREAK case 204: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of host element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 205: YY_RULE_SETUP FAIL("Bad attribute `%s' in `host' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_host): FAIL("EOF in attribute list of `host' element."); - YY_BREAK + YY_BREAK case 206: /* rule 206 can match eol */ @@ -7033,27 +7033,27 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; } } - YY_BREAK + YY_BREAK case 207: /* rule 207 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 208: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(S_surfxml_host_2): case YY_STATE_EOF(S_surfxml_host): case YY_STATE_EOF(E_surfxml_host): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 209: /* rule 209 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 210: /* rule 210 can match eol */ YY_RULE_SETUP @@ -7070,58 +7070,58 @@ YY_RULE_SETUP surfxml_storage_attach_isset = 0; ENTER(AL_surfxml_storage); pushbuffer(0); } - YY_BREAK + YY_BREAK case 211: /* rule 211 can match eol */ YY_RULE_SETUP if (surfxml_storage_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_storage_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_id); - YY_BREAK + YY_BREAK case 212: /* rule 212 can match eol */ YY_RULE_SETUP if (surfxml_storage_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_storage_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_id); - YY_BREAK + YY_BREAK case 213: /* rule 213 can match eol */ YY_RULE_SETUP if (surfxml_storage_typeId_isset != 0) {FAIL("Multiple definition of attribute typeId in ");} surfxml_storage_typeId_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_typeId); - YY_BREAK + YY_BREAK case 214: /* rule 214 can match eol */ YY_RULE_SETUP if (surfxml_storage_typeId_isset != 0) {FAIL("Multiple definition of attribute typeId in ");} surfxml_storage_typeId_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_typeId); - YY_BREAK + YY_BREAK case 215: /* rule 215 can match eol */ YY_RULE_SETUP if (surfxml_storage_content_isset != 0) {FAIL("Multiple definition of attribute content in ");} surfxml_storage_content_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_content); - YY_BREAK + YY_BREAK case 216: /* rule 216 can match eol */ YY_RULE_SETUP if (surfxml_storage_content_isset != 0) {FAIL("Multiple definition of attribute content in ");} surfxml_storage_content_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_content); - YY_BREAK + YY_BREAK case 217: /* rule 217 can match eol */ YY_RULE_SETUP if (surfxml_storage_content___type_isset != 0) {FAIL("Multiple definition of attribute content_type in ");} surfxml_storage_content___type_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_content___type); - YY_BREAK + YY_BREAK case 218: /* rule 218 can match eol */ YY_RULE_SETUP if (surfxml_storage_content___type_isset != 0) {FAIL("Multiple definition of attribute content_type in ");} surfxml_storage_content___type_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_content___type); - YY_BREAK + YY_BREAK case 219: /* rule 219 can match eol */ YY_RULE_SETUP if (surfxml_storage_attach_isset != 0) {FAIL("Multiple definition of attribute attach in ");} surfxml_storage_attach_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_attach); - YY_BREAK + YY_BREAK case 220: /* rule 220 can match eol */ YY_RULE_SETUP if (surfxml_storage_attach_isset != 0) {FAIL("Multiple definition of attribute attach in ");} surfxml_storage_attach_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_attach); - YY_BREAK + YY_BREAK case 221: YY_RULE_SETUP { @@ -7130,7 +7130,7 @@ YY_RULE_SETUP if (!AX_surfxml_storage_attach) FAIL("Required attribute `attach' not set for `storage' element."); LEAVE; STag_surfxml_storage();surfxml_pcdata_ix = 0; ENTER(S_surfxml_storage); } - YY_BREAK + YY_BREAK case 222: YY_RULE_SETUP { @@ -7142,18 +7142,18 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; } } - YY_BREAK + YY_BREAK case 223: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of storage element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 224: YY_RULE_SETUP FAIL("Bad attribute `%s' in `storage' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_storage): FAIL("EOF in attribute list of `storage' element."); - YY_BREAK + YY_BREAK case 225: /* rule 225 can match eol */ @@ -7166,27 +7166,27 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; } } - YY_BREAK + YY_BREAK case 226: /* rule 226 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 227: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(S_surfxml_storage_2): case YY_STATE_EOF(S_surfxml_storage): case YY_STATE_EOF(E_surfxml_storage): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 228: /* rule 228 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 229: /* rule 229 can match eol */ YY_RULE_SETUP @@ -7195,25 +7195,25 @@ YY_RULE_SETUP surfxml_gpu_name_isset = 0; ENTER(AL_surfxml_gpu); pushbuffer(0); } - YY_BREAK + YY_BREAK case 230: /* rule 230 can match eol */ YY_RULE_SETUP if (surfxml_gpu_name_isset != 0) {FAIL("Multiple definition of attribute name in ");} surfxml_gpu_name_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_gpu_name); - YY_BREAK + YY_BREAK case 231: /* rule 231 can match eol */ YY_RULE_SETUP if (surfxml_gpu_name_isset != 0) {FAIL("Multiple definition of attribute name in ");} surfxml_gpu_name_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_gpu_name); - YY_BREAK + YY_BREAK case 232: YY_RULE_SETUP { if (!AX_surfxml_gpu_name) FAIL("Required attribute `name' not set for `gpu' element."); LEAVE; STag_surfxml_gpu();surfxml_pcdata_ix = 0; ENTER(E_surfxml_gpu); } - YY_BREAK + YY_BREAK case 233: YY_RULE_SETUP { @@ -7223,18 +7223,18 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; } } - YY_BREAK + YY_BREAK case 234: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of gpu element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 235: YY_RULE_SETUP FAIL("Bad attribute `%s' in `gpu' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_gpu): FAIL("EOF in attribute list of `gpu' element."); - YY_BREAK + YY_BREAK case 236: /* rule 236 can match eol */ @@ -7247,25 +7247,25 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; } } - YY_BREAK + YY_BREAK case 237: /* rule 237 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 238: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(E_surfxml_gpu): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 239: /* rule 239 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 240: /* rule 240 can match eol */ YY_RULE_SETUP @@ -7278,38 +7278,38 @@ YY_RULE_SETUP surfxml_host___link_down_isset = 0; ENTER(AL_surfxml_host___link); pushbuffer(0); } - YY_BREAK + YY_BREAK case 241: /* rule 241 can match eol */ YY_RULE_SETUP if (surfxml_host___link_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_host___link_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host___link_id); - YY_BREAK + YY_BREAK case 242: /* rule 242 can match eol */ YY_RULE_SETUP if (surfxml_host___link_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_host___link_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host___link_id); - YY_BREAK + YY_BREAK case 243: /* rule 243 can match eol */ YY_RULE_SETUP if (surfxml_host___link_up_isset != 0) {FAIL("Multiple definition of attribute up in ");} surfxml_host___link_up_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host___link_up); - YY_BREAK + YY_BREAK case 244: /* rule 244 can match eol */ YY_RULE_SETUP if (surfxml_host___link_up_isset != 0) {FAIL("Multiple definition of attribute up in ");} surfxml_host___link_up_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host___link_up); - YY_BREAK + YY_BREAK case 245: /* rule 245 can match eol */ YY_RULE_SETUP if (surfxml_host___link_down_isset != 0) {FAIL("Multiple definition of attribute down in ");} surfxml_host___link_down_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host___link_down); - YY_BREAK + YY_BREAK case 246: /* rule 246 can match eol */ YY_RULE_SETUP if (surfxml_host___link_down_isset != 0) {FAIL("Multiple definition of attribute down in ");} surfxml_host___link_down_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host___link_down); - YY_BREAK + YY_BREAK case 247: YY_RULE_SETUP { @@ -7318,7 +7318,7 @@ YY_RULE_SETUP if (!AX_surfxml_host___link_down) FAIL("Required attribute `down' not set for `host_link' element."); LEAVE; STag_surfxml_host___link();surfxml_pcdata_ix = 0; ENTER(E_surfxml_host___link); } - YY_BREAK + YY_BREAK case 248: YY_RULE_SETUP { @@ -7330,18 +7330,18 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; } } - YY_BREAK + YY_BREAK case 249: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of host_link element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 250: YY_RULE_SETUP FAIL("Bad attribute `%s' in `host_link' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_host___link): FAIL("EOF in attribute list of `host_link' element."); - YY_BREAK + YY_BREAK case 251: /* rule 251 can match eol */ @@ -7354,25 +7354,25 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; } } - YY_BREAK + YY_BREAK case 252: /* rule 252 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 253: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(E_surfxml_host___link): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 254: /* rule 254 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 255: /* rule 255 can match eol */ YY_RULE_SETUP @@ -7419,234 +7419,234 @@ YY_RULE_SETUP surfxml_cluster_loopback___lat_isset = 0; ENTER(AL_surfxml_cluster); pushbuffer(0); } - YY_BREAK + YY_BREAK case 256: /* rule 256 can match eol */ YY_RULE_SETUP if (surfxml_cluster_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_cluster_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_id); - YY_BREAK + YY_BREAK case 257: /* rule 257 can match eol */ YY_RULE_SETUP if (surfxml_cluster_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_cluster_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_id); - YY_BREAK + YY_BREAK case 258: /* rule 258 can match eol */ YY_RULE_SETUP if (surfxml_cluster_prefix_isset != 0) {FAIL("Multiple definition of attribute prefix in ");} surfxml_cluster_prefix_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_prefix); - YY_BREAK + YY_BREAK case 259: /* rule 259 can match eol */ YY_RULE_SETUP if (surfxml_cluster_prefix_isset != 0) {FAIL("Multiple definition of attribute prefix in ");} surfxml_cluster_prefix_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_prefix); - YY_BREAK + YY_BREAK case 260: /* rule 260 can match eol */ YY_RULE_SETUP if (surfxml_cluster_suffix_isset != 0) {FAIL("Multiple definition of attribute suffix in ");} surfxml_cluster_suffix_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_suffix); - YY_BREAK + YY_BREAK case 261: /* rule 261 can match eol */ YY_RULE_SETUP if (surfxml_cluster_suffix_isset != 0) {FAIL("Multiple definition of attribute suffix in ");} surfxml_cluster_suffix_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_suffix); - YY_BREAK + YY_BREAK case 262: /* rule 262 can match eol */ YY_RULE_SETUP if (surfxml_cluster_radical_isset != 0) {FAIL("Multiple definition of attribute radical in ");} surfxml_cluster_radical_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_radical); - YY_BREAK + YY_BREAK case 263: /* rule 263 can match eol */ YY_RULE_SETUP if (surfxml_cluster_radical_isset != 0) {FAIL("Multiple definition of attribute radical in ");} surfxml_cluster_radical_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_radical); - YY_BREAK + YY_BREAK case 264: /* rule 264 can match eol */ YY_RULE_SETUP if (surfxml_cluster_power_isset != 0) {FAIL("Multiple definition of attribute power in ");} surfxml_cluster_power_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_power); - YY_BREAK + YY_BREAK case 265: /* rule 265 can match eol */ YY_RULE_SETUP if (surfxml_cluster_power_isset != 0) {FAIL("Multiple definition of attribute power in ");} surfxml_cluster_power_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_power); - YY_BREAK + YY_BREAK case 266: /* rule 266 can match eol */ YY_RULE_SETUP if (surfxml_cluster_core_isset != 0) {FAIL("Multiple definition of attribute core in ");} surfxml_cluster_core_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_core); - YY_BREAK + YY_BREAK case 267: /* rule 267 can match eol */ YY_RULE_SETUP if (surfxml_cluster_core_isset != 0) {FAIL("Multiple definition of attribute core in ");} surfxml_cluster_core_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_core); - YY_BREAK + YY_BREAK case 268: /* rule 268 can match eol */ YY_RULE_SETUP if (surfxml_cluster_bw_isset != 0) {FAIL("Multiple definition of attribute bw in ");} surfxml_cluster_bw_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bw); - YY_BREAK + YY_BREAK case 269: /* rule 269 can match eol */ YY_RULE_SETUP if (surfxml_cluster_bw_isset != 0) {FAIL("Multiple definition of attribute bw in ");} surfxml_cluster_bw_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bw); - YY_BREAK + YY_BREAK case 270: /* rule 270 can match eol */ YY_RULE_SETUP if (surfxml_cluster_lat_isset != 0) {FAIL("Multiple definition of attribute lat in ");} surfxml_cluster_lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_lat); - YY_BREAK + YY_BREAK case 271: /* rule 271 can match eol */ YY_RULE_SETUP if (surfxml_cluster_lat_isset != 0) {FAIL("Multiple definition of attribute lat in ");} surfxml_cluster_lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_lat); - YY_BREAK + YY_BREAK case 272: /* rule 272 can match eol */ case 273: /* rule 273 can match eol */ YY_RULE_SETUP A_surfxml_cluster_sharing___policy = A_surfxml_cluster_sharing___policy_SHARED; - YY_BREAK + YY_BREAK case 274: /* rule 274 can match eol */ case 275: /* rule 275 can match eol */ YY_RULE_SETUP A_surfxml_cluster_sharing___policy = A_surfxml_cluster_sharing___policy_FULLDUPLEX; - YY_BREAK + YY_BREAK case 276: /* rule 276 can match eol */ case 277: /* rule 277 can match eol */ YY_RULE_SETUP A_surfxml_cluster_sharing___policy = A_surfxml_cluster_sharing___policy_FATPIPE; - YY_BREAK + YY_BREAK case 278: /* rule 278 can match eol */ case 279: /* rule 279 can match eol */ YY_RULE_SETUP A_surfxml_cluster_topology = A_surfxml_cluster_topology_FLAT; - YY_BREAK + YY_BREAK case 280: /* rule 280 can match eol */ case 281: /* rule 281 can match eol */ YY_RULE_SETUP A_surfxml_cluster_topology = A_surfxml_cluster_topology_TORUS; - YY_BREAK + YY_BREAK case 282: /* rule 282 can match eol */ case 283: /* rule 283 can match eol */ YY_RULE_SETUP A_surfxml_cluster_topology = A_surfxml_cluster_topology_FAT___TREE; - YY_BREAK + YY_BREAK case 284: /* rule 284 can match eol */ YY_RULE_SETUP if (surfxml_cluster_topo___parameters_isset != 0) {FAIL("Multiple definition of attribute topo_parameters in ");} surfxml_cluster_topo___parameters_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_topo___parameters); - YY_BREAK + YY_BREAK case 285: /* rule 285 can match eol */ YY_RULE_SETUP if (surfxml_cluster_topo___parameters_isset != 0) {FAIL("Multiple definition of attribute topo_parameters in ");} surfxml_cluster_topo___parameters_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_topo___parameters); - YY_BREAK + YY_BREAK case 286: /* rule 286 can match eol */ YY_RULE_SETUP if (surfxml_cluster_bb___bw_isset != 0) {FAIL("Multiple definition of attribute bb_bw in ");} surfxml_cluster_bb___bw_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bb___bw); - YY_BREAK + YY_BREAK case 287: /* rule 287 can match eol */ YY_RULE_SETUP if (surfxml_cluster_bb___bw_isset != 0) {FAIL("Multiple definition of attribute bb_bw in ");} surfxml_cluster_bb___bw_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bb___bw); - YY_BREAK + YY_BREAK case 288: /* rule 288 can match eol */ YY_RULE_SETUP if (surfxml_cluster_bb___lat_isset != 0) {FAIL("Multiple definition of attribute bb_lat in ");} surfxml_cluster_bb___lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bb___lat); - YY_BREAK + YY_BREAK case 289: /* rule 289 can match eol */ YY_RULE_SETUP if (surfxml_cluster_bb___lat_isset != 0) {FAIL("Multiple definition of attribute bb_lat in ");} surfxml_cluster_bb___lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bb___lat); - YY_BREAK + YY_BREAK case 290: /* rule 290 can match eol */ case 291: /* rule 291 can match eol */ YY_RULE_SETUP A_surfxml_cluster_bb___sharing___policy = A_surfxml_cluster_bb___sharing___policy_SHARED; - YY_BREAK + YY_BREAK case 292: /* rule 292 can match eol */ case 293: /* rule 293 can match eol */ YY_RULE_SETUP A_surfxml_cluster_bb___sharing___policy = A_surfxml_cluster_bb___sharing___policy_FATPIPE; - YY_BREAK + YY_BREAK case 294: /* rule 294 can match eol */ YY_RULE_SETUP if (surfxml_cluster_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in ");} surfxml_cluster_availability___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_availability___file); - YY_BREAK + YY_BREAK case 295: /* rule 295 can match eol */ YY_RULE_SETUP if (surfxml_cluster_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in ");} surfxml_cluster_availability___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_availability___file); - YY_BREAK + YY_BREAK case 296: /* rule 296 can match eol */ YY_RULE_SETUP if (surfxml_cluster_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in ");} surfxml_cluster_state___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_state___file); - YY_BREAK + YY_BREAK case 297: /* rule 297 can match eol */ YY_RULE_SETUP if (surfxml_cluster_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in ");} surfxml_cluster_state___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_state___file); - YY_BREAK + YY_BREAK case 298: /* rule 298 can match eol */ YY_RULE_SETUP if (surfxml_cluster_router___id_isset != 0) {FAIL("Multiple definition of attribute router_id in ");} surfxml_cluster_router___id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_router___id); - YY_BREAK + YY_BREAK case 299: /* rule 299 can match eol */ YY_RULE_SETUP if (surfxml_cluster_router___id_isset != 0) {FAIL("Multiple definition of attribute router_id in ");} surfxml_cluster_router___id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_router___id); - YY_BREAK + YY_BREAK case 300: /* rule 300 can match eol */ YY_RULE_SETUP if (surfxml_cluster_limiter___link_isset != 0) {FAIL("Multiple definition of attribute limiter_link in ");} surfxml_cluster_limiter___link_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_limiter___link); - YY_BREAK + YY_BREAK case 301: /* rule 301 can match eol */ YY_RULE_SETUP if (surfxml_cluster_limiter___link_isset != 0) {FAIL("Multiple definition of attribute limiter_link in ");} surfxml_cluster_limiter___link_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_limiter___link); - YY_BREAK + YY_BREAK case 302: /* rule 302 can match eol */ YY_RULE_SETUP if (surfxml_cluster_loopback___bw_isset != 0) {FAIL("Multiple definition of attribute loopback_bw in ");} surfxml_cluster_loopback___bw_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_loopback___bw); - YY_BREAK + YY_BREAK case 303: /* rule 303 can match eol */ YY_RULE_SETUP if (surfxml_cluster_loopback___bw_isset != 0) {FAIL("Multiple definition of attribute loopback_bw in ");} surfxml_cluster_loopback___bw_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_loopback___bw); - YY_BREAK + YY_BREAK case 304: /* rule 304 can match eol */ YY_RULE_SETUP if (surfxml_cluster_loopback___lat_isset != 0) {FAIL("Multiple definition of attribute loopback_lat in ");} surfxml_cluster_loopback___lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_loopback___lat); - YY_BREAK + YY_BREAK case 305: /* rule 305 can match eol */ YY_RULE_SETUP if (surfxml_cluster_loopback___lat_isset != 0) {FAIL("Multiple definition of attribute loopback_lat in ");} surfxml_cluster_loopback___lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_loopback___lat); - YY_BREAK + YY_BREAK case 306: YY_RULE_SETUP { @@ -7659,7 +7659,7 @@ YY_RULE_SETUP if (!AX_surfxml_cluster_lat) FAIL("Required attribute `lat' not set for `cluster' element."); LEAVE; STag_surfxml_cluster();surfxml_pcdata_ix = 0; ENTER(S_surfxml_cluster); } - YY_BREAK + YY_BREAK case 307: YY_RULE_SETUP { @@ -7677,18 +7677,18 @@ YY_RULE_SETUP case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break; } } - YY_BREAK + YY_BREAK case 308: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of cluster element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 309: YY_RULE_SETUP FAIL("Bad attribute `%s' in `cluster' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_cluster): FAIL("EOF in attribute list of `cluster' element."); - YY_BREAK + YY_BREAK case 310: /* rule 310 can match eol */ @@ -7703,27 +7703,27 @@ YY_RULE_SETUP case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break; } } - YY_BREAK + YY_BREAK case 311: /* rule 311 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 312: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(S_surfxml_cluster): case YY_STATE_EOF(S_surfxml_cluster_2): case YY_STATE_EOF(E_surfxml_cluster): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 313: /* rule 313 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 314: /* rule 314 can match eol */ YY_RULE_SETUP @@ -7744,78 +7744,78 @@ YY_RULE_SETUP surfxml_cabinet_lat_isset = 0; ENTER(AL_surfxml_cabinet); pushbuffer(0); } - YY_BREAK + YY_BREAK case 315: /* rule 315 can match eol */ YY_RULE_SETUP if (surfxml_cabinet_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_cabinet_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_id); - YY_BREAK + YY_BREAK case 316: /* rule 316 can match eol */ YY_RULE_SETUP if (surfxml_cabinet_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_cabinet_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_id); - YY_BREAK + YY_BREAK case 317: /* rule 317 can match eol */ YY_RULE_SETUP if (surfxml_cabinet_prefix_isset != 0) {FAIL("Multiple definition of attribute prefix in ");} surfxml_cabinet_prefix_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_prefix); - YY_BREAK + YY_BREAK case 318: /* rule 318 can match eol */ YY_RULE_SETUP if (surfxml_cabinet_prefix_isset != 0) {FAIL("Multiple definition of attribute prefix in ");} surfxml_cabinet_prefix_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_prefix); - YY_BREAK + YY_BREAK case 319: /* rule 319 can match eol */ YY_RULE_SETUP if (surfxml_cabinet_suffix_isset != 0) {FAIL("Multiple definition of attribute suffix in ");} surfxml_cabinet_suffix_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_suffix); - YY_BREAK + YY_BREAK case 320: /* rule 320 can match eol */ YY_RULE_SETUP if (surfxml_cabinet_suffix_isset != 0) {FAIL("Multiple definition of attribute suffix in ");} surfxml_cabinet_suffix_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_suffix); - YY_BREAK + YY_BREAK case 321: /* rule 321 can match eol */ YY_RULE_SETUP if (surfxml_cabinet_radical_isset != 0) {FAIL("Multiple definition of attribute radical in ");} surfxml_cabinet_radical_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_radical); - YY_BREAK + YY_BREAK case 322: /* rule 322 can match eol */ YY_RULE_SETUP if (surfxml_cabinet_radical_isset != 0) {FAIL("Multiple definition of attribute radical in ");} surfxml_cabinet_radical_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_radical); - YY_BREAK + YY_BREAK case 323: /* rule 323 can match eol */ YY_RULE_SETUP if (surfxml_cabinet_power_isset != 0) {FAIL("Multiple definition of attribute power in ");} surfxml_cabinet_power_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_power); - YY_BREAK + YY_BREAK case 324: /* rule 324 can match eol */ YY_RULE_SETUP if (surfxml_cabinet_power_isset != 0) {FAIL("Multiple definition of attribute power in ");} surfxml_cabinet_power_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_power); - YY_BREAK + YY_BREAK case 325: /* rule 325 can match eol */ YY_RULE_SETUP if (surfxml_cabinet_bw_isset != 0) {FAIL("Multiple definition of attribute bw in ");} surfxml_cabinet_bw_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_bw); - YY_BREAK + YY_BREAK case 326: /* rule 326 can match eol */ YY_RULE_SETUP if (surfxml_cabinet_bw_isset != 0) {FAIL("Multiple definition of attribute bw in ");} surfxml_cabinet_bw_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_bw); - YY_BREAK + YY_BREAK case 327: /* rule 327 can match eol */ YY_RULE_SETUP if (surfxml_cabinet_lat_isset != 0) {FAIL("Multiple definition of attribute lat in ");} surfxml_cabinet_lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_lat); - YY_BREAK + YY_BREAK case 328: /* rule 328 can match eol */ YY_RULE_SETUP if (surfxml_cabinet_lat_isset != 0) {FAIL("Multiple definition of attribute lat in ");} surfxml_cabinet_lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_lat); - YY_BREAK + YY_BREAK case 329: YY_RULE_SETUP { @@ -7828,7 +7828,7 @@ YY_RULE_SETUP if (!AX_surfxml_cabinet_lat) FAIL("Required attribute `lat' not set for `cabinet' element."); LEAVE; STag_surfxml_cabinet();surfxml_pcdata_ix = 0; ENTER(E_surfxml_cabinet); } - YY_BREAK + YY_BREAK case 330: YY_RULE_SETUP { @@ -7846,18 +7846,18 @@ YY_RULE_SETUP case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break; } } - YY_BREAK + YY_BREAK case 331: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of cabinet element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 332: YY_RULE_SETUP FAIL("Bad attribute `%s' in `cabinet' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_cabinet): FAIL("EOF in attribute list of `cabinet' element."); - YY_BREAK + YY_BREAK case 333: /* rule 333 can match eol */ @@ -7872,25 +7872,25 @@ YY_RULE_SETUP case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break; } } - YY_BREAK + YY_BREAK case 334: /* rule 334 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 335: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(E_surfxml_cabinet): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 336: /* rule 336 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 337: /* rule 337 can match eol */ YY_RULE_SETUP @@ -7913,88 +7913,88 @@ YY_RULE_SETUP surfxml_peer_state___file_isset = 0; ENTER(AL_surfxml_peer); pushbuffer(0); } - YY_BREAK + YY_BREAK case 338: /* rule 338 can match eol */ YY_RULE_SETUP if (surfxml_peer_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_peer_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_id); - YY_BREAK + YY_BREAK case 339: /* rule 339 can match eol */ YY_RULE_SETUP if (surfxml_peer_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_peer_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_id); - YY_BREAK + YY_BREAK case 340: /* rule 340 can match eol */ YY_RULE_SETUP if (surfxml_peer_power_isset != 0) {FAIL("Multiple definition of attribute power in ");} surfxml_peer_power_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_power); - YY_BREAK + YY_BREAK case 341: /* rule 341 can match eol */ YY_RULE_SETUP if (surfxml_peer_power_isset != 0) {FAIL("Multiple definition of attribute power in ");} surfxml_peer_power_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_power); - YY_BREAK + YY_BREAK case 342: /* rule 342 can match eol */ YY_RULE_SETUP if (surfxml_peer_bw___in_isset != 0) {FAIL("Multiple definition of attribute bw_in in ");} surfxml_peer_bw___in_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_bw___in); - YY_BREAK + YY_BREAK case 343: /* rule 343 can match eol */ YY_RULE_SETUP if (surfxml_peer_bw___in_isset != 0) {FAIL("Multiple definition of attribute bw_in in ");} surfxml_peer_bw___in_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_bw___in); - YY_BREAK + YY_BREAK case 344: /* rule 344 can match eol */ YY_RULE_SETUP if (surfxml_peer_bw___out_isset != 0) {FAIL("Multiple definition of attribute bw_out in ");} surfxml_peer_bw___out_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_bw___out); - YY_BREAK + YY_BREAK case 345: /* rule 345 can match eol */ YY_RULE_SETUP if (surfxml_peer_bw___out_isset != 0) {FAIL("Multiple definition of attribute bw_out in ");} surfxml_peer_bw___out_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_bw___out); - YY_BREAK + YY_BREAK case 346: /* rule 346 can match eol */ YY_RULE_SETUP if (surfxml_peer_lat_isset != 0) {FAIL("Multiple definition of attribute lat in ");} surfxml_peer_lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_lat); - YY_BREAK + YY_BREAK case 347: /* rule 347 can match eol */ YY_RULE_SETUP if (surfxml_peer_lat_isset != 0) {FAIL("Multiple definition of attribute lat in ");} surfxml_peer_lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_lat); - YY_BREAK + YY_BREAK case 348: /* rule 348 can match eol */ YY_RULE_SETUP if (surfxml_peer_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in ");} surfxml_peer_coordinates_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_coordinates); - YY_BREAK + YY_BREAK case 349: /* rule 349 can match eol */ YY_RULE_SETUP if (surfxml_peer_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in ");} surfxml_peer_coordinates_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_coordinates); - YY_BREAK + YY_BREAK case 350: /* rule 350 can match eol */ YY_RULE_SETUP if (surfxml_peer_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in ");} surfxml_peer_availability___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_availability___file); - YY_BREAK + YY_BREAK case 351: /* rule 351 can match eol */ YY_RULE_SETUP if (surfxml_peer_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in ");} surfxml_peer_availability___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_availability___file); - YY_BREAK + YY_BREAK case 352: /* rule 352 can match eol */ YY_RULE_SETUP if (surfxml_peer_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in ");} surfxml_peer_state___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_state___file); - YY_BREAK + YY_BREAK case 353: /* rule 353 can match eol */ YY_RULE_SETUP if (surfxml_peer_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in ");} surfxml_peer_state___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_state___file); - YY_BREAK + YY_BREAK case 354: YY_RULE_SETUP { @@ -8005,7 +8005,7 @@ YY_RULE_SETUP if (!AX_surfxml_peer_lat) FAIL("Required attribute `lat' not set for `peer' element."); LEAVE; STag_surfxml_peer();surfxml_pcdata_ix = 0; ENTER(E_surfxml_peer); } - YY_BREAK + YY_BREAK case 355: YY_RULE_SETUP { @@ -8021,18 +8021,18 @@ YY_RULE_SETUP case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break; } } - YY_BREAK + YY_BREAK case 356: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of peer element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 357: YY_RULE_SETUP FAIL("Bad attribute `%s' in `peer' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_peer): FAIL("EOF in attribute list of `peer' element."); - YY_BREAK + YY_BREAK case 358: /* rule 358 can match eol */ @@ -8047,25 +8047,25 @@ YY_RULE_SETUP case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break; } } - YY_BREAK + YY_BREAK case 359: /* rule 359 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 360: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(E_surfxml_peer): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 361: /* rule 361 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 362: /* rule 362 can match eol */ YY_RULE_SETUP @@ -8076,35 +8076,35 @@ YY_RULE_SETUP surfxml_router_coordinates_isset = 0; ENTER(AL_surfxml_router); pushbuffer(0); } - YY_BREAK + YY_BREAK case 363: /* rule 363 can match eol */ YY_RULE_SETUP if (surfxml_router_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_router_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_router_id); - YY_BREAK + YY_BREAK case 364: /* rule 364 can match eol */ YY_RULE_SETUP if (surfxml_router_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_router_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_router_id); - YY_BREAK + YY_BREAK case 365: /* rule 365 can match eol */ YY_RULE_SETUP if (surfxml_router_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in ");} surfxml_router_coordinates_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_router_coordinates); - YY_BREAK + YY_BREAK case 366: /* rule 366 can match eol */ YY_RULE_SETUP if (surfxml_router_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in ");} surfxml_router_coordinates_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_router_coordinates); - YY_BREAK + YY_BREAK case 367: YY_RULE_SETUP { if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element."); LEAVE; STag_surfxml_router();surfxml_pcdata_ix = 0; ENTER(E_surfxml_router); } - YY_BREAK + YY_BREAK case 368: YY_RULE_SETUP { @@ -8114,18 +8114,18 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; } } - YY_BREAK + YY_BREAK case 369: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of router element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 370: YY_RULE_SETUP FAIL("Bad attribute `%s' in `router' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_router): FAIL("EOF in attribute list of `router' element."); - YY_BREAK + YY_BREAK case 371: /* rule 371 can match eol */ @@ -8138,25 +8138,25 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; } } - YY_BREAK + YY_BREAK case 372: /* rule 372 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 373: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(E_surfxml_router): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 374: /* rule 374 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 375: /* rule 375 can match eol */ YY_RULE_SETUP @@ -8169,38 +8169,38 @@ YY_RULE_SETUP surfxml_backbone_latency_isset = 0; ENTER(AL_surfxml_backbone); pushbuffer(0); } - YY_BREAK + YY_BREAK case 376: /* rule 376 can match eol */ YY_RULE_SETUP if (surfxml_backbone_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_backbone_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_backbone_id); - YY_BREAK + YY_BREAK case 377: /* rule 377 can match eol */ YY_RULE_SETUP if (surfxml_backbone_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_backbone_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_backbone_id); - YY_BREAK + YY_BREAK case 378: /* rule 378 can match eol */ YY_RULE_SETUP if (surfxml_backbone_bandwidth_isset != 0) {FAIL("Multiple definition of attribute bandwidth in ");} surfxml_backbone_bandwidth_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_backbone_bandwidth); - YY_BREAK + YY_BREAK case 379: /* rule 379 can match eol */ YY_RULE_SETUP if (surfxml_backbone_bandwidth_isset != 0) {FAIL("Multiple definition of attribute bandwidth in ");} surfxml_backbone_bandwidth_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_backbone_bandwidth); - YY_BREAK + YY_BREAK case 380: /* rule 380 can match eol */ YY_RULE_SETUP if (surfxml_backbone_latency_isset != 0) {FAIL("Multiple definition of attribute latency in ");} surfxml_backbone_latency_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_backbone_latency); - YY_BREAK + YY_BREAK case 381: /* rule 381 can match eol */ YY_RULE_SETUP if (surfxml_backbone_latency_isset != 0) {FAIL("Multiple definition of attribute latency in ");} surfxml_backbone_latency_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_backbone_latency); - YY_BREAK + YY_BREAK case 382: YY_RULE_SETUP { @@ -8209,7 +8209,7 @@ YY_RULE_SETUP if (!AX_surfxml_backbone_latency) FAIL("Required attribute `latency' not set for `backbone' element."); LEAVE; STag_surfxml_backbone();surfxml_pcdata_ix = 0; ENTER(E_surfxml_backbone); } - YY_BREAK + YY_BREAK case 383: YY_RULE_SETUP { @@ -8221,18 +8221,18 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; } } - YY_BREAK + YY_BREAK case 384: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of backbone element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 385: YY_RULE_SETUP FAIL("Bad attribute `%s' in `backbone' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_backbone): FAIL("EOF in attribute list of `backbone' element."); - YY_BREAK + YY_BREAK case 386: /* rule 386 can match eol */ @@ -8245,25 +8245,25 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; } } - YY_BREAK + YY_BREAK case 387: /* rule 387 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 388: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(E_surfxml_backbone): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 389: /* rule 389 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 390: /* rule 390 can match eol */ YY_RULE_SETUP @@ -8286,103 +8286,103 @@ YY_RULE_SETUP surfxml_link_sharing___policy_isset = 0; ENTER(AL_surfxml_link); pushbuffer(0); } - YY_BREAK + YY_BREAK case 391: /* rule 391 can match eol */ YY_RULE_SETUP if (surfxml_link_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_link_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_id); - YY_BREAK + YY_BREAK case 392: /* rule 392 can match eol */ YY_RULE_SETUP if (surfxml_link_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_link_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_id); - YY_BREAK + YY_BREAK case 393: /* rule 393 can match eol */ YY_RULE_SETUP if (surfxml_link_bandwidth_isset != 0) {FAIL("Multiple definition of attribute bandwidth in ");} surfxml_link_bandwidth_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth); - YY_BREAK + YY_BREAK case 394: /* rule 394 can match eol */ YY_RULE_SETUP if (surfxml_link_bandwidth_isset != 0) {FAIL("Multiple definition of attribute bandwidth in ");} surfxml_link_bandwidth_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth); - YY_BREAK + YY_BREAK case 395: /* rule 395 can match eol */ YY_RULE_SETUP if (surfxml_link_bandwidth___file_isset != 0) {FAIL("Multiple definition of attribute bandwidth_file in ");} surfxml_link_bandwidth___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth___file); - YY_BREAK + YY_BREAK case 396: /* rule 396 can match eol */ YY_RULE_SETUP if (surfxml_link_bandwidth___file_isset != 0) {FAIL("Multiple definition of attribute bandwidth_file in ");} surfxml_link_bandwidth___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth___file); - YY_BREAK + YY_BREAK case 397: /* rule 397 can match eol */ YY_RULE_SETUP if (surfxml_link_latency_isset != 0) {FAIL("Multiple definition of attribute latency in ");} surfxml_link_latency_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency); - YY_BREAK + YY_BREAK case 398: /* rule 398 can match eol */ YY_RULE_SETUP if (surfxml_link_latency_isset != 0) {FAIL("Multiple definition of attribute latency in ");} surfxml_link_latency_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency); - YY_BREAK + YY_BREAK case 399: /* rule 399 can match eol */ YY_RULE_SETUP if (surfxml_link_latency___file_isset != 0) {FAIL("Multiple definition of attribute latency_file in ");} surfxml_link_latency___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency___file); - YY_BREAK + YY_BREAK case 400: /* rule 400 can match eol */ YY_RULE_SETUP if (surfxml_link_latency___file_isset != 0) {FAIL("Multiple definition of attribute latency_file in ");} surfxml_link_latency___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency___file); - YY_BREAK + YY_BREAK case 401: /* rule 401 can match eol */ case 402: /* rule 402 can match eol */ YY_RULE_SETUP A_surfxml_link_state = A_surfxml_link_state_ON; - YY_BREAK + YY_BREAK case 403: /* rule 403 can match eol */ case 404: /* rule 404 can match eol */ YY_RULE_SETUP A_surfxml_link_state = A_surfxml_link_state_OFF; - YY_BREAK + YY_BREAK case 405: /* rule 405 can match eol */ YY_RULE_SETUP if (surfxml_link_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in ");} surfxml_link_state___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_state___file); - YY_BREAK + YY_BREAK case 406: /* rule 406 can match eol */ YY_RULE_SETUP if (surfxml_link_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in ");} surfxml_link_state___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_state___file); - YY_BREAK + YY_BREAK case 407: /* rule 407 can match eol */ case 408: /* rule 408 can match eol */ YY_RULE_SETUP A_surfxml_link_sharing___policy = A_surfxml_link_sharing___policy_SHARED; - YY_BREAK + YY_BREAK case 409: /* rule 409 can match eol */ case 410: /* rule 410 can match eol */ YY_RULE_SETUP A_surfxml_link_sharing___policy = A_surfxml_link_sharing___policy_FATPIPE; - YY_BREAK + YY_BREAK case 411: /* rule 411 can match eol */ case 412: /* rule 412 can match eol */ YY_RULE_SETUP A_surfxml_link_sharing___policy = A_surfxml_link_sharing___policy_FULLDUPLEX; - YY_BREAK + YY_BREAK case 413: YY_RULE_SETUP { @@ -8390,7 +8390,7 @@ YY_RULE_SETUP if (!AX_surfxml_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `link' element."); LEAVE; STag_surfxml_link();surfxml_pcdata_ix = 0; ENTER(S_surfxml_link); } - YY_BREAK + YY_BREAK case 414: YY_RULE_SETUP { @@ -8401,18 +8401,18 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; } } - YY_BREAK + YY_BREAK case 415: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of link element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 416: YY_RULE_SETUP FAIL("Bad attribute `%s' in `link' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_link): FAIL("EOF in attribute list of `link' element."); - YY_BREAK + YY_BREAK case 417: /* rule 417 can match eol */ @@ -8425,27 +8425,27 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; } } - YY_BREAK + YY_BREAK case 418: /* rule 418 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 419: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(S_surfxml_link): case YY_STATE_EOF(S_surfxml_link_2): case YY_STATE_EOF(E_surfxml_link): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 420: /* rule 420 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 421: /* rule 421 can match eol */ YY_RULE_SETUP @@ -8458,42 +8458,42 @@ YY_RULE_SETUP surfxml_route_symmetrical_isset = 0; ENTER(AL_surfxml_route); pushbuffer(0); } - YY_BREAK + YY_BREAK case 422: /* rule 422 can match eol */ YY_RULE_SETUP if (surfxml_route_src_isset != 0) {FAIL("Multiple definition of attribute src in ");} surfxml_route_src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_route_src); - YY_BREAK + YY_BREAK case 423: /* rule 423 can match eol */ YY_RULE_SETUP if (surfxml_route_src_isset != 0) {FAIL("Multiple definition of attribute src in ");} surfxml_route_src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_route_src); - YY_BREAK + YY_BREAK case 424: /* rule 424 can match eol */ YY_RULE_SETUP if (surfxml_route_dst_isset != 0) {FAIL("Multiple definition of attribute dst in ");} surfxml_route_dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_route_dst); - YY_BREAK + YY_BREAK case 425: /* rule 425 can match eol */ YY_RULE_SETUP if (surfxml_route_dst_isset != 0) {FAIL("Multiple definition of attribute dst in ");} surfxml_route_dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_route_dst); - YY_BREAK + YY_BREAK case 426: /* rule 426 can match eol */ case 427: /* rule 427 can match eol */ YY_RULE_SETUP A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_YES; - YY_BREAK + YY_BREAK case 428: /* rule 428 can match eol */ case 429: /* rule 429 can match eol */ YY_RULE_SETUP A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_NO; - YY_BREAK + YY_BREAK case 430: YY_RULE_SETUP { @@ -8501,7 +8501,7 @@ YY_RULE_SETUP if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element."); LEAVE; STag_surfxml_route();surfxml_pcdata_ix = 0; ENTER(S_surfxml_route); } - YY_BREAK + YY_BREAK case 431: YY_RULE_SETUP { @@ -8512,18 +8512,18 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; } } - YY_BREAK + YY_BREAK case 432: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of route element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 433: YY_RULE_SETUP FAIL("Bad attribute `%s' in `route' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_route): FAIL("EOF in attribute list of `route' element."); - YY_BREAK + YY_BREAK case 434: /* rule 434 can match eol */ @@ -8536,27 +8536,27 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; } } - YY_BREAK + YY_BREAK case 435: /* rule 435 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 436: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(S_surfxml_route_2): case YY_STATE_EOF(E_surfxml_route): case YY_STATE_EOF(S_surfxml_route): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 437: /* rule 437 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 438: /* rule 438 can match eol */ YY_RULE_SETUP @@ -8573,62 +8573,62 @@ YY_RULE_SETUP surfxml_ASroute_symmetrical_isset = 0; ENTER(AL_surfxml_ASroute); pushbuffer(0); } - YY_BREAK + YY_BREAK case 439: /* rule 439 can match eol */ YY_RULE_SETUP if (surfxml_ASroute_src_isset != 0) {FAIL("Multiple definition of attribute src in ");} surfxml_ASroute_src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_ASroute_src); - YY_BREAK + YY_BREAK case 440: /* rule 440 can match eol */ YY_RULE_SETUP if (surfxml_ASroute_src_isset != 0) {FAIL("Multiple definition of attribute src in ");} surfxml_ASroute_src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_ASroute_src); - YY_BREAK + YY_BREAK case 441: /* rule 441 can match eol */ YY_RULE_SETUP if (surfxml_ASroute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in ");} surfxml_ASroute_dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_ASroute_dst); - YY_BREAK + YY_BREAK case 442: /* rule 442 can match eol */ YY_RULE_SETUP if (surfxml_ASroute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in ");} surfxml_ASroute_dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_ASroute_dst); - YY_BREAK + YY_BREAK case 443: /* rule 443 can match eol */ YY_RULE_SETUP if (surfxml_ASroute_gw___src_isset != 0) {FAIL("Multiple definition of attribute gw_src in ");} surfxml_ASroute_gw___src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_ASroute_gw___src); - YY_BREAK + YY_BREAK case 444: /* rule 444 can match eol */ YY_RULE_SETUP if (surfxml_ASroute_gw___src_isset != 0) {FAIL("Multiple definition of attribute gw_src in ");} surfxml_ASroute_gw___src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_ASroute_gw___src); - YY_BREAK + YY_BREAK case 445: /* rule 445 can match eol */ YY_RULE_SETUP if (surfxml_ASroute_gw___dst_isset != 0) {FAIL("Multiple definition of attribute gw_dst in ");} surfxml_ASroute_gw___dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_ASroute_gw___dst); - YY_BREAK + YY_BREAK case 446: /* rule 446 can match eol */ YY_RULE_SETUP if (surfxml_ASroute_gw___dst_isset != 0) {FAIL("Multiple definition of attribute gw_dst in ");} surfxml_ASroute_gw___dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_ASroute_gw___dst); - YY_BREAK + YY_BREAK case 447: /* rule 447 can match eol */ case 448: /* rule 448 can match eol */ YY_RULE_SETUP A_surfxml_ASroute_symmetrical = A_surfxml_ASroute_symmetrical_YES; - YY_BREAK + YY_BREAK case 449: /* rule 449 can match eol */ case 450: /* rule 450 can match eol */ YY_RULE_SETUP A_surfxml_ASroute_symmetrical = A_surfxml_ASroute_symmetrical_NO; - YY_BREAK + YY_BREAK case 451: YY_RULE_SETUP { @@ -8638,7 +8638,7 @@ YY_RULE_SETUP if (!AX_surfxml_ASroute_gw___dst) FAIL("Required attribute `gw_dst' not set for `ASroute' element."); LEAVE; STag_surfxml_ASroute();surfxml_pcdata_ix = 0; ENTER(S_surfxml_ASroute); } - YY_BREAK + YY_BREAK case 452: YY_RULE_SETUP { @@ -8652,18 +8652,18 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; } } - YY_BREAK + YY_BREAK case 453: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of ASroute element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 454: YY_RULE_SETUP FAIL("Bad attribute `%s' in `ASroute' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_ASroute): FAIL("EOF in attribute list of `ASroute' element."); - YY_BREAK + YY_BREAK case 455: /* rule 455 can match eol */ @@ -8677,27 +8677,27 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; } } - YY_BREAK + YY_BREAK case 456: /* rule 456 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 457: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(S_surfxml_ASroute_2): case YY_STATE_EOF(S_surfxml_ASroute): case YY_STATE_EOF(E_surfxml_ASroute): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 458: /* rule 458 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 459: /* rule 459 can match eol */ YY_RULE_SETUP @@ -8708,46 +8708,46 @@ YY_RULE_SETUP surfxml_link___ctn_direction_isset = 0; ENTER(AL_surfxml_link___ctn); pushbuffer(0); } - YY_BREAK + YY_BREAK case 460: /* rule 460 can match eol */ YY_RULE_SETUP if (surfxml_link___ctn_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_link___ctn_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link___ctn_id); - YY_BREAK + YY_BREAK case 461: /* rule 461 can match eol */ YY_RULE_SETUP if (surfxml_link___ctn_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_link___ctn_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link___ctn_id); - YY_BREAK + YY_BREAK case 462: /* rule 462 can match eol */ case 463: /* rule 463 can match eol */ YY_RULE_SETUP A_surfxml_link___ctn_direction = A_surfxml_link___ctn_direction_UP; - YY_BREAK + YY_BREAK case 464: /* rule 464 can match eol */ case 465: /* rule 465 can match eol */ YY_RULE_SETUP A_surfxml_link___ctn_direction = A_surfxml_link___ctn_direction_DOWN; - YY_BREAK + YY_BREAK case 466: /* rule 466 can match eol */ case 467: /* rule 467 can match eol */ YY_RULE_SETUP A_surfxml_link___ctn_direction = A_surfxml_link___ctn_direction_NONE; - YY_BREAK + YY_BREAK case 468: YY_RULE_SETUP { if (!AX_surfxml_link___ctn_id) FAIL("Required attribute `id' not set for `link_ctn' element."); LEAVE; STag_surfxml_link___ctn();surfxml_pcdata_ix = 0; ENTER(E_surfxml_link___ctn); } - YY_BREAK + YY_BREAK case 469: YY_RULE_SETUP { @@ -8760,18 +8760,18 @@ YY_RULE_SETUP case S_surfxml_route: case S_surfxml_route_1: case S_surfxml_route_2: SET(S_surfxml_route_2); break; } } - YY_BREAK + YY_BREAK case 470: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of link_ctn element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 471: YY_RULE_SETUP FAIL("Bad attribute `%s' in `link_ctn' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_link___ctn): FAIL("EOF in attribute list of `link_ctn' element."); - YY_BREAK + YY_BREAK case 472: /* rule 472 can match eol */ @@ -8787,25 +8787,25 @@ YY_RULE_SETUP case S_surfxml_route: case S_surfxml_route_1: case S_surfxml_route_2: SET(S_surfxml_route_2); break; } } - YY_BREAK + YY_BREAK case 473: /* rule 473 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 474: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(E_surfxml_link___ctn): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 475: /* rule 475 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 476: /* rule 476 can match eol */ YY_RULE_SETUP @@ -8816,28 +8816,28 @@ YY_RULE_SETUP surfxml_bypassRoute_dst_isset = 0; ENTER(AL_surfxml_bypassRoute); pushbuffer(0); } - YY_BREAK + YY_BREAK case 477: /* rule 477 can match eol */ YY_RULE_SETUP if (surfxml_bypassRoute_src_isset != 0) {FAIL("Multiple definition of attribute src in ");} surfxml_bypassRoute_src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassRoute_src); - YY_BREAK + YY_BREAK case 478: /* rule 478 can match eol */ YY_RULE_SETUP if (surfxml_bypassRoute_src_isset != 0) {FAIL("Multiple definition of attribute src in ");} surfxml_bypassRoute_src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassRoute_src); - YY_BREAK + YY_BREAK case 479: /* rule 479 can match eol */ YY_RULE_SETUP if (surfxml_bypassRoute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in ");} surfxml_bypassRoute_dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassRoute_dst); - YY_BREAK + YY_BREAK case 480: /* rule 480 can match eol */ YY_RULE_SETUP if (surfxml_bypassRoute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in ");} surfxml_bypassRoute_dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassRoute_dst); - YY_BREAK + YY_BREAK case 481: YY_RULE_SETUP { @@ -8845,7 +8845,7 @@ YY_RULE_SETUP if (!AX_surfxml_bypassRoute_dst) FAIL("Required attribute `dst' not set for `bypassRoute' element."); LEAVE; STag_surfxml_bypassRoute();surfxml_pcdata_ix = 0; ENTER(S_surfxml_bypassRoute); } - YY_BREAK + YY_BREAK case 482: YY_RULE_SETUP { @@ -8856,18 +8856,18 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; } } - YY_BREAK + YY_BREAK case 483: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of bypassRoute element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 484: YY_RULE_SETUP FAIL("Bad attribute `%s' in `bypassRoute' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_bypassRoute): FAIL("EOF in attribute list of `bypassRoute' element."); - YY_BREAK + YY_BREAK case 485: /* rule 485 can match eol */ @@ -8880,27 +8880,27 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; } } - YY_BREAK + YY_BREAK case 486: /* rule 486 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 487: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(S_surfxml_bypassRoute_2): case YY_STATE_EOF(E_surfxml_bypassRoute): case YY_STATE_EOF(S_surfxml_bypassRoute): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 488: /* rule 488 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 489: /* rule 489 can match eol */ YY_RULE_SETUP @@ -8915,48 +8915,48 @@ YY_RULE_SETUP surfxml_bypassASroute_gw___dst_isset = 0; ENTER(AL_surfxml_bypassASroute); pushbuffer(0); } - YY_BREAK + YY_BREAK case 490: /* rule 490 can match eol */ YY_RULE_SETUP if (surfxml_bypassASroute_src_isset != 0) {FAIL("Multiple definition of attribute src in ");} surfxml_bypassASroute_src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassASroute_src); - YY_BREAK + YY_BREAK case 491: /* rule 491 can match eol */ YY_RULE_SETUP if (surfxml_bypassASroute_src_isset != 0) {FAIL("Multiple definition of attribute src in ");} surfxml_bypassASroute_src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassASroute_src); - YY_BREAK + YY_BREAK case 492: /* rule 492 can match eol */ YY_RULE_SETUP if (surfxml_bypassASroute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in ");} surfxml_bypassASroute_dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassASroute_dst); - YY_BREAK + YY_BREAK case 493: /* rule 493 can match eol */ YY_RULE_SETUP if (surfxml_bypassASroute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in ");} surfxml_bypassASroute_dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassASroute_dst); - YY_BREAK + YY_BREAK case 494: /* rule 494 can match eol */ YY_RULE_SETUP if (surfxml_bypassASroute_gw___src_isset != 0) {FAIL("Multiple definition of attribute gw_src in ");} surfxml_bypassASroute_gw___src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassASroute_gw___src); - YY_BREAK + YY_BREAK case 495: /* rule 495 can match eol */ YY_RULE_SETUP if (surfxml_bypassASroute_gw___src_isset != 0) {FAIL("Multiple definition of attribute gw_src in ");} surfxml_bypassASroute_gw___src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassASroute_gw___src); - YY_BREAK + YY_BREAK case 496: /* rule 496 can match eol */ YY_RULE_SETUP if (surfxml_bypassASroute_gw___dst_isset != 0) {FAIL("Multiple definition of attribute gw_dst in ");} surfxml_bypassASroute_gw___dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassASroute_gw___dst); - YY_BREAK + YY_BREAK case 497: /* rule 497 can match eol */ YY_RULE_SETUP if (surfxml_bypassASroute_gw___dst_isset != 0) {FAIL("Multiple definition of attribute gw_dst in ");} surfxml_bypassASroute_gw___dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassASroute_gw___dst); - YY_BREAK + YY_BREAK case 498: YY_RULE_SETUP { @@ -8966,7 +8966,7 @@ YY_RULE_SETUP if (!AX_surfxml_bypassASroute_gw___dst) FAIL("Required attribute `gw_dst' not set for `bypassASroute' element."); LEAVE; STag_surfxml_bypassASroute();surfxml_pcdata_ix = 0; ENTER(S_surfxml_bypassASroute); } - YY_BREAK + YY_BREAK case 499: YY_RULE_SETUP { @@ -8979,18 +8979,18 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; } } - YY_BREAK + YY_BREAK case 500: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of bypassASroute element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 501: YY_RULE_SETUP FAIL("Bad attribute `%s' in `bypassASroute' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_bypassASroute): FAIL("EOF in attribute list of `bypassASroute' element."); - YY_BREAK + YY_BREAK case 502: /* rule 502 can match eol */ @@ -9003,27 +9003,27 @@ YY_RULE_SETUP case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; } } - YY_BREAK + YY_BREAK case 503: /* rule 503 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 504: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(E_surfxml_bypassASroute): case YY_STATE_EOF(S_surfxml_bypassASroute_2): case YY_STATE_EOF(S_surfxml_bypassASroute): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 505: /* rule 505 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 506: /* rule 506 can match eol */ YY_RULE_SETUP @@ -9040,62 +9040,62 @@ YY_RULE_SETUP surfxml_process_on___failure_isset = 0; ENTER(AL_surfxml_process); pushbuffer(0); } - YY_BREAK + YY_BREAK case 507: /* rule 507 can match eol */ YY_RULE_SETUP if (surfxml_process_host_isset != 0) {FAIL("Multiple definition of attribute host in ");} surfxml_process_host_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_process_host); - YY_BREAK + YY_BREAK case 508: /* rule 508 can match eol */ YY_RULE_SETUP if (surfxml_process_host_isset != 0) {FAIL("Multiple definition of attribute host in ");} surfxml_process_host_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_process_host); - YY_BREAK + YY_BREAK case 509: /* rule 509 can match eol */ YY_RULE_SETUP if (surfxml_process_function_isset != 0) {FAIL("Multiple definition of attribute function in ");} surfxml_process_function_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_process_function); - YY_BREAK + YY_BREAK case 510: /* rule 510 can match eol */ YY_RULE_SETUP if (surfxml_process_function_isset != 0) {FAIL("Multiple definition of attribute function in ");} surfxml_process_function_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_process_function); - YY_BREAK + YY_BREAK case 511: /* rule 511 can match eol */ YY_RULE_SETUP if (surfxml_process_start___time_isset != 0) {FAIL("Multiple definition of attribute start_time in ");} surfxml_process_start___time_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_process_start___time); - YY_BREAK + YY_BREAK case 512: /* rule 512 can match eol */ YY_RULE_SETUP if (surfxml_process_start___time_isset != 0) {FAIL("Multiple definition of attribute start_time in ");} surfxml_process_start___time_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_process_start___time); - YY_BREAK + YY_BREAK case 513: /* rule 513 can match eol */ YY_RULE_SETUP if (surfxml_process_kill___time_isset != 0) {FAIL("Multiple definition of attribute kill_time in ");} surfxml_process_kill___time_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_process_kill___time); - YY_BREAK + YY_BREAK case 514: /* rule 514 can match eol */ YY_RULE_SETUP if (surfxml_process_kill___time_isset != 0) {FAIL("Multiple definition of attribute kill_time in ");} surfxml_process_kill___time_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_process_kill___time); - YY_BREAK + YY_BREAK case 515: /* rule 515 can match eol */ case 516: /* rule 516 can match eol */ YY_RULE_SETUP A_surfxml_process_on___failure = A_surfxml_process_on___failure_DIE; - YY_BREAK + YY_BREAK case 517: /* rule 517 can match eol */ case 518: /* rule 518 can match eol */ YY_RULE_SETUP A_surfxml_process_on___failure = A_surfxml_process_on___failure_RESTART; - YY_BREAK + YY_BREAK case 519: YY_RULE_SETUP { @@ -9103,7 +9103,7 @@ YY_RULE_SETUP if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element."); LEAVE; STag_surfxml_process();surfxml_pcdata_ix = 0; ENTER(S_surfxml_process); } - YY_BREAK + YY_BREAK case 520: YY_RULE_SETUP { @@ -9114,18 +9114,18 @@ YY_RULE_SETUP case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_4: case S_surfxml_platform_6: case S_surfxml_platform_7: case S_surfxml_platform_8: SET(S_surfxml_platform_8); break; } } - YY_BREAK + YY_BREAK case 521: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of process element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 522: YY_RULE_SETUP FAIL("Bad attribute `%s' in `process' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_process): FAIL("EOF in attribute list of `process' element."); - YY_BREAK + YY_BREAK case 523: /* rule 523 can match eol */ @@ -9138,27 +9138,27 @@ YY_RULE_SETUP case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_4: case S_surfxml_platform_6: case S_surfxml_platform_7: case S_surfxml_platform_8: SET(S_surfxml_platform_8); break; } } - YY_BREAK + YY_BREAK case 524: /* rule 524 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 525: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(S_surfxml_process): case YY_STATE_EOF(E_surfxml_process): case YY_STATE_EOF(S_surfxml_process_2): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 526: /* rule 526 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 527: /* rule 527 can match eol */ YY_RULE_SETUP @@ -9167,25 +9167,25 @@ YY_RULE_SETUP surfxml_argument_value_isset = 0; ENTER(AL_surfxml_argument); pushbuffer(0); } - YY_BREAK + YY_BREAK case 528: /* rule 528 can match eol */ YY_RULE_SETUP if (surfxml_argument_value_isset != 0) {FAIL("Multiple definition of attribute value in ");} surfxml_argument_value_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_argument_value); - YY_BREAK + YY_BREAK case 529: /* rule 529 can match eol */ YY_RULE_SETUP if (surfxml_argument_value_isset != 0) {FAIL("Multiple definition of attribute value in ");} surfxml_argument_value_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_argument_value); - YY_BREAK + YY_BREAK case 530: YY_RULE_SETUP { if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element."); LEAVE; STag_surfxml_argument();surfxml_pcdata_ix = 0; ENTER(E_surfxml_argument); } - YY_BREAK + YY_BREAK case 531: YY_RULE_SETUP { @@ -9195,18 +9195,18 @@ YY_RULE_SETUP case S_surfxml_process: case S_surfxml_process_1: case S_surfxml_process_2: SET(S_surfxml_process_2); break; } } - YY_BREAK + YY_BREAK case 532: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of argument element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 533: YY_RULE_SETUP FAIL("Bad attribute `%s' in `argument' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_argument): FAIL("EOF in attribute list of `argument' element."); - YY_BREAK + YY_BREAK case 534: /* rule 534 can match eol */ @@ -9219,25 +9219,25 @@ YY_RULE_SETUP case S_surfxml_process: case S_surfxml_process_1: case S_surfxml_process_2: SET(S_surfxml_process_2); break; } } - YY_BREAK + YY_BREAK case 535: /* rule 535 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 536: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(E_surfxml_argument): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK case 537: /* rule 537 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 538: /* rule 538 can match eol */ YY_RULE_SETUP @@ -9246,24 +9246,24 @@ YY_RULE_SETUP surfxml_config_id_isset = 0; ENTER(AL_surfxml_config); pushbuffer(0); } - YY_BREAK + YY_BREAK case 539: /* rule 539 can match eol */ YY_RULE_SETUP if (surfxml_config_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_config_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_config_id); - YY_BREAK + YY_BREAK case 540: /* rule 540 can match eol */ YY_RULE_SETUP if (surfxml_config_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_config_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_config_id); - YY_BREAK + YY_BREAK case 541: YY_RULE_SETUP { LEAVE; STag_surfxml_config();surfxml_pcdata_ix = 0; ENTER(S_surfxml_config); } - YY_BREAK + YY_BREAK case 542: YY_RULE_SETUP { @@ -9272,18 +9272,18 @@ YY_RULE_SETUP case S_surfxml_platform: case S_surfxml_platform_2: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break; } } - YY_BREAK + YY_BREAK case 543: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of config element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 544: YY_RULE_SETUP FAIL("Bad attribute `%s' in `config' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_config): FAIL("EOF in attribute list of `config' element."); - YY_BREAK + YY_BREAK case 545: /* rule 545 can match eol */ @@ -9296,21 +9296,21 @@ YY_RULE_SETUP case S_surfxml_platform: case S_surfxml_platform_2: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break; } } - YY_BREAK + YY_BREAK case 546: /* rule 546 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 547: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(S_surfxml_config): case YY_STATE_EOF(S_surfxml_config_2): case YY_STATE_EOF(E_surfxml_config): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK /* * */ @@ -9318,7 +9318,7 @@ case 548: /* rule 548 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 549: /* rule 549 can match eol */ YY_RULE_SETUP @@ -9329,28 +9329,28 @@ YY_RULE_SETUP surfxml_prop_value_isset = 0; ENTER(AL_surfxml_prop); pushbuffer(0); } - YY_BREAK + YY_BREAK case 550: /* rule 550 can match eol */ YY_RULE_SETUP if (surfxml_prop_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_prop_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_id); - YY_BREAK + YY_BREAK case 551: /* rule 551 can match eol */ YY_RULE_SETUP if (surfxml_prop_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_prop_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_id); - YY_BREAK + YY_BREAK case 552: /* rule 552 can match eol */ YY_RULE_SETUP if (surfxml_prop_value_isset != 0) {FAIL("Multiple definition of attribute value in ");} surfxml_prop_value_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_value); - YY_BREAK + YY_BREAK case 553: /* rule 553 can match eol */ YY_RULE_SETUP if (surfxml_prop_value_isset != 0) {FAIL("Multiple definition of attribute value in ");} surfxml_prop_value_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_value); - YY_BREAK + YY_BREAK case 554: YY_RULE_SETUP { @@ -9358,7 +9358,7 @@ YY_RULE_SETUP if (!AX_surfxml_prop_value) FAIL("Required attribute `value' not set for `prop' element."); LEAVE; STag_surfxml_prop();surfxml_pcdata_ix = 0; ENTER(E_surfxml_prop); } - YY_BREAK + YY_BREAK case 555: YY_RULE_SETUP { @@ -9376,18 +9376,18 @@ YY_RULE_SETUP case S_surfxml_storage___type: case S_surfxml_storage___type_1: case S_surfxml_storage___type_2: SET(S_surfxml_storage___type_2); break; } } - YY_BREAK + YY_BREAK case 556: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of prop element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 557: YY_RULE_SETUP FAIL("Bad attribute `%s' in `prop' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_prop): FAIL("EOF in attribute list of `prop' element."); - YY_BREAK + YY_BREAK case 558: /* rule 558 can match eol */ @@ -9407,19 +9407,19 @@ YY_RULE_SETUP case S_surfxml_storage___type: case S_surfxml_storage___type_1: case S_surfxml_storage___type_2: SET(S_surfxml_storage___type_2); break; } } - YY_BREAK + YY_BREAK case 559: /* rule 559 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 560: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(E_surfxml_prop): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK /* * */ @@ -9427,7 +9427,7 @@ case 561: /* rule 561 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 562: /* rule 562 can match eol */ YY_RULE_SETUP @@ -9438,28 +9438,28 @@ YY_RULE_SETUP surfxml_model___prop_value_isset = 0; ENTER(AL_surfxml_model___prop); pushbuffer(0); } - YY_BREAK + YY_BREAK case 563: /* rule 563 can match eol */ YY_RULE_SETUP if (surfxml_model___prop_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_model___prop_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_model___prop_id); - YY_BREAK + YY_BREAK case 564: /* rule 564 can match eol */ YY_RULE_SETUP if (surfxml_model___prop_id_isset != 0) {FAIL("Multiple definition of attribute id in ");} surfxml_model___prop_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_model___prop_id); - YY_BREAK + YY_BREAK case 565: /* rule 565 can match eol */ YY_RULE_SETUP if (surfxml_model___prop_value_isset != 0) {FAIL("Multiple definition of attribute value in ");} surfxml_model___prop_value_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_model___prop_value); - YY_BREAK + YY_BREAK case 566: /* rule 566 can match eol */ YY_RULE_SETUP if (surfxml_model___prop_value_isset != 0) {FAIL("Multiple definition of attribute value in ");} surfxml_model___prop_value_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_model___prop_value); - YY_BREAK + YY_BREAK case 567: YY_RULE_SETUP { @@ -9467,7 +9467,7 @@ YY_RULE_SETUP if (!AX_surfxml_model___prop_value) FAIL("Required attribute `value' not set for `model_prop' element."); LEAVE; STag_surfxml_model___prop();surfxml_pcdata_ix = 0; ENTER(E_surfxml_model___prop); } - YY_BREAK + YY_BREAK case 568: YY_RULE_SETUP { @@ -9478,18 +9478,18 @@ YY_RULE_SETUP case S_surfxml_storage___type: case S_surfxml_storage___type_1: case S_surfxml_storage___type_2: SET(S_surfxml_storage___type_2); break; } } - YY_BREAK + YY_BREAK case 569: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of model_prop element.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 570: YY_RULE_SETUP FAIL("Bad attribute `%s' in `model_prop' element start tag.",surf_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_surfxml_model___prop): FAIL("EOF in attribute list of `model_prop' element."); - YY_BREAK + YY_BREAK case 571: /* rule 571 can match eol */ @@ -9502,29 +9502,29 @@ YY_RULE_SETUP case S_surfxml_storage___type: case S_surfxml_storage___type_1: case S_surfxml_storage___type_2: SET(S_surfxml_storage___type_2); break; } } - YY_BREAK + YY_BREAK case 572: /* rule 572 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); - YY_BREAK + YY_BREAK case 573: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(E_surfxml_model___prop): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK /* EPILOG: after the root element. */ case 574: YY_RULE_SETUP {SET(PROLOG); yyless(0); CLEANUP; return -1;} - YY_BREAK + YY_BREAK case YY_STATE_EOF(EPILOG): SUCCEED; - YY_BREAK + YY_BREAK /* CHARACTER DATA. */ @@ -9532,32 +9532,32 @@ SUCCEED; case 575: YY_RULE_SETUP BUFFERPUTC('&'); - YY_BREAK + YY_BREAK case 576: YY_RULE_SETUP BUFFERPUTC('<'); - YY_BREAK + YY_BREAK case 577: YY_RULE_SETUP BUFFERPUTC('>'); - YY_BREAK + YY_BREAK case 578: YY_RULE_SETUP BUFFERPUTC('\''); - YY_BREAK + YY_BREAK case 579: YY_RULE_SETUP BUFFERPUTC('"'); - YY_BREAK + YY_BREAK /* Character entities. */ case 580: YY_RULE_SETUP BUFFERPUTC((unsigned char)atoi(surf_parse_text+2)); - YY_BREAK + YY_BREAK case 581: YY_RULE_SETUP BUFFERPUTC((unsigned char)strtol(surf_parse_text+3,NULL,16)); - YY_BREAK + YY_BREAK case 582: /* rule 582 can match eol */ @@ -9569,55 +9569,55 @@ case 585: /* rule 585 can match eol */ YY_RULE_SETUP BUFFERPUTC('\n'); - YY_BREAK + YY_BREAK case 586: YY_RULE_SETUP ENTER(CDATA); - YY_BREAK + YY_BREAK case 587: YY_RULE_SETUP FAIL("Unexpected `]""]>' in character data."); - YY_BREAK + YY_BREAK case 588: YY_RULE_SETUP BUFFERDONE; LEAVE; - YY_BREAK + YY_BREAK case YY_STATE_EOF(VALUE1): FAIL("EOF in literal (\"'\" expected)."); - YY_BREAK + YY_BREAK case 589: YY_RULE_SETUP BUFFERDONE; LEAVE; - YY_BREAK + YY_BREAK case YY_STATE_EOF(VALUE2): FAIL("EOF in literal (`\"' expected)."); - YY_BREAK + YY_BREAK case 590: /* rule 590 can match eol */ YY_RULE_SETUP BUFFERPUTC(surf_parse_text[0]); - YY_BREAK + YY_BREAK case 591: YY_RULE_SETUP FAIL("Spurious `%c' in character data.",surf_parse_text[0]); - YY_BREAK + YY_BREAK case 592: YY_RULE_SETUP LEAVE; - YY_BREAK -/* "]""]" BUFFERPUTC(surf_parse_text[0]); BUFFERPUTC(surf_parse_text[1]); */ + YY_BREAK +/* "]""]" BUFFERPUTC(surf_parse_text[0]); BUFFERPUTC(surf_parse_text[1]); */ case 593: YY_RULE_SETUP BUFFERPUTC(surf_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(CDATA): FAIL("EOF in CDATA section."); - YY_BREAK + YY_BREAK /* Impossible rules to avoid warnings from flex(1). */ /* Ideally, this should be replaced by code in flexml.pl that @@ -9627,12 +9627,12 @@ case 594: /* rule 594 can match eol */ YY_RULE_SETUP FAIL("Syntax error on character `%c'.", surf_parse_text[0]); - YY_BREAK + YY_BREAK case 595: YY_RULE_SETUP ECHO; - YY_BREAK + YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(S_surfxml_AS_2): case YY_STATE_EOF(S_surfxml_AS_5): @@ -9654,332 +9654,332 @@ case YY_STATE_EOF(S_surfxml_route_1): case YY_STATE_EOF(S_surfxml_storage_1): case YY_STATE_EOF(S_surfxml_storage___type_1): case YY_STATE_EOF(IMPOSSIBLE): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed surf_parse_in at a new source and called - * surf_parse_lex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = surf_parse_in; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_c_buf_p); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( surf_parse_wrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * surf_parse_text, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of user's declarations */ + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed surf_parse_in at a new source and called + * surf_parse_lex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = surf_parse_in; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( surf_parse_wrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * surf_parse_text, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of surf_parse_lex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = (yytext_ptr); - int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - yy_size_t num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - yy_size_t new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - surf_parse_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - surf_parse_restart(surf_parse_in ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) surf_parse_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + yy_size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + yy_size_t new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + surf_parse_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + surf_parse_restart(surf_parse_in ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) surf_parse_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - return ret_val; + return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { - yy_state_type yy_current_state; - char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; - yy_current_state = (yy_start); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 3466 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; + yy_current_state = (yy_start); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 3466 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis - * next_state = yy_try_NUL_trans( current_state ); + * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - int yy_is_jam; - char *yy_cp = (yy_c_buf_p); - - YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 3466 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 3465); - - return yy_is_jam ? 0 : yy_current_state; + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); + + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 3466 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 3465); + + return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_INPUT @@ -9990,76 +9990,76 @@ static int yy_get_next_buffer (void) #endif { - int c; + int c; - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - surf_parse_restart(surf_parse_in ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( surf_parse_wrap( ) ) - return EOF; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + surf_parse_restart(surf_parse_in ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( surf_parse_wrap( ) ) + return EOF; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; #ifdef __cplusplus - return yyinput(); + return yyinput(); #else - return input(); + return input(); #endif - } + } - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve surf_parse_text */ - (yy_hold_char) = *++(yy_c_buf_p); + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve surf_parse_text */ + (yy_hold_char) = *++(yy_c_buf_p); - if ( c == '\n' ) - + if ( c == '\n' ) + surf_parse_lineno++; ; - return c; + return c; } -#endif /* ifndef YY_NO_INPUT */ +#endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. @@ -10069,14 +10069,14 @@ static int yy_get_next_buffer (void) void surf_parse_restart (FILE * input_file ) { - if ( ! YY_CURRENT_BUFFER ){ + if ( ! YY_CURRENT_BUFFER ){ surf_parse_ensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = + YY_CURRENT_BUFFER_LVALUE = surf_parse__create_buffer(surf_parse_in,YY_BUF_SIZE ); - } + } - surf_parse__init_buffer(YY_CURRENT_BUFFER,input_file ); - surf_parse__load_buffer_state( ); + surf_parse__init_buffer(YY_CURRENT_BUFFER,input_file ); + surf_parse__load_buffer_state( ); } /** Switch to a different input buffer. @@ -10086,40 +10086,40 @@ static int yy_get_next_buffer (void) void surf_parse__switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - /* TODO. We should be able to replace this entire function body - * with - * surf_parse_pop_buffer_state(); - * surf_parse_push_buffer_state(new_buffer); + /* TODO. We should be able to replace this entire function body + * with + * surf_parse_pop_buffer_state(); + * surf_parse_push_buffer_state(new_buffer); */ - surf_parse_ensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - surf_parse__load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (surf_parse_wrap()) processing, but the only time this flag - * is looked at is after surf_parse_wrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; + surf_parse_ensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + surf_parse__load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (surf_parse_wrap()) processing, but the only time this flag + * is looked at is after surf_parse_wrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; } static void surf_parse__load_buffer_state (void) { - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - surf_parse_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + surf_parse_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. @@ -10130,26 +10130,26 @@ static void surf_parse__load_buffer_state (void) */ YY_BUFFER_STATE surf_parse__create_buffer (FILE * file, int size ) { - YY_BUFFER_STATE b; + YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) surf_parse_alloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in surf_parse__create_buffer()" ); + b = (YY_BUFFER_STATE) surf_parse_alloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in surf_parse__create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = size; - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) surf_parse_alloc(b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in surf_parse__create_buffer()" ); + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) surf_parse_alloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in surf_parse__create_buffer()" ); - b->yy_is_our_buffer = 1; + b->yy_is_our_buffer = 1; - surf_parse__init_buffer(b,file ); + surf_parse__init_buffer(b,file ); - return b; + return b; } /** Destroy the buffer. @@ -10159,16 +10159,16 @@ static void surf_parse__load_buffer_state (void) void surf_parse__delete_buffer (YY_BUFFER_STATE b ) { - if ( ! b ) - return; + if ( ! b ) + return; - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - if ( b->yy_is_our_buffer ) - surf_parse_free((void *) b->yy_ch_buf ); + if ( b->yy_is_our_buffer ) + surf_parse_free((void *) b->yy_ch_buf ); - surf_parse_free((void *) b ); + surf_parse_free((void *) b ); } /* Initializes or reinitializes a buffer. @@ -10178,12 +10178,12 @@ static void surf_parse__load_buffer_state (void) static void surf_parse__init_buffer (YY_BUFFER_STATE b, FILE * file ) { - int oerrno = errno; + int oerrno = errno; - surf_parse__flush_buffer(b ); + surf_parse__flush_buffer(b ); - b->yy_input_file = file; - b->yy_fill_buffer = 1; + b->yy_input_file = file; + b->yy_fill_buffer = 1; /* If b is the current buffer, then surf_parse__init_buffer was _probably_ * called from surf_parse_restart() or through yy_get_next_buffer. @@ -10196,7 +10196,7 @@ static void surf_parse__load_buffer_state (void) b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - errno = oerrno; + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. @@ -10205,25 +10205,25 @@ static void surf_parse__load_buffer_state (void) */ void surf_parse__flush_buffer (YY_BUFFER_STATE b ) { - if ( ! b ) - return; + if ( ! b ) + return; - b->yy_n_chars = 0; + b->yy_n_chars = 0; - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - b->yy_buf_pos = &b->yy_ch_buf[0]; + b->yy_buf_pos = &b->yy_ch_buf[0]; - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == YY_CURRENT_BUFFER ) - surf_parse__load_buffer_state( ); + if ( b == YY_CURRENT_BUFFER ) + surf_parse__load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes @@ -10234,28 +10234,28 @@ static void surf_parse__load_buffer_state (void) */ void surf_parse_push_buffer_state (YY_BUFFER_STATE new_buffer ) { - if (new_buffer == NULL) - return; + if (new_buffer == NULL) + return; - surf_parse_ensure_buffer_stack(); + surf_parse_ensure_buffer_stack(); - /* This block is copied from surf_parse__switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } + /* This block is copied from surf_parse__switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; - /* copied from surf_parse__switch_to_buffer. */ - surf_parse__load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; + /* copied from surf_parse__switch_to_buffer. */ + surf_parse__load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. @@ -10264,18 +10264,18 @@ void surf_parse_push_buffer_state (YY_BUFFER_STATE new_buffer ) */ void surf_parse_pop_buffer_state (void) { - if (!YY_CURRENT_BUFFER) - return; + if (!YY_CURRENT_BUFFER) + return; - surf_parse__delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); + surf_parse__delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); - if (YY_CURRENT_BUFFER) { - surf_parse__load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } + if (YY_CURRENT_BUFFER) { + surf_parse__load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } } /* Allocates the stack if it does not exist. @@ -10283,45 +10283,45 @@ void surf_parse_pop_buffer_state (void) */ static void surf_parse_ensure_buffer_stack (void) { - yy_size_t num_to_alloc; + yy_size_t num_to_alloc; - if (!(yy_buffer_stack)) { + if (!(yy_buffer_stack)) { - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)surf_parse_alloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in surf_parse_ensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)surf_parse_realloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in surf_parse_ensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)surf_parse_alloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in surf_parse_ensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)surf_parse_realloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in surf_parse_ensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } } /** Setup the input buffer state to scan directly from a user-specified character buffer. @@ -10332,31 +10332,31 @@ static void surf_parse_ensure_buffer_stack (void) */ YY_BUFFER_STATE surf_parse__scan_buffer (char * base, yy_size_t size ) { - YY_BUFFER_STATE b; + YY_BUFFER_STATE b; - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) surf_parse_alloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in surf_parse__scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - surf_parse__switch_to_buffer(b ); - - return b; + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) surf_parse_alloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in surf_parse__scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + surf_parse__switch_to_buffer(b ); + + return b; } /** Setup the input buffer state to scan a string. The next call to surf_parse_lex() will @@ -10370,7 +10370,7 @@ YY_BUFFER_STATE surf_parse__scan_buffer (char * base, yy_size_t size ) YY_BUFFER_STATE surf_parse__scan_string (yyconst char * yystr ) { - return surf_parse__scan_bytes(yystr,strlen(yystr) ); + return surf_parse__scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to surf_parse_lex() will @@ -10382,64 +10382,64 @@ YY_BUFFER_STATE surf_parse__scan_string (yyconst char * yystr ) */ YY_BUFFER_STATE surf_parse__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - yy_size_t i; + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + yy_size_t i; - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) surf_parse_alloc(n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in surf_parse__scan_bytes()" ); + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) surf_parse_alloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in surf_parse__scan_bytes()" ); - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = surf_parse__scan_buffer(buf,n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in surf_parse__scan_bytes()" ); + b = surf_parse__scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in surf_parse__scan_bytes()" ); - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; - return b; + return b; } static void yy_push_state (int new_state ) { - if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) - { - yy_size_t new_size; + if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) + { + yy_size_t new_size; - (yy_start_stack_depth) += YY_START_STACK_INCR; - new_size = (yy_start_stack_depth) * sizeof( int ); + (yy_start_stack_depth) += YY_START_STACK_INCR; + new_size = (yy_start_stack_depth) * sizeof( int ); - if ( ! (yy_start_stack) ) - (yy_start_stack) = (int *) surf_parse_alloc(new_size ); + if ( ! (yy_start_stack) ) + (yy_start_stack) = (int *) surf_parse_alloc(new_size ); - else - (yy_start_stack) = (int *) surf_parse_realloc((void *) (yy_start_stack),new_size ); + else + (yy_start_stack) = (int *) surf_parse_realloc((void *) (yy_start_stack),new_size ); - if ( ! (yy_start_stack) ) - YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); - } + if ( ! (yy_start_stack) ) + YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); + } - (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; + (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; - BEGIN(new_state); + BEGIN(new_state); } static void yy_pop_state (void) { - if ( --(yy_start_stack_ptr) < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); + if ( --(yy_start_stack_ptr) < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); - BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); + BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); } #ifndef YY_EXIT_FAILURE @@ -10448,26 +10448,26 @@ YY_BUFFER_STATE surf_parse__scan_bytes (yyconst char * yybytes, yy_size_t _yyb static void yy_fatal_error (yyconst char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up surf_parse_text. */ \ + do \ + { \ + /* Undo effects of setting up surf_parse_text. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ - surf_parse_text[surf_parse_leng] = (yy_hold_char); \ - (yy_c_buf_p) = surf_parse_text + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - surf_parse_leng = yyless_macro_arg; \ - } \ - while ( 0 ) + surf_parse_text[surf_parse_leng] = (yy_hold_char); \ + (yy_c_buf_p) = surf_parse_text + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + surf_parse_leng = yyless_macro_arg; \ + } \ + while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ @@ -10589,15 +10589,15 @@ int surf_parse_lex_destroy (void) { /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - surf_parse__delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - surf_parse_pop_buffer_state(); - } + while(YY_CURRENT_BUFFER){ + surf_parse__delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + surf_parse_pop_buffer_state(); + } - /* Destroy the stack itself. */ - surf_parse_free((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; + /* Destroy the stack itself. */ + surf_parse_free((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; /* Destroy the start condition stack. */ surf_parse_free((yy_start_stack) ); @@ -10617,43 +10617,43 @@ int surf_parse_lex_destroy (void) #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - int n; - for ( n = 0; s[n]; ++n ) - ; + int n; + for ( n = 0; s[n]; ++n ) + ; - return n; + return n; } #endif void *surf_parse_alloc (yy_size_t size ) { - return (void *) malloc( size ); + return (void *) malloc( size ); } void *surf_parse_realloc (void * ptr, yy_size_t size ) { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); } void surf_parse_free (void * ptr ) { - free( (char *) ptr ); /* see surf_parse_realloc() for (char *) cast */ + free( (char *) ptr ); /* see surf_parse_realloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" @@ -10662,8 +10662,8 @@ void surf_parse_free (void * ptr ) int surfxml_element_context(int i) { return (0(_write_action); + write_action = static_cast(_write_action); if ((write_action->p_file) == fd) { xbt_dynar_cursor_rm(p_writeActions, &i); write_action->unref(); @@ -316,8 +316,8 @@ StorageAction *StorageN11::write(surf_file_t fd, sg_size_t size) StorageN11Action::StorageN11Action(Model *model, double cost, bool failed, Storage *storage, e_surf_action_storage_type_t type) : StorageAction(model, cost, failed, - lmm_variable_new(model->getMaxminSystem(), this, 1.0, -1.0 , 3), - storage, type) { + lmm_variable_new(model->getMaxminSystem(), this, 1.0, -1.0 , 3), + storage, type) { XBT_IN("(%s,%g", storage->getName(), cost); // Must be less than the max bandwidth for all actions @@ -348,8 +348,8 @@ int StorageN11Action::unref() { m_refcount--; if (!m_refcount) { - if (action_hook.is_linked()) - p_stateSet->erase(p_stateSet->iterator_to(*this)); + if (action_hook.is_linked()) + p_stateSet->erase(p_stateSet->iterator_to(*this)); if (getVariable()) lmm_variable_free(getModel()->getMaxminSystem(), getVariable()); xbt_free(getCategory()); diff --git a/src/surf/storage_n11.hpp b/src/surf/storage_n11.hpp index e34e69465b..ec2c3ae6ae 100644 --- a/src/surf/storage_n11.hpp +++ b/src/surf/storage_n11.hpp @@ -31,7 +31,7 @@ public: StorageN11Model(); ~StorageN11Model(); Storage *createStorage(const char* id, const char* type_id, - const char* content_name, const char* content_type, xbt_dict_t properties, const char* attach); + const char* content_name, const char* content_type, xbt_dict_t properties, const char* attach); void addTraces(){DIE_IMPOSSIBLE;} double shareResources(double now); void updateActionsState(double now, double delta); @@ -44,8 +44,8 @@ public: class StorageN11 : public Storage { public: StorageN11(StorageModel *model, const char* name, xbt_dict_t properties, - lmm_system_t maxminSystem, double bread, double bwrite, double bconnection, - const char* type_id, char *content_name, char *content_type, sg_size_t size, char *attach); + lmm_system_t maxminSystem, double bread, double bwrite, double bconnection, + const char* type_id, char *content_name, char *content_type, sg_size_t size, char *attach); StorageAction *open(const char* mount, const char* path); StorageAction *close(surf_file_t fd); diff --git a/src/surf/surf_c_bindings.cpp b/src/surf/surf_c_bindings.cpp index 8d3fe2c161..16ead873b4 100644 --- a/src/surf/surf_c_bindings.cpp +++ b/src/surf/surf_c_bindings.cpp @@ -76,13 +76,13 @@ double surf_solve(double max_date) XBT_DEBUG("Looking for next event in physical models"); double next_event_phy = surf_host_model->shareResources(NOW); if ((surf_min < 0.0 || next_event_phy < surf_min) && next_event_phy >= 0.0) { - surf_min = next_event_phy; + surf_min = next_event_phy; } if (surf_vm_model != NULL) { - XBT_DEBUG("Looking for next event in virtual models"); - double next_event_virt = surf_vm_model->shareResources(NOW); - if ((surf_min < 0.0 || next_event_virt < surf_min) && next_event_virt >= 0.0) - surf_min = next_event_virt; + XBT_DEBUG("Looking for next event in virtual models"); + double next_event_virt = surf_vm_model->shareResources(NOW); + if ((surf_min < 0.0 || next_event_virt < surf_min) && next_event_virt >= 0.0) + surf_min = next_event_virt; } XBT_DEBUG("Min for resources (remember that NS3 don't update that value): %f", surf_min); @@ -146,7 +146,7 @@ double surf_solve(double max_date) // Inform the models of the date change xbt_dynar_foreach(all_existing_models, iter, model) { - model->updateActionsState(NOW, surf_min); + model->updateActionsState(NOW, surf_min); } TRACE_paje_dump_buffer (0); @@ -160,7 +160,7 @@ double surf_solve(double max_date) surf_action_t surf_model_extract_done_action_set(surf_model_t model){ if (model->getDoneActionSet()->empty()) - return NULL; + return NULL; surf_action_t res = &model->getDoneActionSet()->front(); model->getDoneActionSet()->pop_front(); return res; @@ -168,7 +168,7 @@ surf_action_t surf_model_extract_done_action_set(surf_model_t model){ surf_action_t surf_model_extract_failed_action_set(surf_model_t model){ if (model->getFailedActionSet()->empty()) - return NULL; + return NULL; surf_action_t res = &model->getFailedActionSet()->front(); model->getFailedActionSet()->pop_front(); return res; @@ -198,7 +198,7 @@ const char *surf_resource_name(surf_cpp_resource_t resource){ } surf_action_t surf_host_sleep(sg_host_t host, double duration){ - return host->pimpl_cpu->sleep(duration); + return host->pimpl_cpu->sleep(duration); } diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 2a86c80bb8..5a9ccce4db 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -278,18 +278,18 @@ static XBT_INLINE void surf_storage_free(void *r) void sg_version_check(int lib_version_major,int lib_version_minor,int lib_version_patch) { if ((lib_version_major != SIMGRID_VERSION_MAJOR) || (lib_version_minor != SIMGRID_VERSION_MINOR)) { fprintf(stderr, - "FATAL ERROR: Your program was compiled with SimGrid version %d.%d.%d, " - "and then linked against SimGrid %d.%d.%d. Please fix this.\n", + "FATAL ERROR: Your program was compiled with SimGrid version %d.%d.%d, " + "and then linked against SimGrid %d.%d.%d. Please fix this.\n", SIMGRID_VERSION_MAJOR,SIMGRID_VERSION_MINOR,SIMGRID_VERSION_PATCH, - lib_version_major,lib_version_minor,lib_version_patch); + lib_version_major,lib_version_minor,lib_version_patch); abort(); } if (lib_version_patch != SIMGRID_VERSION_PATCH) { fprintf(stderr, - "Warning: Your program was compiled with SimGrid version %d.%d.%d, " - "and then linked against SimGrid %d.%d.%d. Proceeding anyway.\n", + "Warning: Your program was compiled with SimGrid version %d.%d.%d, " + "and then linked against SimGrid %d.%d.%d. Proceeding anyway.\n", SIMGRID_VERSION_MAJOR,SIMGRID_VERSION_MINOR,SIMGRID_VERSION_PATCH, - lib_version_major,lib_version_minor,lib_version_patch); + lib_version_major,lib_version_minor,lib_version_patch); } } @@ -537,7 +537,7 @@ double Model::shareResourcesMaxMin(ActionList *running_actions, for (++it; it != itend; ++it) { - action = &*it; + action = &*it; value = lmm_variable_getvalue(action->getVariable()); if (value > 0) { if (action->getRemains() > 0) @@ -562,11 +562,11 @@ double Model::shareResourcesMaxMin(ActionList *running_actions, void Model::updateActionsState(double now, double delta) { if (p_updateMechanism == UM_FULL) - updateActionsStateFull(now, delta); + updateActionsStateFull(now, delta); else if (p_updateMechanism == UM_LAZY) - updateActionsStateLazy(now, delta); + updateActionsStateLazy(now, delta); else - xbt_die("Invalid cpu update mechanism!"); + xbt_die("Invalid cpu update mechanism!"); } void Model::updateActionsStateLazy(double /*now*/, double /*delta*/) diff --git a/src/surf/surf_routing.cpp b/src/surf/surf_routing.cpp index 033bcf454e..afb17ba2cc 100644 --- a/src/surf/surf_routing.cpp +++ b/src/surf/surf_routing.cpp @@ -145,7 +145,7 @@ void sg_platf_new_netcard(sg_platf_host_link_cbarg_t netcard) // If dynar is is greater than netcard id and if the host_link is already defined if((int)xbt_dynar_length(current_routing->p_linkUpDownList) > info->getId() && xbt_dynar_get_as(current_routing->p_linkUpDownList, info->getId(), void*)) - surf_parse_error("Host_link for '%s' is already defined!",netcard->id); + surf_parse_error("Host_link for '%s' is already defined!",netcard->id); XBT_DEBUG("Push Host_link for host '%s' to position %d", info->getName(), info->getId()); xbt_dynar_set_as(current_routing->p_linkUpDownList, info->getId(), s_surf_parsing_link_up_down_t, link_up_down); @@ -160,13 +160,13 @@ simgrid::surf::NetCard *routing_add_host( if (current_routing->p_hierarchy == SURF_ROUTING_NULL) current_routing->p_hierarchy = SURF_ROUTING_BASE; xbt_assert(!sg_host_by_name(host->id), - "Reading a host, processing unit \"%s\" already exists", host->id); + "Reading a host, processing unit \"%s\" already exists", host->id); simgrid::surf::NetCard *netcard = new simgrid::surf::NetCardImpl(xbt_strdup(host->id), - -1, - SURF_NETWORK_ELEMENT_HOST, - current_routing); + -1, + SURF_NETWORK_ELEMENT_HOST, + current_routing); netcard->setId(current_routing->parsePU(netcard)); sg_host_t h = sg_host_by_name_or_create(host->id); h->pimpl_netcard = netcard; @@ -791,13 +791,13 @@ void routing_new_cluster(sg_platf_cluster_cbarg_t cluster) memset(&host, 0, sizeof(host)); host.id = host_id; if ((cluster->properties != NULL) && (!xbt_dict_is_empty(cluster->properties))) { - xbt_dict_cursor_t cursor=NULL; - char *key,*data; - host.properties = xbt_dict_new(); + xbt_dict_cursor_t cursor=NULL; + char *key,*data; + host.properties = xbt_dict_new(); - xbt_dict_foreach(cluster->properties,cursor,key,data) { - xbt_dict_set(host.properties, key, xbt_strdup(data),free); - } + xbt_dict_foreach(cluster->properties,cursor,key,data) { + xbt_dict_set(host.properties, key, xbt_strdup(data),free); + } } if (cluster->availability_trace && strcmp(cluster->availability_trace, "")) { xbt_dict_set(patterns, "radical", bprintf("%d", i), NULL); @@ -895,7 +895,7 @@ void routing_new_cluster(sg_platf_cluster_cbarg_t cluster) } else { static_cast(current_routing)->create_links_for_node(cluster, i, rankId, rankId* - static_cast(current_routing)->p_nb_links_per_node + static_cast(current_routing)->p_nb_links_per_node + static_cast(current_routing)->p_has_loopback + static_cast(current_routing)->p_has_limiter ); } @@ -1174,10 +1174,10 @@ static void check_disk_attachment() simgrid::surf::NetCard *host_elm; xbt_lib_foreach(storage_lib, cursor, key, data) { if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != NULL) { - simgrid::surf::Storage *storage = static_cast(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL)); - host_elm = sg_netcard_by_name_or_null(storage->p_attach); - if(!host_elm) - surf_parse_error("Unable to attach storage %s: host %s doesn't exist.", storage->getName(), storage->p_attach); + simgrid::surf::Storage *storage = static_cast(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL)); + host_elm = sg_netcard_by_name_or_null(storage->p_attach); + if(!host_elm) + surf_parse_error("Unable to attach storage %s: host %s doesn't exist.", storage->getName(), storage->p_attach); } } } @@ -1220,8 +1220,8 @@ namespace surf { RoutingPlatf::~RoutingPlatf() { - xbt_dynar_free(&p_lastRoute); - finalize_rec(p_root); + xbt_dynar_free(&p_lastRoute); + finalize_rec(p_root); } } diff --git a/src/surf/surf_routing_dijkstra.cpp b/src/surf/surf_routing_dijkstra.cpp index be44ced9af..dbf3931623 100644 --- a/src/surf/surf_routing_dijkstra.cpp +++ b/src/surf/surf_routing_dijkstra.cpp @@ -435,7 +435,7 @@ void AsDijkstra::end() /* Create the topology graph */ if(!p_routeGraph) - p_routeGraph = xbt_graph_new_graph(1, NULL); + p_routeGraph = xbt_graph_new_graph(1, NULL); if(!p_graphNodeMap) p_graphNodeMap = xbt_dict_new_homogeneous(&graph_node_map_elem_free); diff --git a/src/surf/surf_routing_dijkstra.hpp b/src/surf/surf_routing_dijkstra.hpp index a5ef07e3ed..bcae26f09f 100644 --- a/src/surf/surf_routing_dijkstra.hpp +++ b/src/surf/surf_routing_dijkstra.hpp @@ -39,9 +39,9 @@ public: AsDijkstra(); AsDijkstra(bool cached); ~AsDijkstra(); - xbt_node_t routeGraphNewNode(int id, int graph_id); - graph_node_map_element_t nodeMapSearch(int id); - void newRoute(int src_id, int dst_id, sg_platf_route_cbarg_t e_route); + xbt_node_t routeGraphNewNode(int id, int graph_id); + graph_node_map_element_t nodeMapSearch(int id); + void newRoute(int src_id, int dst_id, sg_platf_route_cbarg_t e_route); /** * For each vertex (node) already in the graph, * make sure it also has a loopback link; this loopback @@ -54,13 +54,13 @@ public: * After this function returns, any node in the graph * will have a loopback attached to it. */ - void addLoopback(); - void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t route, double *lat) override; - xbt_dynar_t getOneLinkRoutes() override; - void getRouteAndLatency(sg_platf_route_cbarg_t route, double *lat); // FIXME: this function is dangerously not overriding because of diverging prototype - void parseASroute(sg_platf_route_cbarg_t route) override; - void parseRoute(sg_platf_route_cbarg_t route) override; - void end(); + void addLoopback(); + void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t route, double *lat) override; + xbt_dynar_t getOneLinkRoutes() override; + void getRouteAndLatency(sg_platf_route_cbarg_t route, double *lat); // FIXME: this function is dangerously not overriding because of diverging prototype + void parseASroute(sg_platf_route_cbarg_t route) override; + void parseRoute(sg_platf_route_cbarg_t route) override; + void end(); xbt_graph_t p_routeGraph = nullptr; /* xbt_graph */ xbt_dict_t p_graphNodeMap = nullptr; /* map */ diff --git a/src/surf/surf_routing_floyd.cpp b/src/surf/surf_routing_floyd.cpp index 2ece750ad6..7f2c653bb8 100644 --- a/src/surf/surf_routing_floyd.cpp +++ b/src/surf/surf_routing_floyd.cpp @@ -38,12 +38,12 @@ AsFloyd::~AsFloyd(){ int table_size; table_size = (int)xbt_dynar_length(p_indexNetworkElm); if (p_linkTable == NULL) // Dealing with a parse error in the file? - return; + return; /* Delete link_table */ for (i = 0; i < table_size; i++) - for (j = 0; j < table_size; j++) { - generic_free_route(TO_FLOYD_LINK(i, j)); - } + for (j = 0; j < table_size; j++) { + generic_free_route(TO_FLOYD_LINK(i, j)); + } xbt_free(p_linkTable); /* Delete bypass dict */ xbt_dict_free(&p_bypassRoutes); @@ -260,7 +260,7 @@ void AsFloyd::parseRoute(sg_platf_route_cbarg_t route) route->gw_src->getName(), src, route->gw_dst->getName()); TO_FLOYD_LINK(dst_net_elm->getId(), src_net_elm->getId()) = - newExtendedRoute(p_hierarchy, route, 0); + newExtendedRoute(p_hierarchy, route, 0); TO_FLOYD_PRED(dst_net_elm->getId(), src_net_elm->getId()) = dst_net_elm->getId(); TO_FLOYD_COST(dst_net_elm->getId(), src_net_elm->getId()) = ((TO_FLOYD_LINK(dst_net_elm->getId(), src_net_elm->getId()))->link_list)->used; /* count of links, old model assume 1 */ diff --git a/src/surf/surf_routing_full.cpp b/src/surf/surf_routing_full.cpp index a3ffd03c52..67363d71e9 100644 --- a/src/surf/surf_routing_full.cpp +++ b/src/surf/surf_routing_full.cpp @@ -80,10 +80,10 @@ xbt_dynar_t AsFull::getOneLinkRoutes() void *link = *(void **) xbt_dynar_get_ptr(route->link_list, 0); Onelink *onelink; if (p_hierarchy == SURF_ROUTING_BASE) { - NetCard *tmp_src = xbt_dynar_get_as(p_indexNetworkElm, src, sg_netcard_t); + NetCard *tmp_src = xbt_dynar_get_as(p_indexNetworkElm, src, sg_netcard_t); tmp_src->setId(src); - NetCard *tmp_dst = xbt_dynar_get_as(p_indexNetworkElm, dst, sg_netcard_t); - tmp_dst->setId(dst); + NetCard *tmp_dst = xbt_dynar_get_as(p_indexNetworkElm, dst, sg_netcard_t); + tmp_dst->setId(dst); onelink = new Onelink(link, tmp_src, tmp_dst); } else if (p_hierarchy == SURF_ROUTING_RECURSIVE) onelink = new Onelink(link, route->gw_src, route->gw_dst); @@ -213,11 +213,11 @@ void AsFull::parseRoute(sg_platf_route_cbarg_t route) XBT_DEBUG("Load ASroute from \"%s\" to \"%s\"", src, dst); if (!route->gw_src || route->gw_src->getRcType() == SURF_NETWORK_ELEMENT_NULL) - surf_parse_error("The src_gateway \"%s\" does not exist!", + surf_parse_error("The src_gateway \"%s\" does not exist!", route->gw_src ? route->gw_src->getName() : "(null)"); if (!route->gw_dst || route->gw_dst->getRcType() == SURF_NETWORK_ELEMENT_NULL) - surf_parse_error("The dst_gateway \"%s\" does not exist!", + surf_parse_error("The dst_gateway \"%s\" does not exist!", route->gw_dst ? route->gw_dst->getName() : "(null)"); XBT_DEBUG("ASroute goes from \"%s\" to \"%s\"", route->gw_src->getName(), route->gw_dst->getName()); diff --git a/src/surf/surf_routing_generic.cpp b/src/surf/surf_routing_generic.cpp index 982038daf4..a95b47ecb5 100644 --- a/src/surf/surf_routing_generic.cpp +++ b/src/surf/surf_routing_generic.cpp @@ -337,7 +337,7 @@ sg_platf_route_cbarg_t AsGeneric::getBypassRoute(NetCard *src, sg_platf_route_cbarg_t new_e_route = NULL; if (e_route_bypass) { - Link* link; + Link* link; unsigned int cpt = 0; new_e_route = xbt_new0(s_sg_platf_route_cbarg_t, 1); new_e_route->gw_src = e_route_bypass->gw_src; diff --git a/src/surf/surf_routing_none.cpp b/src/surf/surf_routing_none.cpp index 4ba9287b31..a4e5059ed2 100644 --- a/src/surf/surf_routing_none.cpp +++ b/src/surf/surf_routing_none.cpp @@ -29,7 +29,7 @@ void AsNone::getRouteAndLatency(NetCard * /*src*/, NetCard * /*dst*/, void AsNone::getGraph(xbt_graph_t /*graph*/, xbt_dict_t /*nodes*/, xbt_dict_t /*edges*/) { - XBT_INFO("No routing no graph"); + XBT_INFO("No routing no graph"); } sg_platf_route_cbarg_t AsNone::getBypassRoute(NetCard * /*src*/, NetCard * /*dst*/, double * /*lat*/) { diff --git a/src/surf/surf_routing_vivaldi.cpp b/src/surf/surf_routing_vivaldi.cpp index b31f273e16..6e9d4bcf80 100644 --- a/src/surf/surf_routing_vivaldi.cpp +++ b/src/surf/surf_routing_vivaldi.cpp @@ -35,7 +35,7 @@ void AsVivaldi::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cb s_surf_parsing_link_up_down_t info; XBT_DEBUG("vivaldi_get_route_and_latency from '%s'[%d] '%s'[%d]", - src->getName(), src->getId(), dst->getName(), dst->getId()); + src->getName(), src->getId(), dst->getName(), dst->getId()); if(src->getRcType() == SURF_NETWORK_ELEMENT_AS) { char *src_name = ROUTER_PEER(src->getName()); diff --git a/src/surf/surfxml_parse.cpp b/src/surf/surfxml_parse.cpp index 6652174c66..b440ea3bda 100644 --- a/src/surf/surfxml_parse.cpp +++ b/src/surf/surfxml_parse.cpp @@ -442,23 +442,23 @@ void ETag_surfxml_host(void) { XBT_DEBUG("Buffer: %s", buf); host.speed_peak = xbt_dynar_new(sizeof(double), NULL); if (strchr(buf, ',') == NULL){ - double speed = parse_cpu_speed(A_surfxml_host_power); - xbt_dynar_push_as(host.speed_peak,double, speed); + double speed = parse_cpu_speed(A_surfxml_host_power); + xbt_dynar_push_as(host.speed_peak,double, speed); } else { - xbt_dynar_t pstate_list = xbt_str_split(buf, ","); - unsigned int i; - for (i = 0; i < xbt_dynar_length(pstate_list); i++) { - double speed; - char* speed_str; - - xbt_dynar_get_cpy(pstate_list, i, &speed_str); - xbt_str_trim(speed_str, NULL); - speed = parse_cpu_speed(speed_str); - xbt_dynar_push_as(host.speed_peak, double, speed); - XBT_DEBUG("Speed value: %f", speed); - } - xbt_dynar_free(&pstate_list); + xbt_dynar_t pstate_list = xbt_str_split(buf, ","); + unsigned int i; + for (i = 0; i < xbt_dynar_length(pstate_list); i++) { + double speed; + char* speed_str; + + xbt_dynar_get_cpy(pstate_list, i, &speed_str); + xbt_str_trim(speed_str, NULL); + speed = parse_cpu_speed(speed_str); + xbt_dynar_push_as(host.speed_peak, double, speed); + XBT_DEBUG("Speed value: %f", speed); + } + xbt_dynar_free(&pstate_list); } XBT_DEBUG("pstate: %s", A_surfxml_host_pstate); diff --git a/src/surf/surfxml_parseplatf.cpp b/src/surf/surfxml_parseplatf.cpp index 5a9ea0ea3a..63df75bb5e 100644 --- a/src/surf/surfxml_parseplatf.cpp +++ b/src/surf/surfxml_parseplatf.cpp @@ -114,7 +114,7 @@ void sg_platf_trace_connect(sg_platf_trace_connect_cbarg_t trace_connect) static int after_config_done; void parse_after_config() { if (!after_config_done) { - TRACE_start(); + TRACE_start(); /* Register classical callbacks */ storage_register_callbacks(); diff --git a/src/surf/virtual_machine.hpp b/src/surf/virtual_machine.hpp index 26f37117a1..21c48969d0 100644 --- a/src/surf/virtual_machine.hpp +++ b/src/surf/virtual_machine.hpp @@ -62,7 +62,7 @@ public: * @param host The host */ VirtualMachine(simgrid::surf::HostModel *model, const char *name, xbt_dict_t props, - simgrid::s4u::Host *host); + simgrid::s4u::Host *host); /** @brief Destructor */ ~VirtualMachine(); diff --git a/src/surf/vm_hl13.cpp b/src/surf/vm_hl13.cpp index d34f21dbb5..35b7b7bf4a 100644 --- a/src/surf/vm_hl13.cpp +++ b/src/surf/vm_hl13.cpp @@ -108,16 +108,16 @@ double VMHL13Model::shareResources(double now) XBT_DEBUG("model %p, %s min_by_cpu %f, %s min_by_net %f, %s min_by_sto %f", this, typeid(surf_cpu_model_pm ).name(), min_by_cpu, - typeid(surf_network_model).name(), min_by_net, + typeid(surf_network_model).name(), min_by_net, typeid(surf_storage_model).name(), min_by_sto); double ret = std::max(std::max(min_by_cpu, min_by_net), min_by_sto); if (min_by_cpu >= 0.0 && min_by_cpu < ret) - ret = min_by_cpu; + ret = min_by_cpu; if (min_by_net >= 0.0 && min_by_net < ret) - ret = min_by_net; + ret = min_by_net; if (min_by_sto >= 0.0 && min_by_sto < ret) - ret = min_by_sto; + ret = min_by_sto; return ret; } diff --git a/src/xbt/automaton/automaton_lexer.yy.c b/src/xbt/automaton/automaton_lexer.yy.c index da2a760074..ffda1f809c 100644 --- a/src/xbt/automaton/automaton_lexer.yy.c +++ b/src/xbt/automaton/automaton_lexer.yy.c @@ -112,15 +112,15 @@ typedef unsigned int flex_uint32_t; /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST -#else /* ! __cplusplus */ +#else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const @@ -199,83 +199,83 @@ extern FILE *xbt_automaton_parser_in, *xbt_automaton_parser_out; /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up xbt_automaton_parser_text. */ \ + do \ + { \ + /* Undo effects of setting up xbt_automaton_parser_text. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up xbt_automaton_parser_text again */ \ - } \ - while ( 0 ) + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up xbt_automaton_parser_text again */ \ + } \ + while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - yy_size_t yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + yy_size_t yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; - int yy_buffer_status; + int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via xbt_automaton_parser_restart()), so that the user can continue scanning by - * just pointing xbt_automaton_parser_in at a new input file. - */ + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via xbt_automaton_parser_restart()), so that the user can continue scanning by + * just pointing xbt_automaton_parser_in at a new input file. + */ #define YY_BUFFER_EOF_PENDING 2 - }; + }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ @@ -300,13 +300,13 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when xbt_automaton_parser_text is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t xbt_automaton_parser_leng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ /* Flag which is used to allow xbt_automaton_parser_wrap()'s to do buffer switches * instead of setting up a fresh xbt_automaton_parser_in. A bit of a hack ... @@ -338,24 +338,24 @@ void xbt_automaton_parser_free (void * ); #define yy_new_buffer xbt_automaton_parser__create_buffer #define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ xbt_automaton_parser_ensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ + YY_CURRENT_BUFFER_LVALUE = \ xbt_automaton_parser__create_buffer(xbt_automaton_parser_in,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } #define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ + { \ + if ( ! YY_CURRENT_BUFFER ){\ xbt_automaton_parser_ensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ + YY_CURRENT_BUFFER_LVALUE = \ xbt_automaton_parser__create_buffer(xbt_automaton_parser_in,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) @@ -386,21 +386,21 @@ static void yy_fatal_error (yyconst char msg[] ); * corresponding action - sets up xbt_automaton_parser_text. */ #define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - xbt_automaton_parser_leng = (size_t) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; + (yytext_ptr) = yy_bp; \ + xbt_automaton_parser_leng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 25 #define YY_END_OF_BUFFER 26 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; static yyconst flex_int16_t yy_accept[54] = { 0, 0, 0, 26, 24, 18, 23, 8, 24, 24, 9, @@ -647,33 +647,33 @@ static int input (void ); */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( xbt_automaton_parser_in )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( xbt_automaton_parser_in ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, xbt_automaton_parser_in))==0 && ferror(xbt_automaton_parser_in)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(xbt_automaton_parser_in); \ - } \ - }\ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + size_t n; \ + for ( n = 0; n < max_size && \ + (c = getc( xbt_automaton_parser_in )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( xbt_automaton_parser_in ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, xbt_automaton_parser_in))==0 && ferror(xbt_automaton_parser_in)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(xbt_automaton_parser_in); \ + } \ + }\ \ #endif @@ -722,206 +722,206 @@ extern int xbt_automaton_parser_lex (void); #endif #define YY_RULE_SETUP \ - YY_USER_ACTION + YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; - if ( !(yy_init) ) - { - (yy_init) = 1; + if ( !(yy_init) ) + { + (yy_init) = 1; #ifdef YY_USER_INIT - YY_USER_INIT; + YY_USER_INIT; #endif - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ - if ( ! xbt_automaton_parser_in ) - xbt_automaton_parser_in = stdin; + if ( ! xbt_automaton_parser_in ) + xbt_automaton_parser_in = stdin; - if ( ! xbt_automaton_parser_out ) - xbt_automaton_parser_out = stdout; + if ( ! xbt_automaton_parser_out ) + xbt_automaton_parser_out = stdout; - if ( ! YY_CURRENT_BUFFER ) { - xbt_automaton_parser_ensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - xbt_automaton_parser__create_buffer(xbt_automaton_parser_in,YY_BUF_SIZE ); - } + if ( ! YY_CURRENT_BUFFER ) { + xbt_automaton_parser_ensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + xbt_automaton_parser__create_buffer(xbt_automaton_parser_in,YY_BUF_SIZE ); + } - xbt_automaton_parser__load_buffer_state( ); - } + xbt_automaton_parser__load_buffer_state( ); + } - { + { #line 45 "parserPromela.lex" #line 766 "automaton_lexer.yy.c" - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); - /* Support of xbt_automaton_parser_text. */ - *yy_cp = (yy_hold_char); + /* Support of xbt_automaton_parser_text. */ + *yy_cp = (yy_hold_char); - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; - yy_current_state = (yy_start); + yy_current_state = (yy_start); yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 54 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 90 ); + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 54 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 90 ); yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; case 1: YY_RULE_SETUP #line 47 "parserPromela.lex" { return (NEVER); } - YY_BREAK + YY_BREAK case 2: YY_RULE_SETUP #line 48 "parserPromela.lex" { return (IF); } - YY_BREAK + YY_BREAK case 3: YY_RULE_SETUP #line 49 "parserPromela.lex" { return (FI); } - YY_BREAK + YY_BREAK case 4: YY_RULE_SETUP #line 50 "parserPromela.lex" { return (IMPLIES); } - YY_BREAK + YY_BREAK case 5: YY_RULE_SETUP #line 51 "parserPromela.lex" { return (GOTO); } - YY_BREAK + YY_BREAK case 6: YY_RULE_SETUP #line 52 "parserPromela.lex" { return (AND); } - YY_BREAK + YY_BREAK case 7: YY_RULE_SETUP #line 53 "parserPromela.lex" { return (OR); } - YY_BREAK + YY_BREAK case 8: YY_RULE_SETUP #line 54 "parserPromela.lex" { return (NOT); } - YY_BREAK + YY_BREAK case 9: YY_RULE_SETUP #line 55 "parserPromela.lex" { return (LEFT_PAR); } - YY_BREAK + YY_BREAK case 10: YY_RULE_SETUP #line 56 "parserPromela.lex" { return (RIGHT_PAR); } - YY_BREAK + YY_BREAK case 11: YY_RULE_SETUP #line 57 "parserPromela.lex" { return (CASE); } - YY_BREAK + YY_BREAK case 12: YY_RULE_SETUP #line 58 "parserPromela.lex" { return (COLON); } - YY_BREAK + YY_BREAK case 13: YY_RULE_SETUP #line 59 "parserPromela.lex" { return (SEMI_COLON); } - YY_BREAK + YY_BREAK case 14: YY_RULE_SETUP #line 60 "parserPromela.lex" { return (CASE_TRUE); } - YY_BREAK + YY_BREAK case 15: YY_RULE_SETUP #line 61 "parserPromela.lex" { return (LEFT_BRACE); } - YY_BREAK + YY_BREAK case 16: YY_RULE_SETUP #line 62 "parserPromela.lex" { return (RIGHT_BRACE); } - YY_BREAK + YY_BREAK case 17: /* rule 17 can match eol */ YY_RULE_SETUP #line 65 "parserPromela.lex" { } - YY_BREAK + YY_BREAK case 18: YY_RULE_SETUP #line 67 "parserPromela.lex" { } - YY_BREAK + YY_BREAK case 19: YY_RULE_SETUP #line 70 "parserPromela.lex" { sscanf(xbt_automaton_parser_text,"%lf",&yylval.real); return (LITT_REEL); } - YY_BREAK + YY_BREAK case 20: YY_RULE_SETUP #line 73 "parserPromela.lex" { sscanf(xbt_automaton_parser_text,"%d",&yylval.integer); return (LITT_ENT); } - YY_BREAK + YY_BREAK case 21: /* rule 21 can match eol */ YY_RULE_SETUP @@ -929,395 +929,395 @@ YY_RULE_SETUP { yylval.string=(char *)malloc(strlen(xbt_automaton_parser_text)+1); sscanf(xbt_automaton_parser_text,"%s",yylval.string); return (LITT_CHAINE); } - YY_BREAK + YY_BREAK case 22: YY_RULE_SETUP #line 80 "parserPromela.lex" { yylval.string=(char *)malloc(strlen(xbt_automaton_parser_text)+1); sscanf(xbt_automaton_parser_text,"%s",yylval.string); - return (ID); } - YY_BREAK + return (ID); } + YY_BREAK case 23: /* rule 23 can match eol */ YY_RULE_SETUP #line 84 "parserPromela.lex" { } - YY_BREAK + YY_BREAK case 24: YY_RULE_SETUP #line 86 "parserPromela.lex" { } - YY_BREAK + YY_BREAK case 25: YY_RULE_SETUP #line 88 "parserPromela.lex" ECHO; - YY_BREAK + YY_BREAK #line 957 "automaton_lexer.yy.c" case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed xbt_automaton_parser_in at a new source and called - * xbt_automaton_parser_lex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = xbt_automaton_parser_in; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_c_buf_p); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( xbt_automaton_parser_wrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * xbt_automaton_parser_text, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of user's declarations */ + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed xbt_automaton_parser_in at a new source and called + * xbt_automaton_parser_lex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = xbt_automaton_parser_in; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( xbt_automaton_parser_wrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * xbt_automaton_parser_text, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of xbt_automaton_parser_lex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - yy_size_t num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - yy_size_t new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - xbt_automaton_parser_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - xbt_automaton_parser_restart(xbt_automaton_parser_in ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) xbt_automaton_parser_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); + register int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + yy_size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + yy_size_t new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + xbt_automaton_parser_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } - return ret_val; + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + xbt_automaton_parser_restart(xbt_automaton_parser_in ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) xbt_automaton_parser_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; + register yy_state_type yy_current_state; + register char *yy_cp; - yy_current_state = (yy_start); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 54 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; + yy_current_state = (yy_start); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 54 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis - * next_state = yy_try_NUL_trans( current_state ); + * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 54 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 53); - - return yy_is_jam ? 0 : yy_current_state; + register int yy_is_jam; + register char *yy_cp = (yy_c_buf_p); + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 54 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 53); + + return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) { - register char *yy_cp; + register char *yy_cp; yy_cp = (yy_c_buf_p); - /* undo effects of setting up xbt_automaton_parser_text */ - *yy_cp = (yy_hold_char); + /* undo effects of setting up xbt_automaton_parser_text */ + *yy_cp = (yy_hold_char); - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register yy_size_t number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register yy_size_t number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + register char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - *--dest = *--source; + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } - *--yy_cp = (char) c; + *--yy_cp = (char) c; - (yytext_ptr) = yy_bp; - (yy_hold_char) = *yy_cp; - (yy_c_buf_p) = yy_cp; + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; } #ifndef YY_NO_INPUT @@ -1328,71 +1328,71 @@ static int yy_get_next_buffer (void) #endif { - int c; + int c; - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - xbt_automaton_parser_restart(xbt_automaton_parser_in ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( xbt_automaton_parser_wrap( ) ) - return EOF; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + xbt_automaton_parser_restart(xbt_automaton_parser_in ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( xbt_automaton_parser_wrap( ) ) + return EOF; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; #ifdef __cplusplus - return yyinput(); + return yyinput(); #else - return input(); + return input(); #endif - } + } - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve xbt_automaton_parser_text */ - (yy_hold_char) = *++(yy_c_buf_p); + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve xbt_automaton_parser_text */ + (yy_hold_char) = *++(yy_c_buf_p); - return c; + return c; } -#endif /* ifndef YY_NO_INPUT */ +#endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. @@ -1402,14 +1402,14 @@ static int yy_get_next_buffer (void) void xbt_automaton_parser_restart (FILE * input_file ) { - if ( ! YY_CURRENT_BUFFER ){ + if ( ! YY_CURRENT_BUFFER ){ xbt_automaton_parser_ensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = + YY_CURRENT_BUFFER_LVALUE = xbt_automaton_parser__create_buffer(xbt_automaton_parser_in,YY_BUF_SIZE ); - } + } - xbt_automaton_parser__init_buffer(YY_CURRENT_BUFFER,input_file ); - xbt_automaton_parser__load_buffer_state( ); + xbt_automaton_parser__init_buffer(YY_CURRENT_BUFFER,input_file ); + xbt_automaton_parser__load_buffer_state( ); } /** Switch to a different input buffer. @@ -1419,40 +1419,40 @@ static int yy_get_next_buffer (void) void xbt_automaton_parser__switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - /* TODO. We should be able to replace this entire function body - * with - * xbt_automaton_parser_pop_buffer_state(); - * xbt_automaton_parser_push_buffer_state(new_buffer); + /* TODO. We should be able to replace this entire function body + * with + * xbt_automaton_parser_pop_buffer_state(); + * xbt_automaton_parser_push_buffer_state(new_buffer); */ - xbt_automaton_parser_ensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - xbt_automaton_parser__load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (xbt_automaton_parser_wrap()) processing, but the only time this flag - * is looked at is after xbt_automaton_parser_wrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; + xbt_automaton_parser_ensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + xbt_automaton_parser__load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (xbt_automaton_parser_wrap()) processing, but the only time this flag + * is looked at is after xbt_automaton_parser_wrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; } static void xbt_automaton_parser__load_buffer_state (void) { - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - xbt_automaton_parser_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + xbt_automaton_parser_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. @@ -1463,26 +1463,26 @@ static void xbt_automaton_parser__load_buffer_state (void) */ YY_BUFFER_STATE xbt_automaton_parser__create_buffer (FILE * file, int size ) { - YY_BUFFER_STATE b; + YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) xbt_automaton_parser_alloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__create_buffer()" ); + b = (YY_BUFFER_STATE) xbt_automaton_parser_alloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = size; - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) xbt_automaton_parser_alloc(b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__create_buffer()" ); + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) xbt_automaton_parser_alloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__create_buffer()" ); - b->yy_is_our_buffer = 1; + b->yy_is_our_buffer = 1; - xbt_automaton_parser__init_buffer(b,file ); + xbt_automaton_parser__init_buffer(b,file ); - return b; + return b; } /** Destroy the buffer. @@ -1492,16 +1492,16 @@ static void xbt_automaton_parser__load_buffer_state (void) void xbt_automaton_parser__delete_buffer (YY_BUFFER_STATE b ) { - if ( ! b ) - return; + if ( ! b ) + return; - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - if ( b->yy_is_our_buffer ) - xbt_automaton_parser_free((void *) b->yy_ch_buf ); + if ( b->yy_is_our_buffer ) + xbt_automaton_parser_free((void *) b->yy_ch_buf ); - xbt_automaton_parser_free((void *) b ); + xbt_automaton_parser_free((void *) b ); } /* Initializes or reinitializes a buffer. @@ -1511,12 +1511,12 @@ static void xbt_automaton_parser__load_buffer_state (void) static void xbt_automaton_parser__init_buffer (YY_BUFFER_STATE b, FILE * file ) { - int oerrno = errno; + int oerrno = errno; - xbt_automaton_parser__flush_buffer(b ); + xbt_automaton_parser__flush_buffer(b ); - b->yy_input_file = file; - b->yy_fill_buffer = 1; + b->yy_input_file = file; + b->yy_fill_buffer = 1; /* If b is the current buffer, then xbt_automaton_parser__init_buffer was _probably_ * called from xbt_automaton_parser_restart() or through yy_get_next_buffer. @@ -1529,7 +1529,7 @@ static void xbt_automaton_parser__load_buffer_state (void) b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - errno = oerrno; + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. @@ -1538,25 +1538,25 @@ static void xbt_automaton_parser__load_buffer_state (void) */ void xbt_automaton_parser__flush_buffer (YY_BUFFER_STATE b ) { - if ( ! b ) - return; + if ( ! b ) + return; - b->yy_n_chars = 0; + b->yy_n_chars = 0; - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - b->yy_buf_pos = &b->yy_ch_buf[0]; + b->yy_buf_pos = &b->yy_ch_buf[0]; - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == YY_CURRENT_BUFFER ) - xbt_automaton_parser__load_buffer_state( ); + if ( b == YY_CURRENT_BUFFER ) + xbt_automaton_parser__load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes @@ -1567,28 +1567,28 @@ static void xbt_automaton_parser__load_buffer_state (void) */ void xbt_automaton_parser_push_buffer_state (YY_BUFFER_STATE new_buffer ) { - if (new_buffer == NULL) - return; - - xbt_automaton_parser_ensure_buffer_stack(); - - /* This block is copied from xbt_automaton_parser__switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from xbt_automaton_parser__switch_to_buffer. */ - xbt_automaton_parser__load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; + if (new_buffer == NULL) + return; + + xbt_automaton_parser_ensure_buffer_stack(); + + /* This block is copied from xbt_automaton_parser__switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from xbt_automaton_parser__switch_to_buffer. */ + xbt_automaton_parser__load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. @@ -1597,18 +1597,18 @@ void xbt_automaton_parser_push_buffer_state (YY_BUFFER_STATE new_buffer ) */ void xbt_automaton_parser_pop_buffer_state (void) { - if (!YY_CURRENT_BUFFER) - return; - - xbt_automaton_parser__delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - xbt_automaton_parser__load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } + if (!YY_CURRENT_BUFFER) + return; + + xbt_automaton_parser__delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + xbt_automaton_parser__load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } } /* Allocates the stack if it does not exist. @@ -1616,45 +1616,45 @@ void xbt_automaton_parser_pop_buffer_state (void) */ static void xbt_automaton_parser_ensure_buffer_stack (void) { - yy_size_t num_to_alloc; + yy_size_t num_to_alloc; - if (!(yy_buffer_stack)) { + if (!(yy_buffer_stack)) { - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)xbt_automaton_parser_alloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser_ensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)xbt_automaton_parser_realloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser_ensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)xbt_automaton_parser_alloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser_ensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)xbt_automaton_parser_realloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser_ensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } } /** Setup the input buffer state to scan directly from a user-specified character buffer. @@ -1665,31 +1665,31 @@ static void xbt_automaton_parser_ensure_buffer_stack (void) */ YY_BUFFER_STATE xbt_automaton_parser__scan_buffer (char * base, yy_size_t size ) { - YY_BUFFER_STATE b; + YY_BUFFER_STATE b; - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) xbt_automaton_parser_alloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - xbt_automaton_parser__switch_to_buffer(b ); - - return b; + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) xbt_automaton_parser_alloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + xbt_automaton_parser__switch_to_buffer(b ); + + return b; } /** Setup the input buffer state to scan a string. The next call to xbt_automaton_parser_lex() will @@ -1703,7 +1703,7 @@ YY_BUFFER_STATE xbt_automaton_parser__scan_buffer (char * base, yy_size_t size YY_BUFFER_STATE xbt_automaton_parser__scan_string (yyconst char * yystr ) { - return xbt_automaton_parser__scan_bytes(yystr,strlen(yystr) ); + return xbt_automaton_parser__scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to xbt_automaton_parser_lex() will @@ -1715,32 +1715,32 @@ YY_BUFFER_STATE xbt_automaton_parser__scan_string (yyconst char * yystr ) */ YY_BUFFER_STATE xbt_automaton_parser__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - yy_size_t i; + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + yy_size_t i; - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) xbt_automaton_parser_alloc(n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__scan_bytes()" ); + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) xbt_automaton_parser_alloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__scan_bytes()" ); - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = xbt_automaton_parser__scan_buffer(buf,n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in xbt_automaton_parser__scan_bytes()" ); + b = xbt_automaton_parser__scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in xbt_automaton_parser__scan_bytes()" ); - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; - return b; + return b; } #ifndef YY_EXIT_FAILURE @@ -1749,26 +1749,26 @@ YY_BUFFER_STATE xbt_automaton_parser__scan_bytes (yyconst char * yybytes, yy_si static void yy_fatal_error (yyconst char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up xbt_automaton_parser_text. */ \ + do \ + { \ + /* Undo effects of setting up xbt_automaton_parser_text. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ - xbt_automaton_parser_text[xbt_automaton_parser_leng] = (yy_hold_char); \ - (yy_c_buf_p) = xbt_automaton_parser_text + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - xbt_automaton_parser_leng = yyless_macro_arg; \ - } \ - while ( 0 ) + xbt_automaton_parser_text[xbt_automaton_parser_leng] = (yy_hold_char); \ + (yy_c_buf_p) = xbt_automaton_parser_text + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + xbt_automaton_parser_leng = yyless_macro_arg; \ + } \ + while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ @@ -1883,15 +1883,15 @@ int xbt_automaton_parser_lex_destroy (void) { /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - xbt_automaton_parser__delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - xbt_automaton_parser_pop_buffer_state(); - } + while(YY_CURRENT_BUFFER){ + xbt_automaton_parser__delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + xbt_automaton_parser_pop_buffer_state(); + } - /* Destroy the stack itself. */ - xbt_automaton_parser_free((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; + /* Destroy the stack itself. */ + xbt_automaton_parser_free((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * xbt_automaton_parser_lex() is called, initialization will occur. */ @@ -1907,43 +1907,43 @@ int xbt_automaton_parser_lex_destroy (void) #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - register int n; - for ( n = 0; s[n]; ++n ) - ; + register int n; + for ( n = 0; s[n]; ++n ) + ; - return n; + return n; } #endif void *xbt_automaton_parser_alloc (yy_size_t size ) { - return (void *) malloc( size ); + return (void *) malloc( size ); } void *xbt_automaton_parser_realloc (void * ptr, yy_size_t size ) { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); } void xbt_automaton_parser_free (void * ptr ) { - free( (char *) ptr ); /* see xbt_automaton_parser_realloc() for (char *) cast */ + free( (char *) ptr ); /* see xbt_automaton_parser_realloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" diff --git a/src/xbt/backtrace_linux.c b/src/xbt/backtrace_linux.c index 55813c472a..4842e834b7 100644 --- a/src/xbt/backtrace_linux.c +++ b/src/xbt/backtrace_linux.c @@ -388,7 +388,7 @@ int xbt_libunwind_backtrace(void* bt[XBT_BACKTRACE_SIZE], int size){ unw_context_t uc; unw_getcontext (&uc); - unw_init_local (&c, &uc); + unw_init_local (&c, &uc); unw_word_t ip; diff --git a/src/xbt/config.c b/src/xbt/config.c index 642a6a9df0..ff9ee32d4b 100644 --- a/src/xbt/config.c +++ b/src/xbt/config.c @@ -932,14 +932,14 @@ void xbt_cfg_set_boolean(xbt_cfg_t cfg, const char *name, const char *val) variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_boolean); for (i = 0; xbt_cfgelm_boolean_values[i].true_val != NULL; i++) { - if (strcmp(val, xbt_cfgelm_boolean_values[i].true_val) == 0){ - bval = 1; - break; - } - if (strcmp(val, xbt_cfgelm_boolean_values[i].false_val) == 0){ - bval = 0; - break; - } + if (strcmp(val, xbt_cfgelm_boolean_values[i].true_val) == 0){ + bval = 1; + break; + } + if (strcmp(val, xbt_cfgelm_boolean_values[i].false_val) == 0){ + bval = 0; + break; + } } if (xbt_cfgelm_boolean_values[i].true_val == NULL) { xbt_die("Value of option '%s' not valid. Should be a boolean (yes,no,on,off,true,false,0,1)", val); diff --git a/src/xbt/ex.c b/src/xbt/ex.c index 5fffc76748..680b110661 100644 --- a/src/xbt/ex.c +++ b/src/xbt/ex.c @@ -150,8 +150,8 @@ void xbt_ex_display(xbt_ex_t * e) xbt_free(thrower); if (xbt_initialized==0 || smx_cleaned) { - fprintf(stderr, "Ouch. SimGrid is not initialized yet, or already closing. No backtrace available.\n"); - return; /* Not started yet or already closing. Trying to generate a backtrace would probably fail */ + fprintf(stderr, "Ouch. SimGrid is not initialized yet, or already closing. No backtrace available.\n"); + return; /* Not started yet or already closing. Trying to generate a backtrace would probably fail */ } if (!e->bt_strings) diff --git a/src/xbt/graphxml.c b/src/xbt/graphxml.c index 0df74b0354..71b4db0ed0 100644 --- a/src/xbt/graphxml.c +++ b/src/xbt/graphxml.c @@ -111,15 +111,15 @@ typedef unsigned int flex_uint32_t; /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST -#else /* ! __cplusplus */ +#else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const @@ -217,83 +217,83 @@ extern FILE *xbt_graph_parse_in, *xbt_graph_parse_out; /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up xbt_graph_parse_text. */ \ + do \ + { \ + /* Undo effects of setting up xbt_graph_parse_text. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up xbt_graph_parse_text again */ \ - } \ - while ( 0 ) + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up xbt_graph_parse_text again */ \ + } \ + while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - yy_size_t yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + yy_size_t yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; - int yy_buffer_status; + int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via xbt_graph_parse_restart()), so that the user can continue scanning by - * just pointing xbt_graph_parse_in at a new input file. - */ + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via xbt_graph_parse_restart()), so that the user can continue scanning by + * just pointing xbt_graph_parse_in at a new input file. + */ #define YY_BUFFER_EOF_PENDING 2 - }; + }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ @@ -318,13 +318,13 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when xbt_graph_parse_text is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t xbt_graph_parse_leng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ /* Flag which is used to allow xbt_graph_parse_wrap()'s to do buffer switches * instead of setting up a fresh xbt_graph_parse_in. A bit of a hack ... @@ -356,24 +356,24 @@ void xbt_graph_parse_free (void * ); #define yy_new_buffer xbt_graph_parse__create_buffer #define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ xbt_graph_parse_ensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ + YY_CURRENT_BUFFER_LVALUE = \ xbt_graph_parse__create_buffer(xbt_graph_parse_in,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } #define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ + { \ + if ( ! YY_CURRENT_BUFFER ){\ xbt_graph_parse_ensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ + YY_CURRENT_BUFFER_LVALUE = \ xbt_graph_parse__create_buffer(xbt_graph_parse_in,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) @@ -404,21 +404,21 @@ static void yy_fatal_error (yyconst char msg[] ); * corresponding action - sets up xbt_graph_parse_text. */ #define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - xbt_graph_parse_leng = (size_t) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; + (yytext_ptr) = yy_bp; \ + xbt_graph_parse_leng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 92 #define YY_END_OF_BUFFER 93 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; static yyconst flex_int16_t yy_accept[564] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1181,23 +1181,23 @@ short int graphxml_node_position___x_isset; /* XML state. */ #ifdef FLEX_DEBUG -# define ENTER(state) debug_enter(state,#state) -# define LEAVE debug_leave() -# define SET(state) debug_set(state,#state) +# define ENTER(state) debug_enter(state,#state) +# define LEAVE debug_leave() +# define SET(state) debug_set(state,#state) static void debug_enter(int, const char*); static void debug_leave(void); static void debug_set(int, const char*); #else -# define ENTER(state) (yy_push_state(state)) -# define LEAVE (yy_pop_state()) -# define SET(state) BEGIN(state) +# define ENTER(state) (yy_push_state(state)) +# define LEAVE (yy_pop_state()) +# define SET(state) BEGIN(state) #endif /* Generic actions. */ -#define SKIP /*skip*/ +#define SKIP /*skip*/ #define SUCCEED CLEANUP; return 0 -#define FAIL return fail +#define FAIL return fail static int fail(const char*, ...); enum {flexml_max_err_msg_size = 512}; @@ -1234,12 +1234,12 @@ static int inext = 1; static int ck_blimit() { if (bnext >= blimit) { - blimit += FLEXML_BUFFERSTACKSIZE + 2; - { - char *temp = (char *) realloc(graphxml_bufferstack, blimit); - assert(temp); - graphxml_bufferstack = temp; - } + blimit += FLEXML_BUFFERSTACKSIZE + 2; + { + char *temp = (char *) realloc(graphxml_bufferstack, blimit); + assert(temp); + graphxml_bufferstack = temp; + } } return 0; } @@ -1248,12 +1248,12 @@ static int ck_blimit() static int ck_ilimit() { if (inext >= ilimit) { - ilimit += FLEXML_INDEXSTACKSIZE + 2; - { - int *temp = (int *) realloc(indexstack, ilimit); - assert(temp); - indexstack = temp; - } + ilimit += FLEXML_INDEXSTACKSIZE + 2; + { + int *temp = (int *) realloc(indexstack, ilimit); + assert(temp); + indexstack = temp; + } } return 0; } @@ -1267,16 +1267,16 @@ static void graphxml_bufferliteral(char c, int* pp, const char* text) assert(s && e && s <= e); ++s; while (s < e) { - if (isspace(*s)) { - BUFFERPUTC(' '); - do ++s; while (s < e && isspace(*s)); - } else - BUFFERPUTC(*s++); + if (isspace(*s)) { + BUFFERPUTC(' '); + do ++s; while (s < e && isspace(*s)); + } else + BUFFERPUTC(*s++); } } else { const char *s = text; while (*s) - BUFFERPUTC(*s++); + BUFFERPUTC(*s++); } BUFFERDONE; } @@ -1310,18 +1310,18 @@ static int popbuffer(void) /* Miscellaneous. */ /* Parser states (flex `exclusive start conditions'): * - * PROLOG the XML prolog of the document before - * DOCTYPE the XML prolog of the document after - * EPILOG after the root element - * INCOMMENT inside an XML comment - * INPI inside an XML PI - * VALUE1 inside a '...'-delimited literal - * VALUE2 inside a "..."-delimited literal - * CDATA inside a section. - * ROOT_ expect root element - * AL_ inside the attribute list for - * IN_ inside a with element contents (ready for end tag) - * IMPOSSIBLE dummy to permit disabling rules; must be last + * PROLOG the XML prolog of the document before + * DOCTYPE the XML prolog of the document after + * EPILOG after the root element + * INCOMMENT inside an XML comment + * INPI inside an XML PI + * VALUE1 inside a '...'-delimited literal + * VALUE2 inside a "..."-delimited literal + * CDATA inside a section. + * ROOT_ expect root element + * AL_ inside the attribute list for + * IN_ inside a with element contents (ready for end tag) + * IMPOSSIBLE dummy to permit disabling rules; must be last */ /* State names. */ @@ -1464,33 +1464,33 @@ static int input (void ); */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( xbt_graph_parse_in )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( xbt_graph_parse_in ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, xbt_graph_parse_in))==0 && ferror(xbt_graph_parse_in)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(xbt_graph_parse_in); \ - } \ - }\ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + size_t n; \ + for ( n = 0; n < max_size && \ + (c = getc( xbt_graph_parse_in )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( xbt_graph_parse_in ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, xbt_graph_parse_in))==0 && ferror(xbt_graph_parse_in)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(xbt_graph_parse_in); \ + } \ + }\ \ #endif @@ -1539,43 +1539,43 @@ extern int xbt_graph_parse_lex (void); #endif #define YY_RULE_SETUP \ - YY_USER_ACTION + YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; - if ( !(yy_init) ) - { - (yy_init) = 1; + if ( !(yy_init) ) + { + (yy_init) = 1; #ifdef YY_USER_INIT - YY_USER_INIT; + YY_USER_INIT; #endif - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ - if ( ! xbt_graph_parse_in ) - xbt_graph_parse_in = stdin; + if ( ! xbt_graph_parse_in ) + xbt_graph_parse_in = stdin; - if ( ! xbt_graph_parse_out ) - xbt_graph_parse_out = stdout; + if ( ! xbt_graph_parse_out ) + xbt_graph_parse_out = stdout; - if ( ! YY_CURRENT_BUFFER ) { - xbt_graph_parse_ensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - xbt_graph_parse__create_buffer(xbt_graph_parse_in,YY_BUF_SIZE ); - } + if ( ! YY_CURRENT_BUFFER ) { + xbt_graph_parse_ensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + xbt_graph_parse__create_buffer(xbt_graph_parse_in,YY_BUF_SIZE ); + } - xbt_graph_parse__load_buffer_state( ); - } + xbt_graph_parse__load_buffer_state( ); + } - { + { /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */ SET(PROLOG); @@ -1628,156 +1628,156 @@ YY_DECL /* COMMENTS and PIs: handled uniformly for efficiency. */ - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); - /* Support of xbt_graph_parse_text. */ - *yy_cp = (yy_hold_char); + /* Support of xbt_graph_parse_text. */ + *yy_cp = (yy_hold_char); - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; - yy_current_state = (yy_start); + yy_current_state = (yy_start); yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 564 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 1586 ); + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 564 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 1586 ); yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) - { - yy_size_t yyl; - for ( yyl = 0; yyl < xbt_graph_parse_leng; ++yyl ) - if ( xbt_graph_parse_text[yyl] == '\n' ) + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) + { + yy_size_t yyl; + for ( yyl = 0; yyl < xbt_graph_parse_leng; ++yyl ) + if ( xbt_graph_parse_text[yyl] == '\n' ) xbt_graph_parse_lineno++; ; - } + } -do_action: /* This label is used only to access EOF actions. */ +do_action: /* This label is used only to access EOF actions. */ - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; case 1: YY_RULE_SETUP ENTER(INCOMMENT); - YY_BREAK + YY_BREAK case 2: YY_RULE_SETUP ENTER(INPI); - YY_BREAK + YY_BREAK case 3: YY_RULE_SETUP LEAVE; - YY_BREAK + YY_BREAK case 4: case 5: case 6: /* rule 6 can match eol */ YY_RULE_SETUP SKIP; - YY_BREAK + YY_BREAK case YY_STATE_EOF(INCOMMENT): FAIL("EOF in comment."); - YY_BREAK + YY_BREAK case 7: YY_RULE_SETUP LEAVE; - YY_BREAK + YY_BREAK case 8: case 9: /* rule 9 can match eol */ YY_RULE_SETUP SKIP; - YY_BREAK + YY_BREAK case YY_STATE_EOF(INPI): FAIL("EOF in PI (processing instruction)."); - YY_BREAK + YY_BREAK /* SPACES: skipped uniformly */ case 10: /* rule 10 can match eol */ YY_RULE_SETUP SKIP; - YY_BREAK + YY_BREAK /* PROLOG: determine root element and process it. */ case 11: /* rule 11 can match eol */ YY_RULE_SETUP SET(DOCTYPE); - YY_BREAK + YY_BREAK case 12: /* rule 12 can match eol */ YY_RULE_SETUP FAIL("Bad declaration %s.",xbt_graph_parse_text); - YY_BREAK + YY_BREAK case 13: /* rule 13 can match eol */ YY_RULE_SETUP SET(ROOT_graphxml_graph); - YY_BREAK + YY_BREAK case 14: /* rule 14 can match eol */ YY_RULE_SETUP SET(ROOT_graphxml_edge); - YY_BREAK + YY_BREAK case 15: /* rule 15 can match eol */ YY_RULE_SETUP SET(ROOT_graphxml_node); - YY_BREAK + YY_BREAK case 16: /* rule 16 can match eol */ YY_RULE_SETUP FAIL("Bad declaration %s.",xbt_graph_parse_text); - YY_BREAK + YY_BREAK case 17: YY_RULE_SETUP FAIL("Unexpected character `%c' in prolog.", xbt_graph_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(PROLOG): case YY_STATE_EOF(DOCTYPE): FAIL("EOF in prolog."); - YY_BREAK + YY_BREAK /* RULES DERIVED FROM DTD. */ /* */ @@ -1787,7 +1787,7 @@ case 18: /* rule 18 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 19: /* rule 19 can match eol */ YY_RULE_SETUP @@ -1796,7 +1796,7 @@ YY_RULE_SETUP graphxml_graph_isDirected_isset = 0; ENTER(AL_graphxml_graph); pushbuffer(0); } - YY_BREAK + YY_BREAK case 20: /* rule 20 can match eol */ @@ -1804,20 +1804,20 @@ case 21: /* rule 21 can match eol */ YY_RULE_SETUP A_graphxml_graph_isDirected = A_graphxml_graph_isDirected_true; - YY_BREAK + YY_BREAK case 22: /* rule 22 can match eol */ case 23: /* rule 23 can match eol */ YY_RULE_SETUP A_graphxml_graph_isDirected = A_graphxml_graph_isDirected_false; - YY_BREAK + YY_BREAK case 24: YY_RULE_SETUP { LEAVE; STag_graphxml_graph();graphxml_pcdata_ix = 0; ENTER(S_graphxml_graph); } - YY_BREAK + YY_BREAK case 25: YY_RULE_SETUP { @@ -1826,18 +1826,18 @@ YY_RULE_SETUP case ROOT_graphxml_graph: SET(EPILOG); break; } } - YY_BREAK + YY_BREAK case 26: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of graph element.", xbt_graph_parse_text[0]); - YY_BREAK + YY_BREAK case 27: YY_RULE_SETUP FAIL("Bad attribute `%s' in `graph' element start tag.",xbt_graph_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_graphxml_graph): FAIL("EOF in attribute list of `graph' element."); - YY_BREAK + YY_BREAK case 28: /* rule 28 can match eol */ @@ -1850,35 +1850,35 @@ YY_RULE_SETUP case ROOT_graphxml_graph: SET(EPILOG); break; } } - YY_BREAK + YY_BREAK case 29: /* rule 29 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",xbt_graph_parse_text); - YY_BREAK + YY_BREAK case 30: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",xbt_graph_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(S_graphxml_graph): case YY_STATE_EOF(E_graphxml_graph): case YY_STATE_EOF(S_graphxml_graph_3): case YY_STATE_EOF(S_graphxml_graph_5): case YY_STATE_EOF(S_graphxml_graph_1): FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK /* label CDATA "" * name CDATA #REQUIRED * data CDATA "" - * position_x CDATA "-1.0" - * position_y CDATA "-1.0" + * position_x CDATA "-1.0" + * position_y CDATA "-1.0" * > */ case 31: /* rule 31 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 32: /* rule 32 can match eol */ YY_RULE_SETUP @@ -1895,65 +1895,65 @@ YY_RULE_SETUP graphxml_node_position___y_isset = 0; ENTER(AL_graphxml_node); pushbuffer(0); } - YY_BREAK + YY_BREAK case 33: /* rule 33 can match eol */ YY_RULE_SETUP if (graphxml_node_label_isset != 0) {FAIL("Multiple definition of attribute label in ");} graphxml_node_label_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_node_label); - YY_BREAK + YY_BREAK case 34: /* rule 34 can match eol */ YY_RULE_SETUP if (graphxml_node_label_isset != 0) {FAIL("Multiple definition of attribute label in ");} graphxml_node_label_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_node_label); - YY_BREAK + YY_BREAK case 35: /* rule 35 can match eol */ YY_RULE_SETUP if (graphxml_node_name_isset != 0) {FAIL("Multiple definition of attribute name in ");} graphxml_node_name_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_node_name); - YY_BREAK + YY_BREAK case 36: /* rule 36 can match eol */ YY_RULE_SETUP if (graphxml_node_name_isset != 0) {FAIL("Multiple definition of attribute name in ");} graphxml_node_name_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_node_name); - YY_BREAK + YY_BREAK case 37: /* rule 37 can match eol */ YY_RULE_SETUP if (graphxml_node_data_isset != 0) {FAIL("Multiple definition of attribute data in ");} graphxml_node_data_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_node_data); - YY_BREAK + YY_BREAK case 38: /* rule 38 can match eol */ YY_RULE_SETUP if (graphxml_node_data_isset != 0) {FAIL("Multiple definition of attribute data in ");} graphxml_node_data_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_node_data); - YY_BREAK + YY_BREAK case 39: /* rule 39 can match eol */ YY_RULE_SETUP if (graphxml_node_position___x_isset != 0) {FAIL("Multiple definition of attribute position_x in ");} graphxml_node_position___x_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_node_position___x); - YY_BREAK + YY_BREAK case 40: /* rule 40 can match eol */ YY_RULE_SETUP if (graphxml_node_position___x_isset != 0) {FAIL("Multiple definition of attribute position_x in ");} graphxml_node_position___x_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_node_position___x); - YY_BREAK + YY_BREAK case 41: /* rule 41 can match eol */ YY_RULE_SETUP if (graphxml_node_position___y_isset != 0) {FAIL("Multiple definition of attribute position_y in ");} graphxml_node_position___y_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_node_position___y); - YY_BREAK + YY_BREAK case 42: /* rule 42 can match eol */ YY_RULE_SETUP if (graphxml_node_position___y_isset != 0) {FAIL("Multiple definition of attribute position_y in ");} graphxml_node_position___y_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_node_position___y); - YY_BREAK + YY_BREAK case 43: YY_RULE_SETUP { if (!AX_graphxml_node_name) FAIL("Required attribute `name' not set for `node' element."); LEAVE; STag_graphxml_node();graphxml_pcdata_ix = 0; ENTER(E_graphxml_node); } - YY_BREAK + YY_BREAK case 44: YY_RULE_SETUP { @@ -1964,18 +1964,18 @@ YY_RULE_SETUP case ROOT_graphxml_node: SET(EPILOG); break; } } - YY_BREAK + YY_BREAK case 45: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of node element.", xbt_graph_parse_text[0]); - YY_BREAK + YY_BREAK case 46: YY_RULE_SETUP FAIL("Bad attribute `%s' in `node' element start tag.",xbt_graph_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_graphxml_node): FAIL("EOF in attribute list of `node' element."); - YY_BREAK + YY_BREAK case 47: /* rule 47 can match eol */ @@ -1989,19 +1989,19 @@ YY_RULE_SETUP case ROOT_graphxml_node: SET(EPILOG); break; } } - YY_BREAK + YY_BREAK case 48: /* rule 48 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",xbt_graph_parse_text); - YY_BREAK + YY_BREAK case 49: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",xbt_graph_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(E_graphxml_node): FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK /* label CDATA "" * name CDATA #IMPLIED @@ -2014,7 +2014,7 @@ case 50: /* rule 50 can match eol */ YY_RULE_SETUP FAIL("Starting tag is not allowed here."); - YY_BREAK + YY_BREAK case 51: /* rule 51 can match eol */ YY_RULE_SETUP @@ -2033,68 +2033,68 @@ YY_RULE_SETUP graphxml_edge_data_isset = 0; ENTER(AL_graphxml_edge); pushbuffer(0); } - YY_BREAK + YY_BREAK case 52: /* rule 52 can match eol */ YY_RULE_SETUP if (graphxml_edge_label_isset != 0) {FAIL("Multiple definition of attribute label in ");} graphxml_edge_label_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_edge_label); - YY_BREAK + YY_BREAK case 53: /* rule 53 can match eol */ YY_RULE_SETUP if (graphxml_edge_label_isset != 0) {FAIL("Multiple definition of attribute label in ");} graphxml_edge_label_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_edge_label); - YY_BREAK + YY_BREAK case 54: /* rule 54 can match eol */ YY_RULE_SETUP if (graphxml_edge_name_isset != 0) {FAIL("Multiple definition of attribute name in ");} graphxml_edge_name_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_edge_name); - YY_BREAK + YY_BREAK case 55: /* rule 55 can match eol */ YY_RULE_SETUP if (graphxml_edge_name_isset != 0) {FAIL("Multiple definition of attribute name in ");} graphxml_edge_name_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_edge_name); - YY_BREAK + YY_BREAK case 56: /* rule 56 can match eol */ YY_RULE_SETUP if (graphxml_edge_source_isset != 0) {FAIL("Multiple definition of attribute source in ");} graphxml_edge_source_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_edge_source); - YY_BREAK + YY_BREAK case 57: /* rule 57 can match eol */ YY_RULE_SETUP if (graphxml_edge_source_isset != 0) {FAIL("Multiple definition of attribute source in ");} graphxml_edge_source_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_edge_source); - YY_BREAK + YY_BREAK case 58: /* rule 58 can match eol */ YY_RULE_SETUP if (graphxml_edge_target_isset != 0) {FAIL("Multiple definition of attribute target in ");} graphxml_edge_target_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_edge_target); - YY_BREAK + YY_BREAK case 59: /* rule 59 can match eol */ YY_RULE_SETUP if (graphxml_edge_target_isset != 0) {FAIL("Multiple definition of attribute target in ");} graphxml_edge_target_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_edge_target); - YY_BREAK + YY_BREAK case 60: /* rule 60 can match eol */ YY_RULE_SETUP if (graphxml_edge_length_isset != 0) {FAIL("Multiple definition of attribute length in ");} graphxml_edge_length_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_edge_length); - YY_BREAK + YY_BREAK case 61: /* rule 61 can match eol */ YY_RULE_SETUP if (graphxml_edge_length_isset != 0) {FAIL("Multiple definition of attribute length in ");} graphxml_edge_length_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_edge_length); - YY_BREAK + YY_BREAK case 62: /* rule 62 can match eol */ YY_RULE_SETUP if (graphxml_edge_data_isset != 0) {FAIL("Multiple definition of attribute data in ");} graphxml_edge_data_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_edge_data); - YY_BREAK + YY_BREAK case 63: /* rule 63 can match eol */ YY_RULE_SETUP if (graphxml_edge_data_isset != 0) {FAIL("Multiple definition of attribute data in ");} graphxml_edge_data_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_edge_data); - YY_BREAK + YY_BREAK case 64: YY_RULE_SETUP { @@ -2102,7 +2102,7 @@ YY_RULE_SETUP if (!AX_graphxml_edge_target) FAIL("Required attribute `target' not set for `edge' element."); LEAVE; STag_graphxml_edge();graphxml_pcdata_ix = 0; ENTER(E_graphxml_edge); } - YY_BREAK + YY_BREAK case 65: YY_RULE_SETUP { @@ -2114,18 +2114,18 @@ YY_RULE_SETUP case S_graphxml_graph_5: case S_graphxml_graph_4: case S_graphxml_graph_1: case S_graphxml_graph: case S_graphxml_graph_3: SET(S_graphxml_graph_5); break; } } - YY_BREAK + YY_BREAK case 66: YY_RULE_SETUP FAIL("Unexpected character `%c' in attribute list of edge element.", xbt_graph_parse_text[0]); - YY_BREAK + YY_BREAK case 67: YY_RULE_SETUP FAIL("Bad attribute `%s' in `edge' element start tag.",xbt_graph_parse_text); - YY_BREAK + YY_BREAK case YY_STATE_EOF(AL_graphxml_edge): FAIL("EOF in attribute list of `edge' element."); - YY_BREAK + YY_BREAK case 68: /* rule 68 can match eol */ @@ -2139,29 +2139,29 @@ YY_RULE_SETUP case S_graphxml_graph_5: case S_graphxml_graph_4: case S_graphxml_graph_1: case S_graphxml_graph: case S_graphxml_graph_3: SET(S_graphxml_graph_5); break; } } - YY_BREAK + YY_BREAK case 69: /* rule 69 can match eol */ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",xbt_graph_parse_text); - YY_BREAK + YY_BREAK case 70: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",xbt_graph_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(E_graphxml_edge): FAIL("Premature EOF: `' expected."); - YY_BREAK + YY_BREAK /* EPILOG: after the root element. */ case 71: YY_RULE_SETUP {SET(PROLOG); yyless(0); CLEANUP; return -1;} - YY_BREAK + YY_BREAK case YY_STATE_EOF(EPILOG): SUCCEED; - YY_BREAK + YY_BREAK /* CHARACTER DATA. */ @@ -2169,32 +2169,32 @@ SUCCEED; case 72: YY_RULE_SETUP BUFFERPUTC('&'); - YY_BREAK + YY_BREAK case 73: YY_RULE_SETUP BUFFERPUTC('<'); - YY_BREAK + YY_BREAK case 74: YY_RULE_SETUP BUFFERPUTC('>'); - YY_BREAK + YY_BREAK case 75: YY_RULE_SETUP BUFFERPUTC('\''); - YY_BREAK + YY_BREAK case 76: YY_RULE_SETUP BUFFERPUTC('"'); - YY_BREAK + YY_BREAK /* Character entities. */ case 77: YY_RULE_SETUP BUFFERPUTC((unsigned char)atoi(xbt_graph_parse_text+2)); - YY_BREAK + YY_BREAK case 78: YY_RULE_SETUP BUFFERPUTC((unsigned char)strtol(xbt_graph_parse_text+3,NULL,16)); - YY_BREAK + YY_BREAK case 79: /* rule 79 can match eol */ @@ -2206,55 +2206,55 @@ case 82: /* rule 82 can match eol */ YY_RULE_SETUP BUFFERPUTC('\n'); - YY_BREAK + YY_BREAK case 83: YY_RULE_SETUP ENTER(CDATA); - YY_BREAK + YY_BREAK case 84: YY_RULE_SETUP FAIL("Unexpected `]""]>' in character data."); - YY_BREAK + YY_BREAK case 85: YY_RULE_SETUP BUFFERDONE; LEAVE; - YY_BREAK + YY_BREAK case YY_STATE_EOF(VALUE1): FAIL("EOF in literal (\"'\" expected)."); - YY_BREAK + YY_BREAK case 86: YY_RULE_SETUP BUFFERDONE; LEAVE; - YY_BREAK + YY_BREAK case YY_STATE_EOF(VALUE2): FAIL("EOF in literal (`\"' expected)."); - YY_BREAK + YY_BREAK case 87: /* rule 87 can match eol */ YY_RULE_SETUP BUFFERPUTC(xbt_graph_parse_text[0]); - YY_BREAK + YY_BREAK case 88: YY_RULE_SETUP FAIL("Spurious `%c' in character data.",xbt_graph_parse_text[0]); - YY_BREAK + YY_BREAK case 89: YY_RULE_SETUP LEAVE; - YY_BREAK -/* "]""]" BUFFERPUTC(xbt_graph_parse_text[0]); BUFFERPUTC(xbt_graph_parse_text[1]); */ + YY_BREAK +/* "]""]" BUFFERPUTC(xbt_graph_parse_text[0]); BUFFERPUTC(xbt_graph_parse_text[1]); */ case 90: YY_RULE_SETUP BUFFERPUTC(xbt_graph_parse_text[0]); - YY_BREAK + YY_BREAK case YY_STATE_EOF(CDATA): FAIL("EOF in CDATA section."); - YY_BREAK + YY_BREAK /* Impossible rules to avoid warnings from flex(1). */ /* Ideally, this should be replaced by code in flexml.pl that @@ -2264,12 +2264,12 @@ case 91: /* rule 91 can match eol */ YY_RULE_SETUP FAIL("Syntax error on character `%c'.", xbt_graph_parse_text[0]); - YY_BREAK + YY_BREAK case 92: YY_RULE_SETUP ECHO; - YY_BREAK + YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(ROOT_graphxml_graph): case YY_STATE_EOF(S_graphxml_graph_2): @@ -2277,332 +2277,332 @@ case YY_STATE_EOF(S_graphxml_graph_4): case YY_STATE_EOF(ROOT_graphxml_node): case YY_STATE_EOF(ROOT_graphxml_edge): case YY_STATE_EOF(IMPOSSIBLE): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed xbt_graph_parse_in at a new source and called - * xbt_graph_parse_lex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = xbt_graph_parse_in; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_c_buf_p); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( xbt_graph_parse_wrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * xbt_graph_parse_text, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of user's declarations */ + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed xbt_graph_parse_in at a new source and called + * xbt_graph_parse_lex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = xbt_graph_parse_in; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( xbt_graph_parse_wrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * xbt_graph_parse_text, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of xbt_graph_parse_lex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = (yytext_ptr); - int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - yy_size_t num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - yy_size_t new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - xbt_graph_parse_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - xbt_graph_parse_restart(xbt_graph_parse_in ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) xbt_graph_parse_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + yy_size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + yy_size_t new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + xbt_graph_parse_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + xbt_graph_parse_restart(xbt_graph_parse_in ); + } - return ret_val; + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) xbt_graph_parse_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { - yy_state_type yy_current_state; - char *yy_cp; - - yy_current_state = (yy_start); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 564 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; + yy_state_type yy_current_state; + char *yy_cp; + + yy_current_state = (yy_start); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 564 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis - * next_state = yy_try_NUL_trans( current_state ); + * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - int yy_is_jam; - char *yy_cp = (yy_c_buf_p); - - YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 564 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 563); - - return yy_is_jam ? 0 : yy_current_state; + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); + + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 564 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 563); + + return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_INPUT @@ -2613,76 +2613,76 @@ static int yy_get_next_buffer (void) #endif { - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - xbt_graph_parse_restart(xbt_graph_parse_in ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( xbt_graph_parse_wrap( ) ) - return EOF; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + xbt_graph_parse_restart(xbt_graph_parse_in ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( xbt_graph_parse_wrap( ) ) + return EOF; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; #ifdef __cplusplus - return yyinput(); + return yyinput(); #else - return input(); + return input(); #endif - } + } - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve xbt_graph_parse_text */ - (yy_hold_char) = *++(yy_c_buf_p); + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve xbt_graph_parse_text */ + (yy_hold_char) = *++(yy_c_buf_p); - if ( c == '\n' ) + if ( c == '\n' ) xbt_graph_parse_lineno++; ; - return c; + return c; } -#endif /* ifndef YY_NO_INPUT */ +#endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. @@ -2692,14 +2692,14 @@ static int yy_get_next_buffer (void) void xbt_graph_parse_restart (FILE * input_file ) { - if ( ! YY_CURRENT_BUFFER ){ + if ( ! YY_CURRENT_BUFFER ){ xbt_graph_parse_ensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = + YY_CURRENT_BUFFER_LVALUE = xbt_graph_parse__create_buffer(xbt_graph_parse_in,YY_BUF_SIZE ); - } + } - xbt_graph_parse__init_buffer(YY_CURRENT_BUFFER,input_file ); - xbt_graph_parse__load_buffer_state( ); + xbt_graph_parse__init_buffer(YY_CURRENT_BUFFER,input_file ); + xbt_graph_parse__load_buffer_state( ); } /** Switch to a different input buffer. @@ -2709,40 +2709,40 @@ static int yy_get_next_buffer (void) void xbt_graph_parse__switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - /* TODO. We should be able to replace this entire function body - * with - * xbt_graph_parse_pop_buffer_state(); - * xbt_graph_parse_push_buffer_state(new_buffer); + /* TODO. We should be able to replace this entire function body + * with + * xbt_graph_parse_pop_buffer_state(); + * xbt_graph_parse_push_buffer_state(new_buffer); */ - xbt_graph_parse_ensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - xbt_graph_parse__load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (xbt_graph_parse_wrap()) processing, but the only time this flag - * is looked at is after xbt_graph_parse_wrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; + xbt_graph_parse_ensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + xbt_graph_parse__load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (xbt_graph_parse_wrap()) processing, but the only time this flag + * is looked at is after xbt_graph_parse_wrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; } static void xbt_graph_parse__load_buffer_state (void) { - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - xbt_graph_parse_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + xbt_graph_parse_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. @@ -2753,26 +2753,26 @@ static void xbt_graph_parse__load_buffer_state (void) */ YY_BUFFER_STATE xbt_graph_parse__create_buffer (FILE * file, int size ) { - YY_BUFFER_STATE b; + YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) xbt_graph_parse_alloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse__create_buffer()" ); + b = (YY_BUFFER_STATE) xbt_graph_parse_alloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse__create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = size; - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) xbt_graph_parse_alloc(b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse__create_buffer()" ); + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) xbt_graph_parse_alloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse__create_buffer()" ); - b->yy_is_our_buffer = 1; + b->yy_is_our_buffer = 1; - xbt_graph_parse__init_buffer(b,file ); + xbt_graph_parse__init_buffer(b,file ); - return b; + return b; } /** Destroy the buffer. @@ -2782,16 +2782,16 @@ static void xbt_graph_parse__load_buffer_state (void) void xbt_graph_parse__delete_buffer (YY_BUFFER_STATE b ) { - if ( ! b ) - return; + if ( ! b ) + return; - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - if ( b->yy_is_our_buffer ) - xbt_graph_parse_free((void *) b->yy_ch_buf ); + if ( b->yy_is_our_buffer ) + xbt_graph_parse_free((void *) b->yy_ch_buf ); - xbt_graph_parse_free((void *) b ); + xbt_graph_parse_free((void *) b ); } /* Initializes or reinitializes a buffer. @@ -2801,12 +2801,12 @@ static void xbt_graph_parse__load_buffer_state (void) static void xbt_graph_parse__init_buffer (YY_BUFFER_STATE b, FILE * file ) { - int oerrno = errno; + int oerrno = errno; - xbt_graph_parse__flush_buffer(b ); + xbt_graph_parse__flush_buffer(b ); - b->yy_input_file = file; - b->yy_fill_buffer = 1; + b->yy_input_file = file; + b->yy_fill_buffer = 1; /* If b is the current buffer, then xbt_graph_parse__init_buffer was _probably_ * called from xbt_graph_parse_restart() or through yy_get_next_buffer. @@ -2819,7 +2819,7 @@ static void xbt_graph_parse__load_buffer_state (void) b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - errno = oerrno; + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. @@ -2828,25 +2828,25 @@ static void xbt_graph_parse__load_buffer_state (void) */ void xbt_graph_parse__flush_buffer (YY_BUFFER_STATE b ) { - if ( ! b ) - return; + if ( ! b ) + return; - b->yy_n_chars = 0; + b->yy_n_chars = 0; - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - b->yy_buf_pos = &b->yy_ch_buf[0]; + b->yy_buf_pos = &b->yy_ch_buf[0]; - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == YY_CURRENT_BUFFER ) - xbt_graph_parse__load_buffer_state( ); + if ( b == YY_CURRENT_BUFFER ) + xbt_graph_parse__load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes @@ -2857,28 +2857,28 @@ static void xbt_graph_parse__load_buffer_state (void) */ void xbt_graph_parse_push_buffer_state (YY_BUFFER_STATE new_buffer ) { - if (new_buffer == NULL) - return; - - xbt_graph_parse_ensure_buffer_stack(); - - /* This block is copied from xbt_graph_parse__switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from xbt_graph_parse__switch_to_buffer. */ - xbt_graph_parse__load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; + if (new_buffer == NULL) + return; + + xbt_graph_parse_ensure_buffer_stack(); + + /* This block is copied from xbt_graph_parse__switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from xbt_graph_parse__switch_to_buffer. */ + xbt_graph_parse__load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. @@ -2887,18 +2887,18 @@ void xbt_graph_parse_push_buffer_state (YY_BUFFER_STATE new_buffer ) */ void xbt_graph_parse_pop_buffer_state (void) { - if (!YY_CURRENT_BUFFER) - return; - - xbt_graph_parse__delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - xbt_graph_parse__load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } + if (!YY_CURRENT_BUFFER) + return; + + xbt_graph_parse__delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + xbt_graph_parse__load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } } /* Allocates the stack if it does not exist. @@ -2906,45 +2906,45 @@ void xbt_graph_parse_pop_buffer_state (void) */ static void xbt_graph_parse_ensure_buffer_stack (void) { - yy_size_t num_to_alloc; + yy_size_t num_to_alloc; - if (!(yy_buffer_stack)) { + if (!(yy_buffer_stack)) { - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)xbt_graph_parse_alloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse_ensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)xbt_graph_parse_realloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse_ensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)xbt_graph_parse_alloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse_ensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)xbt_graph_parse_realloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse_ensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } } /** Setup the input buffer state to scan directly from a user-specified character buffer. @@ -2955,31 +2955,31 @@ static void xbt_graph_parse_ensure_buffer_stack (void) */ YY_BUFFER_STATE xbt_graph_parse__scan_buffer (char * base, yy_size_t size ) { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) xbt_graph_parse_alloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse__scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - xbt_graph_parse__switch_to_buffer(b ); - - return b; + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) xbt_graph_parse_alloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse__scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + xbt_graph_parse__switch_to_buffer(b ); + + return b; } /** Setup the input buffer state to scan a string. The next call to xbt_graph_parse_lex() will @@ -2993,7 +2993,7 @@ YY_BUFFER_STATE xbt_graph_parse__scan_buffer (char * base, yy_size_t size ) YY_BUFFER_STATE xbt_graph_parse__scan_string (yyconst char * yystr ) { - return xbt_graph_parse__scan_bytes(yystr,strlen(yystr) ); + return xbt_graph_parse__scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to xbt_graph_parse_lex() will @@ -3005,64 +3005,64 @@ YY_BUFFER_STATE xbt_graph_parse__scan_string (yyconst char * yystr ) */ YY_BUFFER_STATE xbt_graph_parse__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - yy_size_t i; + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + yy_size_t i; - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) xbt_graph_parse_alloc(n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse__scan_bytes()" ); + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) xbt_graph_parse_alloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse__scan_bytes()" ); - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = xbt_graph_parse__scan_buffer(buf,n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in xbt_graph_parse__scan_bytes()" ); + b = xbt_graph_parse__scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in xbt_graph_parse__scan_bytes()" ); - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; - return b; + return b; } static void yy_push_state (int new_state ) { - if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) - { - yy_size_t new_size; + if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) + { + yy_size_t new_size; - (yy_start_stack_depth) += YY_START_STACK_INCR; - new_size = (yy_start_stack_depth) * sizeof( int ); + (yy_start_stack_depth) += YY_START_STACK_INCR; + new_size = (yy_start_stack_depth) * sizeof( int ); - if ( ! (yy_start_stack) ) - (yy_start_stack) = (int *) xbt_graph_parse_alloc(new_size ); + if ( ! (yy_start_stack) ) + (yy_start_stack) = (int *) xbt_graph_parse_alloc(new_size ); - else - (yy_start_stack) = (int *) xbt_graph_parse_realloc((void *) (yy_start_stack),new_size ); + else + (yy_start_stack) = (int *) xbt_graph_parse_realloc((void *) (yy_start_stack),new_size ); - if ( ! (yy_start_stack) ) - YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); - } + if ( ! (yy_start_stack) ) + YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); + } - (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; + (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; - BEGIN(new_state); + BEGIN(new_state); } static void yy_pop_state (void) { - if ( --(yy_start_stack_ptr) < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); + if ( --(yy_start_stack_ptr) < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); - BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); + BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); } #ifndef YY_EXIT_FAILURE @@ -3071,26 +3071,26 @@ YY_BUFFER_STATE xbt_graph_parse__scan_bytes (yyconst char * yybytes, yy_size_t static void yy_fatal_error (yyconst char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up xbt_graph_parse_text. */ \ + do \ + { \ + /* Undo effects of setting up xbt_graph_parse_text. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ - xbt_graph_parse_text[xbt_graph_parse_leng] = (yy_hold_char); \ - (yy_c_buf_p) = xbt_graph_parse_text + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - xbt_graph_parse_leng = yyless_macro_arg; \ - } \ - while ( 0 ) + xbt_graph_parse_text[xbt_graph_parse_leng] = (yy_hold_char); \ + (yy_c_buf_p) = xbt_graph_parse_text + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + xbt_graph_parse_leng = yyless_macro_arg; \ + } \ + while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ @@ -3212,15 +3212,15 @@ int xbt_graph_parse_lex_destroy (void) { /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - xbt_graph_parse__delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - xbt_graph_parse_pop_buffer_state(); - } + while(YY_CURRENT_BUFFER){ + xbt_graph_parse__delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + xbt_graph_parse_pop_buffer_state(); + } - /* Destroy the stack itself. */ - xbt_graph_parse_free((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; + /* Destroy the stack itself. */ + xbt_graph_parse_free((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; /* Destroy the start condition stack. */ xbt_graph_parse_free((yy_start_stack) ); @@ -3240,43 +3240,43 @@ int xbt_graph_parse_lex_destroy (void) #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - int n; - for ( n = 0; s[n]; ++n ) - ; + int n; + for ( n = 0; s[n]; ++n ) + ; - return n; + return n; } #endif void *xbt_graph_parse_alloc (yy_size_t size ) { - return (void *) malloc( size ); + return (void *) malloc( size ); } void *xbt_graph_parse_realloc (void * ptr, yy_size_t size ) { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); } void xbt_graph_parse_free (void * ptr ) { - free( (char *) ptr ); /* see xbt_graph_parse_realloc() for (char *) cast */ + free( (char *) ptr ); /* see xbt_graph_parse_realloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" @@ -3285,8 +3285,8 @@ void xbt_graph_parse_free (void * ptr ) int graphxml_element_context(int i) { return (0count && (KEY(H, i) != key || CONTENT(H, i) != content)) - i++; - if (i == H->count) - return; - xbt_heap_remove(H,i); + int i=0; + while (i < H->count && (KEY(H, i) != key || CONTENT(H, i) != content)) + i++; + if (i == H->count) + return; + xbt_heap_remove(H,i); } /** diff --git a/src/xbt/lib.c b/src/xbt/lib.c index 8c7c8270a5..8e2f0f65fd 100644 --- a/src/xbt/lib.c +++ b/src/xbt/lib.c @@ -66,7 +66,7 @@ void xbt_lib_set(xbt_lib_t lib, const char *key, int level, void *obj) XBT_DEBUG("Replace %p by %p element under key '%s:%d'", elts[level], obj, key, level); if (lib->free_f[level]) - lib->free_f[level](elts[level]); + lib->free_f[level](elts[level]); } elts[level] = obj; } diff --git a/src/xbt/log.c b/src/xbt/log.c index d1ff4f4047..03ceb2cc34 100644 --- a/src/xbt/log.c +++ b/src/xbt/log.c @@ -1121,9 +1121,9 @@ static xbt_log_setting_t _xbt_log_parse_setting(const char *control_string) if(iappender = xbt_log_appender_file_new(neweq + 5); }else if (!strncmp(neweq, "rollfile:", 9)) { - set->appender = xbt_log_appender2_file_new(neweq + 9,1); + set->appender = xbt_log_appender2_file_new(neweq + 9,1); }else if (!strncmp(neweq, "splitfile:", 10)) { - set->appender = xbt_log_appender2_file_new(neweq + 10,0); + set->appender = xbt_log_appender2_file_new(neweq + 10,0); } else { THROWF(arg_error, 0, "Unknown appender log type: '%s'", neweq); } diff --git a/src/xbt/xbt_os_file.c b/src/xbt/xbt_os_file.c index 2083693d9c..0de1cd2e4b 100644 --- a/src/xbt/xbt_os_file.c +++ b/src/xbt/xbt_os_file.c @@ -68,13 +68,13 @@ ssize_t xbt_getline(char **buf, size_t *n, FILE *stream) */ char *xbt_dirname(const char *path) { #if _MSC_VER - char drive[_MAX_DRIVE]; - char dir[_MAX_DIR]; - errno_t err; - err = _splitpath_s(path, drive, _MAX_DRIVE, dir, _MAX_DIR, NULL,0, NULL,0); - return bprintf("%s%s",drive,dir); + char drive[_MAX_DRIVE]; + char dir[_MAX_DIR]; + errno_t err; + err = _splitpath_s(path, drive, _MAX_DRIVE, dir, _MAX_DIR, NULL,0, NULL,0); + return bprintf("%s%s",drive,dir); #else - return dirname(xbt_strdup(path)); + return dirname(xbt_strdup(path)); #endif } /** @brief Returns the file component of a path (reimplementation of POSIX basename) @@ -83,12 +83,12 @@ char *xbt_dirname(const char *path) { */ char *xbt_basename(const char *path) { #if _MSC_VER - char file[1024]; - char ext[1024]; - errno_t err; - err = _splitpath_s(path, NULL,0, NULL,0, file,1024, ext,1024); - return bprintf("%s.%s",file,ext); + char file[1024]; + char ext[1024]; + errno_t err; + err = _splitpath_s(path, NULL,0, NULL,0, file,1024, ext,1024); + return bprintf("%s.%s",file,ext); #else - return basename(xbt_strdup(path)); + return basename(xbt_strdup(path)); #endif } diff --git a/src/xbt/xbt_replay.c b/src/xbt/xbt_replay.c index b9eef79d37..9be103fa42 100644 --- a/src/xbt/xbt_replay.c +++ b/src/xbt/xbt_replay.c @@ -140,7 +140,7 @@ void xbt_replay_action_unregister(const char *action_name) int _xbt_replay_action_init(void) { if (xbt_action_funs) - return 0; + return 0; is_replay_active = 1; xbt_action_funs = xbt_dict_new_homogeneous(NULL); xbt_action_queues = xbt_dict_new_homogeneous(NULL); diff --git a/teshsuite/mc/mutex_handling.c b/teshsuite/mc/mutex_handling.c index d5aad96a7b..e07970b1f6 100644 --- a/teshsuite/mc/mutex_handling.c +++ b/teshsuite/mc/mutex_handling.c @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) { MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); const char *platform_file = argv[1]; const char *application_file = argv[2]; diff --git a/teshsuite/msg/host_on_off/host_on_off.c b/teshsuite/msg/host_on_off/host_on_off.c index 427b45f3eb..1c6e376815 100644 --- a/teshsuite/msg/host_on_off/host_on_off.c +++ b/teshsuite/msg/host_on_off/host_on_off.c @@ -109,8 +109,8 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", - argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", + argv[0], argv[0]); platform_file = argv[1]; application_file = argv[2]; diff --git a/teshsuite/msg/host_on_off/host_on_off_recv.c b/teshsuite/msg/host_on_off/host_on_off_recv.c index 73adf38c50..937396b759 100644 --- a/teshsuite/msg/host_on_off/host_on_off_recv.c +++ b/teshsuite/msg/host_on_off/host_on_off_recv.c @@ -86,7 +86,7 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); platform_file = argv[1]; application_file = argv[2]; diff --git a/teshsuite/msg/host_on_off/host_on_off_wait.c b/teshsuite/msg/host_on_off/host_on_off_wait.c index a3d829eb04..622c3cf846 100644 --- a/teshsuite/msg/host_on_off/host_on_off_wait.c +++ b/teshsuite/msg/host_on_off/host_on_off_wait.c @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); platform_file = argv[1]; application_file = argv[2]; diff --git a/teshsuite/msg/process/process.c b/teshsuite/msg/process/process.c index 18cf2d1e2f..5c752029b9 100644 --- a/teshsuite/msg/process/process.c +++ b/teshsuite/msg/process/process.c @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc == 3, "Usage: %s platform_file deployment_file\n" - "\n Example: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); + "\n Example: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); platform_file = argv[1]; application_file = argv[2]; diff --git a/teshsuite/msg/storage/concurrent_rw.c b/teshsuite/msg/storage/concurrent_rw.c index 201d8bc77d..0e8c60ab39 100644 --- a/teshsuite/msg/storage/concurrent_rw.c +++ b/teshsuite/msg/storage/concurrent_rw.c @@ -58,9 +58,9 @@ void display_storage_properties(msg_storage_t storage){ if (xbt_dict_length(props) > 0){ XBT_INFO("\tProperties of mounted storage: %s", MSG_storage_get_name(storage)); xbt_dict_foreach(props, cursor, key, data) - XBT_INFO("\t\t'%s' -> '%s'", key, data); + XBT_INFO("\t\t'%s' -> '%s'", key, data); }else{ - XBT_INFO("\tNo property attached."); + XBT_INFO("\tNo property attached."); } } @@ -97,16 +97,16 @@ void display_storage_content(msg_storage_t storage){ int host(int argc, char *argv[]) { - char name[2048]; - sprintf(name,"%s%i", FILENAME1,MSG_process_self_PID()); - msg_file_t file = MSG_file_open(name, NULL); - //MSG_file_read(file, MSG_file_get_size(file)); - MSG_file_write(file, 500000); + char name[2048]; + sprintf(name,"%s%i", FILENAME1,MSG_process_self_PID()); + msg_file_t file = MSG_file_open(name, NULL); + //MSG_file_read(file, MSG_file_get_size(file)); + MSG_file_write(file, 500000); - XBT_INFO("Size of %s: %llu", MSG_file_get_name(file), MSG_file_get_size(file)); - MSG_file_close(file); + XBT_INFO("Size of %s: %llu", MSG_file_get_name(file), MSG_file_get_size(file)); + MSG_file_close(file); - return 1; + return 1; } @@ -120,7 +120,7 @@ int main(int argc, char **argv) MSG_function_register("host", host); storage_info(MSG_host_by_name(xbt_strdup("host"))); for(i = 0 ; i<10; i++){ - MSG_process_create(xbt_strdup("host"), host, NULL, MSG_host_by_name(xbt_strdup("host"))); + MSG_process_create(xbt_strdup("host"), host, NULL, MSG_host_by_name(xbt_strdup("host"))); } diff --git a/teshsuite/msg/storage/storage_basic.c b/teshsuite/msg/storage/storage_basic.c index c19be283ac..400c47ff21 100644 --- a/teshsuite/msg/storage/storage_basic.c +++ b/teshsuite/msg/storage/storage_basic.c @@ -58,9 +58,9 @@ void display_storage_properties(msg_storage_t storage){ if (xbt_dict_length(props) > 0){ XBT_INFO("\tProperties of mounted storage: %s", MSG_storage_get_name(storage)); xbt_dict_foreach(props, cursor, key, data) - XBT_INFO("\t\t'%s' -> '%s'", key, data); + XBT_INFO("\t\t'%s' -> '%s'", key, data); }else{ - XBT_INFO("\tNo property attached."); + XBT_INFO("\tNo property attached."); } } diff --git a/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.c b/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.c index 112c71935d..a2cdc769ed 100644 --- a/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.c +++ b/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.c @@ -124,9 +124,9 @@ int slave(int argc, char *argv[]) MSG_task_execute(task); end = MSG_get_clock(); XBT_INFO("Task \"%s\" done in %f (amount %f)" - , MSG_task_get_name(task) - , end - start - , MSG_task_get_flops_amount(task)); + , MSG_task_get_name(task) + , end - start + , MSG_task_get_flops_amount(task)); MSG_task_destroy(task); task = NULL; @@ -145,7 +145,7 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); platform_file = argv[1]; application_file = argv[2]; diff --git a/teshsuite/simdag/platforms/basic_link_test.c b/teshsuite/simdag/platforms/basic_link_test.c index 173fd650c9..71397f5ba5 100644 --- a/teshsuite/simdag/platforms/basic_link_test.c +++ b/teshsuite/simdag/platforms/basic_link_test.c @@ -13,8 +13,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(basic_link_test, sd, "SimDag test basic_link_test"); static int cmp_link(const void*a, const void*b) { - const char *nameA = sg_link_name(*(SD_link_t*)a); - const char *nameB = sg_link_name(*(SD_link_t*)b); + const char *nameA = sg_link_name(*(SD_link_t*)a); + const char *nameB = sg_link_name(*(SD_link_t*)b); return strcmp( nameA, nameB ); } diff --git a/teshsuite/smpi/reduce/reduce_scatter_coll.c b/teshsuite/smpi/reduce/reduce_scatter_coll.c index 41b6bc7118..0df0d9c961 100644 --- a/teshsuite/smpi/reduce/reduce_scatter_coll.c +++ b/teshsuite/smpi/reduce/reduce_scatter_coll.c @@ -32,7 +32,7 @@ int main( int argc, char **argv ) MPI_Comm_rank( comm, &rank ); sendbuf = (int *) malloc( size * sizeof(int) ); for (i=0; i