// 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;
            while ((line = fp.readLine()) != null) {
                String[] tokens = line.split(delimiter);
                if (tokens.length < 2) throw new IOException();
                key = tokens[0];
                key = trim_whitespace(key);
                value = tokens[1];
                value = trim_whitespace(value);
                r = add_key_value(key, value, loc);
                if (r != 0) throw new IOException();
            }
            fp.close();
            return 0;
        } catch (IOException e) {
            try {
                if (fp != null) fp.close();
            } catch (IOException ignored) {
                assert false;
            }
            return 1;
        }
    }

    /**
     * Parses the command line arguments and constructs the loc
     * data structure out of it
     *
     * @return 0 if all went fine, 1 otherwise
     */
    static int parse_arguments(String[] args,
                               location loc,
// 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;

            while ((line = fp.readLine()) != null) {
                String[] tokens = line.split(delimiter);
                if (tokens.length < 2) throw new IOException();
                key = tokens[0];
                key = trim_whitespace(key);
                value = tokens[1];
                value = trim_whitespace(value);
                r = add_key_value(key, value, loc);
                if (r != 0) throw new IOException();
            }
            fp.close();
            return 0;
        } catch (IOException e) {
            try {
                if (fp != null) fp.close();
            } catch (IOException ignored) {
                assert false;
            }
            return 1;
        }
    }

    /**
     * Parses the command line arguments and constructs the loc
     * data structure out of it
     *
     * @return 0 if all went fine, 1 otherwise
     */
    static int parse_arguments(String[] args,
                               location loc,
                               date_t date,