\doxysection{comps\+\_\+obj.\+h}
\hypertarget{comps__obj_8h_source}{}\label{comps__obj_8h_source}\index{comps\_obj.h@{comps\_obj.h}}
\mbox{\hyperlink{comps__obj_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{/*\ libcomps\ -\/\ C\ alternative\ to\ yum.comps\ library}}
\DoxyCodeLine{00002\ \textcolor{comment}{\ *\ Copyright\ (C)\ 2013\ Jindrich\ Luza}}
\DoxyCodeLine{00003\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00004\ \textcolor{comment}{\ *\ This\ program\ is\ free\ software;\ you\ can\ redistribute\ it\ and/or\ modify}}
\DoxyCodeLine{00005\ \textcolor{comment}{\ *\ it\ under\ the\ terms\ of\ the\ GNU\ General\ Public\ License\ as\ published\ by}}
\DoxyCodeLine{00006\ \textcolor{comment}{\ *\ the\ Free\ Software\ Foundation;\ either\ version\ 2\ of\ the\ License,\ or}}
\DoxyCodeLine{00007\ \textcolor{comment}{\ *\ any\ later\ version.}}
\DoxyCodeLine{00008\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00009\ \textcolor{comment}{\ *\ This\ program\ is\ distributed\ in\ the\ hope\ that\ it\ will\ be\ useful,\ but}}
\DoxyCodeLine{00010\ \textcolor{comment}{\ *\ WITHOUT\ ANY\ WARRANTY;\ without\ even\ the\ implied\ warranty\ of}}
\DoxyCodeLine{00011\ \textcolor{comment}{\ *\ MERCHANTABILITY\ or\ FITNESS\ FOR\ A\ PARTICULAR\ PURPOSE.\ See\ the}}
\DoxyCodeLine{00012\ \textcolor{comment}{\ *\ GNU\ General\ Public\ License\ for\ more\ details.}}
\DoxyCodeLine{00013\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00014\ \textcolor{comment}{\ *\ You\ should\ have\ received\ a\ copy\ of\ the\ GNU\ General\ Public\ License}}
\DoxyCodeLine{00015\ \textcolor{comment}{\ *\ along\ with\ this\ program;\ if\ not,\ write\ to\ \ Free\ Software}}
\DoxyCodeLine{00016\ \textcolor{comment}{\ *\ Foundation,\ Inc.,\ 51\ Franklin\ Street,\ Fifth\ Floor,\ Boston,\ MA\ \ 02110-\/1301,}}
\DoxyCodeLine{00017\ \textcolor{comment}{\ *\ USA}}
\DoxyCodeLine{00018\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00019\ }
\DoxyCodeLine{00020\ \textcolor{preprocessor}{\#ifndef\ COMPS\_OBJECT\_H}}
\DoxyCodeLine{00021\ \textcolor{preprocessor}{\#define\ COMPS\_OBJECT\_H}}
\DoxyCodeLine{00022\ }
\DoxyCodeLine{00023\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{comps__mm_8h}{comps\_mm.h}}"{}}}
\DoxyCodeLine{00024\ }
\DoxyCodeLine{00029\ }
\DoxyCodeLine{00037\ }
\DoxyCodeLine{00042\ }
\DoxyCodeLine{00047\ }
\DoxyCodeLine{00052\ }
\DoxyCodeLine{00058\ }
\DoxyCodeLine{00059\ \textcolor{preprocessor}{\#define\ COMPS\_OBJECT\_CREATE(objtype,\ args)\(\backslash\)}}
\DoxyCodeLine{00060\ \textcolor{preprocessor}{\ \ \ \ (objtype*)comps\_object\_create(\&objtype\#\#\_ObjInfo,\ args)}}
\DoxyCodeLine{00061\ }
\DoxyCodeLine{00062\ }
\DoxyCodeLine{00063\ \textcolor{preprocessor}{\#define\ COMPS\_OBJECT\_CMP(obj1,obj2)\(\backslash\)}}
\DoxyCodeLine{00064\ \textcolor{preprocessor}{\ \ \ \ comps\_object\_cmp((COMPS\_Object*)obj1,\ (COMPS\_Object*)obj2)}}
\DoxyCodeLine{00065\ }
\DoxyCodeLine{00066\ \textcolor{preprocessor}{\#define\ COMPS\_OBJECT\_DESTROY(obj1)\(\backslash\)}}
\DoxyCodeLine{00067\ \textcolor{preprocessor}{\ \ \ \ comps\_object\_destroy((COMPS\_Object*)obj1)}}
\DoxyCodeLine{00068\ }
\DoxyCodeLine{00069\ \textcolor{preprocessor}{\#define\ COMPS\_OBJECT\_COPY(obj)\(\backslash\)}}
\DoxyCodeLine{00070\ \textcolor{preprocessor}{\ \ \ \ comps\_object\_copy(((COMPS\_Object*)obj))}}
\DoxyCodeLine{00071\ }
\DoxyCodeLine{00072\ \textcolor{preprocessor}{\#define\ COMPS\_OBJECT\_INCREF(obj)\(\backslash\)}}
\DoxyCodeLine{00073\ \textcolor{preprocessor}{\ \ \ \ comps\_object\_incref(((COMPS\_Object*)obj))}}
\DoxyCodeLine{00074\ }
\DoxyCodeLine{00075\ \textcolor{preprocessor}{\#define\ COMPS\_OBJECT\_REPLACE(oldobj,\ TYPE,\ new\_obj)\(\backslash\)}}
\DoxyCodeLine{00076\ \textcolor{preprocessor}{\ \ \ \ COMPS\_OBJECT\_DESTROY(oldobj);\(\backslash\)}}
\DoxyCodeLine{00077\ \textcolor{preprocessor}{\ \ \ \ oldobj\ =\ (TYPE*)COMPS\_OBJECT\_INCREF(new\_obj);}}
\DoxyCodeLine{00078\ }
\DoxyCodeLine{00079\ }
\DoxyCodeLine{00080\ \textcolor{preprocessor}{\#define\ COMPS\_CAST\_CONSTR\ void\ (*)(COMPS\_Object*,\ COMPS\_Object**)}}
\DoxyCodeLine{00081\ \textcolor{preprocessor}{\#define\ COMPS\_CAST\_DESTR\ void\ (*)(COMPS\_Object*)}}
\DoxyCodeLine{00082\ }
\DoxyCodeLine{00086\ \textcolor{preprocessor}{\#define\ COMPS\_Object\_HEAD\ COMPS\_RefC\ *refc;\(\backslash\)}}
\DoxyCodeLine{00087\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ COMPS\_ObjectInfo\ *obj\_info}}
\DoxyCodeLine{00088\ }
\DoxyCodeLine{00089\ \textcolor{preprocessor}{\#define\ COMPS\_Object\_TAIL(obj)\ extern\ COMPS\_ObjectInfo\ obj\#\#\_ObjInfo}}
\DoxyCodeLine{00090\ }
\DoxyCodeLine{00091\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}\ \mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}};}
\DoxyCodeLine{00092\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{structCOMPS__ObjectInfo}{COMPS\_ObjectInfo}}\ \mbox{\hyperlink{structCOMPS__ObjectInfo}{COMPS\_ObjectInfo}};}
\DoxyCodeLine{00093\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }COMPS\_Packed\ COMPS\_Packed;}
\DoxyCodeLine{00094\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{structCOMPS__Num}{COMPS\_Num}}\ \mbox{\hyperlink{structCOMPS__Num}{COMPS\_Num}};}
\DoxyCodeLine{00095\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{structCOMPS__Str}{COMPS\_Str}}\ \mbox{\hyperlink{structCOMPS__Str}{COMPS\_Str}};}
\DoxyCodeLine{00096\ }
\DoxyCodeLine{00097\ }
\DoxyCodeLine{00102\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{structCOMPS__ObjectInfo}{COMPS\_ObjectInfo}}\ \{}
\DoxyCodeLine{00103\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ \mbox{\hyperlink{structCOMPS__ObjectInfo_aa84dedf189c41c9de0045dd44e6ea1a6}{obj\_size}};\ }
\DoxyCodeLine{00104\ \ \ \ \ void\ (*\mbox{\hyperlink{structCOMPS__ObjectInfo_a3705ff4617c1572f57ec3bfd7209ab3a}{constructor}})(\mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}*,\ \mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}\ **);}
\DoxyCodeLine{00106\ \ \ \ \ void\ (*\mbox{\hyperlink{structCOMPS__ObjectInfo_ad8eaa8d1e85ca66a2c43e311a3392fda}{destructor}})(\mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}*);}
\DoxyCodeLine{00108\ \ \ \ \ void\ (*\mbox{\hyperlink{structCOMPS__ObjectInfo_a35e59dd0f3b165fc74d825d72b500b76}{copy}})(\mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}*,\ \mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}*);}
\DoxyCodeLine{00110\ \ \ \ \ \mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}*\ (*deep\_copy)(\mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}*,\ \mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}*);}
\DoxyCodeLine{00112\ \ \ \ \ \textcolor{keywordtype}{signed}\ char\ (*\mbox{\hyperlink{structCOMPS__ObjectInfo_a2661614a4eb259b8b4beea45c1e9fd87}{obj\_cmp}})(\mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}*,\ \mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}*);}
\DoxyCodeLine{00114\ \ \ \ \ \textcolor{keywordtype}{char}*\ (*to\_str)(\mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}*);}
\DoxyCodeLine{00116\ \};}
\DoxyCodeLine{00117\ }
\DoxyCodeLine{00124\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}\ \{}
\DoxyCodeLine{00125\ \ \ \ \ \mbox{\hyperlink{structCOMPS__RefC}{COMPS\_RefC}}\ *\mbox{\hyperlink{structCOMPS__Object_a5e59b8de4c32134a9ccfd7e159ab3fa1}{refc}};\ }
\DoxyCodeLine{00126\ \ \ \ \ \mbox{\hyperlink{structCOMPS__ObjectInfo}{COMPS\_ObjectInfo}}\ *\mbox{\hyperlink{structCOMPS__Object_affe7962c3d0a1958c8b7e20857cbeeb5}{obj\_info}};\ }
\DoxyCodeLine{00127\ \};}
\DoxyCodeLine{00128\ }
\DoxyCodeLine{00133\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{structCOMPS__Num}{COMPS\_Num}}\ \{}
\DoxyCodeLine{00134\ \ \ \ \ \mbox{\hyperlink{comps__obj_8h_a00fd526b6bb8d3a008e65267184d457b}{COMPS\_Object\_HEAD}};\ }
\DoxyCodeLine{00135\ \ \ \ \ \textcolor{keywordtype}{int}\ \mbox{\hyperlink{structCOMPS__Num_a7efc2fd6af9291bcd78e178bd3a72419}{val}};\ }
\DoxyCodeLine{00136\ \};}
\DoxyCodeLine{00137\ \mbox{\hyperlink{comps__obj_8h_aa3afe40a21c9580bcb8a93ef61795b03}{COMPS\_Object\_TAIL}}(\mbox{\hyperlink{structCOMPS__Num}{COMPS\_Num}});}
\DoxyCodeLine{00138\ }
\DoxyCodeLine{00143\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{structCOMPS__Str}{COMPS\_Str}}\ \{}
\DoxyCodeLine{00144\ \ \ \ \ \mbox{\hyperlink{comps__obj_8h_a00fd526b6bb8d3a008e65267184d457b}{COMPS\_Object\_HEAD}};\ }
\DoxyCodeLine{00145\ \ \ \ \ \textcolor{keywordtype}{char}\ *\mbox{\hyperlink{structCOMPS__Str_aeafdd8364e2427d3a2bb58a108a5ba70}{val}};\ }
\DoxyCodeLine{00146\ \};}
\DoxyCodeLine{00147\ \mbox{\hyperlink{comps__obj_8h_aa3afe40a21c9580bcb8a93ef61795b03}{COMPS\_Object\_TAIL}}(\mbox{\hyperlink{structCOMPS__Str}{COMPS\_Str}});}
\DoxyCodeLine{00148\ }
\DoxyCodeLine{00149\ }
\DoxyCodeLine{00158\ \mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}*\ \mbox{\hyperlink{comps__obj_8h_a7ac39b8a98918700a42e367ed70587de}{comps\_object\_create}}(\mbox{\hyperlink{structCOMPS__ObjectInfo}{COMPS\_ObjectInfo}}\ *obj\_info,\ \mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}\ **args);}
\DoxyCodeLine{00159\ }
\DoxyCodeLine{00163\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{comps__obj_8h_a2616603f4a7b5d29132032b3fe43df6f}{comps\_object\_destroy}}(\mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}\ *comps\_obj);}
\DoxyCodeLine{00164\ \textcolor{keywordtype}{void}\ comps\_object\_destroy\_v(\textcolor{keywordtype}{void}\ *comps\_obj);}
\DoxyCodeLine{00174\ \mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}*\ \mbox{\hyperlink{comps__obj_8h_ace34dd7913aed6c366b00cd68198db92}{comps\_object\_copy}}(\mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}\ *comps\_obj);}
\DoxyCodeLine{00175\ }
\DoxyCodeLine{00184\ \textcolor{keywordtype}{signed}\ \textcolor{keywordtype}{char}\ \mbox{\hyperlink{comps__obj_8h_a20766951d2e13eb1955f6889ed952c7e}{comps\_object\_cmp}}(\mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}\ *obj1,\ \mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}\ *obj2);}
\DoxyCodeLine{00185\ \textcolor{keywordtype}{char}\ comps\_object\_cmp\_v(\textcolor{keywordtype}{void}\ *obj1,\ \textcolor{keywordtype}{void}\ *obj2);}
\DoxyCodeLine{00186\ }
\DoxyCodeLine{00195\ \textcolor{keywordtype}{char}*\ \mbox{\hyperlink{comps__obj_8h_aaa57f1a54a2658b6d6dfae8645eebc70}{comps\_object\_tostr}}(\mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}\ *obj1);}
\DoxyCodeLine{00196\ }
\DoxyCodeLine{00199\ \mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}*\ \mbox{\hyperlink{comps__obj_8h_aee10c75e327dfafff60371e7d4ed793c}{comps\_object\_incref}}(\mbox{\hyperlink{structCOMPS__Object}{COMPS\_Object}}\ *obj);}
\DoxyCodeLine{00200\ }
\DoxyCodeLine{00204\ \mbox{\hyperlink{structCOMPS__Num}{COMPS\_Num}}*\ \mbox{\hyperlink{comps__obj_8h_a0f0572b5153ac59df85e0b085b57c052}{comps\_num}}(\textcolor{keywordtype}{int}\ n);}
\DoxyCodeLine{00205\ }
\DoxyCodeLine{00211\ \mbox{\hyperlink{structCOMPS__Str}{COMPS\_Str}}*\ \mbox{\hyperlink{comps__obj_8h_aef2bf138e4636a46196c5c430f743d98}{comps\_str}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *s);}
\DoxyCodeLine{00212\ }
\DoxyCodeLine{00220\ \mbox{\hyperlink{structCOMPS__Str}{COMPS\_Str}}*\ \mbox{\hyperlink{comps__obj_8h_aa30de3199114100920147f832d83e9f7}{comps\_str\_x}}(\textcolor{keywordtype}{char}\ *s);}
\DoxyCodeLine{00221\ }
\DoxyCodeLine{00227\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{comps__obj_8h_ae87d6644609081a82e1245d49f03dbe0}{comps\_str\_set}}(\mbox{\hyperlink{structCOMPS__Str}{COMPS\_Str}}\ *str,\ \textcolor{keywordtype}{char}\ *s);}
\DoxyCodeLine{00228\ }
\DoxyCodeLine{00229\ \textcolor{comment}{//extern\ COMPS\_ObjectInfo\ COMPS\_Num\_ObjInfo;}}
\DoxyCodeLine{00230\ \textcolor{comment}{//extern\ COMPS\_ObjectInfo\ COMPS\_Str\_ObjInfo;}}
\DoxyCodeLine{00231\ }
\DoxyCodeLine{00237\ \textcolor{keywordtype}{signed}\ \textcolor{keywordtype}{char}\ \mbox{\hyperlink{comps__obj_8h_a8ad5633490b138f883651df9282197f1}{comps\_str\_fnmatch}}(\mbox{\hyperlink{structCOMPS__Str}{COMPS\_Str}}\ *str,\ \textcolor{keywordtype}{char}\ *pattern,\ \textcolor{keywordtype}{int}\ flags);}
\DoxyCodeLine{00238\ }
\DoxyCodeLine{00244\ \textcolor{keywordtype}{signed}\ \textcolor{keywordtype}{char}\ \mbox{\hyperlink{comps__obj_8h_a647e8ec3255c9b4cf14e26af5ed3e3fc}{comps\_str\_fnmatch\_o}}(\mbox{\hyperlink{structCOMPS__Str}{COMPS\_Str}}\ *str,\ \mbox{\hyperlink{structCOMPS__Str}{COMPS\_Str}}\ *pattern,\ \textcolor{keywordtype}{int}\ flags);}
\DoxyCodeLine{00245\ }
\DoxyCodeLine{00246\ \textcolor{preprocessor}{\#endif}}

\end{DoxyCode}
