91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

libical 包含iCalendar協議和數據格式的一個實現。在編譯bluez時可能需要這個軟件包。 編譯方法,請參考:http://www.linuxfromscratch.org/blfs/view/cvs/general/libical.html

資源截圖

代碼片段和文件信息

/*?Access_component.c?*/

#include?

#include?
#include??/*?for?strdup?*/
#include??/*?for?malloc?*/
#include??/*?for?printf?*/
#include??/*?for?time()?*/

void?do_something(icalcomponent?*c);

/*?Creating?iCal?Components?

???There?are?two?ways?to?create?new?component?in?libical.?You?can
???build?the?component?from?primitive?parts?or?you?can?create?it
???from?a?string.

???There?are?two?variations?of?the?API?for?building?the?component?from
???primitive?parts.?In?the?first?variation?you?add?each?parameter?and
???value?to?a?property?and?then?add?each?property?to?a
???component.?This?results?in?a?long?series?of?function?calls.?This
???style?is?show?in?create_new_component()

???The?second?variation?uses?vargs?lists?to?nest?many?primitive?part
???constructors?resulting?in?a?compact?neatly?formated?way?to?create
???components.?This?style?is?shown?in?create_new_component_with_va_args()

??
???
*/
???
icalcomponent*?create_new_component()
{

????/*?variable?definitions?*/
????icalcomponent*?calendar;
????icalcomponent*?event;
????struct?icaltimetype?atime?=?icaltime_from_timet(?time(0)0);
????struct?icalperiodtype?rtime;
????icalproperty*?property;

????/*?Define?a?time?type?that?will?use?as?data?later.?*/
????rtime.start?=?icaltime_from_timet(?time(0)0);
????rtime.end?=?icaltime_from_timet(?time(0)0);
????rtime.end.hour++;

????/*?Create?calendar?and?add?properties?*/

????calendar?=?icalcomponent_new(ICAL_VCALENDAR_COMPONENT);
????
????/*?Nearly?every?libical?function?call?has?the?same?general
???????form.?The?first?part?of?the?name?defines?the?‘class‘?for?the
???????function?and?the?first?argument?will?be?a?pointer?to?a?struct
???????of?that?class.?So?icalcomponent_?functions?will?all?take
???????icalcomponent*?as?their?first?argument.?*/

????/*?The?next?call?creates?a?new?proeprty?and?immediately?adds?it?to?the?
???????‘calendar‘?component.?*/?

????icalcomponent_add_property(
calendar
icalproperty_new_version(“2.0“)
);

????
????/*?Here?is?the?short?version?of?the?memory?rules:?

?????????If?the?routine?name?has?“new“?in?it:?
?????Caller?owns?the?returned?memory.?
?????????????If?you?pass?in?a?string?the?routine?takes?the?memory.? ?

?????????If?the?routine?name?has?“add“?in?it:
?????The?routine?takes?control?of?the?component?property?
?????parameter?or?value?memory.

?????????If?the?routine?returns?a?string?(?“get“?and?“as_ical_string“?)
?????The?library?owns?the?returned?memory.?

??There?are?more?rules?so?refer?to?the?documentation?for?more?
??details.?

????*/

????icalcomponent_add_property(
calendar
icalproperty_new_prodid(“-//RDU?Software//NONSGML?HandCal//EN“)
);
????
????/*?Add?an?event?*/

????event?=?icalcomponent_new(ICAL_VEVENT_COMPONENT);

????icalcomponent_add_property(
event
icalproperty_new_dtstamp(atime)
);

????/*?In?the?previous?call?atime?is?a?struct?and?it?is?passed?in?by?value.?
???????This?is?how?all?compound?types?of?values?ar

評論

共有 條評論

相關資源