submit.name_array = name_array; submit.value_array = value_array; submit.type_array = (PRUnichar **)type_array; submit.value_cnt = 2;  name_array[0] = nsAutoString("username"); value_array[0] = nsAutoString(username); type_array[0] = FORM_TYPE_TEXT;  name_array[1] = nsAutoString("password"); value_array[1] = nsAutoString(password); type_array[1] = FORM_TYPE_PASSWORD;
nsVoidArray * signonData = new nsVoidArray(); si_SignonDataStruct * data1 = new si_SignonDataStruct; data1 -> name = nsAutoString("username"); data1 -> value = nsAutoString(username); data1 -> isPassword = PR_FALSE; signonData->AppendElement(data1); si_SignonDataStruct * data2 = new si_SignonDataStruct; data2 -> name = nsAutoString("password"); data2 -> value = nsAutoString(password); data2 -> isPassword = PR_TRUE; signonData->AppendElement(data2);
si_RememberSignonDataFromBrowser(char* URLName, nsAutoString username, nsAutoString password) {  si_FormSubmitData submit;  nsAutoString name_array[2];  nsAutoString value_array[2];  uint8 type_array[2];  /* do nothing if signon preference is not enabled */  if (!si_GetSignonRememberingPref()){    return;  }  /* initialize a temporary submit structure */  submit.name_array = name_array;  submit.value_array = value_array;  submit.type_array = (PRUnichar **)type_array;  submit.value_cnt = 2;  name_array[0] = nsAutoString("username");  value_array[0] = nsAutoString(username);  type_array[0] = FORM_TYPE_TEXT;  name_array[1] = nsAutoString("password");  value_array[1] = nsAutoString(password);  type_array[1] = FORM_TYPE_PASSWORD;  /* Save the signon data */  SI_LoadSignonData(PR_TRUE);  si_PutData(URLName, &submit, PR_TRUE);}