Skip to content

Config Reading Functions

SpiredMoth edited this page May 1, 2020 · 3 revisions

All these functions return the values exactly as they appear in PKSM's config.json

char* cfg_default_ot(enum Generation gen);
  • enum Generation gen: generation of the default template to pull the OT name from
  • Returns the OT name as a UTF-8 encoded string
  • The returned string must be manually freed
  • Older generations have smaller OT name limits so depending on the contents of the default OT field and the generation(s) you're editing your script may have to trim the string to fit
unsigned short cfg_default_tid(enum Generation gen);
unsigned short cfg_default_sid(enum Generation gen);

Return 5-digit IDs in the range of 0 to 65,535

  • enum Generation gen: generation of the default template to pull the TID and SID from
int cfg_default_day();
int cfg_default_month();
int cfg_default_year();

Return the respective pieces of the configured default date

  • Scripts should check the result of cfg_default_year() to make sure it is the correct format for the intended usage (i.e. 2-digit or 4-digit) and modify it if necessary
  • returns current day/month/year if default in user's config is set to 0