static MidpProperties verifyMfMustProperties(MidpProperties mfsmp) { /* MUST fields in MANIFEST */ /* pcsl_string MIDlet-<n> for each MIDlet */ pcsl_string * midlet_1; pcsl_string * name; pcsl_string * version; pcsl_string * vendor; pcsl_string * profile; pcsl_string * configuration; name = midp_find_property(&mfsmp, &SUITE_NAME_PROP); if (pcsl_string_is_null(name)) { REPORT_WARN(LC_AMS, "Missing suite name"); mfsmp.status = NO_SUITE_NAME_PROP; return mfsmp; } vendor = midp_find_property(&mfsmp, &SUITE_VENDOR_PROP); if (pcsl_string_is_null(vendor)) { REPORT_WARN(LC_AMS, "Missing suite vendor"); mfsmp.status = NO_SUITE_VENDOR_PROP; return mfsmp; } version = midp_find_property(&mfsmp, &SUITE_VERSION_PROP); if (pcsl_string_is_null(version)) { REPORT_WARN(LC_AMS, "Missing suite version"); mfsmp.status = NO_SUITE_VERSION_PROP; return mfsmp; } if (!midpCheckVersion(version)) { REPORT_WARN(LC_AMS, "Corrupted suite version"); mfsmp.status = BAD_SUITE_VERSION_PROP; return mfsmp; } profile = midp_find_property(&mfsmp, &MICROEDITION_PROFILE_PROP); if (pcsl_string_is_null(profile)) { REPORT_WARN(LC_AMS, "Missing Midp-Profile"); mfsmp.status = NO_MICROEDITION_PROFILE_PROP; return mfsmp; } configuration = midp_find_property(&mfsmp, &MICROEDITION_CONFIGURATION_PROP); if (pcsl_string_is_null(configuration)) { REPORT_WARN(LC_AMS, "Missing Midp-Configuration"); mfsmp.status = NO_MICROEDITION_CONFIGURATION_PROP; return mfsmp; } midlet_1 = midp_find_property(&mfsmp, &MIDLET_ONE_PROP); if (pcsl_string_is_null(midlet_1)) { REPORT_WARN(LC_AMS, "Missing Midlet-1"); mfsmp.status = NO_MIDLET_ONE_PROP; return mfsmp; } return mfsmp; } /* verifyMfMustProperties */
static MidpProperties verifyJadMustProperties(MidpProperties jadsmp) { /* 5 MUST fields in JAD */ pcsl_string * name = NULL; pcsl_string * version = NULL; pcsl_string * vendor = NULL; pcsl_string * jarUrl = NULL; pcsl_string * jarSizeString = NULL; int permittedJarSize = 0; jint jarSizeByJad = 0; jarUrl = midp_find_property(&jadsmp, &JAR_URL_PROP); if (pcsl_string_is_null(jarUrl)) { REPORT_INFO(LC_AMS, "Missing Jar URL"); jadsmp.status = NO_JAR_URL_PROP; return jadsmp; } jarSizeString = midp_find_property(&jadsmp, &JAR_SIZE_PROP); if (pcsl_string_is_null(jarSizeString)) { REPORT_INFO(LC_AMS, "Missing Jar size"); jadsmp.status = NO_JAR_SIZE_PROP; return jadsmp; } if (PCSL_STRING_OK != pcsl_string_convert_to_jint(jarSizeString, &jarSizeByJad)) { /* NUMBER_ERROR */ REPORT_INFO1(LC_AMS, "JAD size ERROR %d", jarSizeByJad); jadsmp.status = NUMBER_ERROR; return jadsmp; } /* verify that requested jar size is not to big */ permittedJarSize = midpGetMaxJarSizePermitted(); if (jarSizeByJad > permittedJarSize) { REPORT_INFO2(LC_AMS, "Jar size requested by Jad is to big %d > %d", jarSizeByJad, permittedJarSize); REPORT_INFO(LC_AMS, "Out Of Storage"); jadsmp.status = OUT_OF_STORAGE; return jadsmp; } name = midp_find_property(&jadsmp, &SUITE_NAME_PROP); if (pcsl_string_is_null(name)) { REPORT_INFO(LC_AMS, "Missing suite name"); jadsmp.status = NO_SUITE_NAME_PROP; return jadsmp; } vendor = midp_find_property(&jadsmp, &SUITE_VENDOR_PROP); if (pcsl_string_is_null(vendor)) { REPORT_INFO(LC_AMS, "Missing suite vendor"); jadsmp.status = NO_SUITE_VENDOR_PROP; return jadsmp; } version = midp_find_property(&jadsmp, &SUITE_VERSION_PROP); if (pcsl_string_is_null(version)) { REPORT_INFO(LC_AMS, "Missing suite version"); jadsmp.status = NO_SUITE_VERSION_PROP; return jadsmp; } if (!midpCheckVersion(version)) { REPORT_INFO(LC_AMS, "Corrupted suite version"); jadsmp.status = NO_SUITE_VERSION_PROP; return jadsmp; } return jadsmp; } /* verifyJadMUSTProperties */