📄 xmlpers1.c
字号:
{
/* Person # 1 */
XMLtestDB_oid oid =
{
"XXIV-AB", MCO_OID(123456789ul, 87654321ul)
};
rc = Person_new(t, &oid, &p_obj);
if (rc)
{
goto err;
}
Person_name_put(&p_obj, "Steven Graves", 13);
Person_residence_put(&p_obj, 0, &res);
Residence_where_write_handle(&res, &adr);
Address_country_write_handle(&adr, &cnt);
Country_c_code_put(&cnt, "RU", 2);
Country_name_put(&cnt, "United Kingdom", 14);
Address_city_put(&adr, "London", 6);
Address_street_put(&adr, "Some street in London", 21);
Residence_since_write_handle(&res, &dat);
Date_day_put(&dat, 16);
Date_month_put(&dat, "May", 3);
Date_year_put(&dat, 1998);
Residence_phone_write_handle(&res, &pho);
Phone_country_put(&pho, 7);
Phone_area_put(&pho, "095", 3);
Phone_number_put(&pho, "9410281", 7);
Person_residence_put(&p_obj, 1, &res);
Residence_where_write_handle(&res, &adr);
Address_country_write_handle(&adr, &cnt);
Country_c_code_put(&cnt, "RU", 2);
Country_name_put(&cnt, "United Kingdom", 14);
Address_city_put(&adr, "London", 6);
Address_street_put(&adr, "Some other street in London", 28);
Residence_since_write_handle(&res, &dat);
Date_day_put(&dat, 11);
Date_month_put(&dat, "September", 9);
Date_year_put(&dat, 1963);
Residence_phone_write_handle(&res, &pho);
Phone_country_put(&pho, 7);
Phone_area_put(&pho, "095", 3);
Phone_number_put(&pho, "4570165", 7);
Person_residence_put(&p_obj, 2, &res);
Residence_where_write_handle(&res, &adr);
Address_country_write_handle(&adr, &cnt);
Country_c_code_put(&cnt, "UK", 2);
Country_name_put(&cnt, "United Kingdom", 14);
Address_city_put(&adr, "London", 6);
Address_street_put(&adr, "Yet another address in London", 29);
Residence_since_write_handle(&res, &dat);
Date_day_put(&dat, 23);
Date_month_put(&dat, "April", 5);
Date_year_put(&dat, 1989);
Residence_phone_write_handle(&res, &pho);
Phone_country_put(&pho, 7);
Phone_area_put(&pho, "095", 3);
Phone_number_put(&pho, "4932576", 7);
Person_office_write_handle(&p_obj, &off);
Office_where_write_handle(&off, &adr);
Address_country_write_handle(&adr, &cnt);
Country_c_code_put(&cnt, "UK", 2);
Country_name_put(&cnt, "United Kingdom", 14);
Address_city_put(&adr, "London", 6);
Address_street_put(&adr, "Perceval House, 14-16 Uxbridge Road, London, W5 2HL", 51);
Office_organization_put(&off, "London Borough of Ealing", 24);
Office_position_put(&off, "CEO", 3);
Office_phone_alloc(&off, 2);
Office_phone_put(&off, 0, &pho);
Phone_country_put(&pho, 7);
Phone_area_put(&pho, "095", 3);
Phone_number_put(&pho, "7237640", 7);
Office_phone_put(&off, 1, &pho);
Phone_country_put(&pho, 7);
Phone_area_put(&pho, "095", 3);
Phone_number_put(&pho, "7232122", 7);
Person_mobile_write_handle(&p_obj, &pho);
Phone_country_put(&pho, 7);
Phone_area_put(&pho, "903", 3);
Phone_number_put(&pho, "7006123", 7);
Person_description_put(&p_obj, "What a wonderful ", 17);
Person_description_append(&p_obj, "person is this ", 15);
Person_description_append(&p_obj, "guy ", 4);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -