// Path: itl/src/main/java/org/arabeyes/itl/newmethod/DefsModule.java
// static class date_t {
//     int year, month, day;
// 
//     /**
//      * @param day starts from 1
//      * @param month starts from 1, like the old ITL
//      */
//     date_t set(int day, int month, int year) {
//         this.year = year;
//         this.month = month;
//         this.day = day;
//         return this;
//     }
// }
// 
// Path: itl/src/main/java/org/arabeyes/itl/newmethod/DefsModule.java
// static class location {
//     /* In original C: The struct members ordering guarantees that the compiler does
//      * not add any padding bytes when compiling for 64-bit machines */
// 
//     double longitude;   /* Observer's longitude */
//     double latitude;    /* Observer's latitude */
//     double altitude;    /* Observer's altitude in meters */
//     double timezone;    /* Observer's timezone (in hours) relative
//                               to Universal Coordinated Time (UTC) */
//     int daylight;    /* Daylight Savings Time (DST) Flag
//                               Set to 1 if DST is on, 0 otherwise */
//     AsrMethod asr_method;  /* Asr Method: Shafii or Hanafi */
//     CalcMethod calc_method; /* Fajr and Isha Calculation method */
//     ExtremeMethod extr_method; /* Extreme latitude method */
//     String name;    /* Observer's location name */
// }
// 
// Path: itl/src/main/java/org/arabeyes/itl/newmethod/PrayerModule.java
// static CalcMethod calc_methods[] = {
//         new CalcMethod(MethodId.MWL, "Muslim World League (MWL)",
//                 IshaFlag.ANGLE, 18, 17),
//         new CalcMethod(MethodId.ISNA, "Islamic Society of North America (ISNA)",
//                 IshaFlag.ANGLE, 15, 15),
//         new CalcMethod(MethodId.EGAS, "Egyptian General Authority of Survey",
//                 IshaFlag.ANGLE, 19.5, 17.5),
//         new CalcMethod(MethodId.UMAQ, "Umm Al-Qura University, Makkah",
//                 IshaFlag.OFFSET, 18.5, 90),
//         new CalcMethod(MethodId.UIS, "University of Islamic Sciences, Karachi",
//                 IshaFlag.ANGLE, 18, 18)
// };


import java.io.IOException;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static org.arabeyes.itl.newmethod.PrayerModule.calc_methods;
import org.arabeyes.itl.newmethod.DefsModule.date_t;
import org.arabeyes.itl.newmethod.DefsModule.location;
import java.io.BufferedReader;
import java.io.FileReader;
        return str.trim();
    }

    /**
     * Adds a new &lt;key,value> pair to the loc struct
     *
     * @return 0 if successful, 1 otherwise
     */
    private static int add_key_value(String key,
                                     String value,
                                     location loc) {
        int method_id;

        assert (key != null);
        assert (value != null);
        assert (loc != null);

        try {
            if (valid_keys.name.equals(key)) {
                loc.name = value;
            } else if (valid_keys.latitude.equals(key)) {
                loc.latitude = Double.parseDouble(value);
            } else if (valid_keys.longitude.equals(key)) {
                loc.longitude = Double.parseDouble(value);
            } else if (valid_keys.altitude.equals(key)) {
                loc.altitude = Double.parseDouble(value);
            } else if (valid_keys.asr_method.equals(key)) {
                loc.asr_method = AsrMethod.values()[Integer.parseInt(value)];
            } else if (valid_keys.calc_method.equals(key)) {
                method_id = Integer.parseInt(value);
// Path: itl/src/main/java/org/arabeyes/itl/newmethod/DefsModule.java
// static class date_t {
//     int year, month, day;
// 
//     /**
//      * @param day starts from 1
//      * @param month starts from 1, like the old ITL
//      */
//     date_t set(int day, int month, int year) {
//         this.year = year;
//         this.month = month;
//         this.day = day;
//         return this;
//     }
// }
// 
// Path: itl/src/main/java/org/arabeyes/itl/newmethod/DefsModule.java
// static class location {
//     /* In original C: The struct members ordering guarantees that the compiler does
//      * not add any padding bytes when compiling for 64-bit machines */
// 
//     double longitude;   /* Observer's longitude */
//     double latitude;    /* Observer's latitude */
//     double altitude;    /* Observer's altitude in meters */
//     double timezone;    /* Observer's timezone (in hours) relative
//                               to Universal Coordinated Time (UTC) */
//     int daylight;    /* Daylight Savings Time (DST) Flag
//                               Set to 1 if DST is on, 0 otherwise */
//     AsrMethod asr_method;  /* Asr Method: Shafii or Hanafi */
//     CalcMethod calc_method; /* Fajr and Isha Calculation method */
//     ExtremeMethod extr_method; /* Extreme latitude method */
//     String name;    /* Observer's location name */
// }
// 
// Path: itl/src/main/java/org/arabeyes/itl/newmethod/PrayerModule.java
// static CalcMethod calc_methods[] = {
//         new CalcMethod(MethodId.MWL, "Muslim World League (MWL)",
//                 IshaFlag.ANGLE, 18, 17),
//         new CalcMethod(MethodId.ISNA, "Islamic Society of North America (ISNA)",
//                 IshaFlag.ANGLE, 15, 15),
//         new CalcMethod(MethodId.EGAS, "Egyptian General Authority of Survey",
//                 IshaFlag.ANGLE, 19.5, 17.5),
//         new CalcMethod(MethodId.UMAQ, "Umm Al-Qura University, Makkah",
//                 IshaFlag.OFFSET, 18.5, 90),
//         new CalcMethod(MethodId.UIS, "University of Islamic Sciences, Karachi",
//                 IshaFlag.ANGLE, 18, 18)
// };


// Path: itl/src/main/java/org/arabeyes/itl/newmethod/ConfigModule.java
import java.io.IOException;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static org.arabeyes.itl.newmethod.PrayerModule.calc_methods;
import org.arabeyes.itl.newmethod.DefsModule.date_t;
import org.arabeyes.itl.newmethod.DefsModule.location;
import java.io.BufferedReader;
import java.io.FileReader;

        return str.trim();
    }

    /**
     * Adds a new &lt;key,value> pair to the loc struct
     *
     * @return 0 if successful, 1 otherwise
     */
    private static int add_key_value(String key,
                                     String value,
                                     location loc) {
        int method_id;

        assert (key != null);
        assert (value != null);
        assert (loc != null);

        try {
            if (valid_keys.name.equals(key)) {
                loc.name = value;
            } else if (valid_keys.latitude.equals(key)) {
                loc.latitude = Double.parseDouble(value);
            } else if (valid_keys.longitude.equals(key)) {
                loc.longitude = Double.parseDouble(value);
            } else if (valid_keys.altitude.equals(key)) {
                loc.altitude = Double.parseDouble(value);
            } else if (valid_keys.asr_method.equals(key)) {
                loc.asr_method = AsrMethod.values()[Integer.parseInt(value)];
            } else if (valid_keys.calc_method.equals(key)) {
                method_id = Integer.parseInt(value);
                loc.calc_method = calc_methods[method_id];